Live data from Hacker News

Python Ecosystem - An Introduction

mirnazim.org

71–78 of 78 posts

Re: Python Ecosystem - An Introduction

#71
post #29

Great post - I wish there was a unified resource for things like that for other languages/tools. I would only add iPython - a must for any console adventures.

ipython has known issues running certain code. It is not guaranteed to function like a normal interpreter. If you insist on a fancy interpreter, use bpython.

These issues are not known to me, could you expand?

Re: Python Ecosystem - An Introduction

#72
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…

Agree with your points. Would add emphasis on ipython and heavy use of interpreter, pylint instead of pyflakes, "learn and prefer builtin modules" rule, and Python in a Nutshell on the desk.

Re: Python Ecosystem - An Introduction

#73
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…

> System packages should be managed by a system packager. You shouldn't be using the system Python. Should compile from source and put in /opt/ /. And that shouldn't be owned by some random user. So, you should be using sudo.

Building your own Python and using system package manager do not exclude each other. On the contrary, I'd even recommend installing your own built software with your systems package manager

Re: Python Ecosystem - An Introduction

#74
post #71

Earlier quoted context omitted.

ipython has known issues running certain code. It is not guaranteed to function like a normal interpreter. If you insist on a fancy interpreter, use bpython.

These issues are not known to me, could you expand?

References last far longer than they should, because the interpreter doesn't always let go of references to returned results.

There used to be a problem with certain statements being executed as expressions and printed, but I'm told that's been fixed.

The encoding is always Latin-1. Always. Hope you don't use Unicode literals.

It's not Python. It's Python plus other things. That's always a Bad Thing because it precludes taking results from the interpreter and using them in plain Python contexts. web2py also has this problem.

Re: Python Ecosystem - An Introduction

#76
post #72
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…

Agree with your points. Would add emphasis on ipython and heavy use of interpreter, pylint instead of pyflakes, "learn and prefer builtin modules" rule, and Python in a Nutshell on the desk.

My reasons for preferring pyflakes over pylint: * pyflakes are fast * pyflakes is less likely to flood me with false positives

What are your reasons for preferring pylint?

Re: Python Ecosystem - An Introduction

#77
post #20

Great post. I would add: * the site module, which is imported by default and is what is responsible for setting up the default sys.path. You can skip 'import site' by running python with the -S switch. the site module is written in python, so you can scan through it and understand how python starts up and inits. * PYTHONSTARTUP env variable, which points to a python file that is run (like a bashrc, or AUTOEXEC.BAT, i…

PYTHONSTARTUP also lets you enable things like

  * coloured prompt
  * tab-completion
  * persistent history
Here's mine: http://mg.pov.lt/pythonrc

Re: Python Ecosystem - An Introduction

#78
post #67

Earlier quoted context omitted.

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

This happens to me all the time. My most favorite is when I have to type the word "important", my mind spells "I M P O R T A N T" but my fingers instinctively stop at "import".

My fingers often type "test" when I want to type "text".
Post reply on HN