How do I reference the Python programming language in a thesis or a paper?
In order to cite a programming language, a possible way is to cite the reference manual, including the version of the language you use (your approach might no longer work with the version of Python available in 20 years ...). 

For instance, you can have a citation like: 


  Python Software Foundation. Python Language Reference, version 2.7. Available at http://www.python.org


According to this thread, you can also cite the original CWI TR: 


  "G. van Rossum, Python tutorial, Technical Report CS-R9526, 
  Centrum voor Wiskunde en Informatica (CWI), Amsterdam, May 
  1995."