Sean Perry wrote:
Ok, this may be slightly above tutor's level, but hey, never hurts to
ask (-:
__import__ is dark magic; generally those who venture into that realm
would do well to read the C source for Python..
I'm guessing that '.' is not in your sys.path, so Python isn't finding
the
Try this:
a=myClass()
b=myClass()
a.howmany()
a.count=0
del a
Does this help clear things up?
Todd Maynard
On Friday 23 December 2005 06:18, shivayogi kumbar wrote:
class myClass:
count = 0
def __init__(self):
Shivayogi,
Sorry my last e-mail wasn't very helpful.
Better would have been:
a=myClass()
b=myClass()
a.howmany()
myClass.count=0
del a
which will (hopefully) give you something like:
Exception exceptions.AssertionError: exceptions.AssertionError instance at
0xb7b1d12c in bound
Scott,
Take a look at setuptools: http://peak.telecommunity.com/DevCenter/setuptools
It should handle everything you are looking for with ease. Turbogears
( http://turbogears.org )is a real world project that uses it.
So far it seems to be flexible and reliabe for me.
Good Luck,
--Todd
How about changing it into a math quiz program?
You have the program output random problems (What is 14 * 3 ?)
And then you can output appropriate random insults, words of encouragement, or
praise as appropriate until the user gets the answer right. Just be careful
with division. You
Ignoring the python stuff for the moment
In answer to Question 1., You want to use Public Key authentication...this
will let you log in without a password.Google for SSH Public Key
Authentication will give you several hits for the howto's
One pretty good one was
Are you:
a.) Having trouble with the code and looking for help?
b.) Looking for suggestions on how to improve the code?
c.) Offering the code as a demo for Nathan et al.?
I was just doing stuff along the same lines and was having fun seeing the
different approaches to the same problem.
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
Not sure exactly what you have going wrong without the code or the exact url
you are using.
Does something like:
import urllib
page =
urllib.urlopen(http://slashdot.org/article.pl?sid=05/08/08/043236tid=126;).read()
print page
give you the correct results?
Is the problem specific to
Remember this problem from yesterday?
Take a look at the line before the one you are getting the error on.
And count the ('s and the )'s.
--Todd
On Sunday 31 July 2005 07:38 pm, Nathan Pinno wrote:
What the invalid syntax? Here is the error message:
SyntaxError: invalid syntax
File
I'd count the parenthesis on the prior line:
option = int(raw_input('Option (1,2,3,4,5,6,9): ')
while option != 9:
Also when you notice that you are copying and pasting the same line over and
over, it may be time to think about reorganizing the code a little bit (Once
you have it
How does the user indicate that they are done with the program?
One solution is to ask at the end of each iteration if they want to repeat.
Psuedocode:
keep_going=True
while(keep_going)
Run your program stuff
keep_going = get_user_response(Do you want to run again?)
--Todd
On
Looks like you are making some pretty good progress.
The short answer to your question is that the menu user input need to be
inside the while loop. That way cal_opt has a chance to change value before
it gets evaluated by the while loop again.
Another comment - the global cal_opt is
You are almost there.
Do you undestand why you are getting the output that you are getting?
Pretend that you are the computer and walk through what happens when you enter
9 at the menu:
while cal_opt != 9:
menu()
cal_opt = cal() # This is where you entered '9' so
Have you worked through the diveintopython.org tutorial/book? Chapter 6
covers file handling. If/When you get stuck post your code/question and ask
for help.
--Todd
On Saturday 30 July 2005 11:49 pm, Nathan Pinno wrote:
If anyone will help me learn file I/O, it would be appreciated. I went
15 matches
Mail list logo