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
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Dynamic languages are fantastic for prototyping ideas. Often for performance reasons they won't work for permanent solutions or products. But, with languages like Python, which allow you to embed standard C/C++/Java inside them or visa versa, you can speed up the really critical bits but leave it glued together with the flexibility of a dynamic language. ...and so you get the best of both worlds. If you need to justify this in terms of why more people should learn these languages, just point out much faster you can develop the same software and how much more robust the solution is (because debugging/fixing problems in dynamic languages is in my experience, considerably easier!).
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
85,789
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Knowing grep and ruby made it possible to narrow down a problem, and verify the fix for, an issue involving tons of java exceptions on some production servers. Because I threw the solution together in ruby, it was done (designed, implemented, tested, run, bug-fixed, re-run, enhanced, results analyzed) in an afternoon instead of a couple of days. I could have solved the same problem using an all-java solution or a C# solution, but it most likely would have taken me longer. Having dynamic language expertise also sometimes leads you to simpler solutions in less dynamic languages. In ruby, perl or python, you just intuitively reach for associative arrays (hashes, dictionaries, whatever word you want to use) for the smallest things, where you might be tempted to create a complex class hierarchy in a statically typed language when the problem doesn't necessarily demand it. Plus you can plug in most scripting languages into most runtimes. So it doesn't have to be either/or.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
85,891
31
35
1
2
66
0
0.011428
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Learning a new language is a long-term process. In a couple of days you'll learn the basics, yes. But! As you probably know, the real practical applicability of any language is tied to the standard library and other available components. Learning how to use the efficiently requires a lot of hands-on experience. Perhaps the only immediate short-term benefit is that developers learn to distinguish the nails that need a Python/Perl/Ruby -hammer. And, if they are any good, they can then study some more (online, perhaps!) and become real experts. The long-term benefits are easier to imagine: The employee becomes a better developer. Better developer => better quality. We are living in a knowledge economy these days. It's wiser to invest in those brains that already work for you. It is easier to adapt when the next big language emerges. It is very likely that the NBL will have many of the features present in today's scripting languages: first-class functions, closures, streams/generators, etc. New market possibilities and ability to respond more quickly. Even if you are not writing Python, other people are. Your clients? Another vendor in the project? Perhaps a critical component was written in some other language? It will cost money and time, if you do not have people who can understand the code and interface with it. Recruitment. If your company has a reputation of teaching new and interesting stuff to people, it will be easier to recruit the top people. Everyone is doing Java/C#/C++. It is not a very effective way to differentiate yourself in the job market.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
85,898
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
The "real benefit" that an employer could see is a better programmer who can implement solutions faster; however, you will not be able to provide any hard numbers to justify the expense and an employer will most likely have you work on what makes money now as opposed to having you work on things that make the future better. The only time you can get training on the employer's dime, is when they perceive a need for it and it's cheaper than hiring a new person who already has that skill-set.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
85,910
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Testing. It's often quicker and easier to test your C#/Java application by using a dynamic language. You can do exploratory testing at the interactive prompt and quickly create automated test scripts.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
86,366
31
35
1
1
66
0
0.005714
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
I think the main benefits of dynamic languages can be boiled down to Rapid development Glue The short design-code-test cycle time makes dynamic languages ideal for prototyping, tools, and quick & dirty one-off scripts. IMHO, the latter two can make a huge impact on a programmer's productivity. It amazes me how many people trudge through things manually instead of whipping up a tool to do it for them. I think it's because they don't have something like Perl in their toolbox. The ability to interface with just about anything (other programs or languages, databases, etc.) makes it easy to reuse existing work and automate tasks that would otherwise need to be done manually.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
86,657
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Others have already explained why learning more languages makes you a better programmer. As for convincing your boss it's worth it, this is probably just your company's culture. Some places make career and skill progress a policy (move up or out), some places value it but leave it up to the employee's initiative, and some places are very focused on the bottom line. If you have to explain why learning a language is a good thing to your boss, my advice would be to stay at work only as long as necessary, then go home and study new things on your own.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
86,738
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
For after work work, for freelance jobs...:) and final to be programming literate as possible as...;)
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
87,164
31
35
1
3
66
0
0.017141
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Edit: I wrote this before reading the update to the original question. See my other answer for a better answer to the updated question. I will leave this as is as a warning against being the fastest gun in the west =) Over a decade ago, when I was learning the ways of the Computer, the Old Wise Men With Beards explained how C and C++ are the tools of the industry. No one used Pascal and only the foolhardy would risk their companies with assembler. And of course, no one would even mention the awful slow ugly thing called Java. It will not be a tool for serious business. So. Um. Replace the languages in the above story and perhaps you can predict the future. Perhaps you can't. Point is, Java will not be the Last Programming Language ever and also you will most likely switch employers as well. The future is charging at you 24 hours per day. Be prepared. Learning new languages is good for you. Also, in some cases it can give you bragging rights for a long time. My first university course was in Scheme. So when people talk to me about the new language du jour, my response is something like "First-class functions? That's so last century." And of course, you get more stuff done with a high-level language.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,571
31
35
1
80
66
0
1.2
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
A lot of times some quick task comes up that isn't part of the main software you are developing. Sometimes the task is one off ie compare this file to the database and let me know the differences. It is a lot easier to do text parsing in Perl/Ruby/Python than it is in Java or C# (partially because it is a lot easier to use regular expressions). It will probably take a lot less time to parse the text file using Perl/Ruby/Python (or maybe even vbscript cringe and then load it into the database than it would to create a Java/C# program to do it or to do it by hand. Also, due to the ease at which most of the dynamic languages parse text, they are great for code generation. Sure your final project must be in C#/Java/Transact SQL but instead of cutting and pasting 100 times, finding errors, and cutting and pasting another 100 times it is often (but not always) easier just to use a code generator. A recent example at work is we needed to get data from one accounting system into our accounting system. The system has an import format, but the old system had a completely different format (fixed width although some things had to be matched). The task is not to create a program to migrate the data over and over again. It is to shove the data into our system and then maintain it there going forward. So even though we are a C# and SQL Server shop, I used Python to convert the data into the format that could be imported by our application. Ultimately it doesn't matter that I used python, it matters that the data is in the system. My boss was pretty impressed. Where I often see the dynamic languages used for is testing. It is much easier to create a Python/Perl/Ruby program to link to a web service and throw some data against it than it is to create the equivalent Java program. You can also use python to hit against command line programs, generate a ton of garbage (but still valid) test data, etc.. quite easily. The other thing that dynamic languages are big on is code generation. Creating the C#/C++/Java code. Some examples follow: The first code generation task I often see is people using dynamic languages to maintain constants in the system. Instead of hand coding a bunch of enums, a dynamic language can be used to fairly easily parse a text file and create the Java/C# code with the enums. SQL is a whole other ball game but often you get better performance by cut and pasting 100 times instead of trying to do a function (due to caching of execution plans or putting complicated logic in a function causing you to go row by row instead of in a set). In fact it is quite useful to use the table definition to create certain stored procedures automatically. It is always better to get buy in for a code generator. But even if you don't, is it more fun to spend time cutting/pasting or is it more fun to create a Perl/Python/Ruby script once and then have that generate the code? If it takes you hours to hand code something but less time to create a code generator, then even if you use it once you have saved time and hence money. If it takes you longer to create a code generator than it takes to hand code once but you know you will have to update the code more than once, it may still make sense. If it takes you 2 hours to hand code, 4 hours to do the generator but you know you'll have to hand code equivalent work another 5 or 6 times than it is obviously better to create the generator. Also some things are easier with dynamic languages than Java/C#/C/C++. In particular regular expressions come to mind. If you start using regular expressions in Perl and realize their value, you may suddenly start making use of the Java regular expression library if you haven't before. If you have then there may be something else. I will leave you with one last example of a task that would have been great for a dynamic language. My work mate had to take a directory full of files and burn them to various cd's for various customers. There were a few customers but a lot of files and you had to look in them to see what they were. He did this task by hand....A Java/C# program would have saved time, but for one time and with all the development overhead it isn't worth it. However slapping something together in Perl/Python/Ruby probably would have been worth it. He spent several hours doing it. It would have taken less than one to create the Python script to inspect each file, match which customer it goes to, and then move the file to the appropriate place.....Again, not part of the standard job. But the task came up as a one off. Is it better to do it yourself, spend the larger amount of time to make Java/C# do the task, or spend a much smaller amount of time doing it in Python/Perl/Ruby. If you are using C or C++ the point is even more dramatic due to the extra concerns of programming in C or C++ (pointers, no array bounds checking, etc.).
0
32,287
true
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,943
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Often, dynamc languages (especially python and lua) are embedded in programs to add a more plugin-like functionality and because they are high-level languages that make it easy to add certain behavior, where a low/mid-level language is not needed. Lua specificially lacks all the low-level system calls because it was designed for easeof-use to add functionality within the program, not as a general programming language.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,400
31
35
1
1
66
0
0.005714
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
It's all about broadening your horizons as a developer. If you limit yourself to only strong-typed languages, you may not end up the best programmer you could. As for tasks, Python/Lua/Ruby/Perl are great for small simple tasks, like finding some files and renaming them. They also work great when paired with a framework (e.g. Rails, Django, Lua for Windows) for developing simple apps quickly. Hell, 37Signals is based on creating simple yet very useful apps in Ruby on Rails.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,441
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Philosophical issues aside, I know that I have gotten value from writing quick-and-dirty Ruby scripts to solve brute-force problems that Java was just too big for. Last year I had three separate directory structures that were all more-or-less the same, but with lots of differences among the files (the client hadn't heard of version control and I'll leave the rest to your imagination). It would have taken a great deal of overhead to write an analyzer in Java, but in Ruby I had one working in about 40 minutes.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,383
31
35
1
1
66
0
0.005714
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Given the increasing focus to running dynamic languages (da-vinci vm etc.) on the JVM and the increasing number of dynamic languages that do run on it (JRuby, Grrovy, Jython) I think the usecases are just increasing. Some of the scenarios I found really benifited are Prototyping- use RoR or Grails to build quick prototypes with advantage of being able to runn it on the standard app server and (maybe) reuse existing services etc. Testing- right unit tests much much faster in dynamic languages Performance/automation test scripting- some of these tools are starting to allow the use standard dynamic language of choice to write the test scripts instead of proprietary script languages. Side benefit might be to the able to reuse some unit test code you've already written.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
90,403
31
35
1
1
66
0
0.005714
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Don't tell your employer that you want to learn Ruby. Tell him you want to learn about the state-of-the-art in web framework technologies. it just happens that the hottest ones are Django and Ruby on Rails.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
98,291
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Don't bother your employer, spend ~$40 on a book, download some software, and devote some time each day to read/do exercises. In no time you'll be trained :)
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
114,875
31
35
1
5
66
0
0.028564
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
A good hockey player plays where the puck is. A great hockey player plays where the puck is going to be. - Wayne Gretzky Our industry is always changing. No language can be mainstream forever. To me Java, C++, .Net is where the puck is right now. And python, ruby, perl is where the puck is going to be. Decide for yourself if you wanna be good or great!
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
92,642
31
35
1
1
66
0
0.005714
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
I have often found that learning another language, especially a dynamically typed language, can teach you things about other languages and make you an overall better programmer. Learning ruby, for example, will teach you Object Oriented programming in ways Java wont, and vice versa. All in all, I believe that it is better to be a well rounded programmer than stuck in a single language. It makes you more valuable to the companies/clients you work for.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,382
31
35
1
0
66
0
0
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Dynamic languages are a different way to think and sometimes the practices you learn from a dynamic or functional language can transfer to the more statically typed languages but if you never take the time to learn different languages, you'll never get the benefit of having a knew way to think when you are coding.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
90,005
31
35
1
21
66
0
1
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
Let me turn your question on its head by asking what use it is to an American English speaker to learn another language? The languages we speak (and those we program in) inform the way we think. This can happen on a fundamental level, such as c++ versus javascript versus lisp, or on an implementation level, in which a ruby construct provides a eureka moment for a solution in your "real job." Speaking of your real job, if the market goes south and your employer decides to "right size" you, how do you think you'll stack up against a guy who is flexible because he's written software in tens of languages, instead of your limited exposure? All things being equal, I think the answer is clear. Finally, you program for a living because you love programming... right?
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,362
31
35
1
9
66
0
1
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
I primarily program in Java and C# but use dynamic languages (ruby/perl) to support smoother deployment, kicking off OS tasks, automated reporting, some log parsing, etc. After a short time learning and experimenting with ruby or perl you should be able to write some regex manipulating scripts that can alter data formats or grab information from logs. An example of a small ruby/perl script that could be written quickly would be a script to parse a very large log file and report out only a few events of interest in either a human readable format or a csv format. Also, having experience with a variety of different programming languages should help you think of new ways to tackle problems in more structured languages like Java, C++, and C#.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,437
31
35
1
7
66
0
1
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
One big reason to learn Perl or Ruby is to help you automate any complicated tasks that you have to do over and over. Or if you have to analyse contents of log files and you need more mungeing than available using grep, sed, etc. Also using other languages, e.g. Ruby, that don't have much "setup cost" will let you quickly prototype ideas before implementing them in C++, Java, etc. HTH cheers, Rob
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
84,535
31
35
1
1
66
0
0.005714
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
I have found the more that I play with Ruby, the better I understand C#. 1) As you switch between these languages that each of them has their own constructs and philosophies behind the problems that they try to solve. This will help you when finding the right tool for the job or the domain of a problem. 2) The role of the compiler (or interpreter for some languages) becomes more prominent. Why is Ruby's type system differ from the .Net/C# system? What problems do each of these solve? You'll find yourself understanding at a lower level the constructs of the compiler and its influence on the language 3) Switching between Ruby and C# really helped me to understand Design Patterns better. I really suggest implementing common design patterns in a language like C# and then in a language like Ruby. It often helped me see through some of the compiler ceremony to the philosophy of a particular pattern. 4) A different community. C#, Java, Ruby, Python, etc all have different communities that can help engage your abilities. It is a great way to take your craft to the next level. 5) Last, but not least, because new languages are fun :)
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
2,870,953
31
35
1
14
66
0
1
0
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
c#,java,python,ruby,perl
2008-09-17T15:16:00.000
0
84,340
I don't think anyone has mentioned this yet. Learning a new language can be fun! Surely that's a good enough reason to try something new.
0
32,287
false
0
1
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
89,272
4
6
0
0
7
0
0
0
What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback (which I already generate and show in my error dialog). It would be fine if it could simply email it, but I can't think of a way to do this without including a username and password for the smtp server in the application... Should I implement a simple web service on the server side and have my app send it an HTTP request with the info? Any better ideas?
0
python,cross-platform,error-reporting
2008-09-17T18:09:00.000
0
85,985
Whether you use SMTP or HTTP to send the data, you need to have a username/password in the application to prevent just anyone from sending random data to you. With that in mind, I suspect it would be easier to use SMTP rather than HTTP to send the data.
0
1,475
false
0
1
How to best implement simple crash / error reporting?
86,022
4
6
0
5
7
0
1.2
0
What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback (which I already generate and show in my error dialog). It would be fine if it could simply email it, but I can't think of a way to do this without including a username and password for the smtp server in the application... Should I implement a simple web service on the server side and have my app send it an HTTP request with the info? Any better ideas?
0
python,cross-platform,error-reporting
2008-09-17T18:09:00.000
0
85,985
The web service is the best way, but there are some caveats: You should always ask the user if it is ok to send error feedback information. You should be prepared to fail gracefully if there are network errors. Don't let a failure to report a crash impede recovery! You should avoid including user identifying or sensitive information unless the user knows (see #1) and you should either use SSL or otherwise protect it. Some jurisdictions impose burdens on you that you might not want to deal with, so it's best to simply not save such information. Like any web service, make sure your service is not exploitable by miscreants.
0
1,475
true
0
1
How to best implement simple crash / error reporting?
86,050
4
6
0
1
7
0
0.033321
0
What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback (which I already generate and show in my error dialog). It would be fine if it could simply email it, but I can't think of a way to do this without including a username and password for the smtp server in the application... Should I implement a simple web service on the server side and have my app send it an HTTP request with the info? Any better ideas?
0
python,cross-platform,error-reporting
2008-09-17T18:09:00.000
0
85,985
The web hit is the way to go, but make sure you pick a good URL - your app will be hitting it for years to come.
0
1,475
false
0
1
How to best implement simple crash / error reporting?
86,007
4
6
0
0
7
0
0
0
What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback (which I already generate and show in my error dialog). It would be fine if it could simply email it, but I can't think of a way to do this without including a username and password for the smtp server in the application... Should I implement a simple web service on the server side and have my app send it an HTTP request with the info? Any better ideas?
0
python,cross-platform,error-reporting
2008-09-17T18:09:00.000
0
85,985
Some kind of simple web service would suffice. You would have to consider security so not just anyone could make requests to your service.. On a larger scale we considered a JMS messaging system. Put a serialized object of data containing the traceback/error message into a queue and consume it every x minutes generating reports/alerts from that data.
0
1,475
false
0
1
How to best implement simple crash / error reporting?
86,069
1
3
0
12
12
1
1.2
0
I'm a little confused about how the standard library will behave now that Python (from 3.0) is unicode-based. Will modules such as CGI and urllib use unicode strings or will they use the new 'bytes' type and just provide encoded data?
0
python,unicode,string,cgi,python-3.x
2008-09-18T09:29:00.000
0
91,205
Logically a lot of things like MIME-encoded mail messages, URLs, XML documents, and so on should be returned as bytes not strings. This could cause some consternation as the libraries start to be nailed down for Python 3 and people discover that they have to be more aware of the bytes/string conversions than they were for str/unicode ...
0
464
true
0
1
Will everything in the standard library treat strings as unicode in Python 3.0?
91,301
4
24
0
9
6,790
1
1
0
What are metaclasses? What are they used for?
0
python,oop,metaclass,python-class,python-datamodel
2008-09-19T06:10:00.000
0
100,003
In Python, a metaclass is a subclass of a subclass that determines how a subclass behaves. A class is an instance of another metaclass. In Python, a class specifies how the class's instance will behave. Since metaclasses are in charge of class generation, you can write your own custom metaclasses to change how classes are created by performing additional actions or injecting code. Custom metaclasses aren't always important, but they can be.
0
1,011,070
false
0
1
What are metaclasses in Python?
67,201,732
4
24
0
9
6,790
1
1
0
What are metaclasses? What are they used for?
0
python,oop,metaclass,python-class,python-datamodel
2008-09-19T06:10:00.000
0
100,003
I saw an interesting use case for metaclasses in a package called classutilities. It checks if all class variables are in upper case format (it is convenient to have unified logic for configuration classes), and checks if there are no instance level methods in class. Another interesting example for metaclases was deactivation of unittests based on complex conditions (checking values of multiple environmental variables).
0
1,011,070
false
0
1
What are metaclasses in Python?
68,354,618
4
24
0
16
6,790
1
1
0
What are metaclasses? What are they used for?
0
python,oop,metaclass,python-class,python-datamodel
2008-09-19T06:10:00.000
0
100,003
In object-oriented programming, a metaclass is a class whose instances are classes. Just as an ordinary class defines the behavior of certain objects, a metaclass defines the behavior of certain class and their instances The term metaclass simply means something used to create classes. In other words, it is the class of a class. The metaclass is used to create the class so like the object being an instance of a class, a class is an instance of a metaclass. In python classes are also considered objects.
0
1,011,070
false
0
1
What are metaclasses in Python?
56,945,952
4
24
0
14
6,790
1
1
0
What are metaclasses? What are they used for?
0
python,oop,metaclass,python-class,python-datamodel
2008-09-19T06:10:00.000
0
100,003
A class, in Python, is an object, and just like any other object, it is an instance of "something". This "something" is what is termed as a Metaclass. This metaclass is a special type of class that creates other class's objects. Hence, metaclass is responsible for making new classes. This allows the programmer to customize the way classes are generated. To create a metaclass, overriding of new() and init() methods is usually done. new() can be overridden to change the way objects are created, while init() can be overridden to change the way of initializing the object. Metaclass can be created by a number of ways. One of the ways is to use type() function. type() function, when called with 3 parameters, creates a metaclass. The parameters are :- Class Name Tuple having base classes inherited by class A dictionary having all class methods and class variables Another way of creating a metaclass comprises of 'metaclass' keyword. Define the metaclass as a simple class. In the parameters of inherited class, pass metaclass=metaclass_name Metaclass can be specifically used in the following situations :- when a particular effect has to be applied to all the subclasses Automatic change of class (on creation) is required By API developers
0
1,011,070
false
0
1
What are metaclasses in Python?
59,818,321
3
6
0
7
23
0
1
0
A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop. I've read about unit testing in Dive Into Python, and it's pretty clear what I want to do when testing an app that converts decimal to Roman Numerals (the example in DintoP). The testing is nicely self-contained. You don't need to verify that the program PRINTS the right thing, you just need to verify that the functions are returning the right output to a given input. In my case, however, we need to test that the program is modifying its environment correctly. Here's what I've come up with: 1) Create the "original" file in a standard location, perhaps /tmp. 2) Run the function that modifies the file, passing it the path to the file in /tmp. 3) Verify that the file in /tmp was changed correctly; pass/fail unit test accordingly. This seems kludgy to me. (Gets even kludgier if you want to verify that backup copies of the file are created properly, etc.) Has anyone come up with a better way?
0
python,linux,unit-testing
2008-09-20T01:56:00.000
0
106,766
You have two levels of testing. Filtering and Modifying content. These are "low-level" operations that don't really require physical file I/O. These are the tests, decision-making, alternatives, etc. The "Logic" of the application. File system operations. Create, copy, rename, delete, backup. Sorry, but those are proper file system operations that -- well -- require a proper file system for testing. For this kind of testing, we often use a "Mock" object. You can design a "FileSystemOperations" class that embodies the various file system operations. You test this to be sure it does basic read, write, copy, rename, etc. There's no real logic in this. Just methods that invoke file system operations. You can then create a MockFileSystem which dummies out the various operations. You can use this Mock object to test your other classes. In some cases, all of your file system operations are in the os module. If that's the case, you can create a MockOS module with mock version of the operations you actually use. Put your MockOS module on the PYTHONPATH and you can conceal the real OS module. For production operations you use your well-tested "Logic" classes plus your FileSystemOperations class (or the real OS module.)
0
4,799
false
0
1
Unit Testing File Modifications
106,780
3
6
0
2
23
0
0.066568
0
A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop. I've read about unit testing in Dive Into Python, and it's pretty clear what I want to do when testing an app that converts decimal to Roman Numerals (the example in DintoP). The testing is nicely self-contained. You don't need to verify that the program PRINTS the right thing, you just need to verify that the functions are returning the right output to a given input. In my case, however, we need to test that the program is modifying its environment correctly. Here's what I've come up with: 1) Create the "original" file in a standard location, perhaps /tmp. 2) Run the function that modifies the file, passing it the path to the file in /tmp. 3) Verify that the file in /tmp was changed correctly; pass/fail unit test accordingly. This seems kludgy to me. (Gets even kludgier if you want to verify that backup copies of the file are created properly, etc.) Has anyone come up with a better way?
0
python,linux,unit-testing
2008-09-20T01:56:00.000
0
106,766
When I touch files in my code, I tend to prefer to mock the actual reading and writing of the file... so then I can give my classes exact contents I want in the test, and then assert that the test is writing back the contents I expect. I've done this in Java, and I imagine it is quite simple in Python... but it may require designing your classes/functions in such a way that it is EASY to mock the use of an actual file. For this, you can try passing in streams and then just pass in a simple string input/output stream which won't write to a file, or have a function that does the actual "write this string to a file" or "read this string from a file", and then replace that function in your tests.
0
4,799
false
0
1
Unit Testing File Modifications
106,772
3
6
0
1
23
0
0.033321
0
A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop. I've read about unit testing in Dive Into Python, and it's pretty clear what I want to do when testing an app that converts decimal to Roman Numerals (the example in DintoP). The testing is nicely self-contained. You don't need to verify that the program PRINTS the right thing, you just need to verify that the functions are returning the right output to a given input. In my case, however, we need to test that the program is modifying its environment correctly. Here's what I've come up with: 1) Create the "original" file in a standard location, perhaps /tmp. 2) Run the function that modifies the file, passing it the path to the file in /tmp. 3) Verify that the file in /tmp was changed correctly; pass/fail unit test accordingly. This seems kludgy to me. (Gets even kludgier if you want to verify that backup copies of the file are created properly, etc.) Has anyone come up with a better way?
0
python,linux,unit-testing
2008-09-20T01:56:00.000
0
106,766
You might want to setup the test so that it runs inside a chroot jail, so you have all the environment the test needs, even if paths and file locations are hardcoded in the code [not really a good practice, but sometimes one gets the file locations from other places...] and then check the results via the exit code.
0
4,799
false
0
1
Unit Testing File Modifications
106,781
2
11
0
1
117
0
0.01818
1
What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download the content. Does anyone know of an easy way of doing this?
0
python,python-2.7,http,http-headers,content-type
2008-09-20T06:38:00.000
0
107,405
As an aside, when using the httplib (at least on 2.5.2), trying to read the response of a HEAD request will block (on readline) and subsequently fail. If you do not issue read on the response, you are unable to send another request on the connection, you will need to open a new one. Or accept a long delay between requests.
0
72,799
false
0
1
How do you send a HEAD HTTP request in Python 2?
779,985
2
11
0
1
117
0
0.01818
1
What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download the content. Does anyone know of an easy way of doing this?
0
python,python-2.7,http,http-headers,content-type
2008-09-20T06:38:00.000
0
107,405
I have found that httplib is slightly faster than urllib2. I timed two programs - one using httplib and the other using urllib2 - sending HEAD requests to 10,000 URL's. The httplib one was faster by several minutes. httplib's total stats were: real 6m21.334s user 0m2.124s sys 0m16.372s And urllib2's total stats were: real 9m1.380s user 0m16.666s sys 0m28.565s Does anybody else have input on this?
0
72,799
false
0
1
How do you send a HEAD HTTP request in Python 2?
2,630,687
4
8
0
11
26
1
1
0
Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?
0
python,perl,raku
2008-09-23T23:50:00.000
0
124,604
In my opinion, Python's syntax is much cleaner, simpler, and consistent. You can define nested data structures the same everywhere, whether you plan to pass them to a function (or return them from one) or use them directly. I like Perl a lot, but as soon as I learned enough Python to "get" it, I never turned back. In my experience, random snippets of Python tend to be more readable than random snippets of Perl. The difference really comes down to the culture around each language, where Perl users often appreciate cleverness while Python users more often prefer clarity. That's not to say you can't have clear Perl or devious Python, but those are much less common. Both are fine languages and solve many of the same problems. I personally lean toward Python, if for no other reason in that it seems to be gaining momentum while Perl seems to be losing users to Python and Ruby. Note the abundance of weasel words in the above. Honestly, it's really going to come down to personal preference.
0
3,114
false
0
1
I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python?
124,804
4
8
0
25
26
1
1
0
Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?
0
python,perl,raku
2008-09-23T23:50:00.000
0
124,604
There is no advantage to be gained by switching from Perl to Python. There is also no advantage to be gained by switching from Python to Perl. They are both equally capable. Choose your tools based on what you know and the problem you are trying to solve rather than on some sort of notion that one is somehow inherently better than the other. The only real advantage is if you are switching from a language you don't know to a language you do know, in which case your productivity will likely go up.
0
3,114
false
0
1
I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python?
124,797
4
8
0
4
26
1
0.099668
0
Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?
0
python,perl,raku
2008-09-23T23:50:00.000
0
124,604
You have not said why you want to move away from Perl*. If my crystal ball is functioning today then it is because you do not fully know the language and so it frustrates you. Stick with Perl and study the language well. If you do then one day you will be a guru and know why your question is irrelevant. Enlightment comes to those to seek it. You called it "Perl5" but there is no such language. :P
0
3,114
false
0
1
I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python?
127,627
4
8
0
4
26
1
0.099668
0
Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?
0
python,perl,raku
2008-09-23T23:50:00.000
0
124,604
IMO python's regexing, esp. when you try to represent something like perl's /e operator as in s/whatever/somethingelse/e, becomes quite slow. So in doubt, you may need to stay with Perl5 :-)
0
3,114
false
0
1
I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python?
4,294,670
1
2
0
2
2
0
1.2
0
Almost every Python web framework has a simple server that runs a wsgi application and automatically reloads the imported modules every time the source gets changed. I know I can look at the code and see how it's done, but that may take some time and I'm asking just out of curiosity. Does anyone have any idea how this is implemented?
0
python
2008-09-24T12:21:00.000
0
126,787
As the author of one of the reloader mechanisms (the one in werkzeug) I can tell you that it doesn't work. What all the reloaders do is forking one time and restarting the child process if a monitor thread notices that one module changed on the file system. Inline reload()ing doesn't work because references to the reloaded module are not updated.
0
304
true
1
1
Checking for code changes in all imported python modules
126,843
1
4
0
0
3
0
0
0
Are there any good packages or methods for doing extensive CRUD (create-retrieve-update-delete) interfaces in the Turbogears framework. The FastDataGrid widget is too much of a black box to be useful and CRUDTemplate looks like more trouble than rolling my own. Ideas? Suggestions?
0
python,crud,turbogears
2008-09-24T17:53:00.000
0
128,689
After doing some more digging and hacking it turns out to not be terribly hard to drop the Cakewalk interface into an application. It's not pretty without a lot of work, but it works right away.
0
1,363
false
1
1
Doing CRUD in Turbogears
158,626
4
8
0
2
19
0
0.049958
0
I am planning on porting a PHP application over to Python. The application is mostly about data collection and processing. The main application runs as a stand alone command line application. There is a web interface to the application which is basically a very light weight reporting interface. I did not use a framework in the PHP version, but being new to Python, I am wondering if it would be advantageous to use something like Django or at the very least Genshi. The caveat is I do not want my application distribution to be overwhelmed by the framework parts I would need to distribute with the application. Is using only the cgi import in Python the best way to go in this circumstance? I would tend to think a framework is too much overhead, but perhaps I'm not thinking in a very "python" way about them. What suggestions do you have in this scenario?
0
python,frameworks
2008-09-25T20:59:00.000
0
136,069
Go for a framework. Basic stuffs like session handling are a nightmare if you don't use a one because Python is not web specialized like PHP. If you think django is too much, you can try a lighter one like the very small but still handy web.py.
0
7,200
false
1
1
Python web development - with or without a framework
138,888
4
8
0
0
19
0
0
0
I am planning on porting a PHP application over to Python. The application is mostly about data collection and processing. The main application runs as a stand alone command line application. There is a web interface to the application which is basically a very light weight reporting interface. I did not use a framework in the PHP version, but being new to Python, I am wondering if it would be advantageous to use something like Django or at the very least Genshi. The caveat is I do not want my application distribution to be overwhelmed by the framework parts I would need to distribute with the application. Is using only the cgi import in Python the best way to go in this circumstance? I would tend to think a framework is too much overhead, but perhaps I'm not thinking in a very "python" way about them. What suggestions do you have in this scenario?
0
python,frameworks
2008-09-25T20:59:00.000
0
136,069
It depends on the way you are going to distribute your application. If it will only be used internally, go for django. It's a joy to work with it. However, django really falls short at the distribution-task; django-applications are a pain to set up.
0
7,200
false
1
1
Python web development - with or without a framework
136,166
4
8
0
2
19
0
0.049958
0
I am planning on porting a PHP application over to Python. The application is mostly about data collection and processing. The main application runs as a stand alone command line application. There is a web interface to the application which is basically a very light weight reporting interface. I did not use a framework in the PHP version, but being new to Python, I am wondering if it would be advantageous to use something like Django or at the very least Genshi. The caveat is I do not want my application distribution to be overwhelmed by the framework parts I would need to distribute with the application. Is using only the cgi import in Python the best way to go in this circumstance? I would tend to think a framework is too much overhead, but perhaps I'm not thinking in a very "python" way about them. What suggestions do you have in this scenario?
0
python,frameworks
2008-09-25T20:59:00.000
0
136,069
Django makes it possible to whip out a website rapidly, that's for sure. You don't need to be a Python master to use it, and since it's very pythonic in it's design, and there is not really any "magic" going on, it will help you learn Python along the way. Start with the examples, check out some django screencasts from TwiD and you'll be on your way. Start slow, tweaking the admin, and playing with it via shell is the way to start. Once you have a handle on the ORM and get how things work, start building the real stuff! The framework isn't going to cause any performance problems, like S. Lott said, it's code you don't have to maintain, and that's the best kind.
0
7,200
false
1
1
Python web development - with or without a framework
136,683
4
8
0
4
19
0
0.099668
0
I am planning on porting a PHP application over to Python. The application is mostly about data collection and processing. The main application runs as a stand alone command line application. There is a web interface to the application which is basically a very light weight reporting interface. I did not use a framework in the PHP version, but being new to Python, I am wondering if it would be advantageous to use something like Django or at the very least Genshi. The caveat is I do not want my application distribution to be overwhelmed by the framework parts I would need to distribute with the application. Is using only the cgi import in Python the best way to go in this circumstance? I would tend to think a framework is too much overhead, but perhaps I'm not thinking in a very "python" way about them. What suggestions do you have in this scenario?
0
python,frameworks
2008-09-25T20:59:00.000
0
136,069
Depends on the size of the project. If you had only a few previous php-scripts which called your stand alone application then I'd probably go for a cgi-app. If you have use for databases, url rewriting, templating, user management and such, then using a framework is a good idea. And of course, before you port it, consider if it's worth it just to switch the language or if there are specific Python features you need. Good luck!
0
7,200
false
1
1
Python web development - with or without a framework
136,152
2
3
0
0
9
1
0
0
I write tons of python scripts, and I find myself reusing lots code that I've written for other projects. My solution has been to make sure the code is separated into logical modules/packages (this one's a given). I then make them setuptools-aware and publish them on PyPI. This allows my other scripts to always have the most up-to-date code, I get a warm fuzzy feeling because I'm not repeating myself, and my development, in general, is made less complicated. I also feel good that there MAY be someone out there that finds my code handy for something they're working on, but it's mainly for selfish reasons :) To all the pythonistas, how do you handle this? Do you use PyPI or setuptools (easy_install)? or something else?
0
python,code-reuse
2008-09-25T21:18:00.000
0
136,207
I store it all offline in a logical directory structure, with commonly used modules grouped as utilities. This means it's easier to control which versions I publish, and manage. I also automate the build process to interpret the logical directory structure.
0
344
false
0
1
How do you manage your custom modules?
48,569,865
2
3
0
1
9
1
0.066568
0
I write tons of python scripts, and I find myself reusing lots code that I've written for other projects. My solution has been to make sure the code is separated into logical modules/packages (this one's a given). I then make them setuptools-aware and publish them on PyPI. This allows my other scripts to always have the most up-to-date code, I get a warm fuzzy feeling because I'm not repeating myself, and my development, in general, is made less complicated. I also feel good that there MAY be someone out there that finds my code handy for something they're working on, but it's mainly for selfish reasons :) To all the pythonistas, how do you handle this? Do you use PyPI or setuptools (easy_install)? or something else?
0
python,code-reuse
2008-09-25T21:18:00.000
0
136,207
What kind of modules are we talking about here? If you're planning on distributing your projects to other python developers, setuptools is great. But it's usually not a very good way to distribute apps to end users. Your best bet in the latter case is to tailor your packaging to the platforms you're distributing it for. Sure, it's a pain, but it makes life for end users far easier. For example, in my Debian system, I usually don't use easy_install because it is a little bit more difficult to get eggs to work well with the package manager. In OS X and windows, you'd probably want to package everything up using py2app and py2exe respectively. This makes life for the end user better. After all, they shouldn't know or care what language your scripts are written in. They just need them to install.
0
344
false
0
1
How do you manage your custom modules?
137,291
1
11
0
0
36
0
0
0
Is it possible to make it appear to a system that a key was pressed, for example I need to make A key be pressed thousands of times, and it is much to time consuming to do it manually, I would like to write something to do it for me, and the only thing I know well enough is Python. A better way to put it, I need to emulate a key press, I.E. not capture a key press. More Info (as requested): I am running windows XP and need to send the keys to another application.
0
python,keypress
2008-09-25T22:58:00.000
0
136,734
You can use pyautogui module which can be used for automatically moving the mouse and for pressing a key. It can also be used for some GUI(very basic). You can do the following :- import pyautogui pyautogui.press('A') # presses the 'A' key If you want to do it 1000 times, then you can use a while loop Hope this is helpful :)
0
186,710
false
0
1
Key Presses in Python
66,835,510
1
2
0
0
2
0
0
1
I've added cookie support to SOAPpy by overriding HTTPTransport. I need functionality beyond that of SOAPpy, so I was planning on moving to ZSI, but I can't figure out how to put the Cookies on the ZSI posts made to the service. Without these cookies, the server will think it is an unauthorized request and it will fail. How can I add cookies from a Python CookieJar to ZSI requests?
0
python,web-services,cookies,soappy,zsi
2008-09-26T12:45:00.000
0
139,212
Additionally, the Binding class also allows any header to be added. So I figured out that I can just add a "Cookie" header for each cookie I need to add. This worked well for the code generated by wsdl2py, just adding the cookies right after the binding is formed in the SOAP client class. Adding a parameter to the generated class to take in the cookies as a dictionary is easy and then they can easily be iterated through and added.
0
526
false
0
1
Adding Cookie to ZSI Posts
148,379
3
4
0
1
8
1
0.049958
0
I understand that IronPython is an implementation of Python on the .NET platform just like IronRuby is an implementation of Ruby and F# is more or less OCaml. What I can't seem to grasp is whether these languages perform closer to their "ancestors" or closer to something like C# in terms of speed. For example, is IronPython somehow "compiled" down to the same bytecode used by C# and, therefore, will run just as fast?
0
.net,performance,ironpython
2008-09-28T04:06:00.000
0
145,191
Currently IronRuby is pretty slow in most regards. It's definitely slower than MRI (Matz' Ruby Implementation) overall, though in some places they're faster. IronRuby does have the potential to be much faster, though I doubt they'll ever get near C# in terms of speed. In most cases it just doesn't matter. A database call will probably make up 90% of the overall duration of a web request, for example. I suspect the team will go for language-completeness rather than performance first. This will allow you to run IronRuby & run most ruby programs when 1.0 ships, then they can improve perf as they go. I suspect IronPython has a similar story.
0
1,684
false
0
1
Dynamic .NET language performance?
145,200
3
4
0
9
8
1
1.2
0
I understand that IronPython is an implementation of Python on the .NET platform just like IronRuby is an implementation of Ruby and F# is more or less OCaml. What I can't seem to grasp is whether these languages perform closer to their "ancestors" or closer to something like C# in terms of speed. For example, is IronPython somehow "compiled" down to the same bytecode used by C# and, therefore, will run just as fast?
0
.net,performance,ironpython
2008-09-28T04:06:00.000
0
145,191
IronPython and IronRuby are built on top of the DLR -- dynamic language runtime -- and are compiled to CIL (the bytecode used by .NET) on the fly. They're slower than C# but faaaaaaar faster than their non-.NET counterparts. There aren't any decent benchmarks out there, to my knowledge, but you'll see the difference.
0
1,684
true
0
1
Dynamic .NET language performance?
145,195
3
4
0
7
8
1
1
0
I understand that IronPython is an implementation of Python on the .NET platform just like IronRuby is an implementation of Ruby and F# is more or less OCaml. What I can't seem to grasp is whether these languages perform closer to their "ancestors" or closer to something like C# in terms of speed. For example, is IronPython somehow "compiled" down to the same bytecode used by C# and, therefore, will run just as fast?
0
.net,performance,ironpython
2008-09-28T04:06:00.000
0
145,191
IronPython is actually the fastest Python implementation out there. For some definition of "fastest", at least: the startup overhead of the CLR, for example, is huge compared to CPython. Also, the optimizing compiler IronPython has, really only makes sense, when code is executed multiple times. IronRuby has the potential to be as fast IronPython, since many of the interesting features that make IronPython fast, have been extracted into the Dynamic Language Runtime, on which both IronPython and IronRuby (and Managed JavaScript, Dynamic VB, IronScheme, VistaSmalltalk and others) are built. In general, the speed of a language implementation is pretty much independent of the actual language features, and more dependent on the number of engineering man-years that go into it. IOW: dynamic vs. static doesn't matter, money does. E.g., Common Lisp is a language that is even more dynamic than Ruby or Python, and yet there are Common Lisp compilers out there that can even give C a run for its money. Good Smalltalk implementations run as fast as Java (which is no surprise, since both major JVMs, Sun HotSpot and IBM J9, are actually just slightly modified Smalltalk VMs) or C++. In just the past 6 months, the major JavaScript implementations (Mozilla TraceMonkey, Apple SquirrelFish Extreme and the new kid on the block, Google V8) have made ginormous performance improvements, 10x and more, to bring JavaScript head-to-head with un-optimized C.
0
1,684
false
0
1
Dynamic .NET language performance?
145,300
4
7
0
10
11
0
1.2
0
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
0
python,eclipse,pylons,pydev,pyramid
2008-09-29T05:41:00.000
1
147,650
Create a new launch configuration (Python Run) Main tab Use paster-script.py as main module (you can find it in the Scripts sub-directory in your python installation directory) Don't forget to add the root folder of your application in the PYTHONPATH zone Arguments Set the base directory to the root folder also. As Program Arguments use "serve development.ini" (or whatever you use to debug your app") Common Tab Check allocate console and launch in background
0
5,139
true
1
1
Debug Pylons application through Eclipse
147,768
4
7
0
2
11
0
0.057081
0
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
0
python,eclipse,pylons,pydev,pyramid
2008-09-29T05:41:00.000
1
147,650
I was able to get --reload working by changing the 'Working directory' in the arguments tab to not use default (i.e. select 'Other'->File System->'Root of your Pylons' app where development.ini is stored.
0
5,139
false
1
1
Debug Pylons application through Eclipse
3,817,880
4
7
0
1
11
0
0.028564
0
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
0
python,eclipse,pylons,pydev,pyramid
2008-09-29T05:41:00.000
1
147,650
On linux that will probably be /usr/bin/paster or /usr/local/bin/paster for paste script, and for arguments i have: serve ${workspace_loc}${project_path}/development.ini
0
5,139
false
1
1
Debug Pylons application through Eclipse
2,958,194
4
7
0
2
11
0
0.057081
0
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
0
python,eclipse,pylons,pydev,pyramid
2008-09-29T05:41:00.000
1
147,650
yanjost has it right, just wanted to add that you need to make sure you do not use the --reload option, this will prevent the debugger from properly attaching itself and cause your breakpoints not to work. Just a little thing I ran in to.
0
5,139
false
1
1
Debug Pylons application through Eclipse
1,306,122
2
14
0
70
1,624
1
1
0
How do I check if an object is of a given type, or if it inherits from a given type? How do I check if the object o is of type str?
0
python,types
2008-09-30T11:00:00.000
0
152,580
isinstance(o, str) will return True if o is an str or is of a type that inherits from str. type(o) is str will return True if and only if o is a str. It will return False if o is of a type that inherits from str.
0
1,190,669
false
0
1
What's the canonical way to check for type in Python?
152,592
2
14
0
7
1,624
1
1
0
How do I check if an object is of a given type, or if it inherits from a given type? How do I check if the object o is of type str?
0
python,types
2008-09-30T11:00:00.000
0
152,580
I think the cool thing about using a dynamic language like Python is you really shouldn't have to check something like that. I would just call the required methods on your object and catch an AttributeError. Later on this will allow you to call your methods with other (seemingly unrelated) objects to accomplish different tasks, such as mocking an object for testing. I've used this a lot when getting data off the web with urllib2.urlopen() which returns a file like object. This can in turn can be passed to almost any method that reads from a file, because it implements the same read() method as a real file. But I'm sure there is a time and place for using isinstance(), otherwise it probably wouldn't be there :)
0
1,190,669
false
0
1
What's the canonical way to check for type in Python?
153,032
2
9
0
7
85
0
1
0
I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac. I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script. Any better ideas? Thanks in advance!
0
php,python
2008-10-03T13:44:00.000
1
166,944
I do this kind of thing all the time for quick-and-dirty scripts. It's quite common to have a CGI or PHP script that just uses system/popen to call some external program. Just be extra careful if your web server is open to the internet at large. Be sure to sanitize your GET/POST input in this case so as to not allow attackers to run arbitrary commands on your machine.
0
180,160
false
0
1
Calling Python in PHP
167,205
2
9
0
0
85
0
0
0
I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac. I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script. Any better ideas? Thanks in advance!
0
php,python
2008-10-03T13:44:00.000
1
166,944
Note that if you are using a virtual environment (as in shared hosting) then you must adjust your path to python, e.g: /home/user/mypython/bin/python ./cgi-bin/test.py
0
180,160
false
0
1
Calling Python in PHP
45,592,623
4
6
0
0
24
1
0
0
On a question of just performance, how does Python 3 compare to Python 2.x?
0
python,performance,python-3.x,python-2.x
2008-10-04T14:28:00.000
0
170,426
I don't if it faster now, but I have to expect that it eventually will be because that is where new performance work will happen and not all of that will be backported.
0
10,338
false
0
1
Performance: Python 3.x vs Python 2.x
170,568
4
6
0
3
24
1
0.099668
0
On a question of just performance, how does Python 3 compare to Python 2.x?
0
python,performance,python-3.x,python-2.x
2008-10-04T14:28:00.000
0
170,426
Unless there are plans for a new VM of some kind (and I haven't heard of any such plans), there is all the reason to believe that in the long run the performance of Py3K will, at least asymptotically, equal that of 2.5 It may take a few months, but will eventually happen, as nothing in the new features of Py3k is inherently less performant. To conclude, I don't think there's place to worry about it. Neither to hope for a major improvement of some kind.
0
10,338
false
0
1
Performance: Python 3.x vs Python 2.x
170,797
4
6
0
4
24
1
0.132549
0
On a question of just performance, how does Python 3 compare to Python 2.x?
0
python,performance,python-3.x,python-2.x
2008-10-04T14:28:00.000
0
170,426
I think ultimately it is too early to make that kind of comparison just yet. Wait until it is out of beta before benchmarking it. The interpreter will probably be polished enormously before the release but overall i think for most uses the performance would be comparable and if you are running a really speed conscious app is python really the right language to be using?
0
10,338
false
0
1
Performance: Python 3.x vs Python 2.x
170,805
4
6
0
7
24
1
1
0
On a question of just performance, how does Python 3 compare to Python 2.x?
0
python,performance,python-3.x,python-2.x
2008-10-04T14:28:00.000
0
170,426
I'd say any difference will be below trivial. For example, looping over a list will be the exact same. The idea behind Python 3 is to clean up the language syntax itself - remove ambigious stuff like except Exception1, Exception2, cleanup the standard modules (no urllib, urllib2, httplib etc). There really isn't much you can do to improve it's performance, although I imagine stuff like the garbage collection and memory management code will have had some tweaks, but it's not going to be a "wow, my database statistic generation code completes in half the time!" improvement - that's something you get by improving the code, rather than the language! Really, performance of the language is irrelevant - all interpreted languages basically function at the same speed. Why I find Python "faster" is all the built-in moudles, and the nice-to-write syntax - something that has been improved in Python3, so I guess in those terms, yes, python3's performance is better then python2.x..
0
10,338
false
0
1
Performance: Python 3.x vs Python 2.x
170,521
3
7
0
5
9
0
0.141893
0
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
0
python,unix,shell
2008-10-05T00:42:00.000
1
171,267
Well, there's emacs, which is arguably a shell written in lisp :) Seriously though, are you looking for a reimplementation of an existing shell design in a different language such as Python? Or are you looking for a new implementation of a shell language that looks similar to your language of choice?
0
3,377
false
0
1
UNIX shell written in a reasonable language?
171,271
3
7
0
6
9
0
1
0
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
0
python,unix,shell
2008-10-05T00:42:00.000
1
171,267
From all appearances, Python IS a shell. It runs with #! and it can run interactively. Between the os and shutil packages you have all of the features of standard Unix shells. Since you can do anything in Python with simple, powerful scripts, you don't really need to spend any time messing with the other shells.
0
3,377
false
0
1
UNIX shell written in a reasonable language?
171,304
3
7
0
3
9
0
0.085505
0
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
0
python,unix,shell
2008-10-05T00:42:00.000
1
171,267
Tclsh is pretty nice (assuming you like Tcl, of course).
0
3,377
false
0
1
UNIX shell written in a reasonable language?
171,290
7
19
0
3
46
1
0.031568
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
Just a note on using psyco: In some cases it can actually produce slower run-times. Especially when trying to use psyco with code that was written in C. I can't remember the the article I read this, but the map() and reduce() functions were mentioned specifically. Luckily you can tell psyco not to handle specified functions and/or modules.
0
22,486
false
0
1
Speeding Up Python
172,782
7
19
0
4
46
1
0.04208
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
Run your app through the Python profiler. Find a serious bottleneck. Rewrite that bottleneck in C. Repeat.
0
22,486
false
0
1
Speeding Up Python
172,737
7
19
0
4
46
1
0.04208
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
People have given some good advice, but you have to be aware that when high performance is needed, the python model is: punt to c. Efforts like psyco may in the future help a bit, but python just isn't a fast language, and it isn't designed to be. Very few languages have the ability to do the dynamic stuff really well and still generate very fast code; at least for the forseeable future (and some of the design works against fast compilation) that will be the case. So, if you really find yourself in this bind, your best bet will be to isolate the parts of your system that are unacceptable slow in (good) python, and design around the idea that you'll rewrite those bits in C. Sorry. Good design can help make this less painful. Prototype it in python first though, then you've easily got a sanity check on your c, as well. This works well enough for things like numpy, after all. I can't emphasize enough how much good design will help you though. If you just iteratively poke at your python bits and replace the slowest ones with C, you may end up with a big mess. Think about exactly where the C bits are needed, and how they can be minimized and encapsulated sensibly.
0
22,486
false
0
1
Speeding Up Python
172,766
7
19
0
28
46
1
1
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
Rather than just punting to C, I'd suggest: Make your code count. Do more with fewer executions of lines: Change the algorithm to a faster one. It doesn't need to be fancy to be faster in many cases. Use python primitives that happens to be written in C. Some things will force an interpreter dispatch where some wont. The latter is preferable Beware of code that first constructs a big data structure followed by its consumation. Think the difference between range and xrange. In general it is often worth thinking about memory usage of the program. Using generators can sometimes bring O(n) memory use down to O(1). Python is generally non-optimizing. Hoist invariant code out of loops, eliminate common subexpressions where possible in tight loops. If something is expensive, then precompute or memoize it. Regular expressions can be compiled for instance. Need to crunch numbers? You might want to check numpy out. Many python programs are slow because they are bound by disk I/O or database access. Make sure you have something worthwhile to do while you wait on the data to arrive rather than just blocking. A weapon could be something like the Twisted framework. Note that many crucial data-processing libraries have C-versions, be it XML, JSON or whatnot. They are often considerably faster than the Python interpreter. If all of the above fails for profiled and measured code, then begin thinking about the C-rewrite path.
0
22,486
false
0
1
Speeding Up Python
173,055
7
19
0
1
46
1
0.010526
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
If using psyco, I'd recommend psyco.profile() instead of psyco.full(). For a larger project it will be smarter about the functions that got optimized and use a ton less memory. I would also recommend looking at iterators and generators. If your application is using large data sets this will save you many copies of containers.
0
22,486
false
0
1
Speeding Up Python
175,283
7
19
0
9
46
1
1
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
Cython and pyrex can be used to generate c code using a python-like syntax. Psyco is also fantastic for appropriate projects (sometimes you'll not notice much speed boost, sometimes it'll be as much as 50x as fast). I still reckon the best way is to profile your code (cProfile, etc.) and then just code the bottlenecks as c functions for python.
0
22,486
false
0
1
Speeding Up Python
172,740
7
19
0
3
46
1
0.031568
0
This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from scratch in python, what are some good ways to greatly improve performance? For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization. What would you do to speed it up in this case short of rewriting it in something like C?
0
python,optimization,performance
2008-10-05T21:46:00.000
0
172,720
This is the procedure that I try to follow: import psyco; psyco.full() If it's not fast enough, run the code through a profiler, see where the bottlenecks are. (DISABLE psyco for this step!) Try to do things such as other people have mentioned to get the code at those bottlenecks as fast as possible. Stuff like [str(x) for x in l] or [x.strip() for x in l] is much, much slower than map(str, x) or map(str.strip, x). After this, if I still need more speed, it's actually really easy to get PyRex up and running. I first copy a section of python code, put it directly in the pyrex code, and see what happens. Then I twiddle with it until it gets faster and faster.
0
22,486
false
0
1
Speeding Up Python
172,991
9
13
0
7
2
0
1
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
All of them will get the job done. Use the one that you and your team are most familiar with This will have a far greater impact on the delivery times and stability of your app than any of the other variables.
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
188,971
9
13
0
9
2
0
1
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
Sorry, but your question is wrong. People are probably going to vote me down for this one but I want to say it anyway: I wouldn't expect to get an objective answer! Why? That's simple: All Ruby advocates will tell to use Ruby. All Python advocates will tell to use Python. All PHP advocates will tell to use PHP. Insert additional languages here. Got the idea? I recommend you to try each of the languages you mentioned for yourself. At least a few days each. Afterwards you should have a much better foundation to make your final decision. That said, I would choose Ruby (because I am a Ruby advocate).
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
184,278
9
13
0
1
2
0
0.015383
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
Don't get stuck in the mindset of server-side page layout. Consider technologies like SproutCore, GWT or ExtJS which put the layouting code fully on the client, making the server responsible only for data marshalling and processing (and easily replaced). And you really, really need to know which server platform you want. Don't pick one because it's the flavor of the month, pick one because you're comfortable with it. Flavors don't last, a solidly built codebase will.
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
189,236
9
13
0
5
2
0
1.2
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
it depends. php - symfony is a great framework. downsides: php, wordy and directory heavy. propel gets annoying to use. upsides: php is everywhere and labor is cheap. well done framework, and good support. lots of plugins to make your life easier python - django is also a great framework. downsides: python programmers can be harder to find, django even harder. changing your db schema can be somewhat difficult since there are no official migrations. doesn't quite do mvc like you'd expect. upsides: does everything you need and has the great python std library and community behind it. ruby - i've never used merb, so I'll address rails. upsides: there is a plugin, gem, or recipe for almost anything you could want to do. easy to use. downsides: those plugins, gems, and recipes sometimes fail to work in mysterious ways. monkey patching is often evil. the community is.. vocal. opinionated software, and sometimes those opinions are wrong (lack of foreign keys). rails itself seems like a tower of cards waiting to explode and take hours of your life away. with all of that said, I'm a freelance php/symfony and ruby/rails developer. I've worked on several projects in both languages and frameworks. My latest project is in Rails solely because of ActiveMerchant. I've been looking for a reason to develop a django app for a while. If there were an ActiveMerchant like library for django, I probably would have used it.
0
959
true
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
184,376
9
13
0
0
2
0
0
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
My experience with various new technologies over the last ten years leads me to recommend that you make stability of the platform a serious criterion. It's all well and good developing with the latest and greatest framework, but when you find it's moved forward a point version and suddenly the way you have done everything is deprecated, that can turn out to result in extra unnecessary work. This was particularly my experience working with rails a little ahead of version 1. For that reason alone I would avoid any platform that wasn't at least at 1.0 when you start work on it. Ruby is great to work with and will keep your developer productivity high, but if Django is the more stable platform I would favour that for sure.
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
186,765
9
13
0
1
2
0
0.015383
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
I have to preface this with my agreeing with Orion Edwards, choose the one your team is most familiar with. However, I also have to note the curious lack of ASP.NET languages in your list. Not to provoke the great zealot army, but where's the beef? .NET is a stable, rapid development platform and the labor pool is growing daily. VB.NET and C# are transportable skill sets, and that can mean a lot when you're building a team of developers to work on a diverse set of tasks. .NET also allows you to separate your presentation layer from your backend code, like other languages, but also allows you to expose that backend code as web service for things like your iPhone and Facebook applications. Take every suggestion with a grain of salt, and pick what suits the application best. Do your research, and design for function and not the zealots. Disclaimer: Once a PHP, ColdFusion and Perl developer. Flex zealot, and Adobe lover. Now writing enterprise .NET applications. ;) Don't forget Mono, which will let you run .NET under *nix. Not that I'm saying it will be perfect, just playing devil's advocate.
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
189,012
9
13
0
1
2
0
0.015383
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
Having built apps in Django, I can attest to its utility. If only all frameworks were as elegant (yes Spring, I'm looking at you). However in terms of betting the farm on Django, one thing you need to factor in is that Python 3 will be released shortly. Python 3 is not backwards compatible and there's a risk that it will fork the language and end up slowing momentum for all Python projects while they deal with the fallout. To be fair, Ruby 2.0 is due soon too, but I don't think it will be as disruptive.
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
208,938
9
13
0
4
2
0
0.061461
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
I would go with Django, if you are comfortable with a Python solution. It's at version 1.0 now, and is maturing nicely, with a large user base and many contributors. Integrating jQuery is no problem, and I've done it without any issues. The only thing is, as far as I can tell, Ruby is much more popular for web development nowadays, so it's easier to find Ruby developers. I get this impression from browsing recent job advertisements - there aren't that many for Python or Django. I don't know much about Merb, so I can't give a fair comparison. I've done enough PHP to not recommend starting a new project with it.
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
184,107
9
13
0
2
2
0
0.03076
0
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
0
python,ruby-on-rails,django,merb
2008-10-08T18:07:00.000
1
184,049
Based in your reasons, I would go with Ruby. I see that you want some administration tools (scp, ftp client) and Ruby has it (net/sftp and net/ftp libraries). Also, there are great gems like God for monitoring your system, Vlad the Deployer for deploying, etc. And a lot of alternatives in Merb's field, just use whatever you find it's better for your needs (Thin, Mongrel, ebb, etc).
0
959
false
1
1
Framework/Language for new web 2.0 sites (2008 and 2009)
184,157
2
6
0
2
15
0
0.066568
0
I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test first.
0
python,scripting,perforce
2008-10-08T18:33:00.000
0
184,187
You may want to check out the P4Python module. It's available on the perforce site and it makes things very simple.
0
19,107
false
0
1
How do I check out a file from perforce in python?
184,238
2
6
0
3
15
0
0.099668
0
I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test first.
0
python,scripting,perforce
2008-10-08T18:33:00.000
0
184,187
Building from p4python source requires downloading and extracting the p4 api recommended for that version. For example, if building the Windows XP x86 version of P4Python 2008.2 for activepython 2.5: download and extract both the p4python and p4api fixup the setup.cfg for p4python to point to the p4api directory. To open files for edit (do a checkout), on the command line, see 'p4 help open'. You can check out files without making a changelist if you add the file to the default changelist, but it's a good idea to make a changelist first. P4Python doesn't currently compile for activepython 2.6 without visual studio 2008; the provided libs are built with 2005 or 2003. Forcing p4python to build against mingw is nearly impossible, even with pexports of python26.dll and reimp/reassembly of the provided .lib files into .a files. In that case, you'll probably rather use subprocess, and return p4 results as marshalled python objects. You can write your own command wrapper that takes an arg array, constructs and runs the commands, and returns the results dictionary. You might try changing everything, testing, and on success, opening the files that are different with something equivalent to 'p4 diff -se //...'
0
19,107
false
0
1
How do I check out a file from perforce in python?
307,908
1
1
0
5
2
0
1.2
0
I am working with a hosting provider who has installed mod_python for me. I followed the install instructions locally and included it in httpd.conf but they have opted to put it in conf.d/python.conf. Is there any difference/benefit to doing it either way?
0
mod-python,apache
2008-10-09T13:15:00.000
0
187,195
No, all the files are parsed at run time, you can include as many as you want. They've just opted to seperate out the configuration for easier management.
0
295
true
0
1
Is there a difference between installing mod_python via httpd.conf and conf.d in apache?
187,202
2
7
0
1
26
1
0.028564
0
After having looked at each of these two projects, it seems that both are VERY similar. Both run on top of the CLI, both have python style syntax, both use .NET instead of the standard python libraries. So, what are the differences between them and advantages of each?
0
ironpython,boo
2008-10-11T08:44:00.000
0
193,862
I agree with VolkA here. Being able to run Django is big. It's just such an amazing framework, that Boo will have a hard time redoing it. Today it's more a question of the frameworks that a language provides, than it is the construct that it provides. And Boo doesn't provide much improvements over Python in the constructs it support.
0
6,385
false
0
1
Boo vs. IronPython
194,040
2
7
0
4
26
1
0.113791
0
After having looked at each of these two projects, it seems that both are VERY similar. Both run on top of the CLI, both have python style syntax, both use .NET instead of the standard python libraries. So, what are the differences between them and advantages of each?
0
ironpython,boo
2008-10-11T08:44:00.000
0
193,862
I have written applications in both Boo and IronPython. For me IronPython has been the more robust choice and much of what I've written in CPython ports without changes. All recent projects have been pure IronPython if targeted for .Net Framework. Since Jim "defected" to Microsoft, IronPython has been elevated to a top tier language. There's even Visual Studio for it.
0
6,385
false
0
1
Boo vs. IronPython
199,236
1
4
0
14
68
0
1
0
What to use for a medium to large python WSGI application, Apache + mod_wsgi or Nginx + mod_wsgi? Which combination will need more memory and CPU time? Which one is faster? Which is known for being more stable than the other? I am also thinking to use CherryPy's WSGI server but I hear it's not very suitable for a very high-load application, what do you know about this? Note: I didn't use any Python Web Framework, I just wrote the whole thing from scratch. Note': Other suggestions are also welcome.
0
python,apache,nginx,mod-wsgi
2008-10-12T14:14:00.000
0
195,534
The main difference is that nginx is built to handle large numbers of connections in a much smaller memory space. This makes it very well suited for apps that are doing comet like connections that can have many idle open connections. This also gives it quite a smaller memory foot print. From a raw performance perspective, nginx is faster, but not so much faster that I would include that as a determining factor. Apache has the advantage in the area of modules available, and the fact that it is pretty much standard. Any web host you go with will have it installed, and most techs are going to be very familiar with it. Also, if you use mod_wsgi, it is your wsgi server so you don't even need cherrypy. Other than that, the best advice I can give is try setting up your app under both and do some benchmarking, since no matter what any one tells you, your mileage may vary.
0
31,610
false
1
1
In production, Apache + mod_wsgi or Nginx + mod_wsgi?
196,580
2
5
0
1
9
1
0.039979
0
I'm not exactly sure how to ask this question really, and I'm no where close to finding an answer, so I hope someone can help me. I'm writing a Python app that connects to a remote host and receives back byte data, which I unpack using Python's built-in struct module. My problem is with the strings, as they include multiple character encodings. Here is an example of such a string: "^LThis is an example ^Gstring with multiple ^Jcharacter encodings" Where the different encoding starts and ends is marked using special escape chars: ^L - Latin1 ^E - Central Europe ^T - Turkish ^B - Baltic ^J - Japanese ^C - Cyrillic ^G - Greek And so on... I need a way to convert this sort of string into Unicode, but I'm really not sure how to do it. I've read up on Python's codecs and string.encode/decode, but I'm none the wiser really. I should mention as well, that I have no control over how the strings are outputted by the host. I hope someone can help me with how to get started on this.
0
python,string,unicode,encoding
2008-10-13T14:26:00.000
0
197,759
I don't suppose you have any way of convincing the person who hosts the other machine to switch to unicode? This is one of the reasons Unicode was invented, after all.
0
3,280
false
0
1
Dealing with a string containing multiple character encodings
197,854
2
5
0
3
9
1
0.119427
0
I'm not exactly sure how to ask this question really, and I'm no where close to finding an answer, so I hope someone can help me. I'm writing a Python app that connects to a remote host and receives back byte data, which I unpack using Python's built-in struct module. My problem is with the strings, as they include multiple character encodings. Here is an example of such a string: "^LThis is an example ^Gstring with multiple ^Jcharacter encodings" Where the different encoding starts and ends is marked using special escape chars: ^L - Latin1 ^E - Central Europe ^T - Turkish ^B - Baltic ^J - Japanese ^C - Cyrillic ^G - Greek And so on... I need a way to convert this sort of string into Unicode, but I'm really not sure how to do it. I've read up on Python's codecs and string.encode/decode, but I'm none the wiser really. I should mention as well, that I have no control over how the strings are outputted by the host. I hope someone can help me with how to get started on this.
0
python,string,unicode,encoding
2008-10-13T14:26:00.000
0
197,759
I would write a codec that incrementally scanned the string and decoded the bytes as they came along. Essentially, you would have to separate strings into chunks with a consistent encoding and decode those and append them to the strings that followed them.
0
3,280
false
0
1
Dealing with a string containing multiple character encodings
197,786
1
6
0
3
9
0
0.099668
0
The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on.
0
python,vim,omnicomplete
2008-10-13T22:08:00.000
0
199,180
Once I generated ctags for one of my site-packages, it started working for that package -- so I'm guessing that the omnicomplete function depends on ctags for non-sys modules. EDIT: Not true at all. Here's the problem -- poor testing on my part -- omnicomplete WAS working for parts of my project, just not most of it. The issue was that I'm working on a django project, and in order to import django.db, you need to have an environment variable set. Since I couldn't import django.db, any class that inherited from django.db, or any module that imported a class that inherited from django.db wouldn't complete.
0
4,900
false
0
1
Is there any way to get python omnicomplete to work with non-system modules in vim?
213,253
1
4
0
1
14
1
0.049958
0
I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my application.
0
python,module,compilation
2008-10-15T15:02:00.000
0
205,062
I think you can use jython to compile python to Java bytecode, and then compile that with GCJ.
0
4,549
false
0
1
Is it possible to compile Python natively (beyond pyc byte code)?
209,176
2
5
0
2
15
0
0.07983
0
Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?
0
python,validation,emacs,syntax
2008-10-15T17:46:00.000
0
205,704
Or from emacs (or vim) you could run python -c 'import x' where x is the name of your file minus the .py extension.
0
8,119
false
0
1
How can I check the syntax of Python code in Emacs without actually executing it?
207,059
2
5
0
0
15
0
0
0
Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?
0
python,validation,emacs,syntax
2008-10-15T17:46:00.000
0
205,704
You can use pylint, pychecker, pyflakes etc. from Emacs' compile command (M-x compile). Hint: bind a key (say, F5) to recompile.
0
8,119
false
0
1
How can I check the syntax of Python code in Emacs without actually executing it?
207,593
2
5
0
1
8
0
0.039979
0
I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on. An obvious way to do this is via something like XML-RPC or maybe CORBA but I would be interested in any other approaches. What have other people done to get code from Python and Ruby communicating with one another, either locally on the same system or remotely accross a network? Thanks in advance.
0
python,ruby,interop
2008-10-15T22:49:00.000
1
206,823
Expose your Ruby classes as web services using Sinatra, Rails, or, plain old Rack. Expose your Python classes as web services using web.py, flask, Django, or App Engine. Use HTTParty for Ruby to build an API into your Python classes. Use a Python REST library to build an API into your Ruby classes.
0
2,499
false
0
1
Ruby to Python bridge
4,859,776
2
5
0
3
8
0
0.119427
0
I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on. An obvious way to do this is via something like XML-RPC or maybe CORBA but I would be interested in any other approaches. What have other people done to get code from Python and Ruby communicating with one another, either locally on the same system or remotely accross a network? Thanks in advance.
0
python,ruby,interop
2008-10-15T22:49:00.000
1
206,823
Please be advised that I don't speak from personal experience here, but I imagine JRuby and Jython (The ruby and python implementations in the JVM) would be able to to easily talk to each other, as well as Java code. You may want to look into that.
0
2,499
false
0
1
Ruby to Python bridge
206,839