Re: [Tutor] Question About chdir()

2005-08-08 Thread Ewald Ertl
Hi Don! Don Parris wrote: The book, Programming Python, shows an example of os.chdir() on the Windows platform, as follows: os.chdir(r'c:\temp') r ... raw Strings. There will no substitution be processed. Otherwise the \t ( Tab ) will be inserted in the string: print a\tb a b

Re: [Tutor] Question About chdir()

2005-08-08 Thread python-tutor
Let's see if I can get this right.as I am working on memory and not enough sleep. The 'r' means that using a raw string so the backslashes aren't escaped out The equivalent without using the 'r' would be: os.chdir('c:\\temp') --Todd On Monday 08 August 2005 03:07 am, Don Parris

Re: [Tutor] Question about resetting values

2005-08-03 Thread Nathan Pinno
: Tuesday, August 02, 2005 2:45 PM Subject: Re: [Tutor] Question about resetting values I am writing a Blackjack program, and was wondering how to reset the values to zero, e.g. cash = 0? Yes, that's how you do it. Now what is the bit you don't understand? Alan G Author of the Learn

Re: [Tutor] Question

2005-08-02 Thread Alan G
Just curious to wonder if Python can be used to write a program to check an HTTP mail server for mail, Yes, you would probably use the urllib module for that. and check more than one server, Yes that would be a fairly typical use for Python as a web client. even if they are using

Re: [Tutor] Question about BASIC and Python

2005-08-02 Thread Alan G
I had a co-worker say to me at work that Python was related to or based upon BASIC. Is this true, and if not, how can I tell my friend why they are similar? Both Python and BASIC are interpreted languages intended to be used (amongst other things) to learn how to program. There the

[Tutor] Question about resetting values

2005-08-02 Thread Nathan Pinno
I am writing a Blackjack program, and was wondering how to reset the values to zero, e.g. cash = 0? Thanks, Nathan Pinno,Crew, Camrose McDonalds and owner/operator of Woffee BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan;Paul;Mr. FN:Pinno, Nathan Paul ORG:Woffee;Executive TITLE:Owner/operator

[Tutor] question on numarray across platforms

2005-08-01 Thread Xiangyi Meng
Hi there, I ran across this error when running a few lines of code in debian python, but this runs perfectly in windows python. Basically I created a dummy matrix called gamma (using kroneckerproduct in numarray) and printed out its mean. Here is the code: gamma = kroneckerproduct(ones((N,

[Tutor] question on string

2005-08-01 Thread Gilbert Tsang
Hi there, I would like to construct some string objects using the cprintf-style format: command_string = diff -u %s %s %s.patch % ( src, dst, file ) Of course it is illegal in python but I couldn't figure out a way to construct strings with that kind of formatting and substitution. I have

Re: [Tutor] question on string

2005-08-01 Thread Kent Johnson
Gilbert Tsang wrote: Hi there, I would like to construct some string objects using the cprintf-style format: command_string = diff -u %s %s %s.patch % ( src, dst, file ) Of course it is illegal in python but I couldn't figure out a way to construct strings with that kind of

Re: [Tutor] question on numarray across platforms

2005-08-01 Thread Danny Yoo
On Mon, 1 Aug 2005, Xiangyi Meng wrote: I ran across this error when running a few lines of code in debian python, but this runs perfectly in windows python. Hi Xiangyi, This seems a bit specific to numarray; you may want to ask the Numeric discussion group:

Re: [Tutor] question on string

2005-08-01 Thread Danny Yoo
On Mon, 1 Aug 2005, Kent Johnson wrote: I would like to construct some string objects using the cprintf-style format: command_string = diff -u %s %s %s.patch % ( src, dst, file ) Of course it is illegal in python but I couldn't figure out a way to construct strings with that kind

Re: [Tutor] question on string

2005-08-01 Thread Alan G
I would like to construct some string objects using the cprintf-style format: command_string = diff -u %s %s %s.patch % ( src, dst, file ) Should work - assuming the 3 variables are defined! Although file is a bad name for a variable since its also the name of the function for opening

Re: [Tutor] question on string

2005-08-01 Thread Bob Gailer
At 10:42 AM 8/1/2005, Gilbert Tsang wrote: Hi there, I would like to construct some string objects using the cprintf-style format: command_string = diff -u %s %s %s.patch % ( src, dst, file ) Of course it is illegal in python How did you conclude that? diff -u %s %s %s.patch % ( src, dst,

Re: [Tutor] question on string

2005-08-01 Thread Gilbert Tsang
Thank you all for the enthusiastic responses. It must have been other part of the script since the command string construction now works. I also realized that "file" is a poor choice of variable name. Thanks Danny for telling me about the subprocess module. Best regards, Gilbert. ZIYAD A.

[Tutor] Question about BASIC and Python

2005-08-01 Thread Nathan Pinno
Hi all, I had a co-worker say to me at work that Python was related to or based uponBASIC. Is this true, and if not, how can I tell my friend why they are similar? Nathan Pinno,Crew, Camrose McDonalds and owner/operator of Woffee BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan;Paul;Mr. FN:Pinno,

Re: [Tutor] Question about BASIC and Python

2005-08-01 Thread Liam Clarke
Erm erm erm having used Visual Basic, XBasic and QBasic, I can honestly say, that about the only similarity is that VB is more or less object orientated, and that they use modules. On 8/2/05, Nathan Pinno [EMAIL PROTECTED] wrote: Hi all, I had a co-worker say to me at work

Re: [Tutor] Question about BASIC and Python

2005-08-01 Thread Bob Gailer
At 06:13 PM 8/1/2005, Nathan Pinno wrote: Hi all, I had a co-worker say to me at work that Python was related to or based upon BASIC. Is this true, and if not, how can I tell my friend why they are similar? There are many versions of BASIC (Beginners All-Purpose Symbolic Instruction Code) (or

[Tutor] QUESTION

2005-08-01 Thread Jane MUIRI
Hi! I'd like to know what kind of Python I can download. I've tried but in vain! My computer is windows xp servixe pack 1, version 2002. Please, tell me what to do. Jane. _ Express yourself instantly with MSN Messenger! Download

Re: [Tutor] Question about BASIC and Python

2005-08-01 Thread Nathan Pinno
Thanks Bob and Liam. I was wondering myself. - Original Message - From: Bob Gailer To: Nathan Pinno ; Tutor mailing list Sent: Monday, August 01, 2005 11:09 PM Subject: Re: [Tutor] Question about BASIC and Python At 06:13 PM 8/1/2005, Nathan Pinno wrote

Re: [Tutor] QUESTION

2005-08-01 Thread Liam Clarke
This link - http://www.python.org/ftp/python/2.4.1/python-2.4.1.msi straight from the python.org website is for a Windows installer. May I also recommend this - http://wiki.python.org/moin/BeginnersGuide The Python Beginner's Guide? Good luck, Liam ClarkeOn 8/2/05, Jane MUIRI [EMAIL

[Tutor] question on numarray in python

2005-07-30 Thread Xiangyi Meng
Hi there, I ran across this error when running a few lines of code in debian python, but this runs perfectly in windows python. Basically I created a dummy matrix called gamma (using kroneckerproduct in numarray) and printed out its mean. Here is the code: gamma = kroneckerproduct(ones((N,

Re: [Tutor] question about programmers

2005-06-22 Thread John Purser
If that's your only question about programmers then you aint been around them much. I'm 45. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 14:38 To: tutor@python.org Subject: [Tutor] question

Re: [Tutor] question about programmers

2005-06-22 Thread Alan G
What's the average age of a python user? This is my only question about programmers themselves. There was a thread on this on comp.lang.python recently. Try searching google groups and you should find literally hundreds of replies! From memory average was around 30 but with a distribution

[Tutor] question about comma delineated text

2005-06-19 Thread nephish
Hey there, i have some log files that i want to be able to work with. the lines of the log files are comma - delineated. i want to put those into a database where each piece of info (comma delineated) would be the fields of the database. ok, so the first obstacle is learning how to make a list

Re: [Tutor] question about comma delineated text

2005-06-19 Thread Kent Johnson
nephish wrote: Hey there, i have some log files that i want to be able to work with. the lines of the log files are comma - delineated. i want to put those into a database where each piece of info (comma delineated) would be the fields of the database. ok, so the first obstacle is

[Tutor] question about hiding a function/method in a class

2005-06-03 Thread Mike Hansen
I haven't done much OO in Python yet. For various web apps we write, we usually write up a DB schema in a spreadsheet. Then we write the sql script that would create the tables in the database. I thought it would be neat to save the spreadsheet as a csv file and have python write the sql

Re: [Tutor] question about hiding a function/method in a class

2005-06-03 Thread Kent Johnson
Mike Hansen wrote: class DBField(object): def __init__(self, fieldName): self.fieldName = fieldName self.type = self.size = 0 self.notNull = False self.unique = False self.references = self.default = def

Re: [Tutor] question about hiding a function/method in a class

2005-06-03 Thread Mike Hansen
Subject: Re: [Tutor] question about hiding a function/method in a class From: Kent Johnson [EMAIL PROTECTED] Date: Fri, 03 Jun 2005 09:45:20 -0400 CC: tutor@python.org Mike Hansen wrote: class DBField(object): def __init__(self, fieldName): self.fieldName

Re: [Tutor] question about hiding a function/method in a class

2005-06-03 Thread Alan G
I haven't done much OO in Python yet. For various web apps we write, we usually write up a DB schema in a spreadsheet. Wow! How exactly do you represent a schema in a spreadsheet? I confess I cannot conceive of such a thing. Can you send a representative sample to illustrate? create the

Re: [Tutor] question about hiding a function/method in a class

2005-06-03 Thread Mike Hansen
Alan G wrote: I haven't done much OO in Python yet. For various web apps we write, we usually write up a DB schema in a spreadsheet. Wow! How exactly do you represent a schema in a spreadsheet? I confess I cannot conceive of such a thing. Can you send a representative sample to

Re: [Tutor] question about hiding a function/method in a class

2005-06-03 Thread Alan G
Maybe it's not a schema exactly. |Table Name|Fields |Type |Size|Primary Key|Not Null|Unique|Foreign Key| ... |'s represent each cell. It's just a way to organize your thoughts, and have something a little more readable than an SQ script for a DB schema. There's been less than 20 tables

[Tutor] Question regarding the len function of a list while using a loop

2005-04-14 Thread Ben Markwell
Could somebody explain to me why the code I used to complete this exercise doesn't work. And how do you send an integer to len? Thanks Ben == As an exercise, write a loop that traverses a list and prints the length of each element. What happens if you send an

Re: [Tutor] Question regarding the len function of a list while using a loop

2005-04-14 Thread Max Noel
On Apr 14, 2005, at 14:14, Ben Markwell wrote: Could somebody explain to me why the code I used to complete this exercise doesn't work. And how do you send an integer to len? Well, I think you've successfully completed that exercise. len() doesn't work on integers because integers don't have a

RE: [Tutor] Question regarding the len function of a list while using aloop

2005-04-14 Thread Alberto Troiano
this sentence: for element in foo: print len(element) Regards AlbertoFrom: Ben Markwell [EMAIL PROTECTED] Reply-To: Ben Markwell [EMAIL PROTECTED] To: Python Tutor tutor@python.org Subject: [Tutor] Question regarding the len function of a list while using aloop Date: Thu, 14 Apr 2005 08:14:12 -0400

Re: [Tutor] Question regarding the len function of a list while using a loop

2005-04-14 Thread Brian van den Broek
Ben Markwell said unto the world upon 2005-04-14 08:14: Could somebody explain to me why the code I used to complete this exercise doesn't work. And how do you send an integer to len? Thanks Ben == *As an exercise, write a loop that traverses a list and prints

Re: [Tutor] Question regarding the len function of a list while using a loop

2005-04-14 Thread Ben Markwell
Yes this does make sense. Thank youOn 4/14/05, Brian van den Broek [EMAIL PROTECTED] wrote: Ben Markwell said unto the world upon 2005-04-14 08:14: Could somebody explain to me why the code I used to complete this exercise doesn't work. And how do you send an integer to len? Thanks Ben

Re: [Tutor] Question about Frames and Scrollbars

2005-04-13 Thread Alberto Troiano
The second option will do the trick. I use Pmw.Combobox but I didn't know there was a ScrolledFrame Thanks a lot Regards Alberto GauchoFrom: [EMAIL PROTECTED] To: "tutor@python.org" tutor@python.org Subject: Re: [Tutor] Question about Frames and Scrollbars Date: Wed, 13 Apr 2005 10:1

[Tutor] Question about Frames and Scrollbars

2005-04-12 Thread Alberto Troiano
Hi everyone I don't know if anyone posted something similar but I'll shoot. Is there anyway to Scroll over a Frame?? Let me put this under water. I made a 2D blueprint inside a frame. I'm creating labels dynamically depending on how many rows and columns I want. Suppose you have an 8x8 matriz of

Re: [Tutor] Question about Frames and Scrollbars

2005-04-12 Thread jfouhy
A couple of options... You can pack a scrollbar on the right hand side of the containing frame and use the yscrollcommand option to associate it with the frame --- see Fredrik Lundh's Tkinter pages for an example. Or you could grab Python MegaWidgets from http://pmw.sourceforge.com/ and use a

[Tutor] Question about urllib module?

2005-03-28 Thread libsvm
Dear all, I was learning how to use the urllib, BUT there is nothing printed out in the following example. Could anyone hellp me or tell why? import urllib params = urllib.urlencode({'DN':'Adrenal glands disorders'}) address=http://xin.cz3.nus.edu.sg/group/cjttd/List.asp?SetQuery=Y; f =

Re: [Tutor] question about expressing mathematical equations

2005-02-05 Thread alieks lao
I've spent hours trying things out and I'm no better off. I don't understand exactly what I'm supposed to do... alieks__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Re: [Tutor] question about expressing mathematical equations

2005-02-05 Thread Alan Gauld
I've spent hours trying things out and I'm no better off. I don't understand exactly what I'm supposed to do... alieks The tutor you are using is fairly specialised. What are you trying to learn? Python or math in Python? To learn Python use one of the other tutorials that focus on Pyhon

Re: [Tutor] question about expressing mathematical equations

2005-02-04 Thread Danny Yoo
On Fri, 4 Feb 2005, alieks lao wrote: Once again i have a question concerning something from the tutorial im being tortured by. ___ x.y= \ x (dot)y(dot) /__ i i How would i express this in python. If the above doesn't make any sense to ya'll. It's at the bottom

Re: [Tutor] question regarding python exception handling

2005-01-30 Thread Danny Yoo
On Sat, 29 Jan 2005, Roy wrote: I am learning about python exception handling. I am reading Python in a Nutshell. In the chapter of exception handling, it says: Note that the try/finally form is distinct from the try/except form: a try statement cannot have both except and finally clauses,

Re: [Tutor] question regarding python exception handling

2005-01-30 Thread Alan Gauld
a Nutshell. In the chapter of exception handling, it says: Note that the try/finally form is distinct from the try/except form: a try statement cannot have both except and finally clauses, as execution order might be ambiguous. I don't understand the reason why except and finally clauses

[Tutor] question regarding python exception handling

2005-01-29 Thread Roy
Hello, there: I am learning about python exception handling. I am reading Python in a Nutshell. In the chapter of exception handling, it says: Note that the try/finally form is distinct from the try/except form: a try statement cannot have both except and finally clauses, as execution order might

<    5   6   7   8   9   10