background preloader

Programming

Facebook Twitter

Python BooksA Python Book » Python Books. (1 votes, average: 5.00 out of 5) Loading ...

Python BooksA Python Book » Python Books

A Python Book: Beginning Python, Advanced Python, and Python Exercises by Dave Kuhlman This book is available for free in HTML format from the author’s websitePDF format from the author’s websiteePub format from Lulu.com The book is divided into 3 parts: Beginning PythonAdvanced PythonPython Workbook It is designed as a self-study textbook and workbook. Parts 1 and 2 cover the topics you would expect to find in a beginning Python book. Part 3 is what sets this book apart from others. Python Cheat Sheet. String String Methods Array Indexes and Slices a=[0,1,2,3,4,5] 6 len(a) 0 a[0] 5 a[5] 5 a[-1] 4 a[-2] [1,2,3,4,5] a[1:] [0,1,2,3,4] a[:5] [0,1,2,3] a[:-2] [1,2] a[1:3] [1,2,3,4] a[1:-1] Shallow copy of a b=a[:] Math Constants math.pi The mathematical constant π = 3.141592..., to available precision. math.e The mathematical constant e = 2.718281..., to available precision.

Python Cheat Sheet

Random Functions Sys Sys Variables argv Command line args builtin_module_names Linked C modules byteorder Native byte order check_-interval Signal check frequency exec_prefix Root directory executable Name of executable exitfunc Exit function name modules Loaded modules path Search path platform Current platform stdin, stdout, stderr File objects for I/O version_info Python version info winver Version number sys.argv foo.py sys.argv[0] bar sys.argv[1] -c sys.argv[2] qux sys.argv[3] --h sys.argv[4] os Variables Class Special Methods String Formatting Formatting Operations 'd' Signed integer decimal.

Date Formatting Date Formatting Ad. Python page Richard Gruet @ free.fr. 10. Brief Tour of the Standard Library — Python v2.7.5 documentation. 10.1.

10. Brief Tour of the Standard Library — Python v2.7.5 documentation

Operating System Interface The os module provides dozens of functions for interacting with the operating system: >>> import os>>> os.getcwd() # Return the current working directory'C:\\Python26'>>> os.chdir('/server/accesslogs') # Change current working directory>>> os.system('mkdir today') # Run the command mkdir in the system shell0 Be sure to use the import os style instead of from os import *. This will keep os.open() from shadowing the built-in open() function which operates much differently. The built-in dir() and help() functions are useful as interactive aids for working with large modules like os: >>> import os>>> dir(os)<returns a list of all module functions>>>> help(os)<returns an extensive manual page created from the module's docstrings> For daily file and directory management tasks, the shutil module provides a higher level interface that is easier to use: >>> import shutil>>> shutil.copyfile('data.db', 'archive.db')>>> shutil.move('/build/executables', 'installdir')

Think Python. Software: Python Sidebar. When programming Python, I tend to visit the most current reference documentation quite often.

Software: Python Sidebar

To get faster and more convenient access to the documentation, inspired by Mark Hammond’s sidebar, I wrote an updated sidebar for the Mozilla family of web browser. The sidebar also offers simple searching of related python websites and mailing lists. It might be semi-useful in other browsers as well, but the main target here is Mozilla. Installation To add the sidebar to your Mozilla (or Firefox) browser, just click the button below: Latest News Questions and Feedback For feedback, comments and questions, please email daniel@edgewall.com, or use our contact form. Collecting all the cheat sheets.

Michael Hansmeyer - Computational Architecture: Contact. Learn C++ Where Hackers and Security Experts Come to Train - Enigma Group.