Live data from Hacker News

Python Ecosystem - An Introduction

mirnazim.org

51–60 of 78 posts

Re: Python Ecosystem - An Introduction

#51
post #33
post #28

A formidable effort. It might be matter of taste but recommendations given starting from "Understanding the packages" and to "Install packages that need compiling" are almost harmful. My preference: * you should not care what is your `sys.path` looks like. You need it for debugging if something goes horribly wrong. A tutorial might mention it but things like `sys.path.insert(0,..)` should be avoided or accompanied wi…

My indented audience was not the pure beginners. I was targeting for developers coming to python from other platforms. Over past 2 years, if I have learned one thing while training interns, trainees and experience devs in Python/Django, it is that packaging confuses people a lot. apt-get vs easy_install vs pip. That is why I choose to spend most time on package management and virtualenv etc. I think, I should have in…

Great Pythonesque pun there! indented==intended, I'm sure.

Re: Python Ecosystem - An Introduction

#56

Nice article. I am bookmarking it. Also The Zen of Python can always be accessed by this Easter egg >>> import this http://www.python.org/dev/peps/pep-0020/

relax. it's a joke http://svn.python.org/view/python/trunk/Lib/this.py?view=mar...

IMHO this is more useful in the long run ... http://www.cs.yale.edu/quotes.html

Re: Python Ecosystem - An Introduction

#57
You really shouldn't tell people to go ask how to install Python on stackoverflow.com. Instead give them a few URLs to stackoverflow questions with the answer such as this one http://stackoverflow.com/questions/7538834/how-to-create-a-p...

Or even better, give them a stackoverflow search like this one http://stackoverflow.com/search?q=%5Bpython%5D+%22install+py...

P.S. I think that your wiki page is a great idea and I'm going to write a custom one for our developer wiki.

Re: Python Ecosystem - An Introduction

#58

> Choose Python 3 only if you need to and/or fully understand the implications. I would apply the "if you need to" part to Python 2. "3 if you can, 2 if you must"

I still thing that Python 2.7.2 is the only way to go for development unless you already know Python and its ecosystem well enough to know that 3.x will work for you.

That said, I try to use any backported 3.0 features such as .format for string formatting. And for beginners, I heartily recommend using the 'six' module. That way when you need to move to 3.0, porting your code or your skills, will be easy-peasy.

Re: Python Ecosystem - An Introduction

#60

I think that $ sudo apt-get install python-pip is a bad idea. You should not mix multiple packaging system on your operating system. And more you can dammage it pip provide more recent package than your distro. And if you upgrade a lib that have an incompatibility with a part of the system, you can corrupt it. I have no example to give but I am sure you can find it... Ubuntu now have many tools written in python. You…

What I tell people is that Python (as installed by apt-get, yum) is not on your system for you to develop with. It is there because some of the system tools are written in Python, including at least part of the apt packaging system. It's also there for System admins to use for writing Python scripts instead of bash scripts.

But for app development, get your own Python, manage it yourself and install 'distribute' so that you have both easy_install and pip to work with. I've taken that to extreme by making a portable Python distro that comes in a tarball and runs on any Linux distro, but even if you only untar the source and run ./configure --prefix=/home/python;make

That will build a default Python with support for any shared libraries for which you have a development version installed ( -dev version on debian/ubuntu, -devel version on redhat/suse)

sudo make install will install it, assuming that you have write permissions on the target prefix that you specified. You can even hide it in your home directory with --prefix=~/tools/python272

Post reply on HN