Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (21 sloc) 1.56 KB

Python Examples


When I was learning Python I had to go all over the web to find the examples I needed. I decided to put some common examples here to make it easier for others who are learning Python to find. If these scripts are helpful or if you have suggestions for other examples that should be added, please let me know. Please note all of my scripts are compatible with the 2.x version of Python and may need to be modified to work in the 3.x version of Python. There are significant differences in the two versions of Python. If you need help choosing which version to use see I use the 2.x version of Python because it is the default version in Ubuntu and BT5.

This is not meant to be a Python tutorial. If you need a tutorial please check out the following resources:


  • - opens a file, reads each line, and processes the line.
  • - write data to a file
  • - opens two files, read from one, write to the other
  • - Python server with sockets
  • - Python client with sockets
  • - open a url and parse data

Coming Soon

  • - open an xml file and parse the data
Something went wrong with that request. Please try again.