Home || Syllabus || Readings || Resources
Python Programming Resources
Software from python.org
- Python Downloads - http://python.org/download/
- CS department instructions for installing Python - http://cs.nyu.edu/courses/fall15/CSCI-UA.0002-002/common_syllabus/#software
Mac Users: Possible Idle Error Message and how to fix it:
If you are running Mac OS 10.9 (Mavericks) you may see the following error message when launching IDLE:
WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.If so, you should quit IDLE and install ActiveTcl version # 8.5.15.0 from this website http://www.activestate.com/activetcl/downloads.
Notes:
- To create a new script in IDLE: use FILE / NEW.
- To run a script or program in IDLE, use RUN / RUN MODULE (or F5).
- Using line numbers: Line Numbers are not displayed on the left-hand side. However, you can go to a specific line with Edit / Go to Line. Also, note that there is a line/column indicator in the lower right corner of the
IDLE window.
Notes on using Python’s IDLE in Windows:
In order to set a default directory for your programs so that Python does not save them with the rest of Python, you can reconfigure the shortcut on your desktop to specify your own working directory. To do that, right-click on the shortcut on your desktop and choose Properties. In the “Start In:” line, enter your own folder, for example C:PythonClass and then click OK.
Notes on De-bugging in Python’s IDLE:
- In the SHELL, click on DEBUG / DEBUGGER
- Select your options (e.g. LOCALS / STACK )
- Use STEP to go through the program one line at a time and follow how the program executes
- Use GO to run the program to finish the way that it normally would run (in other words, to stop the STEP behavior).
Python eBook available at the Bobst:
- Python in a Nutshell - http://proquest.safaribooksonline.com/0596100469
Online open source textbook (also available in paperback for cost):
Think Python: How to Think Like a Computer Scientist
By Allen B. Downey
Publisher: O'Reilly Media, 2012
Print ISBN: 978-1-4493-3072-9 | ISBN 10: 1-4493-3072-X
Ebook ISBN: 978-1-4493-3071-2 | ISBN 10: 1-4493-3071-1
http://shop.oreilly.com/product/0636920025696.do
Available on-line: http://www.greenteapress.com/thinkpython/
Online Tutorials and fun pages
- Python programming for Java Programmers http://python4java.necaiseweb.org/Main/TableOfContents
- Solved Problem Sets: http://www.pyschools.com/
- Online python tutor: http://www.pythontutor.com
- Python Wiki: learning to program https://wiki.python.org/moin/BeginnersGuide/Programmers
- The Zen of Python - http://www.python.org/dev/peps/pep-0020/
Additional Python IDE
- JetBrains offers a free academic license for PyCharm: https://www.jetbrains.com/pycharm/
Online Resources and documentation:
Additional resources will be added throughout the semester.
- The official Python site - http://python.org/
- Math functions - http://docs.python.org/release/3.0.1/library/math.html
- generating pseudo-random numbers - http://docs.python.org/release/3.0.1/library/random.html
- Useful Python modules, packages and libraries
- String methods - http://docs.python.org/release/3.0.1/library/stdtypes.html?highlight=capitalize#id4
- Mutable Sequence Types (e.g. lists) - http://docs.python.org/release/3.0.1/library/stdtypes.html?highlight=capitalize#mutable-sequence-types
- Mapping types (e.g. dictionary) - http://docs.python.org/release/3.0.1/library/stdtypes.html?highlight=capitalize#mapping-types-dict
- File objects (File IO) - http://docs.python.org/release/3.0.1/library/stdtypes.html?highlight=capitalize#file-objects
- Python and Unicodes - https://docs.python.org/3/howto/unicode.html
- Python and codecs - https://docs.python.org/3/library/codecs.html
- Regular expressions in Python - http://www.python-course.eu/re.php and https://docs.python.org/3/howto/regex.html
Some of the differences Between Python 2.x and Python 3.x
- Official documentation is posted at differences between Python 2.x and Python 3.x -http://docs.python.org/3.1/whatsnew/3.0.html
- Here are some of the differences to keep in mind with respect to the CSCI-UA.2 syllabus material; there are many more:
Topic | Python 2.x | Python 3.x | |
Print statement | print ‘Hello, World!’ | print(‘Hello, World’) | |
Data entry: text | name = raw_input(‘What is your name? ‘) | name = input(‘What is your name? ‘) | |
Data entry: numbers (values) | age = input(‘What is your age? ‘) | age = input(‘What is your age? ‘) age = int(age) |
|
Integer arithmetic: division |
[ where 7 and 2 are integers] |
>>> 7/2 3.5 >>> 7//2 3 |
Working with NLTK: Natural Language Toolkit
- NLTK site: http://www.nltk.org
- NLTK on-line book http://www.nltk.org/book/
- NLTK paperback (complete book) http://shop.oreilly.com/product/9780596516499.do
- Installing NLTK http://www.nltk.org/install.html
- NLTK "cheat sheet" https://blogs.princeton.edu/etc/files/2014/03/Text-Analysis-with-NLTK-Cheatsheet.pdf