background preloader

Try Python: Interactive Python Tutorial in the Browser

Try Python: Interactive Python Tutorial in the Browser
Related:  Getting started with Python

A Note on Python Paths This time I decided to share some knowledge about Python paths which seemed a little bit confusing to me in the beginning of diving into Python. I am working with Django in different platforms like Mac OS X, Windows, and Linux, therefore the common patterns how to activate new python modules in all of those environments should be familiar to me. Python modules are either *.py files or directories containing __init__.py . For example, if you can run the following, then django is under your python path. python >>> import django Stay tuned to get deeper into python paths. Installing modules If a module is installable, usually all you need to do is to extract its setup directory, cd to it, and run python setup.py install This will copy the module into the site-packages directory of the current python installation. python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" Or you can use PEAK EasyInstall for installing python modules even faster. Sym-linking *.pth files or

Online Python Tutor - Learn programming by visualizing code execution The Python Tutorial Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, and may be freely distributed. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. For a description of standard objects and modules, see The Python Standard Library. The Glossary is also worth going through.

Becoming a Pythonista — Platipy 0.2 documentation This chapter is will provide a very brief review of some important python concepts which will be useful and necessary. The basic concepts will be for those who are unfamiliar with Python, but a good refresher for those who don’t write in Python every day. Intermediate concepts will be great for programmers of all levels to refresh on some Python idioms. The code below will focus on Python 2.5+, since that is the version on most XO laptops. PEP8 and The Zen of Python¶ One of the most important aspects of developing in Python is the Python community. Use 4 spaces per indentation level. The Zen of Python is a list of guiding principles behind the design of Python, and a good list of guiding principles for any project written in python. Control Flow in Python¶ The if statement acts predictably in Python. >>> if <conditional>:... statement... elif <conditional>:... statement... else:... statement >>> for <item> in <sequence>:... statement >>> while <conditional>:... statement Numerics¶ Strings¶ Note

Using .pth files for Python development Python's site module is responsible for setting up the interpreter's environment upon startup. One of the things it does during startup is scan your site directories (typically just site-packages , but framework builds for Mac OS X have an additional undocumented default location) for .pth files. .pth files are used to add additional locations sys.path , and they are typically created by distutils setup scripts that use the (still undocumented) extra_path argument. .pth files are a great alternative to using the PYTHONPATH environment variable: You don't have to screw with your environment (which can be difficult on Mac OS X and Windows). The effect is localized to a particular Python installation. For pure Python ("purelib" in distutils terminology) packages, I create a .pth file that points straight at the source directory, which means I don't have to bother with the distutils setup script when I modify the code. py2app.pth docutils.pth PyObjC.pth ctypes.pth hack1.pth hack2.pth hack2.py

The Python Tutorial Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). This tutorial introduces the reader informally to the basic concepts and features of the Python language and system.

Python for Software Design: How to Think Like a Computer Scientist How to Think Like a Computer Scientist by Allen B. Downey This is the first edition of Think Python. Buy this book at Amazon.com Download Think Python in PDF. Read Think Python in HTML. Example programs and solutions to some problems are here (links to specific examples are in the book). Description Think Python is an introduction to Python programming for beginners. Some examples and exercises are based on Swampy, a Python package written by the author to demonstrate aspects of software design, and to give readers a chance to experiment with simple graphics and animation. Think Python is a Free Book. If you have comments, corrections or suggestions, please send me email at feedback{at}thinkpython{dot}com. Other Free Books by Allen Downey are available from Green Tea Press. Download Precompiled copies of the book are available in PDF. Python 3.0 Most of the book works for Python 2.x and 3.0. Michael Kart at St. Earlier Versions Translations and adaptations

Online Python Tutor - Learn programming by visualizing code execution Python progression path - From apprentice to guru Python Programming Language – Official Website Dive Into Python Code Like a Pythonista: Idiomatic Python In this interactive tutorial, we'll cover many essential Python idioms and techniques in depth, adding immediately useful tools to your belt. There are 3 versions of this presentation: ©2006-2008, licensed under a Creative Commons Attribution/Share-Alike (BY-SA) license. My credentials: I am a resident of Montreal,father of two great kids, husband of one special woman,a full-time Python programmer,author of the Docutils project and reStructuredText,an editor of the Python Enhancement Proposals (or PEPs),an organizer of PyCon 2007, and chair of PyCon 2008,a member of the Python Software Foundation,a Director of the Foundation for the past year, and its Secretary. In the tutorial I presented at PyCon 2006 (called Text & Data Processing), I was surprised at the reaction to some techniques I used that I had thought were common knowledge. Many of you will have seen some of these techniques and idioms before. These are the guiding principles of Python, but are open to interpretation. import this

[Resource] Learning Python A lot of people who join this course might not be that familiar with Python, or not be familiar with Python at all. So for those students this is a list of places where they can learn a bit about Python. Udacity CS101 - I took it in February & trust me it's worth it, even if you know Python.Learn Python The Hard Way - The hard way is the right way, and in the long run the easy way. Free to browse on the internet.Invent Your Own Computer Games with Python - A good book, with the blog a good resource too. Free to download.Dive into Python - Free to downloadHow to think like a computer scientist - This book is about more than just Python, but still a good resource to have.MIT 6.00 Introduction to Computer Programming - This is a youtube playlist for lecture videos from Fall 2008. IMO, the best way would be to get a Python book, any book, and get cracking. Happy learning everyone.

Related: