Available Count
int64
1
31
AnswerCount
int64
1
35
GUI and Desktop Applications
int64
0
1
Users Score
int64
-17
588
Q_Score
int64
0
6.79k
Python Basics and Environment
int64
0
1
Score
float64
-1
1.2
Networking and APIs
int64
0
1
Question
stringlengths
15
7.24k
Database and SQL
int64
0
1
Tags
stringlengths
6
76
CreationDate
stringlengths
23
23
System Administration and DevOps
int64
0
1
Q_Id
int64
469
38.2M
Answer
stringlengths
15
7k
Data Science and Machine Learning
int64
0
1
ViewCount
int64
13
1.88M
is_accepted
bool
2 classes
Web Development
int64
0
1
Other
int64
1
1
Title
stringlengths
15
142
A_Id
int64
518
72.2M
4
21
0
5
148
1
0.047583
0
I have a friend who likes to use metaclasses, and regularly offers them as a solution. I am of the mind that you almost never need to use metaclasses. Why? because I figure if you are doing something like that to a class, you should probably be doing it to an object. And a small redesign/refactor is in order. Being able to use metaclasses has caused a lot of people in a lot of places to use classes as some kind of second rate object, which just seems disastrous to me. Is programming to be replaced by meta-programming? The addition of class decorators has unfortunately made it even more acceptable. So please, I am desperate to know your valid (concrete) use-cases for metaclasses in Python. Or to be enlightened as to why mutating classes is better than mutating objects, sometimes. I will start: Sometimes when using a third-party library it is useful to be able to mutate the class in a certain way. (This is the only case I can think of, and it's not concrete)
0
python,metaclass
2008-12-24T20:13:00.000
0
392,160
The only legitimate use-case of a metaclass is to keep other nosy developers from touching your code. Once a nosy developer masters metaclasses and starts poking around with yours, throw in another level or two to keep them out. If that doesn't work, start using type.__new__ or perhaps some scheme using a recursive metaclass. (written tongue in cheek, but I've seen this kind of obfuscation done. Django is a perfect example)
0
32,950
false
0
1
What are some (concrete) use-cases for metaclasses?
5,330,521
4
21
0
2
148
1
0.019045
0
I have a friend who likes to use metaclasses, and regularly offers them as a solution. I am of the mind that you almost never need to use metaclasses. Why? because I figure if you are doing something like that to a class, you should probably be doing it to an object. And a small redesign/refactor is in order. Being able to use metaclasses has caused a lot of people in a lot of places to use classes as some kind of second rate object, which just seems disastrous to me. Is programming to be replaced by meta-programming? The addition of class decorators has unfortunately made it even more acceptable. So please, I am desperate to know your valid (concrete) use-cases for metaclasses in Python. Or to be enlightened as to why mutating classes is better than mutating objects, sometimes. I will start: Sometimes when using a third-party library it is useful to be able to mutate the class in a certain way. (This is the only case I can think of, and it's not concrete)
0
python,metaclass
2008-12-24T20:13:00.000
0
392,160
This is a minor use, but... one thing I've found metaclasses useful for is to invoke a function whenever a subclass is created. I codified this into a metaclass which looks for an __initsubclass__ attribute: whenever a subclass is created, all parent classes which define that method are invoked with __initsubclass__(cls, subcls). This allows creation of a parent class which then registers all subclasses with some global registry, runs invariant checks on subclasses whenever they are defined, perform late-binding operations, etc... all without have to manually call functions or to create custom metaclasses that perform each of these separate duties. Mind you, I've slowly come to realize the implicit magicalness of this behavior is somewhat undesirable, since it's unexpected if looking at a class definition out of context... and so I've moved away from using that solution for anything serious besides initializing a __super attribute for each class and instance.
0
32,950
false
0
1
What are some (concrete) use-cases for metaclasses?
7,058,179
9
15
0
-1
15
1
-0.013333
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
C++ and Java are quite slow compared to C. The language should be a tool but not a crutch.
0
16,457
false
0
1
Good language to develop a game server in?
393,963
9
15
0
0
15
1
0
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
What are your objectives? Not the creation of the game itself, but why are you creating it? If you're doing it to learn a new language, then pick the one that seems the most interesting to you (i.e., the one you most want to learn). If it is for any other reason, then the best language will be the one that you already know best and enjoy using most. This will allow you to focus on working out the game logic and getting something up and running so that you can see progress and remain motivated to continue, rather than getting bogged down in details of the language you're using and losing interest. If your favorite language proves inadequate in some ways (too slow, not expressive enough, whatever), then you can rewrite the problem sections in a more suitable language when issues come up - and you won't know the best language to address the specific problems until you know what the problems end up being. Even if your chosen language proves entirely unsuitable for final production use and the whole thing has to be rewritten, it will give you a working prototype with tested game logic, which will make dealing with the new language far easier.
0
16,457
false
0
1
Good language to develop a game server in?
392,874
9
15
0
3
15
1
0.039979
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
More details about this game server might help folks better answer your question. Is this a game server in the sense of something like a Counter Strike dedicated server which sits in the background and hosts multiplayer interactions or are you writing something which will be hosted on an HTTP webserver? Personally, if it were me, I'd be considering Java or C++. My personal preference and skill set would probably lead me towards C++ because I find Java clumsy to work with on both platforms (moreso on Linux) and don't have the confidence that C# is ready for prime-time in Linux yet. That said, you also need to have a pretty significant community hammering on said server before performance of your language is going to be so problematic. My advise would be to write it in whatever language you can at the moment and if your game grows to be of sufficient size, invest in a rewrite at that time.
0
16,457
false
0
1
Good language to develop a game server in?
392,831
9
15
0
1
15
1
0.013333
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
It may depend a lot on what language your "game logic" (you may know this term as "business logic") is best expressed in. For example, if the game logic is best expressed in Python (or any other particular language) it might be best to just write it in Python and deal with the performance issues the hard way with either multi-threading or clustering. Even though it may cost you a lot of time to get the performance you want out of Python it will be less that the time it will take you to express "player A now casts a level 70 Spell of darkness in the radius of 7 units effecting all units that have spoken with player B and .... " in C++. Something else to consider is what protocol you will be using to communicate with the clients. If you have a complex binary protocol C++ may be easier (esp. if you already had experience doing it before) while a JSON (or similar) may be easier to parse in Python. Yes, i know C++ and python aren't languages you are limited to (or even considering) but i'm refer to them generally here. Probably comes down to what language you are the best at. A poorly written program which you hated writing will be worse that one written in a language you know and enjoy, even if the poorly written program was in an arguable more powerful language.
0
16,457
false
0
1
Good language to develop a game server in?
392,645
9
15
0
2
15
1
0.02666
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
You could as well use Java and compile the code using GCC to a native executable. That way you don't get the performance hit of the bytecode engine (Yes, I know - Java out of the box is as fast as C++. It must be just me who always measures a factor 5 performance difference). The drawback is that the GCC Java-frontend does not support all of the Java 1.6 language features. Another choice would be to use your language of choice, get the code working first and then move the performance critical stuff into native code. Nearly all languages support binding to compiled libraries. That does not solve your "python does not multithread well"-problem, but it gives you more choices.
0
16,457
false
0
1
Good language to develop a game server in?
392,764
9
15
0
18
15
1
1
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
I might be going slightly off-topic here, but the topic interests me as I have (hobby-wise) worked on quite a few game servers (MMORPG servers) - on others' code as well as mine. There is literature out there that will be of interest to you, drop me a note if you want some references. One thing that strikes me in your question is the want to serve a thousand users off a multithreaded application. From my humble experience, that does not work too well. :-) When you serve thousands of users you want a design that is as modular as possible, because one of your primary goals will be to keep the service as a whole up and running. Game servers tend to be rather complex, so there will be quite a few show-stopping bugs. Don't make your life miserable with a single point of failure (one application!). Instead, try to build multiple processes that can run on a multitude of hosts. My humble suggestion is the following: Make them independent, so a failing process will be irrelevant to the service. Make them small, so that the different parts of the service and how they interact are easy to grasp. Don't let users communicate with the gamelogic OR DB directly. Write a proxy - network stacks can and will show odd behaviour on different architectures when you have a multitude of users. Also make sure that you can later "clean"/filter what the proxies forward. Have a process that will only monitor other processes to see if they are still working properly, with the ability to restart parts. Make them distributable. Coordinate processes via TCP from the start or you will run into scalability problems. If you have large landscapes, consider means to dynamically divide load by dividing servers by geography. Don't have every backend process hold all the data in memory. I have ported a few such engines written in C++ and C# for hosts operating on Linux, FreeBSD and also Solaris (on an old UltraSparc IIi - yes, mono still runs there :). From my experience, C# is well fast enough, considering on what ancient hardware it operates on that sparc machine. The industry (as far as I know) tends to use a lot of C++ for the serving work and embeds scripting languages for the actual game logic. Ah, written too much already - way cool topic.
0
16,457
false
0
1
Good language to develop a game server in?
392,911
9
15
0
7
15
1
1
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
What kind of performance do you need? twisted is great for servers that need lots of concurrency, as is erlang. Either supports massive concurrency easily and has facilities for distributed computing. If you want to span more than one core in a python app, do the same thing you'd do if you wanted to span more than one machine — run more than one process.
0
16,457
false
0
1
Good language to develop a game server in?
392,650
9
15
0
21
15
1
1
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
I hate to say it, and I know I'm risking a down mod here, but it doesn't sound like there's a language out there for you. All programming languages have their quirks and programmers simply have to adapt to them. It's completely possible to write a working server in Python without classes (eliminating the "self" variable class references) and likewise just as easy to write C++ with clean syntax. If you're looking to deploy cross-platform and want to develop cross-platform as well, your best bet would probably be Java. It shorter development cycles than compiled languages like C and C++, but is higher performance (arguable, but I've always been anti-Java =P) than interpreted languages like Python and Perl and you don't have to work with unofficial implementations like Mono that may from time to time not support all of a language's features.
0
16,457
false
0
1
Good language to develop a game server in?
392,627
9
15
0
2
15
1
0.02666
0
I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it would just be too much trouble since it doesn't spawn threads across cores (meaning an 8 core server=1 core server). I also didn't really like the language (that "self" stuff grossed me out). I know that C++ is the language for the job in terms of performance, but I hate it. I don't want to deal with its sloppy syntax and I like my hand to be held by managed languages. This brings me to C# and Java, but I am open to other languages. I love the simplicity of .NET, but I was wondering if, speed wise, this would be good for the job. Keep in mind since this will be deployed on a Linux server, it would be running on the Mono framework - not sure if that matters. I know that Java is syntax-wise very similar to .Net, but my experience with it is limited. Are there any frameworks out there for it or anthing to ease in the development? Please help me and my picky self arrive on a solution. UPDATE: I didn't mean to sound so picky, and I really don't think I was. The only language I really excluded was C++, Python I don't like because of the scalability problem. I know that there are ways of communicating between processes, but if I have an 8 core server, why should I need to make 8 processes? Is there a more elegant solution?
0
c#,java,python,networking
2008-12-25T08:25:00.000
1
392,624
The obvious candidates are Java and Erlang: Pro Java: ease of development good development environments stability, good stack traces well-known (easy to find experienced programmers, lots of libraries, books, ...) quite fast, mature VM Pro Erlang: proven in systems that need >99.9% uptime ability to have software updates without downtime scalable (not only multi-core, but also multi-machine) Contra Erlang: unfamiliar syntax and programming paradigm not so well known; hard to get experienced programmers for VM is not nearly as fast as java If your game server mainly works as a event dispatcher (with a bit of a database tucked on), Erlang's message-driven paradigm should be a good match. In this day and age, I would not consider using an unmanaged language (like C or C++); the marginal performance benefits simply aren't worth the hassle.
0
16,457
false
0
1
Good language to develop a game server in?
392,844
3
5
0
1
5
0
0.039979
0
For those of you who have had the opportunity of writing web applications in PHP and then as an application server (eg. Python-based solutions like CherryPy or Pylons), in what context are application servers a better alternative to PHP? I tend to favor PHP simply because it's available on just about any web server (especially shared host), but I'm looking for other good reasons to make an informed choice. Thank you.
0
php,python
2008-12-28T07:56:00.000
0
395,960
Python web-apps tend to require more initial setup and development than the equivalent PHP site (particularly so for small sites). There also tend to be more reusable pieces for PHP (ie Wordpress as a blog). Configuring a server to run Python web-apps can be a difficult process, and not always well documented. PHP tends to be very easy to get running with Apache. Also, as PHP is very widely used and is heavily used by beginners, there tends to be very good documentation for it. However, Python is much more fun, and much more maintainable. It scales well (in development complexity terms, rather than traffic). Personally, I would also say that using Python tends to train you to solve problems in a better way. I am definitely a better developer for having learned the Pythonic way of doing things.
0
1,413
false
1
1
PHP vs. application server?
397,669
3
5
0
0
5
0
0
0
For those of you who have had the opportunity of writing web applications in PHP and then as an application server (eg. Python-based solutions like CherryPy or Pylons), in what context are application servers a better alternative to PHP? I tend to favor PHP simply because it's available on just about any web server (especially shared host), but I'm looking for other good reasons to make an informed choice. Thank you.
0
php,python
2008-12-28T07:56:00.000
0
395,960
Using application servers like Pylons, Django, etc. require much more work to setup and deploy then PHP applications which are generally supported out of the box. I run a few Django apps and had to learn a bit of configuring apache with mod_python in order to get things to work. I put forth the effort because coding in python is much more enjoyable to me than PHP and after you get the Apache config right once you never really have to mess with it again. On another note, if you decide to go with a framework like Django, Rails, Pylons, .... they tend to solve a lot of small repetitive tasks that you would otherwise do on your own. But frameworks are their own huge topic of discussion.
0
1,413
false
1
1
PHP vs. application server?
396,717
3
5
0
5
5
0
0.197375
0
For those of you who have had the opportunity of writing web applications in PHP and then as an application server (eg. Python-based solutions like CherryPy or Pylons), in what context are application servers a better alternative to PHP? I tend to favor PHP simply because it's available on just about any web server (especially shared host), but I'm looking for other good reasons to make an informed choice. Thank you.
0
php,python
2008-12-28T07:56:00.000
0
395,960
I have a feeling that some of the responses didn't address the initial question directly, so I decided to post my own. I understand that the question was about the difference between the mod_php deployment model and the application server deployment model. In simple words, PHP executes a given script on every request, and the application has no knowledge of what has happened before (unless it is emulated somehow). Moreover even the source code is being parsed on every request (unless you use a bytecode cache like APC). This process can be slow, especially if you have a framework with complex initialization. In contrast to this, the application server has to be started once, and then it waits for a request to be processed. The application server should clean up resources after every requests (allocated memory, open descriptors, etc.), it can also pool certain resources (like database connections) that can be reused between requests for extra performance. This later model (application server) is more efficient in most cases, but on the other hand more difficult to setup and maintain. It is also more demanding, as you have to pay more attention to the resources you utilize, in order to avoid resource leaks.
0
1,413
false
1
1
PHP vs. application server?
397,730
6
12
0
0
21
0
0
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can't seem to be able to choose from Python and Ruby: they seem very similar but apparently Ruby is more functional and object-oriented, which are good things, while Python is more like Perl: a simple scripting language. Do I have the right impression? PS - This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back.
0
python,ruby,lisp
2009-01-01T17:12:00.000
0
405,165
pick the most popular one for your domain so your work gets the most visibility. some might say ruby/rails for web, python for everything else. picking a language just because its like lisp is really not appropriate for a professional.
0
5,716
false
1
1
Please advise on Ruby vs Python, for someone who likes LISP a lot
405,577
6
12
0
3
21
0
0.049958
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can't seem to be able to choose from Python and Ruby: they seem very similar but apparently Ruby is more functional and object-oriented, which are good things, while Python is more like Perl: a simple scripting language. Do I have the right impression? PS - This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back.
0
python,ruby,lisp
2009-01-01T17:12:00.000
0
405,165
I am a Pythonista; however, based on your requirements, especially the "cool hacks on the language level", I would suggest you work on Ruby. Ruby is more flexible in the Perl way and you can do a lot of hacks; Python is targeted towards readability, which is a very good thing, and generally language hacks are a little frowned upon. Ruby's basic types can be modified in a hackish way that typically prototype languages allow, while Python's basic types are more suited for subclassing. By the way, I would add a minor correction: both Ruby and Python are very, very object-oriented, and neither is intended to be used for quick-and-dirty scripts the Perl way. Among the two, Ruby is syntactically more similar to Perl than Python.
0
5,716
false
1
1
Please advise on Ruby vs Python, for someone who likes LISP a lot
405,382
6
12
0
1
21
0
0.016665
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can't seem to be able to choose from Python and Ruby: they seem very similar but apparently Ruby is more functional and object-oriented, which are good things, while Python is more like Perl: a simple scripting language. Do I have the right impression? PS - This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back.
0
python,ruby,lisp
2009-01-01T17:12:00.000
0
405,165
If you need Unicode support, remember to check how well supported it is. AFAIK, Python's support for Unicode is better than Ruby's, especially since Python 3.0. On the other hand, Python 3 is still missing some popular packages and 3rd party libraries, so that might play against.
0
5,716
false
1
1
Please advise on Ruby vs Python, for someone who likes LISP a lot
405,317
6
12
0
0
21
0
0
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can't seem to be able to choose from Python and Ruby: they seem very similar but apparently Ruby is more functional and object-oriented, which are good things, while Python is more like Perl: a simple scripting language. Do I have the right impression? PS - This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back.
0
python,ruby,lisp
2009-01-01T17:12:00.000
0
405,165
I'm a Rubyist who chose the language based on very similar criteria. Python is a good language and I enjoy working with it too, but I think Ruby is somewhat more Lispy in the degree of freedom it gives to the programmer. Python seems to impose its opinions a little bit more (which can be a good thing, but isn't according to our criteria here). Python certainly isn't more Perlish— Ruby is essentially a Smalltalk/Perl mashup (some of its less-used features are pulled directly from Perl), whereas Python is only distantly related to either.
0
5,716
false
1
1
Please advise on Ruby vs Python, for someone who likes LISP a lot
405,474
6
12
0
8
21
0
1
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can't seem to be able to choose from Python and Ruby: they seem very similar but apparently Ruby is more functional and object-oriented, which are good things, while Python is more like Perl: a simple scripting language. Do I have the right impression? PS - This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back.
0
python,ruby,lisp
2009-01-01T17:12:00.000
0
405,165
Both Ruby and Python are fairly distant from the Lisp traditions of immutable data, programs as data, and macros. But Ruby is very nearly a clone of Smalltalk (and I hope will grow more like Smalltalk as the Perlish cruft is deprecated), and Smalltalk, like Lisp, is a language that takes one idea to extremes. Based on your desire to do cool hacks on the language level I'd go with Ruby, as it inherits a lot of the metaprogramming mindset from Smalltalk, and that mindset is connected to the Lisp tradition.
0
5,716
false
1
1
Please advise on Ruby vs Python, for someone who likes LISP a lot
405,310
6
12
0
12
21
0
1
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can't seem to be able to choose from Python and Ruby: they seem very similar but apparently Ruby is more functional and object-oriented, which are good things, while Python is more like Perl: a simple scripting language. Do I have the right impression? PS - This might seem like a flame bait but it's not really, I'm just trying not to go crazy from OCD about switching from RoR to Python/Django and back.
0
python,ruby,lisp
2009-01-01T17:12:00.000
0
405,165
Speaking as a "Rubyist", I'd agree with Kiv. The two languages both grant a nice amount of leeway when it comes to programming paradigms, but are also have benefits/shortcomings. I think that the compromises you make either way are a lot about your own programming style and taste. Personally, I think Ruby can read more like pseudo-code than Python. First, Python has active whitespace, which while elegant in the eyes of many, doesn't tend to enter the equation when writing pseudo-code. Also, Ruby's syntax is quite flexible. That flexibility causes a lot of quirks that can confuse, but also allows code that's quite expressive and pretty to look at. Finally, I'd really say that Ruby feels more Perl-ish to me. That's partly because I'm far more comfortable with it, so I can hack out scripts rather quickly. A lot of Ruby's syntax was borrowed from Perl though, and I haven't seen much Python code that feels similar (though again, I have little experience with Python). Depending on the approach to web programming you'd like to take, I think that the types of web frameworks available in each language could perhaps be a factor in deciding as well. I'd say try them both. You can get a working knowledge of each of them in an afternoon, and while you won't be writing awesome Ruby or Python, you can probably establish a feel for each, and decide which you like more. Update: I think your question should actually be two separate discussions: one with Ruby, one with Python. The comparisons are less important because you start debating the merits of the differences, as opposed to which language will work better for you. If you have questions about Ruby, I'd be more than happy to answer as best I can.
0
5,716
false
1
1
Please advise on Ruby vs Python, for someone who likes LISP a lot
405,228
1
5
0
0
32
0
0
0
I've been using mutagen for reading and writing MP3 tags, but I want to be able to embed album art directly into the file.
0
python,mp3,metadata,id3,albumart
2009-01-03T21:59:00.000
0
409,949
A nice small CLI tool which helped me a lot with checking what I did while developing id3 stuff is mid3v2 which is the mutagen version of id3v2. It comes bundled with the Python mutagen library. The source of this little tool gave me also lots of answers about how to use mutagen.
0
21,737
false
0
1
How do you embed album art into an MP3 using Python?
1,961,919
4
5
0
0
0
0
0
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
0
php,python,ruby,artificial-intelligence,recommendation-engine
2009-01-04T00:49:00.000
0
410,183
I happen to know a world-class expert in machine learning. He likes Prolog, especially for the higher level logic of the system. Hadn't even heard anyone mention that in a long time. Personally, I like Java. But if you're going to do intensive machine learning, you should be concerned about the speed of math processing. C++ for the math, in my view.
0
2,360
false
1
1
Interested in Collective Programming for the web -- Ruby or Python or PHP?
7,620,095
4
5
0
-2
0
0
-0.07983
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
0
php,python,ruby,artificial-intelligence,recommendation-engine
2009-01-04T00:49:00.000
0
410,183
I recently did some research into this for a project at my day job. It was for a recommendation system and the options were php,perl or python. PHP was out almost immediately, there were no good 3rd party open source libraries and the language itself is not as well suited to any kind of complex real programming. Python had a few libraries that i wanted to try out and Perl didn't, so I went with Python. In the end, none of those libraries were useful to me but besides library support I prefer python personally anyway so that was the right decision. Because your question is very vague I can only suggest that you don't use PHP and select the language based on library support for your specific problem area and your comfort in that language. I would say that library support is the biggest factor in your decision and language familiarity/preference is a close second.
0
2,360
false
1
1
Interested in Collective Programming for the web -- Ruby or Python or PHP?
636,664
4
5
0
0
0
0
0
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
0
php,python,ruby,artificial-intelligence,recommendation-engine
2009-01-04T00:49:00.000
0
410,183
All of the points that Bill Karwin have brought up are entirely valid: You should really operate in what you are most comfortable with. If that isn't a factor, I would personally suggest Ruby. It's an incredibly powerful language that draws a lot of commonalities with Lisp and is probably just as good, if not better, for AI programming for all the same reasons Lisp was: it's an extremely dynamic, self-modifiable language. As an added benefit Ruby has a really nice standard library including some great libs like the distributed computed library "dRuby".
0
2,360
false
1
1
Interested in Collective Programming for the web -- Ruby or Python or PHP?
636,639
4
5
0
16
0
0
1
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
0
php,python,ruby,artificial-intelligence,recommendation-engine
2009-01-04T00:49:00.000
0
410,183
The language you know best would be best. I mean that half-seriously. Given the brief description of your project, there's no reason to believe any of the languages you list would be any better or worse than the others. Those three languages are adequate for approximately similar tasks, so you should pick the one you are most comfortable with and proceed. Any other recommendations would be advocacy for one language or the other, with no real basis on which to evaluate them. Your description is just too vague.
0
2,360
false
1
1
Interested in Collective Programming for the web -- Ruby or Python or PHP?
410,193
1
9
0
1
2
1
0.022219
0
What are good online resources to learn Python, quickly, for some who can code decently in other languages? edit: It'll help if you could explain why you think that resource is useful.
0
python
2009-01-05T07:23:00.000
0
412,482
Search "Alex Martelli - Python For Programmers" on Google Video. Good introductory (but fast-paced) talk. Related videos are also worth watching.
0
5,777
false
0
1
Resources for moving to Python
412,584
1
1
0
2
0
0
1.2
0
I've got an IronPython script that configures log4net, then calls .NET code that uses log4net. log4net is properly configured, as I log a message to indicate that it is initialized. But when I try to use my .NET class, it reports "could not load file or assembly 'log4net, ...'. Some useful facts: log4net is not installed to the GAC the .NET class is correct, I've called it from other .NET code the log4net assembly being loaded in IPY is in the same folder as my .NET assembly. filemon shows that all log4net.dll access is successfully resolved from the expected location fuslogvw doesn't report any binding errors I'm adding both the log4net reference and the .NET assembly references using AddReferenceToFileAndPath( ) What's strange is that the log4net assembly has already been loaded. It must be loading the .NET assembly in another AppDomain. If that's how it works, it would be helpful to know. Any ideas out there? Thanks.
0
log4net,ironpython,dynamic-language-runtime
2009-01-06T00:15:00.000
0
415,015
I was able to solve the problem by using absolute reference paths rather than relative ones.
0
1,015
true
0
1
Calling .NET code from IronPython, getting error loading the log4net assembly
417,084
1
5
0
0
4
1
0
0
How can you raise an exception when you import a module that is less or greater than a given value for its __version__? There are a lot of different ways you could do it, but I feel like there must be some really simple way that eludes me at the moment. In this case the version number is of the format x.x.x
0
python,versioning
2009-01-07T02:39:00.000
0
419,010
You should be using setuptools: It allows you to lock the dependancies of an application, so even if multiple versions of an egg or package exist on a system only the right one will ever be used. This is a better way of working: Rather than fail if the wrong version of a dependancy is present it is better to ensure that the right version is present. Setuptools provides an installer which guarantees that everything required to run the application is present at install-time. It also gives you the means to select which of the many versions of a package which may be present on your PC is the one that gets loaded when you issue an import statement.
0
453
false
0
1
How to raise an exception on the version number of a module
420,029
3
5
0
3
8
0
0.119427
0
I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming. So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa). I know that ideally to get the best learning experience I would learn each techonology independently but I don't have the time. :) So my question is which is a more mature platform, PyObc or RubyCocoa, main things I am looking for: Documentation of API Tutorials Tools Supportive Community Completness of Cocoa API avaialble through the bridge Regarding point 5 I don't expect that the entire Cocoa API will be availble through either bridge but I need to have enough Cocoa APIs available to develop a functioning application.
0
python,ruby,cocoa,pyobjc,ruby-cocoa
2009-01-09T00:16:00.000
0
426,607
Both are roughly equal, I'd say. Better in some places, worse in others. But I wouldn't recommend learning Cocoa with either. Like Chris said, Cocoa requires some understanding of Objective-C. I like Ruby better than Objective-C, but I still don't recommend using it to learn Cocoa. Once you have a solid foundation (no pun intended) in Cocoa/Objective-C, then the bridges can be useful to you.
0
2,518
false
1
1
PyObjc vs RubyCocoa for Mac development: Which is more mature?
426,733
3
5
0
12
8
0
1
0
I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming. So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa). I know that ideally to get the best learning experience I would learn each techonology independently but I don't have the time. :) So my question is which is a more mature platform, PyObc or RubyCocoa, main things I am looking for: Documentation of API Tutorials Tools Supportive Community Completness of Cocoa API avaialble through the bridge Regarding point 5 I don't expect that the entire Cocoa API will be availble through either bridge but I need to have enough Cocoa APIs available to develop a functioning application.
0
python,ruby,cocoa,pyobjc,ruby-cocoa
2009-01-09T00:16:00.000
0
426,607
While you say you "don't have time" to learn technologies independently the fastest route to learning Cocoa will still be to learn it in its native language: Objective-C. Once you understand Objective-C and have gotten over the initial learning curve of the Cocoa frameworks you'll have a much easier time picking up either PyObjC or RubyCocoa.
0
2,518
false
1
1
PyObjc vs RubyCocoa for Mac development: Which is more mature?
426,703
3
5
0
1
8
0
0.039979
0
I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming. So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa). I know that ideally to get the best learning experience I would learn each techonology independently but I don't have the time. :) So my question is which is a more mature platform, PyObc or RubyCocoa, main things I am looking for: Documentation of API Tutorials Tools Supportive Community Completness of Cocoa API avaialble through the bridge Regarding point 5 I don't expect that the entire Cocoa API will be availble through either bridge but I need to have enough Cocoa APIs available to develop a functioning application.
0
python,ruby,cocoa,pyobjc,ruby-cocoa
2009-01-09T00:16:00.000
0
426,607
ObjectiveC is nowhere near as much fun or as productive as either Python or Ruby. That is why people want to pick a python or ruby with good Objective C access. Advising them to learn Objective C first misses the point imo. I have really good things to say about pyobjc. Its ability to interoperate painlessly with Objective C frameworks is superb. I have less experience with Ruby Cocoa and that was partly because when I last looked it didn't seem to have as clean and relatively painless interoperability. I feel hesitant about MacRuby because it seems to go too far. In pyobjc you can write plain python and only subclass/use Foundation and Cocoa objects when you really want/mean to. From what I understand of MacRuby it is a Ruby on top of Cocoa. So a string is always an NSString. I am less happy with that. YMMV.
0
2,518
false
1
1
PyObjc vs RubyCocoa for Mac development: Which is more mature?
3,930,584
2
2
0
1
2
0
0.099668
0
I use python cgi for our intranet application. When I measure time, the script takes 4s to finish. But after that, it still takes another 11s to show the screen in the browser. The screen is build with tables (size: 10 KB, 91 KB uncompressed) and has a large css file (5 KB, 58 KB uncompressed). I used YSlow and did as much optimization as suggested. Gzipping etc. Firebug Net says: 11s for the file. How do I measure where these last 11 seconds are needed for? Is it just the size of the HTML, or the table structure? Anyone more ideas for tweaking?
0
python,html,css,browser,cgi
2009-01-09T16:19:00.000
0
428,704
with that much html to render I would also consider the speed of the computer. you can test this by saving the html file and opening it from your local hard drive :)
0
653
false
1
1
Measure load time for python cgi script?
428,832
2
2
0
1
2
0
0.099668
0
I use python cgi for our intranet application. When I measure time, the script takes 4s to finish. But after that, it still takes another 11s to show the screen in the browser. The screen is build with tables (size: 10 KB, 91 KB uncompressed) and has a large css file (5 KB, 58 KB uncompressed). I used YSlow and did as much optimization as suggested. Gzipping etc. Firebug Net says: 11s for the file. How do I measure where these last 11 seconds are needed for? Is it just the size of the HTML, or the table structure? Anyone more ideas for tweaking?
0
python,html,css,browser,cgi
2009-01-09T16:19:00.000
0
428,704
I think I'd grab a copy of Ethereal and watch the TCP connection between the browser and the script, if I were concerned about whether the server is not getting its job done in an acceptable amount of time. If you see the TCP socket close before that 11s gap, you know that your issue is entirely on the browser side. If the TCP close comes well into the 11s gap, then you're going to have to do some debugging on the http server side. I think that Ethereal has changed it's name to WireShark. Whatever it is calling itself recently, it's a must-have tool for this sort of work. I was using it just the other day to find out why I couldn't connect to my virtualized http server.
0
653
false
1
1
Measure load time for python cgi script?
428,767
1
2
0
0
5
0
0
1
I need to poll a web service, in this case twitter's API, and I'm wondering what the conventional wisdom is on this topic. I'm not sure whether this is important, but I've always found feedback useful in the past. A couple scenarios I've come up with: The querying process starts every X seconds, eg a cron job runs a python script A process continually loops and queries at each iteration, eg ... well, here is where I enter unfamiliar territory. Do I just run a python script that doesn't end? Thanks for your advice. ps - regarding the particulars of twitter: I know that it sends emails for following and direct messages, but sometimes one might want the flexibility of parsing @replies. In those cases, I believe polling is as good as it gets. pps - twitter limits bots to 100 requests per 60 minutes. I don't know if this also limits web scraping or rss feed reading. Anyone know how easy or hard it is to be whitelisted? Thanks again.
0
python,twitter,polling
2009-01-10T00:10:00.000
0
430,226
You should have a page that is like a Ping or Heartbeat page. The you have another process that "tickles" or hits that page, usually you can do this in your Control Panel of your web host, or use a cron if you have a local access. Then this script can keep statistics of how often it has polled in a database or some data store and then you poll the service as often as you really need to, of course limiting it to whatever the providers limit is. You definitely don't want to (and certainly don't want to rely) on a python scrip that "doesn't end." :)
0
5,380
false
0
1
Best way to poll a web service (eg, for a twitter app)
430,245
3
4
0
0
0
1
0
0
I am creating an interface for Python scripting. Later I will be dong Python scripting also for automated testing. Is it necessary the at i must use class in my code.Now I have created the code with dictionaries,lists,functions,global and local variables. Is class necessary? Help me in this.
0
python,class,scripting
2009-01-13T06:42:00.000
0
438,149
not necessary since python is not a purely object oriented language but certain things are better written in classes (encapsulation).it becomes easier to build a large project using classes
0
2,284
false
0
1
Help needed--Is class necessary in Python scripting?
1,992,389
3
4
0
1
0
1
0.049958
0
I am creating an interface for Python scripting. Later I will be dong Python scripting also for automated testing. Is it necessary the at i must use class in my code.Now I have created the code with dictionaries,lists,functions,global and local variables. Is class necessary? Help me in this.
0
python,class,scripting
2009-01-13T06:42:00.000
0
438,149
It's not needed to make it work, but I would argue that it will become messy to maintain if you do not encapsulate certain things in classes. Classes are something that schould help the programmer to organizes his/her code, not just nice to have fluff.
0
2,284
false
0
1
Help needed--Is class necessary in Python scripting?
438,239
3
4
0
10
0
1
1
0
I am creating an interface for Python scripting. Later I will be dong Python scripting also for automated testing. Is it necessary the at i must use class in my code.Now I have created the code with dictionaries,lists,functions,global and local variables. Is class necessary? Help me in this.
0
python,class,scripting
2009-01-13T06:42:00.000
0
438,149
No, of course class is not a must. As Python is a scripting language, you can simply code your scripts without defining your own classes. Classes are useful if you implement a more complex program which needs a structured approach and OOP benfits (encapsulation, polimorphism) help you in doing it.
0
2,284
false
0
1
Help needed--Is class necessary in Python scripting?
438,171
1
3
0
7
4
1
1
0
For my next project I plan to create images with text and graphics. I'm comfortable with ruby, but interested in learning python. I figured this may be a good time because PIL looks like a great library to use. However, I don't know how it compares to what ruby has to offer (e.g. RMagick and ruby-gd). From what I can gather PIL had better documentation (does ruby-gd even have a homepage?) and more features. Just wanted to hear a few opinions to help me decide. Thanks. Vince
0
python,ruby,python-imaging-library,rmagick
2009-01-13T16:21:00.000
0
439,641
PIL is a good library, use it. ImageMagic (what RMagick wraps) is a very heavy library that should be avoided if possible. Its good for doing local processing of images, say, a batch photo editor, but way too processor inefficient for common image manipulation tasks for web. EDIT: In response to the question, PIL supports drawing vector shapes. It can draw polygons, curves, lines, fills and text. I've used it in a project to produce rounded alpha corners to PNG images on the fly over the web. It essentially has most of the drawing features of GDI+ (in Windows) or GTK (in Gnome on Linux).
0
2,243
false
0
1
PIL vs RMagick/ruby-gd
440,298
1
2
0
23
27
1
1
0
Is there any reason to prefer unicode(somestring, 'utf8') as opposed to somestring.decode('utf8')? My only thought is that .decode() is a bound method so python may be able to resolve it more efficiently, but correct me if I'm wrong.
0
python,unicode,utf-8
2009-01-13T19:06:00.000
0
440,320
I'd prefer 'something'.decode(...) since the unicode type is no longer there in Python 3.0, while text = b'binarydata'.decode(encoding) is still valid.
0
30,226
false
0
1
unicode() vs. str.decode() for a utf8 encoded byte string (python 2.x)
440,461
2
8
0
0
25
1
0
0
Just want to know what's the common way to react on events in python. There are several ways in other languages like callback functions, delegates, listener-structures and so on. Is there a common way? Which default language concepts or additional modules are there and which can you recommend?
0
python,events,delegates,callback
2009-01-14T17:20:00.000
0
443,885
Personally, I've only seen callbacks used. However, I haven't seen that much event driven python code so YMMV.
0
23,479
false
0
1
Python: Callbacks, Delegates, ... ? What is common?
443,934
2
8
0
0
25
1
0
0
Just want to know what's the common way to react on events in python. There are several ways in other languages like callback functions, delegates, listener-structures and so on. Is there a common way? Which default language concepts or additional modules are there and which can you recommend?
0
python,events,delegates,callback
2009-01-14T17:20:00.000
0
443,885
I have seen listeners and callbacks used. But AFAIK there is no Python way. They should be equally feasible if the application in question is suitable.
0
23,479
false
0
1
Python: Callbacks, Delegates, ... ? What is common?
444,003
1
3
0
0
1
0
0
0
I have scanned 'the Google' and have not found the definitive answer on whether the Iron* languages (any or all) will end up with Attribute support.. Anyone? Thanks - Jon
0
ironpython,ironruby
2009-01-14T17:49:00.000
0
443,996
We're looking at attribute support again for a .NET interop-focused release in the near future. Keep an eye on [email protected] for an updates.
0
316
false
1
1
Has anyone tracked down whether IronPython or IronRuby will support Attributes?
592,844
5
12
0
0
10
1
0
0
What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?
0
python,programming-languages
2009-01-16T22:38:00.000
0
452,305
Dynamic languages are in general good for web apps because the speed of development. Python in particular has two advantages over most of them: "batteries included" means lots of available libraries Django. For me this is the only reason why i use Python instead of Lua (which i like a lot more).
0
15,173
false
0
1
What are the benefits of using Python for web programming?
452,352
5
12
0
1
10
1
0.016665
0
What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?
0
python,programming-languages
2009-01-16T22:38:00.000
0
452,305
GNU Mailman is another project written in python that is widely successful.
0
15,173
false
0
1
What are the benefits of using Python for web programming?
452,356
5
12
0
0
10
1
0
0
What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?
0
python,programming-languages
2009-01-16T22:38:00.000
0
452,305
Besides the frameworks... Python's pervasive support for Unicode should make i18n much smoother. A sane namespace system makes debugging much nicer, because it's typically easier to find where things are defined. Python's inability to function as a standalone templating language should discourage the mixture of HTML with model code Great standard library
0
15,173
false
0
1
What are the benefits of using Python for web programming?
452,384
5
12
0
0
10
1
0
0
What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?
0
python,programming-languages
2009-01-16T22:38:00.000
0
452,305
Other examples of Python sites are Reddit and YouTube.
0
15,173
false
0
1
What are the benefits of using Python for web programming?
452,392
5
12
0
1
10
1
0.016665
0
What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?
0
python,programming-languages
2009-01-16T22:38:00.000
0
452,305
As many have pointed out, Django is a great reason to use Python...so in order to figure out why Python is great for web development, the best bet is to look at why it is a good language to build a framework like Django. IMHO Python combines the cleanest, or at least one of the cleanest, metaprogramming models of any language with a very pure object orientation. This not only makes it possible to write extremely general abstractions that are easy to use, but also allows the abstractions to combine relatively cleanly with others. This is harder to do in languages that take a code-generation based approach to metaprogramming (e.g. Ruby).
0
15,173
false
0
1
What are the benefits of using Python for web programming?
452,600
2
3
0
4
6
0
0.26052
1
I'm new to web services and as an introduction I'm playing around with the Twitter API using the Twisted framework in python. I've read up on the different formats they offer, but it's still not clear to me which one I should use in my fairly simple project. Specifically the practical difference between using JSON or XML is something I'd like guidance on. All I'm doing is requesting the public timeline and caching it locally. Thanks.
0
python,xml,json,twitter,twisted
2009-01-17T11:19:00.000
0
453,158
RSS and Atom are XML formats. JSON is a string which can be evaluated as Javascript code.
0
8,204
false
0
1
What is the practical difference between xml, json, rss and atom when interfacing with Twitter?
453,160
2
3
0
1
6
0
0.066568
1
I'm new to web services and as an introduction I'm playing around with the Twitter API using the Twisted framework in python. I've read up on the different formats they offer, but it's still not clear to me which one I should use in my fairly simple project. Specifically the practical difference between using JSON or XML is something I'd like guidance on. All I'm doing is requesting the public timeline and caching it locally. Thanks.
0
python,xml,json,twitter,twisted
2009-01-17T11:19:00.000
0
453,158
I would say the amount of data being sent over the wire is one factor. XML data stream will be bigger than JSON for the same data. But you can use whatever you know more/have more experience. I would recommend JSON, as it's more "pythonic" than XML.
0
8,204
false
0
1
What is the practical difference between xml, json, rss and atom when interfacing with Twitter?
453,164
5
7
0
35
20
1
1.2
0
I have a Python class full of static methods. What are the advantages and disadvantages of packaging these in a class rather than raw functions?
0
python,class,static-methods
2009-01-18T22:09:00.000
0
456,001
There are none. This is what modules are for: grouping related functions. Using a class full of static methods makes me cringe from Javaitis. The only time I would use a static function is if the function is an integral part of the class. (In fact, I'd probably want to use a class method anyway.)
0
6,805
true
0
1
Is there any advantage in using a Python class?
456,008
5
7
0
2
20
1
0.057081
0
I have a Python class full of static methods. What are the advantages and disadvantages of packaging these in a class rather than raw functions?
0
python,class,static-methods
2009-01-18T22:09:00.000
0
456,001
Classes are only useful when you have a set of functionality than interacts with a set of data (instance properties) that needs to be persisted between function calls and referenced in a discrete fashion. If your class contains nothing other than static methods, then your class is just syntactic cruft, and straight functions are much clearer and all that you need.
0
6,805
false
0
1
Is there any advantage in using a Python class?
456,081
5
7
0
0
20
1
0
0
I have a Python class full of static methods. What are the advantages and disadvantages of packaging these in a class rather than raw functions?
0
python,class,static-methods
2009-01-18T22:09:00.000
0
456,001
I agree with Benjamin. Rather than having a bunch of static methods, you should probably have a bunch of functions. And if you want to organize them, you should think about using modules rather than classes. However, if you want to refactor your code to be OO, that's another matter.
0
6,805
false
0
1
Is there any advantage in using a Python class?
456,013
5
7
0
1
20
1
0.028564
0
I have a Python class full of static methods. What are the advantages and disadvantages of packaging these in a class rather than raw functions?
0
python,class,static-methods
2009-01-18T22:09:00.000
0
456,001
Not only are there no advantages, but it makes things slower than using a module full of methods. There's much less need for static methods in python than there is for them in java or c#, they are used in very special cases.
0
6,805
false
0
1
Is there any advantage in using a Python class?
456,016
5
7
0
0
20
1
0
0
I have a Python class full of static methods. What are the advantages and disadvantages of packaging these in a class rather than raw functions?
0
python,class,static-methods
2009-01-18T22:09:00.000
0
456,001
Depends on the nature of the functions. If they're not strongly unrelated (minimal amount of calls between them) and they don't have any state then yes I'd say dump them into a module. However, you could be shooting yourself in the foot if you ever need to modify the behavior as you're throwing inheritance out the window. So my answer is maybe, and be sure you look at your particular scenario rather then always assuming a module is the best way to collect a set of methods.
0
6,805
false
0
1
Is there any advantage in using a Python class?
456,222
3
10
1
8
70
0
1
0
I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c/c++ extension for performance. With the help of swig you almost don't need to care about arguments etc. Everything works fine. Now my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code. Does anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.
0
python,c++,c,swig,cython
2009-01-19T08:32:00.000
0
456,884
An observation: Based on the benchmarking conducted by the pybindgen developers, there is no significant difference between boost.python and swig. I haven't done my own benchmarking to verify how much of this depends on the proper use of the boost.python functionality. Note also that there may be a reason that pybindgen seems to be in general quite a bit faster than swig and boost.python: it may not produce as versatile a binding as the other two. For instance, exception propagation, call argument type checking, etc. I haven't had a chance to use pybindgen yet but I intend to. Boost is in general quite big package to install, and last I saw you can't just install boost python you pretty much need the whole Boost library. As others have mentioned compilation will be slow due to heavy use of template programming, which also means typically rather cryptic error messages at compile time. Summary: given how easy SWIG is to install and use, that it generates decent binding that is robust and versatile, and that one interface file allows your C++ DLL to be available from several other languages like LUA, C#, and Java, I would favor it over boost.python. But unless you really need multi-language support I would take a close look at PyBindGen because of its purported speed, and pay close attention to robustness and versatility of binding it generates.
0
32,045
false
0
1
Extending python - to swig, not to swig or Cython
3,167,276
3
10
1
6
70
0
1
0
I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c/c++ extension for performance. With the help of swig you almost don't need to care about arguments etc. Everything works fine. Now my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code. Does anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.
0
python,c++,c,swig,cython
2009-01-19T08:32:00.000
0
456,884
There be dragons here. Don't swig, don't boost. For any complicated project the code you have to fill in yourself to make them work becomes unmanageable quickly. If it's a plain C API to your library (no classes), you can just use ctypes. It will be easy and painless, and you won't have to spend hours trawling through the documentation for these labyrinthine wrapper projects trying to find the one tiny note about the feature you need.
0
32,045
false
0
1
Extending python - to swig, not to swig or Cython
461,364
3
10
1
3
70
0
0.059928
0
I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c/c++ extension for performance. With the help of swig you almost don't need to care about arguments etc. Everything works fine. Now my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code. Does anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.
0
python,c++,c,swig,cython
2009-01-19T08:32:00.000
0
456,884
If its not a big extension, boost::python might also be an option, it executes faster than swig, because you control what's happening, but it'll take longer to dev. Anyways swig's overhead is acceptable if the amount of work within a single call is large enough. For example if you issue is that you have some medium sized logic block you want to move to C/C++, but that block is called within a tight-loop, frequently, you might have to avoid swig, but I can't really think of any real-world examples except for scripted graphics shaders.
0
32,045
false
0
1
Extending python - to swig, not to swig or Cython
456,894
2
3
0
0
1
0
0
0
Please tell me C++/Java code which utilize memory more than 70% . For Example we have 3 Virtual machine and in memory resources we want to test the memory utilization as per memory resources allocated by user.
0
java,c++,python,c
2009-01-19T08:52:00.000
0
456,926
I want to test the Memory utilization but after executing the code i am unable to test the same. As i am new to this so help me more on this. Let we have 3 Virtual machine V1,V2,V3 For V1 - Set shared resource as High For V2 - Set shared resources as Normal For V3 - Set shared resources as Normal So it means total is 2 GB then V1 get 1 GB and V2,V3 gets 512 MB each . So i want to test using programming if some one changes the Shared or reservation or Limit then how it works.
0
352
false
0
1
Code to utilize memory more than 70%
460,265
2
3
0
4
1
0
0.26052
0
Please tell me C++/Java code which utilize memory more than 70% . For Example we have 3 Virtual machine and in memory resources we want to test the memory utilization as per memory resources allocated by user.
0
java,c++,python,c
2009-01-19T08:52:00.000
0
456,926
Which memory? On a 64 bit platform, a 64 bit process can use far more than 4GB. You'd be filling swap for hours before you hit those limits. If you want to test "70% of physical RAM", you might discover that you cannot allocate 70% of the 32 bits address space. A significant amount is already claimed by the OS.
0
352
false
0
1
Code to utilize memory more than 70%
456,948
3
4
0
1
3
0
0.049958
0
I wrote an application server (using python & twisted) and I want to start writing some tests. But I do not want to use Twisted's Trial due to time constraints and not having time to play with it now. So here is what I have in mind: write a small test client that connects to the app server and makes the necessary requests (the communication protocol is some in-house XML), store in a static way the received XML and then write some tests on those static data using unitest. My question is: Is this a correct approach and if yes, what kind of tests are covered with this approach? Also, using this method has several disadvantages, like: not being able to access the database layer in order to build/rebuild the schema, when will the test client going to connect to the server: per each unit test or before running the test suite?
0
python,unit-testing,twisted
2009-01-21T09:15:00.000
1
464,543
I think you chose the wrong direction. It's true that the Trial docs is very light. But Trial is base on unittest and only add some stuff to deal with the reactor loop and the asynchronous calls (it's not easy to write tests that deal with deffers). All your tests that are not including deffer/asynchronous call will be exactly like normal unittest. The Trial command is a test runner (a bit like nose), so you don't have to write test suites for your tests. You will save time with it. On top of that, the Trial command can output profiling and coverage information. Just do Trial -h for more info. But in any way the first thing you should ask yourself is which kind of tests do you need the most, unit tests, integration tests or system tests (black-box). It's possible to do all with Trial but it's not necessary allways the best fit.
0
1,357
false
1
1
unit testing for an application server
465,422
3
4
0
1
3
0
1.2
0
I wrote an application server (using python & twisted) and I want to start writing some tests. But I do not want to use Twisted's Trial due to time constraints and not having time to play with it now. So here is what I have in mind: write a small test client that connects to the app server and makes the necessary requests (the communication protocol is some in-house XML), store in a static way the received XML and then write some tests on those static data using unitest. My question is: Is this a correct approach and if yes, what kind of tests are covered with this approach? Also, using this method has several disadvantages, like: not being able to access the database layer in order to build/rebuild the schema, when will the test client going to connect to the server: per each unit test or before running the test suite?
0
python,unit-testing,twisted
2009-01-21T09:15:00.000
1
464,543
"My question is: Is this a correct approach?" It's what you chose. You made a lot of excuses, so I'm assuming that your pretty well fixed on this course. It's not the best, but you've already listed all your reasons for doing it (and then asked follow-up questions on this specific course of action). "correct" doesn't enter into it anymore, so there's no answer to this question. "what kind of tests are covered with this approach?" They call it "black-box" testing. The application server is a black box that has a few inputs and outputs, and you can't test any of it's internals. It's considered one acceptable form of testing because it tests the bottom-line external interfaces for acceptable behavior. If you have problems, it turns out to be useless for doing diagnostic work. You'll find that you need to also to white-box testing on the internal structures. "not being able to access the database layer in order to build/rebuild the schema," Why not? This is Python. Write a separate tool that imports that layer and does database builds. "when will the test client going to connect to the server: per each unit test or before running the test suite?" Depends on the intent of the test. Depends on your use cases. What happens in the "real world" with your actual intended clients? You'll want to test client-like behavior, making connections the way clients make connections. Also, you'll want to test abnormal behavior, like clients dropping connections or doing things out of order, or unconnected.
0
1,357
true
1
1
unit testing for an application server
464,870
3
4
0
0
3
0
0
0
I wrote an application server (using python & twisted) and I want to start writing some tests. But I do not want to use Twisted's Trial due to time constraints and not having time to play with it now. So here is what I have in mind: write a small test client that connects to the app server and makes the necessary requests (the communication protocol is some in-house XML), store in a static way the received XML and then write some tests on those static data using unitest. My question is: Is this a correct approach and if yes, what kind of tests are covered with this approach? Also, using this method has several disadvantages, like: not being able to access the database layer in order to build/rebuild the schema, when will the test client going to connect to the server: per each unit test or before running the test suite?
0
python,unit-testing,twisted
2009-01-21T09:15:00.000
1
464,543
haven't used twisted before, and the twisted/trial documentation isn't stellar from what I just saw, but it'll likely take you 2-3 days to implement correctly the test system you describe above. Now, like I said I have no idea about Trial, but I GUESS you could probably get it working in 1-2 days, since you already have a Twisted application. Now if Trial gives you more coverage in less time, I'd go with Trial. But remember this is just an answer from a very cursory look at the docs
0
1,357
false
1
1
unit testing for an application server
464,596
6
7
0
1
5
1
0.028564
0
I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts?
0
.net,python,ruby,ironpython,ironruby
2009-01-21T20:43:00.000
0
466,897
IronPython/IronRuby are built to work on the .net virtual machine, so they are as you say essentially platform specific. Apparently they are compatible with Python and Ruby as long as you don't use any of the .net framework in your programs.
0
501
false
0
1
How will Python and Ruby applications be affected by .NET?
466,930
6
7
0
0
5
1
0
0
I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts?
0
.net,python,ruby,ironpython,ironruby
2009-01-21T20:43:00.000
0
466,897
You answer your first question with the second one, if you don't use anything from .Net only the original libs provided by the implementation of the language, you could interpret your *.py or *.rb file with another implementation and it should work. The advantage would be if your a .Net shop you usually take care of having the right framework installed on client machine etc... well if you want python or ruby code, you now need to support another "framework" need to distribute install, take care of version problem etc... So there 2 advantages, using .Net framework power inside another language + keep the distribution/maintenance as simple as possible.
0
501
false
0
1
How will Python and Ruby applications be affected by .NET?
467,031
6
7
0
0
5
1
0
0
I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts?
0
.net,python,ruby,ironpython,ironruby
2009-01-21T20:43:00.000
0
466,897
It would be cool to run Rails/Django under IIS rather then Apache/Mongrel type solutions
0
501
false
0
1
How will Python and Ruby applications be affected by .NET?
467,067
6
7
0
1
5
1
0.028564
0
I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts?
0
.net,python,ruby,ironpython,ironruby
2009-01-21T20:43:00.000
0
466,897
If you create a library or framework, people can use it on .NET with their .NET code. That's pretty cool for them, and for you! When developing an application, if you use .NET's facilities with abandon then you lose "cross-platformity", which is not always an issue. If you wrap these uses with an internal API, you can replace the .NET implementations later with pure-Python, wrapped C (for CPython), or Java (for Jython) later.
0
501
false
0
1
How will Python and Ruby applications be affected by .NET?
467,145
6
7
0
1
5
1
0.028564
0
I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts?
0
.net,python,ruby,ironpython,ironruby
2009-01-21T20:43:00.000
0
466,897
According to the Mono page, IronPython is compatible with Mono's implementation of the .Net runtime, so executables should work both on Windows and Linux.
0
501
false
0
1
How will Python and Ruby applications be affected by .NET?
467,385
6
7
0
2
5
1
0.057081
0
I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts?
0
.net,python,ruby,ironpython,ironruby
2009-01-21T20:43:00.000
0
466,897
Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? IronRuby currently ships with most of the core ruby standard library, and support for ruby gems. This means that it will support pretty much any native ruby app that doesn't rely on C extensions. The flipside is that it will be possible to write native ruby apps in IronRuby that don't rely on the CLR, and those will be portable to MRI. Whether or not people choose to create or use extensions for their apps using the CLR is the same question as to whether people create or use C extensions for MRI - one is no more portable than the other. There is a side-question of "because it is so much easier to create IronRuby extensions in C# than it is to create CRuby extensions in C, will people create extensions where they should be sticking to native ruby code?", but that's entirely subjective. On the whole though, I think anything that makes creating extensions easier is a big win. If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterparts? Performance: IronRuby is already faster for the most part than MRI 1.8, and isn't far off MRI 1.9, and things will only improve in future. I think python is similar in this respect. Deployment: As people have mentioned, running a native ruby cross-platform rails app inside IIS is an attractive proposition to some windows-based developers, as it lets them better integrate with existing servers/management infrastructure/etc Stability: While MRI 1.9 is much better than 1.8 was, I don't think anyone could disagree that CLR has a much better garbage collector and base runtime than C ruby does.
0
501
false
0
1
How will Python and Ruby applications be affected by .NET?
1,285,474
2
3
1
7
16
0
1
0
We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software structures. So we believe IronPython is a good platform for us because it provides standard GUI functionality on windows and access to all of .Net libraries. I know Ironpython studio is not complete, and in fact I had a hard time adding my references but I was wondering if someone could list some of the pros and cons of this migration for us, considering Python code is easier to read by our clients and we usually deliver a proof-of-concept prototype instead of a full-functional code, our clients usually go ahead and implement the application themselves
0
python,ironpython,ironpython-studio
2009-01-23T02:49:00.000
0
471,712
The way you describe things, it sounds like you're company is switching to Python simple for the sake of Python. Is there some specific reason you want to use Python? Is a more dynamic language necessary? Is the functional programming going to help you at all? If you've got a perfectly good working set of tools in C#, why bother switching? If you're set on switching, you may want to consider starting with standard Python unless you're specifically tied to the .NET libraries. You can write cross platform GUIs using a number of different frameworks like wxPython, pyQt, etc. That said, Visual Studio has a far superior GUI designer to just about any of the tools out there for creating Python windowed layouts.
0
5,128
false
0
1
Pros and cons of IronPython and IronPython Studio
471,725
2
3
1
18
16
0
1.2
0
We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software structures. So we believe IronPython is a good platform for us because it provides standard GUI functionality on windows and access to all of .Net libraries. I know Ironpython studio is not complete, and in fact I had a hard time adding my references but I was wondering if someone could list some of the pros and cons of this migration for us, considering Python code is easier to read by our clients and we usually deliver a proof-of-concept prototype instead of a full-functional code, our clients usually go ahead and implement the application themselves
0
python,ironpython,ironpython-studio
2009-01-23T02:49:00.000
0
471,712
My company, Resolver Systems, develops what is probably the biggest application written in IronPython yet. (It's called Resolver One, and it's a Pythonic spreadsheet). We are also hosting the Ironclad project (to run CPython extensions under IronPython) and that is going well (we plan to release a beta of Resolver One & numpy soon). The reason we chose IronPython was the .NET integration - our clients want 100% integration on Windows and the easiest way to do that right now is .NET. We design our GUI (without behaviour) in Visual Studio, compile it into a DLL and subclass it from IronPython to add behaviour. We have found that IronPython is faster at some cases and slower at some others. However, the IronPython team is very responsive, whenever we report a regression they fix it and usually backport it to the bugfix release. If you worry about performance, you can always implement a critical part in C# (we haven't had to do that yet). If you have experience with C#, then IronPython will be natural for you, and easier than C#, especially for prototypes. Regarding IronPython studio, we don't use it. Each of us has his editor of choice (TextPad, Emacs, Vim & Wing), and everything works fine.
0
5,128
true
0
1
Pros and cons of IronPython and IronPython Studio
472,355
2
5
0
13
8
0
1.2
0
If there is truly a 'best' way, what is the best way to ship a python app and ensure people can't (easily) reverse engineer your algorithms/security/work in general? If there isn't a 'best' way, what are the different options available? Background: I love coding in Python and would love to release more apps with it. One thing that I wonder about is the possibility of people circumventing any licensing code I put in, or being able to just rip off my entire source base. I've heard of Py2Exe and similar applications, but I'm curious if there are 'preferred' ways of doing it, or if this problem is just a fact of life.
0
python,security,reverse-engineering
2009-01-24T00:40:00.000
0
475,216
Security through obscurity never works. If you must use a proprietary license, enforce it through the law, not half-baked obfuscation attempts. If you're worried about them learning your security (e.g. cryptography) algorithm, the same applies. Real, useful, security algorithms (like AES) are secure even though the algorithm is fully known.
0
12,980
true
0
1
Python Applications: Can You Secure Your Code Somehow?
475,246
2
5
0
8
8
0
1
0
If there is truly a 'best' way, what is the best way to ship a python app and ensure people can't (easily) reverse engineer your algorithms/security/work in general? If there isn't a 'best' way, what are the different options available? Background: I love coding in Python and would love to release more apps with it. One thing that I wonder about is the possibility of people circumventing any licensing code I put in, or being able to just rip off my entire source base. I've heard of Py2Exe and similar applications, but I'm curious if there are 'preferred' ways of doing it, or if this problem is just a fact of life.
0
python,security,reverse-engineering
2009-01-24T00:40:00.000
0
475,216
Even if you use a compiled language like C# or Java, people can perform reverse engineering if they are motivated and technically competent. Obfuscation is not a reliable protection against this. You can add prohibition against reverse-engineering to your end-user license agreement for your software. Most proprietary companies do this. But that doesn't prevent violation, it only gives you legal recourse. The best solution is to offer products and services in which the user's access to read your code does not harm your ability to sell your product or service. Base your business on service provided, or subscription to periodic updates to data, rather than the code itself. Example: Slashdot actually makes their code for their website available. Does this harm their ability to run their website? No. Another remedy is to set your price point such that the effort to pirate your code is more costly than simply buying legitimate licenses to use your product. Joel Spolsky has made a recommendation to this effects in his articles and podcasts.
0
12,980
false
0
1
Python Applications: Can You Secure Your Code Somehow?
475,394
2
3
0
-1
0
1
-0.066568
0
I will participate a modeling competition, which spends three days. I need a language which is fast and designed for modeling, such as to 2D/3D models. I have considered these languages: Python Sage Which languages would you use?
0
python,sage
2009-01-25T07:40:00.000
0
477,335
I would use C++, since it spends three days I would have time to write C++ code, and it's a lot faster then python, which would be my choice if it were a one day competition. So I would probably use C++ with OpenGL and SDL for the models. The simulations would I first write in C++, and if I had time at the end I would try to implement them in a shader if it were possible.
0
185
false
0
1
Most suitable language(s) for simulations in modeling?
477,372
2
3
0
4
0
1
1.2
0
I will participate a modeling competition, which spends three days. I need a language which is fast and designed for modeling, such as to 2D/3D models. I have considered these languages: Python Sage Which languages would you use?
0
python,sage
2009-01-25T07:40:00.000
0
477,335
You should use the language that you know best and that has good-enough tools for the task at hand. Depending on when the competition is you may have no time to learn a new language/environment.
0
185
true
0
1
Most suitable language(s) for simulations in modeling?
477,384
10
11
1
0
18
0
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
Between komodo and wingide i would go for wing. The license is not that expensive and the fact that it is commercial gives you a bigger probability of more updates and bug fixes. If you, like me, prefer a free solution, then stick with pydev. At least until aptana closes the free door :)
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
495,362
10
11
1
2
18
0
0.036348
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
Check to see if the 'P' icon is appearing for your items and in the top of your editor after opening it. If it's not appearing, it may be that there's a problem with the file association, so, go to window > preferences > general > editors > file associations and make sure that the .py files are associated with the Python Editor (note that because of an eclipse bug, if it seems correct, you may have to remove the association and add it again)
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
1,399,741
10
11
1
1
18
0
0.01818
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
It sounds like you have to specify the location of the Python interpreter. Do this under Preferences > Pydev > Interpreter - Python. Create a new interpreter and point it to the Python interpreter executable.
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
4,665,424
10
11
1
5
18
0
0.090659
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
Make sure you use 'Open With' as 'Python Editor' by right clicking on the file - It worked for me
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
17,847,161
10
11
1
0
18
0
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
Check your Theme configuration. Python highlighting uses Theme Colors
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
18,933,901
10
11
1
0
18
0
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
In case anyone else makes the embarrassing mistake that I did: be sure your source code file actually ends with ".py". Even if its in a Python project, PyDev won't guess without the extension.
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
19,301,447
10
11
1
0
18
0
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
When syntax highlighting was not working for me using PyDev, I discovered that there were somehow two 'Python Editor' associations defined for .py files in my installation of Eclipse/PyDev. From the Eclipse Main Menu, go to Window > Preferences > General > Editors > FileAssociations to see the file extension <-> editor mapping. I set a different one as default for .py files at the bottom of the dialog, and got syntax highlighting working again.
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
35,208,736
10
11
1
0
18
0
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
Well, I tried the Wing Professional and I think its really the best Py IDE out there.
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
495,297
10
11
1
13
18
0
1
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
The typical reason that code completion doesn't work under PyDev is that the libraries aren't in the PYTHONPATH. If you go into the Project Properties, and setup PyDev PYTHONPATH preferences to include the places where the code you are trying to complete lives, it will work just fine... Project > Properties > PyDev-PYTHONPAH > click 'Add source folder'
0
31,316
false
0
1
No code completion and syntax highlighting in Pydev
1,836,524
10
11
1
23
18
0
1.2
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
0
python,ide
2009-01-29T09:50:00.000
0
491,053
To enable code completion, go to Window > Preferences > Pydev > Editor > Code Completion, and check the 'Use Code Completion?' box, as well as the other boxes for what you want to complete on. It seems to take a second to load, the first time it has to complete something. Syntax coloring should just work by default. Right-click on the file in the package explorer, go to 'Open With', and make sure you're opening it with the Python Editor, and not the regular Text Editor. I don't know exactly what you mean by importing external modules. I have my source in a separate directory structure on disk; my PyDev projects contain folders linked to those. Code completion works for that, as well as other modules like 'os'. If you're having troubles, are the modules added to the PyDev's Python search path (not necessarily the same as the regular one)? I took a brief look at Komodo and Wingware a while back, so I can't answer the second part of your question. But ended up going with PyDev. I'm not a big fan of Eclipse, but PyDev works reasonably well for me.
0
31,316
true
0
1
No code completion and syntax highlighting in Pydev
492,073
3
9
0
1
3
0
0.022219
0
I want to have some work done on the Network front, pinging numerous computers on a LAN and retrieving data about the response time. Which would be the most useful and productive to work with: Perl or Python?
0
python,perl,networking,scripting-language
2009-01-29T12:22:00.000
0
491,380
Right now I've experimented the approach of creating some simple unit test for network services using various TAP libraries (mainly bash+netcat+curl and perl). The advantage is that you wrote a single script that you can use for both unit and network testing. The display is dove via TAP::Harness::HTML.
0
7,896
false
0
1
Should I use Perl or Python for network monitoring?
4,275,651
3
9
0
1
3
0
0.022219
0
I want to have some work done on the Network front, pinging numerous computers on a LAN and retrieving data about the response time. Which would be the most useful and productive to work with: Perl or Python?
0
python,perl,networking,scripting-language
2009-01-29T12:22:00.000
0
491,380
Whichever you know better or are more comfortable using. They both can do the job and do it well, so it is your preference.
0
7,896
false
0
1
Should I use Perl or Python for network monitoring?
492,708
3
9
0
-1
3
0
-0.022219
0
I want to have some work done on the Network front, pinging numerous computers on a LAN and retrieving data about the response time. Which would be the most useful and productive to work with: Perl or Python?
0
python,perl,networking,scripting-language
2009-01-29T12:22:00.000
0
491,380
I'd say that if you need something quick and dirty that's up and running by this afternoon, then perl is probably the better language. However for developing solid application that's easy to maintain and extend and that you can build on over time, I'd go with python. This is of course assuming you know both languages more or less equally well.
0
7,896
false
0
1
Should I use Perl or Python for network monitoring?
491,625
7
13
0
0
8
1
0
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
I find dynamic languages like Perl and to a lesser extent Python allow me to write quick and dirty scripts for things I need to do. The run cycle is much shorter in dynamic languages and often less code needs to be written then in a statically typed language which increases my productivity. This unfortunately comes at the cost of maintainability but that is a fault of the way I write programs in dynamic languages not in the languages them selves.
0
1,456
false
0
1
Uses for Dynamic Languages
494,118
7
13
0
1
8
1
0.015383
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
The point is that in a dynamic language you can implement the same functionality much quicker than in a statically typed one. Therefore the productivity is typically much higher. Things like templates or polymorphism in principle give you lots of flexibility, but you have to write a large amount of code to make it work. In a dynamic language this flexibility almost comes for free. So I think you look at the difference in the wrong way, productivity really is the main point here (just like garbage collection improves productivity, but otherwise does not really allow you to do new things).
0
1,456
false
0
1
Uses for Dynamic Languages
495,293
7
13
0
1
8
1
0.015383
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
One big advantage of dynamic typing when using objects is that you don't need to use class hierarchies anymore when you want several classes to have the same interface - that's more or less what is called duck typing. Bad inheritance is very difficult to fix afterwards - this makes refactoring often harder than it is in a language like python.
0
1,456
false
0
1
Uses for Dynamic Languages
494,423
7
13
0
-2
8
1
-0.03076
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
Compiled languages tend to be used when efficiency and type safety are the priorities. Otherwise I can't think of any reason why anyone wouldn't be using ruby :)
0
1,456
false
0
1
Uses for Dynamic Languages
494,121
7
13
0
1
8
1
0.015383
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
In dynamic languages you can use values in ways that you know are correct. In a statically typed language you can only use values in ways the compiler knows are correct. You need all of the things you mentioned to regain flexibility that's taken away by the type system (I'm not bashing static type systems, the flexibility is often taken away for good reasons). This is a lot of complexity that you don't have to deal with in a dynamic language if you want to use values in ways the language designer didn't anticipate (for example, putting values of different types in a hash table). So it's not that you can't do these things in a statically typed language (if you have runtime reflection), it's just more complicated.
0
1,456
false
0
1
Uses for Dynamic Languages
494,009
7
13
0
0
8
1
0
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
With a dynamic language it's much easier to have a command line interpreter so you can test things on the command line and don't have to worry about a compile step to see if they work.
0
1,456
false
0
1
Uses for Dynamic Languages
493,993
7
13
0
15
8
1
1.2
0
My primary language right now is D, and I'm in the process of learning Python because it's required for a course I'm taking. While I understand why dynamic languages would be a breath of fresh air for people programming in static languages without type inference or templates (IMHO templates are to a large extent compile-time duck typing), I'm curious what the benefits are of dynamic languages even when you have those. The bottom line is that, if I'm going to learn Python, I want to learn it in a way that really changes my thinking about programming, rather than just writing D in Python. I have not used dynamic languages since I was a fairly novice programmer and unable to appreciate the flexibility they supposedly offer, and want to learn to take full advantage of them now. What can be done easily/elegantly in a dynamically typed, interpreted language that's awkward or impossible in a static language, even with templates, polymorphism, static type inference, and maybe runtime reflection?
0
python,programming-languages,language-design,dynamic-languages,duck-typing
2009-01-29T23:42:00.000
0
493,973
In theory, there's nothing that dynamic languages can do and static languages can't. Smart people put a lot of work into making very good dynamic languages, leading to a perception at the moment that dynamic languages are ahead while static ones need to catch up. In time, this will swing the other way. Already various static languages have: Generics, which make static types less stupid by letting it select the right type when objects are passed around, saving the programmer from having to cast it themselves Type inference, which saves having to waste time on writing the stuff that should be obvious Closures, which among many other things help to separate mechanism from intention, letting you pull together complicated algorithms from mostly existing ingredients. Implicit conversions, which lets you simulate "monkey patching" without the risks it usually involves. Code loading and easy programmatic access to the compiler, so users and third parties can script your program. Use with caution! Syntaxes that are more conducive to the creation of Domain Specific Languages within them. ...and no doubt more to come. The dynamic movement has spawned some interesting developments in static language design, and we all benefit from the competition. I only hope more of these features make it to the mainstream. There's one place where I don't see the dominant dynamic language being replaced, and that's Javascript in the browser. There's just too much of an existing market to replace, so the emphasis seems to be towards making Javascript itself better instead.
0
1,456
true
0
1
Uses for Dynamic Languages
494,055
1
12
0
0
52
1
0
0
I waste a lot of time between Vim and Python. I find it too slow to manually copy-paste from Python to Vim and vice versa. A good broken example is: %!python for i in xrange(25); print 6*i \n How can you do such tweaks direcly in Vim? [Solved] [Clarification] I need things to Vim, like printing sequences, arithmetics... - things I cannot do in Vim. [?] Can someone elaborate this point: "your script can read from stdin to operate directly on the lines given (., %, ...)." [Further Clarification] If I want to print 'Hello' to lines 4,5, 6 and 7, what is wrong: :4-7!python -c "print 'hello'" The dot . modifies the current line. Can I print on multiple lines 7, 32 and 99: :7,32,99!python -c "print 'hello'" Clearly not working. How?
0
python,vim
2009-02-01T21:10:00.000
0
501,585
If I want to print 'Hello' to lines 4,5, 6 and 7, what is wrong: If you want to do something in randomly chosen places throughout your file, you're better of recording keystrokes and replaying them. Go to the first line you want to change, and hit qz to starting recording into register z. Do whatever edits you want for that line and hit q again when you're finished. Go to the next line you want to change and press @z to replay the macro.
0
20,950
false
0
1
How can you use Python in Vim?
501,812
2
5
0
4
6
1
0.158649
0
I've got a number of scripts that use common definitions. How do I split them in multiple files? Furthermore, the application can not be installed in any way in my scenario; it must be possible to have an arbitrary number of versions concurrently running and it must work without superuser rights. Solutions I've come up with are: Duplicate code in every script. Messy, and probably the worst scheme. Put all scripts and common code in a single directory, and use from . import to load them. The downside of this approach is that I'd like to put my libraries in other directory than the applications. Put common code in its own directory, write a __init__.py that imports all submodules and finally use from . import to load them. Keeps code organized, but it's a little bit of overhead to maintain __init__.py and qualify names. Add the library directory to sys.path and import. I tend to this, but I'm not sure whether fiddling with sys.path is nice code. Load using execfile (exec in Python 3). Combines the advantages of the previous two approaches: Only one line per module needed, and I can use a dedicated. On the other hand, this evades the python module concept and polutes the global namespace. Write and install a module using distutils. This installs the library for all python scripts and needs superuser rights and impacts other applications and is hence not applicable in my case. What is the best method?
0
python
2009-02-02T00:59:00.000
0
501,945
You can set the PYTHONPATH environment variable to the directory where your library files are located. This adds that path to the library search path and you can use a normal import to import them.
0
3,665
false
0
1
How to modularize a Python application
501,958
2
5
0
1
6
1
0.039979
0
I've got a number of scripts that use common definitions. How do I split them in multiple files? Furthermore, the application can not be installed in any way in my scenario; it must be possible to have an arbitrary number of versions concurrently running and it must work without superuser rights. Solutions I've come up with are: Duplicate code in every script. Messy, and probably the worst scheme. Put all scripts and common code in a single directory, and use from . import to load them. The downside of this approach is that I'd like to put my libraries in other directory than the applications. Put common code in its own directory, write a __init__.py that imports all submodules and finally use from . import to load them. Keeps code organized, but it's a little bit of overhead to maintain __init__.py and qualify names. Add the library directory to sys.path and import. I tend to this, but I'm not sure whether fiddling with sys.path is nice code. Load using execfile (exec in Python 3). Combines the advantages of the previous two approaches: Only one line per module needed, and I can use a dedicated. On the other hand, this evades the python module concept and polutes the global namespace. Write and install a module using distutils. This installs the library for all python scripts and needs superuser rights and impacts other applications and is hence not applicable in my case. What is the best method?
0
python
2009-02-02T00:59:00.000
0
501,945
I've used the third approach (add the directories to sys.path) for more than one project, and I think it's a valid approach.
0
3,665
false
0
1
How to modularize a Python application
501,966
1
2
0
-1
0
0
1.2
0
I am using postfix in my production server which will receive all the emails related to mydomain.com In this context, I want to forward only emails related to few users to different email addresses. By which I mean, lets say I am a super user([email protected]). I want to forward all my emails(all mails with to:[email protected]) to my personal email id: [email protected]. So I think I would some programming logic is needed here. So I want to write a custom python script which should read the postfix email inbox and forward all new emails depending on the said criteria. Can I do this? I heard about .forward file in the postfix arena. Can I use that to achieve the same(by totally bypassing pythonic solution)?
0
python,email,smtp,postfix-mta,mailing
2009-02-03T14:54:00.000
0
507,376
Procmail is the solution for mail filtering. You can call python scripts from your .procmailrc if you need more scripting.
0
2,899
true
0
1
How do I read/retrieve emails received by local postfix, through python
507,398
1
2
1
5
8
0
1.2
0
I have a C extension module for Python and I want to make it available to Rubyists. The source has a number of C modules, with only one being Python-dependent. The rest depend only on each other and the standard library. I can build it with python setup.py build in the usual way. I've been experimenting with adding Ruby support using newgem and I can build a version of the extension with rake gem. However, the combined source has an ugly directory layout (mixing Gem-style and Setuptools-style structures) and the build process is a kludge. I can't just keep all the sources in the same directory because mkmf automatically picks up the Python-dependent module and tries to build that, and users shouldn't have to install Python to compile a module that won't be used. My current hack is for extconf.rb to copy the Python-independent source-files into the same directory as the Ruby-dependent extension module. Is there a saner way to make the code available to both languages? Should I just duplicate the Python-independent code in a separate Gem? Should I release the independent code as a separate lib built with autotools? Is there a version of mkmf that can skip the unwanted module?
0
python,ruby,setuptools,newgem
2009-02-04T13:42:00.000
0
511,412
One way to solve it is to create three different projects: The library itself, independent on python & ruby Python bindings Ruby bindings That's probably the cleanest solution, albeit it requires a bit more work when doing releases, but it has the advantage that you can release a new version of the Ruby bindings without having to ship a new library/python bindings version.
0
734
true
0
1
Combined Python & Ruby extension module
511,871
6
8
0
0
2
0
0
0
My hosting service does not currently run/allow svn, git, cvs on their server. I would really like to be able to 'sync' my current source on my development machine with my production server. I am looking for a pure php/python/ruby version control system (not just a client for a version control system) that does not require any services running on the server machine, something that could use the http interface to upload/download and sync files - basically offering a back end into my 'live' site for version control. Additionally, I would think that such a system would be easy to develop an 'online' ide for, so that I could develop directly on the production server. (issues of testing aside of course) Does anyone know if such a system exists? ==Edit== Really, I want a wiki front end for a version control / development system - Basically look like a wiki and edit development files so that I could easily make and roll back changes via the web. I doubt this exists, but it would be easy to extend an existing php port of svn...
0
php,python,version-control,web-applications
2009-02-04T20:34:00.000
0
513,173
Why dont you want a client..? A simple client that you can run on your production machine which then syncs to your repository running on another server somewhere. SVN is available over HTTP so writing a client that is able to sync your code is really easy in python or php.
0
1,960
false
1
1
pure web based versioning system
513,899