Re: [Tutor] Python Course at Foothill College

2006-09-17 Thread Elaine
Foothill is a community college (2-year college), and CIS is computer information systems. I always teach the fundamentals like how to write efficient, modifiable and documented software. This is an introductory course, so we won't be covering data structures and algorithms. We will cover files, Ex

Re: [Tutor] Python Course at Foothill College

2006-09-17 Thread Jonathon Sisson
I'll have to second that...my school is wrapped up with Java, C#, and Scheme. Python has all about ruined me for programming in other languages, and I really wish Python was taught/allowed at my school. I'm currently working on a team for CSC 480 (Senior Project - Design Phase) and we're forced t

Re: [Tutor] Python Course at Foothill College

2006-09-17 Thread Luke Paireepinart
Elaine wrote: > If you would like to learn Python, Foothill College in > Los Altos Hills, CA is offering a course starting > Mon. evening, 25 Sept. The course is designed for > students who are already familiar with some type of > programming. Here is the course description: > > CIS 68K "INTRODUC

[Tutor] Python Course at Foothill College

2006-09-17 Thread Elaine
If you would like to learn Python, Foothill College in Los Altos Hills, CA is offering a course starting Mon. evening, 25 Sept. The course is designed for students who are already familiar with some type of programming. Here is the course description: CIS 68K "INTRODUCTION TO PYTHON PROGRAMMING"

Re: [Tutor] python text adventures question

2006-09-17 Thread Luke Paireepinart
R. Alan Monroe wrote: > I just ran into the following link; it's a tutorial on writing adventure games (circa 1983): http://www.atariarchives.org/adventure Would anyone be interested in "porting" the examples over from BASIC to Python? It might make a fun

Re: [Tutor] Some questions about my yen-USD.py

2006-09-17 Thread Luke Paireepinart
Dick Moores wrote: > I'm bck! > > I kept getting ideas for what I (and some of you) thought was a > finished yen-USD.py. And some of the good advice I got was to move on > to other things. I did for a while, but I kept thinking up new > revisions. The script has more than doubled in length.

Re: [Tutor] python text adventures question

2006-09-17 Thread R. Alan Monroe
>>> I just ran into the following link; it's a tutorial on writing >>> adventure games (circa 1983): >>> >>>http://www.atariarchives.org/adventure >>> >>> Would anyone be interested in "porting" the examples over from BASIC to >>> Python? It might make a fun project for us here on Tutor; a

Re: [Tutor] Some questions about my yen-USD.py

2006-09-17 Thread Dick Moores
At 07:10 PM 9/17/2006, Amadeo Bellotti wrote: >ok i jsut wanted to say great program but i would like to see an >acutal exchange rate like maybe get it from a website it would be so >much nicer and easier to use also it would help linux users who run >from console so they dont have to look up th

Re: [Tutor] Some questions about my yen-USD.py

2006-09-17 Thread Amadeo Bellotti
ok i jsut wanted to say great program but i would like to see an acutal exchange rate like maybe get it from a website it would be so much nicer and easier to use also it would help linux users who run from console so they dont have to look up the current rate online On 9/17/06, Dick Moores <[EMAIL

Re: [Tutor] Some questions about my yen-USD.py

2006-09-17 Thread Dick Moores
I'm bck! I kept getting ideas for what I (and some of you) thought was a finished yen-USD.py. And some of the good advice I got was to move on to other things. I did for a while, but I kept thinking up new revisions. The script has more than doubled in length. I'd previously posted v4 at <

Re: [Tutor] i just cant do it

2006-09-17 Thread Ivan Shevanski
(if I'm getting this right)Think of it as saving file 'hello.txt' in /usr/bin/some_random_folder_you_madeThen in the terminal, you try to open the file by typing 'gedit hello.txt'.  It has no idea where to look. [I'm a noob too, so if I got it wrong don't flame me too bad ;)   ]On 9/17/06, Alan Ga

Re: [Tutor] urllib

2006-09-17 Thread Patricia
Hi again, I was able to use urllib2_file, which is a wrapper to urllib2.urlopen(). It seems to work fine, and I'm able to retrieve the contents of the file using: afile = req.form.list[1].file.read() Now I have to store this text file (which is about 500k) and an id number into a mysql database

Re: [Tutor] i just cant do it

2006-09-17 Thread Alan Gauld
> When i try this it works > > #!/usr/bin/python > > import Cookie > C = Cookie.SimpleCookie() > C['adminuser'] = 'fedekiller' > C['adminuser']['max-age'] = 60*60*24*7 > print C > print "Content-Type: text/html\n\n" > print "Bienvenido",C['adminuser'].value,'!' > > > but when i try this it does

Re: [Tutor] Cookie help

2006-09-17 Thread Kent Johnson
federico ramirez wrote: > Hey, im working on a cgi script, just a simple news system. > And im stucked with the login system. > GOD! I hate being a noob! > Well, this is the login page > > > #!/usr/bin/python > > import cgi, dbm, string, Cookie > import config > r

Re: [Tutor] i just cant do it

2006-09-17 Thread Kent Johnson
federico ramirez wrote: > well, im very angry :( > I cant get this to work > > When i try this it works > > #!/usr/bin/python > > import Cookie > C = Cookie.SimpleCookie() > C['adminuser'] = 'fedekiller' > C['adminuser']['max-age'] = 60*60*24*7 > print C > print "Content-Type: text/html\n\n" > p

Re: [Tutor] python text adventures question

2006-09-17 Thread Danny Yoo
> I came across the following and wondered if anyone had followed up on this [old message follows:] >> I just ran into the following link; it's a tutorial on writing >> adventure games (circa 1983): >> >>http://www.atariarchives.org/adventure >> >> Would anyone be interested in "porting" t

Re: [Tutor] i just cant do it

2006-09-17 Thread Luke Paireepinart
federico ramirez wrote: > well, im very angry :( > I cant get this to work > > When i try this it works > > #!/usr/bin/python > > import Cookie > C = Cookie.SimpleCookie() > C['adminuser'] = 'fedekiller' > C['adminuser']['max-age'] = 60*60*24*7 > print C > print "Content-Type: text/html\n\n" > prin

Re: [Tutor] Lists in lists

2006-09-17 Thread Brian van den Broek
Kent Johnson said unto the world upon 16/09/06 07:49 PM: > Brian van den Broek wrote: >> Kent Johnson said unto the world upon 16/09/06 04:35 PM: >>> Brian van den Broek wrote: > You say you are new to Python. Well, it might not now be obvious why dictionaries are especially useful, but

[Tutor] i just cant do it

2006-09-17 Thread federico ramirez
well, im very angry :(I cant get this to workWhen i try this it works#!/usr/bin/pythonimport CookieC = Cookie.SimpleCookie()C['adminuser'] = 'fedekiller'C['adminuser']['max-age'] = 60*60*24*7 print Cprint "Content-Type: text/html\n\n"print "Bienvenido",C['adminuser'].value,'!'but when i try this it

Re: [Tutor] folder and module

2006-09-17 Thread Brian van den Broek
linda.s said unto the world upon 17/09/06 02:03 PM: > I checked sys.path and environemntal variables: > since the desktop directory is not listed in either of them, > why there is no error report when I import a module which is in the > desktop into test.py which is under a different folder? > L

Re: [Tutor] folder and module

2006-09-17 Thread linda.s
On 9/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > >> listed in the variable sys.path. sys.path gets populated when > >> Python starts up and includes some standard locations plus > >> any you define in your PYTHONPATH environment variable. > >> > > I checked my PYTHONPATH environment variable > >

Re: [Tutor] exit app withour raise ?

2006-09-17 Thread Dave S
On Sunday 17 September 2006 17:54, Alan Gauld wrote: > > In the middle of an application, if someone presses the quit button > > I want to > > exit. At the moment i > > > > raise 'Quit button pressed' > > > > which works but spews a stack trace leading to the raise statement. > > Is there a > > nea

Re: [Tutor] From byte[] to Image

2006-09-17 Thread Alan Gauld
> (Note that this function decodes pixel data only, not entire images. > If you > have an entire image file in a string, wrap it in a *StringIO* > object, and > use > *open*to > load it.) > > So I guess "frombuffer" must not be used in my case. Looks like it, but did you try what it suggested,

Re: [Tutor] exit app withour raise ?

2006-09-17 Thread Alan Gauld
> In the middle of an application, if someone presses the quit button > I want to > exit. At the moment i > > raise 'Quit button pressed' > > which works but spews a stack trace leading to the raise statement. > Is there a > neat way to just exit without a stack trace ? raise SystemExit or more

Re: [Tutor] environment variables

2006-09-17 Thread Alan Gauld
> since user variables override system variables, why we need do > anything related to python in the system variables? Why not delete > the > value in the system variable and add to it to define the user > variable? System variables apply to all users, so if you want every user of the computer to

Re: [Tutor] From byte[] to Image

2006-09-17 Thread Ziad Rahhal
Hi Alan, The Library I am using is the PIL. And I read the Docs, they say the following about "frombuffer" operation: (Note that this function decodes pixel data only, not entire images. If you have an entire image file in a string, wrap it in a StringIO object, and use open to load it.) So I gu

Re: [Tutor] folder and module

2006-09-17 Thread Alan Gauld
>> listed in the variable sys.path. sys.path gets populated when >> Python starts up and includes some standard locations plus >> any you define in your PYTHONPATH environment variable. >> > I checked my PYTHONPATH environment variable > My questions are: > 1. since the desktop directory is not li

Re: [Tutor] exit app withour raise ?

2006-09-17 Thread Kent Johnson
Dave S wrote: > In the middle of an application, if someone presses the quit button I want to > exit. At the moment i > > raise 'Quit button pressed' > > which works but spews a stack trace leading to the raise statement. Is there > a > neat way to just exit without a stack trace ? sys.exit()

[Tutor] exit app withour raise ?

2006-09-17 Thread Dave S
In the middle of an application, if someone presses the quit button I want to exit. At the moment i raise 'Quit button pressed' which works but spews a stack trace leading to the raise statement. Is there a neat way to just exit without a stack trace ? Dave

Re: [Tutor] Problems with Python Modules

2006-09-17 Thread Kent Johnson
Will Shattuck wrote: > Hi all, > > I'm trying to install some python mud engines, but I keep running into > problems with the software not seeing python modules. Could this be > due to environment variables missing on my system? Here is an example > of the most recent error message using the Inn

Re: [Tutor] folder and module

2006-09-17 Thread Liam Clarke
Hi Linda, At your Python prompt try the following: >>> import sys >>> print sys.path What directories are listed there? On 9/17/06, linda.s <[EMAIL PROTECTED]> wrote: > > > i have test.py under c:\try1\new; > > > I want to import b and b.py is under c:\trytry. How to do it? > > > Also, I impor

Re: [Tutor] Cookie help

2006-09-17 Thread Kent Johnson
federico ramirez wrote: > Hey, im working on a cgi script, just a simple news system. > And im stucked with the login system. > GOD! I hate being a noob! > Well, this is the login page > > > #!/usr/bin/python > > import cgi, dbm, string, Cookie > import config > r

[Tutor] environment variables

2006-09-17 Thread linda.s
Hi there, I found the following paragraph in the web: environment variables on Windows come in two flavors: user variables and system variables. In particular, if there is a system variable PYTHONPATH and you are adding this as a user variable, start with the value in the system variable and add to

Re: [Tutor] folder and module

2006-09-17 Thread linda.s
> > i have test.py under c:\try1\new; > > I want to import b and b.py is under c:\trytry. How to do it? > > Also, I import c and c.py is in the desktop folder but no error > > reported. > > Python imports modules by looking for them in the folders > listed in the variable sys.path. sys.path gets po

Re: [Tutor] folder and module

2006-09-17 Thread Liam Clarke
Hi Linda, As Alan said, you can modify your sys.path at runtime - to clarify, a simple example is: >>> import sys >>> sys.path.append("c:/trytry") "import b" should now work. Regards, Liam Clarke On 9/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > Linda, > > > i have test.py under c:\try1\new

Re: [Tutor] folder and module

2006-09-17 Thread Alan Gauld
Linda, > i have test.py under c:\try1\new; > I want to import b and b.py is under c:\trytry. How to do it? > Also, I import c and c.py is in the desktop folder but no error > reported. Python imports modules by looking for them in the folders listed in the variable sys.path. sys.path gets popula