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
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
> 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
> 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
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
>
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
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
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://
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
> 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
> 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> 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
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,
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
> 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
30 matches
Mail list logo