Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Tips
I have been programming in Python since 2006 (with breaks) from version 2.5. This would be my recommended programming language for people who want to learn programming. There is Python library for everything under the sun, it is general purpose programming language and pre-installed on almost any computer including Raspberry Pi, It's perfectly suitable for tooling, generally it is several times faster to write a utility in Python than C++ or Java, dont get me started on Bash.

This is not supposed to be a tutorial, you can find plenty of those online, more like my random notes.

Python homepage is here:


Next thing I always install is PIP, install it like this:

curl | python

Then you can install Python packages like this:

pip install some-package-name

If that does not work, this always works:

python -m pip install some-package-name


The -m option allows to run python library module as Python script. I frequently use it also like this:

python -m SimpleHTTPServer

This will start webserver on port 8000 with directory indexing capability, so you can download files from your computer using wget or curl.


If you include shebang on the first line and make your script executable (chmod +x, it can be called like any other command.

#!/usr/bin/env python
Btw. on Windows it's possible to call .py files from command line without prepending "python"


Most of the time you do not need full IDE, just an editor. Some people use whatever basic editor is included and have command line open where they test it. This is too crude, I prefer editor with line numbers that allows running the script captures output and errors and allows navigation in the source by double-clicking on error line. The one I have used since ever is SciTE. On Linux install

sudo apt-get install scite

That's all for now

Forum Jump:

Users browsing this thread: 1 Guest(s)