As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I already bought a good book on Python 2.5. Should I return it and get a book on 3.1 instead? that I know this question has already been asked, but I wanted a more up-to-date answer.
Linky: Python2orPython3
Synopsis:
Python 2.5 is old but the general consensus is Python 3 if you don't have any dependencies or a large code base already in production, if this is the case then writing more future ready code might be a better option. On the other hand bigger projects have already started the long process of porting their code.
When you learn python really you should learn 2 and 3 and then just remember the differences between them. Its not like a different language all together and you could probably get most of the differences on a cheat sheet.
You probably should learn Python 3, unless you're planning to work on a significant 2.x codebase anytime soon.
2.x and 3.x aren't actually all that different. It's quite possible to use a common subset for most things. EG, I just wrote a 4000 line deduplicating backup system that runs on 2.x and 3.x.
They are similar enough that it makes sense to learn either 2.7 or 3.2, then learn the differences if they are important to you.
There's a guide on the Python site: http://wiki.python.org/moin/Python2orPython3
For the time being 2.x and 3.x will live side by side. So you should learn "both". BUT actualy they are so similar, that you will learn the differences as you tag along. Keep your book, you won't learn something wrong, which you would have to relearn later.
Actualy it may be better, NOT to start with 3.x, becuase you may come along some legacy code which you might have problems understanding, because they use "deprecated" constructs to accomplish something.
On the other hand if you come accross some new constructs, you will begin to compare it, with how you would do it in python 2.x and you might find it easier to remember how something is done generaly in python, because you gain experience and understanding through overthinking the underlying concepts and reasonings why something changed.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was using python 2.7 for the last few years. I had a lot of libraries I used that weren't yet compatible with Python 3 and my general feeling was that it wasn't settled enough for me.
Lately I've heard so many people talking about how good Python 3.3 is that I realized maybe I lagged behind for too long.
So, what are the main resources for someone like me, who stayed in 2.7 until now, to get up to speed with the syntax differences, new standard library features and general questions of idiomatic code?
Edit:
As suggested by #PhilH, it would be nice to have a few comments on the main advantages of using python 3.3 over 2.7 and tips on features python 3.3 that can make a difference in readability, performance, etc.
THe "What's New" documents for each 3.x release is the best place. For example, version 3.3 was just released, the What's New page has a good description of... what's new. There is another describing 3.x in general. Google will find it for you.
Dive Into Python 3 Is one place to start, it's also free.
Also, Mark Lutz's all-time classic Learning Python, 4th edition covers differences between 2 and 3 explicitly wherever they occur.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What is the best way to communicate between a Python 3.x and a Python 2.x program?
We're writing a web app whose front end servers will be written in Python 3 (CherryPy + uWSGI) primarily because it is unicode heavy app and Python 3.x has a cleaner support for unicode.
But we need to use systems like Redis and Boto (AWS client) which don't yet have Python 3 support.
Hence we need to create a system in which we can communicate between Python 3.x and 2.x programs.
What do you think is the best way to do this?
The best way? Write everything in Python 2.x. It's a simple question: can I do everything in Python 2.x? Yes! Can I do everything in Python 3.x? No. What's your problem then?
But if you really, really have to use two different Python versions ( why not two different languages for example? ) then you will probably have to create two different servers ( which will be clients at the same time ) which will communicate via TCP/UDP or whatever protocol you want. This might actually be quite handy if you think about scaling the application in the future. Although let me warn you: it won't be easy at all.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been programming for a few months now and have a few small programs I've done (https://github.com/jlegs). A veteran programmer who is a friend suggested to a company that was looking for Python coders that they take a look at me. So I went in to meet them today. They wanted to see more complex programs from me to show that I was on a more intermediate level.
So a question: What kind of projects would you folks say would be on par for intermediate level programmers?
Plenty of well written questions and answers on StackOverflow would go a long way towards convincing me of both your ability to think critically and to communicate with a team.
Companies in my time were happy if you could recreate a couple of dozen Unix command line filters. Nowadays that is not enough. Cross platform scripting in multiple languages is the name of the game. SQL, php, Java and various flavors of C are often seen. An applicant is expected to be conversant in everything from lambda expressions and iterators to complex regexes and html parsers. Rather than jump in to studying all these things however, you should know the things you do know really well and be able to discuss them, in depth, with the interviewer.
If I were to set out an ultimate task list, it would be to code samples of the patterns in this page . When doing these don't limit yourself to Python, if a call to a DB works then do that, if a call to command line utility satisfies the pattern then do that. It's not the complexity of the code but your understanding of how the code implements the pattern and the clarity of the interface definition that is the seller.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am still kind of new to programming and after playing around with a lot of languages trying to find which one worked best for me I stumbled across python and have been doing really well with it.
The only problem/concern I have is that I do not mainly want to do web development. I want to create desktop apps with nice GUis as well. Unlike most other programming languages that I have dabbled in python doesn't seem to have one definitive ide for this sort of thing which kind of sucks imo, especially since it's such a cool language.
I've searched and found quite a few IDEs that include GUI designers with code editing as well but I can't decide which one to use. Of those I am interested in the following
BlackAdder - http://www.thekompany.com/products/blackadder/
Pythoncard - http://pythoncard.sourceforge.net/
Boa Constructor - http://boa-constructor.sourceforge.net/
SPE - http://pythonide.blogspot.com/
Dabo (is it even an ide?) - http://dabodev.com/
Eric IDE - http://eric-ide.python-projects.org/index.html
Xrope - http://xrope.sourceforge.net/
I am not looking for opinions on which one is the "best" or anyone's favorite. I want to know which one is the most widely used and which one I would be able to find the most documentation on and get the most user support from whether it be via forums, here, community, etc..
P.S. If anyone cares to post any links to some documentation/tutorials with their answer it would be greatly appreciated.
P.P.S. Does anyone know if there are any plans for a larger company maybe thinking of creating a full fledged ide comparable to Delphi, Visual Studio for python in the foreseeable future? Would make things a lot easier IMO.
Thanks..
You can use Visual Studio to build IronPython GUI applications as well: http://msdn.microsoft.com/en-us/library/bb165375(v=vs.80).aspx
EDIT: You can now use pytools (http://pytools.codeplex.com/) to develop non-IronPython apps in VisualStudio.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have taken it upon myself to learn python. As it is my second language is has not been that hard to get the hang of. I am looking for some simple python projects to undertake so I can better learn the syntax of the language in general. I would specifically like to learn the syntax of arrays, lists, and dictionaries.
Edit:
I cant say that one of your answers are right or wrong but between all of you i have alot of material! Thanks everyone :D
ps I particularly liked Google's Python Class
Google's Python class has a bunch of projects you can work on.
The Python Challenge has been by far the coolest exploratory stuff I've done with Python.
Take your time working through the problems - it's worth it.
Python Koans is a good interactive tutorial that covers basic syntax and advanced concepts.
A usual response to such things is Project Euler. Not necessarily special to python, but all those problems are solveable with python, and by working on them, you especially learn a lot of things that make Python special.
You can try pyschools.com
There are many small exercises categorized into different topics. Quite a fun way to learn how to program.
Steve Lott's Building Skills In Python is great. He's prominent on this site, too.
I would highly recommend the following e-book for learning Python. It covers several different programming paradigms and is a very good introduction to Python in general.
www.greenteapress.com/thinkpython/thinkCSpy.pdf
If you are already familiar with programming in general then Dive into Python is an unbeatable resource for getting the foundation of the language fast.
I have read both of the above and found them to be very helpful.
Also something similar to Project Euler is Rosalind
http://rosalind.info/problems/list-view/
Most of the problems are solved by writing programs that perform opetarions on strings, which makes it a goot tool to learn about lists and dictionaries. And you also learn something about bioinformatics which doesn't really help you much in your programming career but is really cool =D
Sorry to state the obvious, but why not read a good book or two, like:
Learning Python: Powerful Object-Oriented Programming
If you like more of a learn as you go approach, there's always the venerable:
Python Cookbook
Also in line with the Project Euler answer already provided, I'd recommend looking into some Code Kata. I generally go through these as part of learning any new language, and here's a link to several good ones:
http://codingdojo.org/cgi-bin/wiki.pl?KataCatalogue
Also a Stack Overflow question discussing Kata:
https://stackoverflow.com/questions/44533/your-favorite-code-kata
Python challenge is cool. And I see another good http://projecteuler.net