•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 397,786 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,383 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 13650 | Replies: 3
![]() |
•
•
Join Date: Aug 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hey, I'm new to Python, as well as this message board, and I was wondering what some of the most useful and frequently-used commands are. I've so far only learned while, if, print, input # and words, and can make some basic programs only.
I've previously had experience in TI83 programming, so I know the basics. What are the commands for random integers, repeats, different text styles, etc?
EDIT: As long as I'm at it, does anyone know any good sites where I can easily check out scripts and the like?
I've previously had experience in TI83 programming, so I know the basics. What are the commands for random integers, repeats, different text styles, etc?
EDIT: As long as I'm at it, does anyone know any good sites where I can easily check out scripts and the like?
Last edited by pato : Aug 24th, 2006 at 7:22 pm.
To find experiments with the Python random module see:
http://www.daniweb.com/code/snippet306.html
For loops and function range() are covered in:
http://www.daniweb.com/code/snippet386.html
You can search the Python snippets and this forum for other things like lists, strings, dictionaries, tuples, file handling and so on.
Different text types are the realm of GUI programming with Tkinter for instance.
Here is an example of a Tkinter GUI program that sets a text font and uses random:
A good tutorial for beginners is in this online book:
http://www.ibiblio.org/g2swap/byteofpython/read/
http://www.daniweb.com/code/snippet306.html
For loops and function range() are covered in:
http://www.daniweb.com/code/snippet386.html
You can search the Python snippets and this forum for other things like lists, strings, dictionaries, tuples, file handling and so on.
Different text types are the realm of GUI programming with Tkinter for instance.
Here is an example of a Tkinter GUI program that sets a text font and uses random:
# display random sentences from a list using colorful Tkinter
from Tkinter import *
import random
black = '#000000'
blue = '#0000FF'
red = '#FF0000'
yellow = '#FFFF00'
lime = '#00FF00'
sentenceList = [
'the dog is on skates',
'the bird is on a plane',
'the pig rides the horse',
'the snake is on rollerskates',
'the fish drives a car']
def setText():
str1 = random.choice(sentenceList)
push1.config(text=str1)
#create the form
form1 = Tk()
# set the form's title
form1.title('Random Text')
# create a button
push1 = Button(form1, text='Click to set new text .............', command=setText)
# configure the button's text font and foreground/background colors
push1.config(height=3, font=('times', 20, 'bold'), fg=black, bg=yellow)
# pack the button into the frame
push1.pack(expand=YES, fill=BOTH)
# start the event loop (run the program)
form1.mainloop()A good tutorial for beginners is in this online book:
http://www.ibiblio.org/g2swap/byteofpython/read/
Last edited by Ene Uran : Aug 25th, 2006 at 12:17 pm.
drink her pretty
Richard Gruet has very good quick-reference of Python on his home page:
http://rgruet.free.fr/
The reference can be downloaded as HTML, zipped HTML or PDF file. It is in English.
http://rgruet.free.fr/
The reference can be downloaded as HTML, zipped HTML or PDF file. It is in English.
Last edited by bumsfeld : Aug 26th, 2006 at 1:31 pm.
•
•
Join Date: Aug 2005
Location: England - York
Posts: 136
Reputation:
Rep Power: 4
Solved Threads: 9
http://bembry.org/technology/python/index.php
Has a whole quick tutorial and it has notes on all the main topics it covers, so you can read it, or use it as a reference, i found the Tkinter section wickedly useful as a starter into gui stuff, it also has some exercises.
Has a whole quick tutorial and it has notes on all the main topics it covers, so you can read it, or use it as a reference, i found the Tkinter section wickedly useful as a starter into gui stuff, it also has some exercises.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
- Is there any place where you can find a complete list of python commands? (Python)
- blogspot cannot be crawled (to use in google sitemap generator) (Search Engine Optimization)
- very 1st python tutorial 4 newbies (Python)
Other Threads in the Python Forum
- Previous Thread: problem on len()
- Next Thread: raise in Text()



Linear Mode