Main.PythonStudyGroup History
Hide minor edits - Show changes to markup
Get feedback and ongoing discussion at the TLLTS Forum.
Get feedback and ongoing discussion at the TLLTS Forum. Other Python forums include Python Forum
- PyGTK interactive console pygtkconsole.py
- PyGTK interactive console pygtkconsole.py by JZA
- PyGTK interactive console pygtkconsole.py
- PyGTK interactive console pygtkconsole.py
- PyGTK interactive console pygtkconsole.py
- Display the day-of-week name for a date DayOfWeek by verbal
- Display the day-of-week name for a date DayOfWeek by Verbal
- Shuffle a string of characters PythonShuffle by Verbal
Display the day-of-week name for a date DayOfWeek by verbal Random numbers PythonRandomNumbers by Verbal
- Display the day-of-week name for a date DayOfWeek by verbal
- Random numbers PythonRandomNumbers by Verbal
Random numbers PythonRandomNumbers by Verbal
Take, for instance, an "if" loop:
Take, for instance, an "if" statement:
Display the weekday name for a date DayOfWeek by verbal
Display the day-of-week name for a date DayOfWeek by verbal
Display the weekday name for a date DayOfWeek by verbal
Python Code Examples
DayOfWeek
<<<<<<< ======= One thing that sets Python apart from other languages is that it is INDENTATION SENSITIVE! =====================
Indentation Sensitive
One thing that sets Python apart from other languages is that it is indentation sensitive! You might see this refered to as whitespace sensitive, also.
Take, for instance, an "if" loop:
... print "Greater than"
... print "Greater than"
===================== >>>>>>>
Indenting the fourth line produces the desired result.
>>> if 3 > 4 : ... print "Greater than" ... else : ... print "Less than" Less than
So, the indentation, or whitespace, is not merely for looks, but a part of the language and has meaning.
Get feedback and ongoing discussion at the TLLTS Forum.
Get feedback and ongoing discussion at the TLLTS Forum.
<<<<<<< =======
>>>>>>>
Get feedback and ongoing discussion at the TLLTS Forum.
Get feedback and ongoing discussion at the TLLTS Forum.
>>> if 3 > 4 : ... print "Greater than" ... else : ... print "Less than"
File "<stdin>", line 4
print "Less than"
^
IndentationError: expected an indented block
>>> if 3 > 4 :
... print "Greater than"
... else :
... print "Less than"
File "<stdin>", line 4
print "Less than"
^
IndentationError: expected an indented block
===================== >>> if 3 > 4 : ... print "Greater than" ... else : ... print "Less than"
File "<stdin>", line 4
print "Less than"
^
IndentationError: expected an indented block =====================
One thing that sets Python apart from other languages is that it is INDENTATION SENSITIVE!
IRC Meeting Day
Still deciding on what day to have IRC meetings.
Python Forum
Get feedback and ongoing discussion at the TLLTS Forum.
Resources
Python Tutor Mailing List
Visit Python Tutor Mailing List to sign up for questions and answers. You can choose the daily digest or receive them as they come, and of course the list runs on mailman, a Python-based mailing list.
- Strings
- Lists
- Tuples
- Sets
- Dictionaries (split)
- Strings
- Lists
- Tuples
- Sets
- Dictionaries (split)
- Strings
- Lists
- Tuples
- Sets
- Dictionaries (split)
- Lists
- Lists
- Sets
- Sets
Python Lectures
Python Lectures Recordings
- http://www.oooxtremo.org/DataStructureStrings.ogg Strings
- http://www.oooxtremo.org/DataStructure_Lists.ogg Lists
- http://www.oooxtremo.org/DataStructure_tuples.ogg Tuples
- http://www.oooxtremo.org/DataStructure_Sets.org Sets
- http://www.oooxtremo.org/DataStructure_dictionaries.ogg Dictionaries (split)
- Strings
- Lists
- Tuples
- Sets
- Dictionaries (split)
Python Lectures
A lecture by Dr. Sergio Rey of San Diego St. University on Python Data Sturctures, including strings, lists, tuples, dictionaries and sets.
- http://www.oooxtremo.org/DataStructureStrings.ogg Strings
- http://www.oooxtremo.org/DataStructure_Lists.ogg Lists
- http://www.oooxtremo.org/DataStructure_tuples.ogg Tuples
- http://www.oooxtremo.org/DataStructure_Sets.org Sets
- http://www.oooxtremo.org/DataStructure_dictionaries.ogg Dictionaries (split)
Or, alternatively, we can pass pass the prompt to raw_input() directly:
Or, alternatively, we can pass the prompt to raw_input() directly:
Or, alternatively, we can pass pass the prompt to raw_input() directly:
#!/usr/bin/python
name = raw_input('Please enter your name: ')
print 'How are you, ' + name + '?'
[@
- !/usr/bin/python
[@#!/usr/bin/python Name.py - Ask your name and replies with your name
print 'How are you, ' + name + '?' @]
print 'How are you, ' + name + '?' @] We run the program and we can get the following:
$ python Name.py Please enter your name Dann How are you Dann?
Standard input and output
To have Python standard input output we need to use the print and raw_input(), print will become a function on Python 3000 but so far it's still a command. Here is the code sample:
#!/usr/bin/python print 'Please enter your name.' name = raw_input() print 'How are you, ' + name + '?'
- Also links to several other online books and resources, available in a printable format.
- Also links to several other online books and resources, available in a printable format. Likely to be the text used.
- Seems like a nice book, too. From the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python.
- Seems like a nice book, too. From the site:
- Seems like a nice book, too. From the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python. Might be more complete than Python Programming
- Seems like a nice book, too. From the site:
- A book published by Apress, available in several formats for download.
- A book published by Apress, available in several formats for download, but written with experienced programmers in mind.
I think it a good plan to glance at these and other books, and have a (hopefully brief) discussion about which suits the group best. It appears that the first three texts are good for the first-time programmer. Any opinions on other qualities we'd like the text to have?
We're leaning towards Python Programming, so that will likely be the text to use, starting with the Interactive shell.
IRC Meeting Day
Still deciding on what day to have IRC meetings.
I think it a good plan to glance at these and other books, and have a (hopefully brief) discussion about which suits the group best. It appears that the first three texts are good for the first-time programmer. Any opinions on what qualities we'd like the text to have?
I think it a good plan to glance at these and other books, and have a (hopefully brief) discussion about which suits the group best. It appears that the first three texts are good for the first-time programmer. Any opinions on other qualities we'd like the text to have?
- Seems like a nice book, too. From the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python.
- Seems like a nice book, too. From the site:
- Seems like a nice book, too. From the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python.
- Seems like a nice book, too. From the site:
I think it a good plan to glance at these and other books, and have a (hopefully brief) discussion about which suits the group best. Any general ideas for exactly what qualities we'd like the text to have?
I think it a good plan to glance at these and other books, and have a (hopefully brief) discussion about which suits the group best. It appears that the first three texts are good for the first-time programmer. Any opinions on what qualities we'd like the text to have?
- An advanced text to use after learning the basics, listed as a 0.1 version, and this book recommends Byte of Python as an intro text.
- An advanced text to use after learning the basics, listed as a 0.1 version, and this book recommends Byte of Python as an intro text. Looks like it could be out of date, though.
- Also links to several other online books and resources
- Also links to several other online books and resources, available in a printable format.
- Seems like a nice book, too. Maybe a bit short, from the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python.
- Seems like a nice book, too. Maybe a bit short, from the site:
- Seems like a nice book, too. From the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python.
- Seems like a nice book, too. From the site:
- Dive into Python
- A book published by Apress, available in several formats for download.
- Thinking in Python
- An advanced text to use after learning the basics, listed as a 0.1 version, and this book recommends Byte of Python as an intro text.
Just something to give us a quick start.
Hello Python
hello_world()
hello_world()
Books
So, in order to work together, it seems we'll need a text to work from, but which book to use? The current books that have been recommended or mentioned are:
- Python Programming
- Also links to several other online books and resources
- Byte of Python
- Seems like a nice book, too. Maybe a bit short, from the site:
This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python.
- Seems like a nice book, too. Maybe a bit short, from the site:
I think it a good plan to glance at these and other books, and have a (hopefully brief) discussion about which suits the group best. Any general ideas for exactly what qualities we'd like the text to have?
def hello_world():
print 'Hello World!'
def hello_world(): print 'Hello World!'
Just something to give us a quick start.
Just something to give us a quick start.
def hello_world():
print 'Hello World!'
hello_world()
Just something to give us a quick start.
