https://github.com/jeffthompson/pythonteachingexamples
Example scripts for learning Python
https://github.com/jeffthompson/pythonteachingexamples
Last synced: 10 months ago
JSON representation
Example scripts for learning Python
- Host: GitHub
- URL: https://github.com/jeffthompson/pythonteachingexamples
- Owner: jeffThompson
- Created: 2013-02-06T19:15:55.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-02-26T21:30:55.000Z (over 12 years ago)
- Last Synced: 2025-05-12T17:22:11.865Z (about 1 year ago)
- Language: Python
- Size: 950 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PythonTeachingExamples
======================
Example scripts for learning Python. Currently examples are for text parsing for data visualization.
**GETTING STARTED**
We'll be writing code in a text editor - I recommend one of the following:
+ Text Wrangler (free, [download here](http://www.barebones.com/products/textwrangler/download.html))
+ Sublime Text (free with paid upgrade, [download here](http://www.sublimetext.com/2))
Python is a scripting language that is very powerful, but easy to get started with. It should come pre-installed on your computer! To check, open your command line:
+ Mac users: `Applications > Utilities > Terminal`
+ PC users: `Start > All Programs > Accessories > Command Prompt`
To see if Python is set up, type `python` into the window - you should get a bunch of information on which version you have set up.
**WRITING YOUR FIRST SCRIPT**
All Python scripts (programs) will be written in your text editor and saved with the `.py` extension. See the `Basics` folder for some simple examples.
Once written, you can run your script using the following:
+ Text Wrangler: `#! > Run in Terminal...`
+ Sublime Text: `Tools > Build... (or command/control B)`
Your script should run, either in the Terminal window (Text Wrangler) or in the built-in console (Sublime Text).
**BASICS**
Just a few simple scripts to get you started. Covers printing, data types, and basic math operators.
**DATA CLEANUP**
A few examples of taking messy, real-world data and prepping it for use. (See also the `Text Processing > Introduction to Regular Expressions` example.)
**TEXT PARSING**
Basic to intermediate examples on manipulating text.
**UTILITIES**
Random assortment of (hopefully) useful scripts, mostly based on in-the-moment student questions.
\- \- \-
\[ all code available under [Creative Commons BY-NC-SA license](http://creativecommons.org/licenses/by-nc-sa/3.0/) - feel free to use but [please let me know](http://www.jeffreythompson.org) \]