Re: [Tutor] Why does my code show this?

2005-07-10 Thread Nathan Pinno
Thanks to all in the group. Mini_calc is now up and running successfully and is now available to download from my site. Thanks again, Nathan - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, July 10, 2005 5:03 PM

Re: [Tutor] Single Underscore

2005-07-10 Thread Kevin Reeder
Thanks for the info. I'll look into the links provided. > http://jaynes.colorado.edu/PythonGuidelines.html > http://www.python.org/peps/pep-0008.html Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] please help

2005-07-10 Thread Alan G
> The line that Ive been writing (of course wrong > script): > > f1 = open('myfile','r') > stuff = f1.read().split('\n') > for i in stuff: > if i != '//': >trcode = line.split('\t')[0] >trquant = line.split('\t')[1] >print trcode+'\t'+trquant > You use i in the for loop

Re: [Tutor] adding quotation marks around variables

2005-07-10 Thread Alan G
> Hello all, I am a college student and I am currently working > on a two numbers program for our class, The purpose of this > program is to take user input and do some math functions. So why not show us what you have come up with so far and we'll work from there? > I have figured out how to

Re: [Tutor] please help

2005-07-10 Thread Danny Yoo
On Sun, 10 Jul 2005, Srinivas Iyyer wrote: > I have a file that looks like this: > > // > AB32456\tTransaction from India > \t 43 \t 34 > \t 34 \t 65 > \t 12 \t 35 > // [some lines cut] > What I have to do: > // > AB32456\tTransaction from India > AB32456\t 43 \t 34 >

Re: [Tutor] Single Underscore

2005-07-10 Thread jfouhy
Quoting Kevin Reeder <[EMAIL PROTECTED]>: > What's the significance of naming a variable with a single > underscore as its first character? For example, I'm looking at > find.py in the standard library and it has variables named _debug > and _prune. Basically, it means "These variables are intern

Re: [Tutor] Single Underscore

2005-07-10 Thread Chinook
Kevin Reeder wrote: >What's the significance of naming a variable with a single >underscore as its first character? For example, I'm looking at >find.py in the standard library and it has variables named _debug >and _prune. > >Kevin >___ >Tutor maillist

[Tutor] Single Underscore

2005-07-10 Thread Kevin Reeder
What's the significance of naming a variable with a single underscore as its first character? For example, I'm looking at find.py in the standard library and it has variables named _debug and _prune. Kevin ___ Tutor maillist - Tutor@python.org http://

[Tutor] please help

2005-07-10 Thread Srinivas Iyyer
Hello group, after 4 months my brain became rusty by not solving problems. I need some help to regain my basic skills. my problem: I have a file that looks like this: // AB32456\tTransaction from India \t 43 \t 34 \t 34 \t 65 \t 12 \t 35 // AV32567\tTransaction from Si

Re: [Tutor] Why does my code show this?

2005-07-10 Thread Alan G
> cal_opt = int(raw_input("What option would you like: ")) Here you get the input and convert it to a number (int() ) which is fine. > if cal_opt == "1": But here you compare it to a string (see the quotes). So either remove the convertion to int() around raw_input or remove the quotes aroun

Re: [Tutor] What's going on with this code? Error message supplied.

2005-07-10 Thread Alan G
> Here's an error message: > >File "D:\GC.py", line 78 > cal_opt = cal_menu() > ^ > SyntaxError: invalid syntax > > The relevant code: > > option = main_menu() > if option == 1: > cal_menu() > cal_opt = cal_menu() Consistent indentation is all important in Pyth

Re: [Tutor] adding quotation marks around variables

2005-07-10 Thread Brian van den Broek
Robert said unto the world upon 10/07/2005 17:31: > Hello all, I am a college student and I am currently working on a two numbers > program for our class, The purpose of this program is to take user input and > do some math functions. > > I have figured out how to do the math but I need to disp

Re: [Tutor] adding quotation marks around variables

2005-07-10 Thread Brian van den Broek
Robert said unto the world upon 10/07/2005 17:31: > Hello all, I am a college student and I am currently working on a > two numbers program for our class, The purpose of this program is > to take user input and do some math functions. > > I have figured out how to do the math but I need to display

Re: [Tutor] adding quotation marks around variables

2005-07-10 Thread jfouhy
Quoting Robert <[EMAIL PROTECTED]>: > I have figured out how to do the math but I need to display these two > variables with quotation marks around them. > > Also I need to add these two variables together and display the > hexadecimal of these two variables??? > > Also how do you display wheat

[Tutor] adding quotation marks around variables

2005-07-10 Thread Robert
Hello all, I am a college student and I am currently working on a two numbers program for our class, The purpose of this program is to take user input and do some math functions.   I have figured out how to do the math but I need to display these two variables with quotation marks around the

Re: [Tutor] Another newbie question from Nathan.

2005-07-10 Thread Adam Bark
If I understand your problem correctly all you need to do is use the name of the function to call it ie: def func():     print "hello world" func() would give the output "hello world"On 7/10/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:   Hi all,  How do I make Python get a def? Is it the "get" f

Re: [Tutor] Why does my code show this?

2005-07-10 Thread geon
Nathan Pinno napsal(a): cal_opt = int(raw_input("What option would you like: ")) if cal_opt == "1":        .. your problem is in these two lines (and even more, but if you solve this, the others you get for free). try run just these two lines and guess, think abo

[Tutor] Why does my code show this?

2005-07-10 Thread Nathan Pinno
Hey all,   Thought I'd try a mini-calc. Here's the code:   # This is a small calculator.print "Mini Calculator"print "By Nathan Pinno"printprint "CALCULATE MENU"print "1) Add"print "2) Subraction"print "3) Multiplication"print "4) Division w/o remainder"print "5) Division wit

Re: [Tutor] What's going on with this code? Error message supplied.

2005-07-10 Thread Nathan Pinno
Here's an error message: File "D:\GC.py", line 78 cal_opt = cal_menu() ^ SyntaxError: invalid syntax The relevant code: option = main_menu() if option == 1: cal_menu() cal_opt = cal_menu() if cal_opt == 1: How do I fix this error? Nathan

Re: [Tutor] Another newbie question from Nathan.

2005-07-10 Thread Nathan Pinno
Hi all, How do I make Python get a def? Is it the "get" function, or something else? I need to know so that I can get a def for that computer MasterMind(tm) game that I'm writing. BTW, I took your advice, and wrote some definitions for my Giant Calculator program. Might make the code eas

Re: [Tutor] What's the invalid syntax? [What's the error mesaage?]

2005-07-10 Thread Nathan Pinno
I fixed this bug by myself, I had forgotten to add a print on a line by itself. - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Sunday, July 10, 2005 12:29 AM Subject: Re: [Tutor] What's the invalid syntax? [What's

Re: [Tutor] Learning Python with a Simple IM

2005-07-10 Thread Alan G
Hi Jorge, > I am a Java Developer that wants to learn Python by doing. > I am loving this initial vibe I'm getting out of Python. > However, because I feel programmers of a certain languages > bring with them certain vices when moving to other languages, Absolutely right, thats why its good to le

Re: [Tutor] What's going on with this code? Error message supplied.

2005-07-10 Thread Byron
Hi Nathan, It appears that you are just starting to learn the Python programming language. May I suggest that you check out the following FREE resources -- they will help to get you started and running smoothly with Python. Learning With Python http://www.greenteapress.com/thinkpython/ After

Re: [Tutor] Is it possible to...

2005-07-10 Thread Byron
Alan G wrote: >> I was just wondering if it is possible to use Python as a language to >> password protect a webpage? > > > Yes it is possible but you will need to have a web server that can run > Pyhon and there aren't too many of those on the internet... > > However, there are some hoste

[Tutor] Learning Python with a Simple IM

2005-07-10 Thread Jorge Louis De Castro
Hello,   I am a Java Developer that wants to learn Python by doing. I am loving this initial vibe I'm getting out of Python. However, because I feel programmers of a certain languages bring with them certain vices when moving to other languages, I'd like to have feedback from seasoned Pytho

Re: [Tutor] UnicodeDecodeError when copying files with Umlauten

2005-07-10 Thread Severin Kacianka
Hello, I finally could solve the problem on my own. These two articles helped me a lot: http://www.onlamp.com/pub/a/python/excerpt/pythonckbk_chap1/ http://www.reportlab.com/i18n/python_unicode_tutorial.html I simply had to ensure that all the file names I got from the m3u file were in unicode

Re: [Tutor] Looks like Giant Calc is a bust.

2005-07-10 Thread Alan G
> The Giant Calculator runs now, just not as I want it to. > I can't seem to get it past the main menu. See my other post. You are never returning the choice from the function so option is never changed from 0... -- option = 0 def main_menu(): print "OPTIONS MENU" print

Re: [Tutor] What's going on with this code? Error message supplied.

2005-07-10 Thread Alan G
Nathan, > Subject: [Tutor] What's going on with this code? Error message > supplied. > > Here is the error message: > > Traceback (most recent call last): > File "D:\GC.py", line 67, in ? >if option == 1: > NameError: name 'option' is not defined The error message tells you what is wrong,

Re: [Tutor] Can I use def without ( ) at the end?

2005-07-10 Thread Alan G
Nathan, > How do I make Python get a def? Is it the "get" function, or > something > else? I need to know so that I can get a def for that computer > MasterMind(tm) game that I'm writing. This sounds like you really don't understand what def does. Can I suggest you take time out to read about

Re: [Tutor] Is it possible to...

2005-07-10 Thread Alan G
> I was just wondering if it is possible to use Python as a language > to password protect a webpage? Yes it is possible but you will need to have a web server that can run Pyhon and there aren't too many of those on the internet... OTOH if its a privately owned web server then password protec