On Thu, 7 Jul 2005, Nathan Pinno wrote:
> Why does invalid syntax popup?
> def lookup_login_command(site,filename):
> print "Lookup a login info card"
> site = raw_input("Site: ")
> if sitelist.has_key(site):
> print "The ID is: ",sitelist[site][0]
>
Alan G wrote:
>> Start your python interpreter and:
>>
> import sys sys.getrecursionlimit()
>> 1000
> help(sys.setrecursionlimit)
>
>
> Ooh, that's nice. When did the ability to tweak it programmatically
> appear? Or has it always been there and I've just never noticed?
It isn't in the
I should also add the most simple and obvious implementation which is also the
fastest:
class Test:
def __init__(self, dict):
self.somedict = dict
def updateit(self, **mydict):
errdict = {}
for k, v in mydict.iteritems():
if k not in self.somedict:
David Driver wrote:
> I have a function
>
> def updateit(self,**mydict):
>
> which is intended to update a dictionary self.somedict.
>
> If there are keys in mydict that are not in self.somedict I want them
> returned in a new dict.
>
> here is what i am doing now:
>
> errdict = dict([(a,b) f
I don't know if this will be useful to everyone, but I found the
O'Reilly book wasn't so helpful to those starting with Python and
moving to Jython (i.e., rather than starting with Java and not knowing
Python). I have yet to find Jython materials that are very good for
beginners - most everything
> I'm a semi-competent python user who has discovered that all the
> toolkits I really have use of are bound up in java classes. I can
cope
> with this, because there is Python, but I was wondering if anyone
who
> has spent more time around it than I have could spare any advice
that
> will make t
> Why does invalid syntax popup?
If you show us the error message it will probably tell us.
Thats what the error messages are for. They may look cryptic when
you start out but they generally give you a clue as to roughly
the right bit of the program and the reason.
Can you repost with the err
On Thu, 7 Jul 2005, Nathan Pinno wrote:
> Here is another error message:
>
> Traceback (most recent call last):
> File "D:\password.py", line 69, in ?
> main_menu()
> NameError: name 'main_menu' is not defined
Hi Nathan,
The error message is correct: there is no "main_menu()"
> Start your python interpreter and:
>
> >>> import sys
> >>> sys.getrecursionlimit()
> 1000
> >>> help(sys.setrecursionlimit)
Ooh, that's nice. When did the ability to tweak it programmatically
appear?
Or has it always been there and I've just never noticed?
Looks like a good candidate for use
> I wrote a recursive function a got this error how can
> I increase maximum recursion depth.
You have to go into the Python source code and change a
value then rebuild Python.
> And what is its default value?
1000 last time I looked.
But beware that increasing it too far can result in
sign
I'm a semi-competent python user who has discovered that all the
toolkits I really have use of are bound up in java classes. I can cope
with this, because there is Python, but I was wondering if anyone who
has spent more time around it than I have could spare any advice that
will make the adjustme
> Subject:
> Re: [Tutor] generating documentation for a module
> From:
> Wolfram Kraus <[EMAIL PROTECTED]>
> Date:
> Thu, 07 Jul 2005 16:17:11 +0200
> To:
> tutor@python.org
>
> To:
> tutor@python.org
>
>
> Mike Hansen wrote:
>
>> Is there a utility that generates documentation for your python
Here is the latest code, in case you need it:
# This is the code for a password protected program to store passwords.
password = "hello"
print "The Password Program"
print "Copyright 2005 Nathan Pinno."
print
answer = raw_input("What is the password? ")
while password != answer:
Here is another error message:
Traceback (most recent call last):
File "D:\password.py", line 69, in ?
main_menu()
NameError: name 'main_menu' is not defined
Thanks.
- Original Message -
From: "Nathan Pinno" <[EMAIL PROTECTED]>
To: "Danny Yoo" <[EMAIL PROTECTED]>
Here is the error:
File "D:\password.py", line 45
site = raw_input("Site: ")
^
SyntaxError: invalid syntax
HTH,
Nathan Pinno
- Original Message -
From: "Danny Yoo" <[EMAIL PROTECTED]>
To: "Nathan Pinno" <[EMAIL PROTECTED]>
Cc:
Sent: Thursday, July 07, 2
On Thu, 7 Jul 2005, Nathan Pinno wrote:
> Why does invalid syntax popup?
[text cut]
Hi Nathan,
What does the SyntaxError look like? Copy-and-paste that error message
and bring it to the Tutor list. One thing we want to help you do is
recognize what the SyntaxError is really trying to say,
Hi all,
Why does invalid syntax popup?
Here is the latest code:
# This is the code for a password protected program to store
passwords.password = "hello"print "The Password Program"print
"Copyright 2005 Nathan Pinno."printanswer = raw_input("What is the
password? ")whil
Jim Roush said unto the world upon 07/07/2005 12:42:
> I'm getting the following error message:
>
> AttributeError: 'tuple' object has no attribute 'seek'
>
> below is the code that produced the error. The line in question is
> marked with arrow in the left margin. Any help would be appr
Jim Roush wrote:
>I'm getting the following error message:
>
> AttributeError: 'tuple' object has no attribute 'seek'
>
>below is the code that produced the error. The line in question is
>marked with arrow in the left margin. Any help would be appreciated.
>
>def build_sp500_rand():
>
I'm getting the following error message:
AttributeError: 'tuple' object has no attribute 'seek'
below is the code that produced the error. The line in question is
marked with arrow in the left margin. Any help would be appreciated.
def build_sp500_rand():
sp500_csv = open('c:/indic
I have a function
def updateit(self,**mydict):
which is intended to update a dictionary self.somedict.
If there are keys in mydict that are not in self.somedict I want them
returned in a new dict.
here is what i am doing now:
errdict = dict([(a,b) for a,b in mydict.items() if not a in self.so
Mike Hansen wrote:
> Is there a utility that generates documentation for your python
> modules/scripts/programs based on their doc strings that looks similar to the
> library documentation on the python web site?
>
> What do you use to generate documentation for your python
> modules/scripts/pr
Is there a utility that generates documentation for your python
modules/scripts/programs based on their doc strings that looks similar to the
library documentation on the python web site?
What do you use to generate documentation for your python
modules/scripts/programs?
Mike
_
Hi,
I've read this:
http://www.python.org/workshops/1997-10/proceedings/shprentz.html
and some points look good:
- no hand coded SQL queries
- provide a cache
- objects insert and updates
- ...
but quite old too.
So the question is : what are the best practice to use python with a pgsql.
Ced
Mohammad Moghimi wrote:
> Hi there
> can you describe why last two lines print different numbers
>
> ---
> import struct
> struct.calcsize("lH")
> struct.calcsize("Hl")
> ---
Be
Negroup - wrote:
> Hi, in my application I need to generate a zip file (via the great
> zipfile module) and pass it from function A to function B. One way to
> do it is create the object from function A and write it on filesystem
> via close(). Then, function B will obtain the object reading the fi
Hi there
can you describe why last two lines print different numbers
---
import struct
struct.calcsize("lH")
struct.calcsize("Hl")
---
-- Mohammad
do you Python?!!
_
On 7/7/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I meant to ask why the main part after the password is not working right.
> No one has answered that yet. When I run the code and try to load a file
> that has been saved, a TypeError appears. How do I fix the code so no more
> e
Hi Mohammad!
I've never use a recursive function in python, but the error has the
same meaning as e.g in java.
Your function get's called and called without the end-criteria for the
recursive call is ever met.
I would suggest to check if the end-criteria of the recursive call is
correct.
I
Mohammad Moghimi wrote:
> Hi there
> I wrote a recursive function a got this error how can I increase
> maximum recursion depth. And what is its default value?
> -- Mohammad
> do you Python?!!
Start your python interpreter and:
>>> import sys
>>> sys.getrecursionlimit()
1000
>>> help(sys.setr
Hello!
I just looked a little over the code, what it is perhaps ment to do now.
As allready mentioned by Ziyad in your former post:
just call "main_menu()"
don't print main_menu()
This calls the funciton main_men(), which prints it menu and
after this the print-Command in this line
Hi there
I wrote a recursive function a got this error how can I increase
maximum recursion depth. And what is its default value?
-- Mohammad
do you Python?!!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Thu, 07 Jul 2005 11:03:00 +1200 (NZST)
[EMAIL PROTECTED] wrote:
> Quoting Michael Lange <[EMAIL PROTECTED]>:
>
> > I'm trying to write a python wrapper for the tkDnD Tk extension to add
> > drag and drop support
>
> Hi Michael,
>
> Just a side issue --- tkDnD seems to be broken in python 2.4
And please, please, post the whole error message, as it specifies where the error occurred.
Oh, yes, and I think I answered this -
"
I meant to ask why the main part after the password is not working right.
No one has answered that yet. When I run the code and try to load a file
that has been sa
On Thu, 2005-07-07 at 00:54 -0600, Nathan Pinno wrote:
> Hi all,
>
> Here's one of the messages that pops up:
>
> Traceback (most recent call last):
> File "D:\password.py", line 77, in ?
> filename == raw_input("Filename to load: ")
> NameError: name 'filename' is not defined
>
> Why i
Hi Nathan,
Other folks are pointing out why you're getting certain error messages.
You may also want to consider breaking up the long second-half of the
program into into its own set of functions. I believe that the second
half could look something like this:
##
while menu_choice != 9:
Hi, in my application I need to generate a zip file (via the great
zipfile module) and pass it from function A to function B. One way to
do it is create the object from function A and write it on filesystem
via close(). Then, function B will obtain the object reading the file
from disk. After this
How do I change it to a dictionary, then? Or do I have to delete it, and
just code it in the main part of the code?
- Original Message -
From: "Ewald Ertl" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 07, 2005 1:36 AM
Subject: Re: [Tutor] Why is this error showing up? (Origin
Hi!
on Thu, 7 Jul 2005 01:13:48 -0600 "Nathan Pinno" <[EMAIL PROTECTED]> wrote :
-
Nathan Pinno > Thanks Wolfram for help with that error.
Nathan Pinno >
Nathan Pinno > Here's another that popped up
Thanks Wolfram for help with that error.
Here's another that popped up:
Traceback (most recent call last):
File "D:\password.py", line 68, in ?
for x in site.keys():
AttributeError: 'str' object has no attribute 'keys'
How to fix it?
Thanks,
Nathan Pinno
- Original
You wrote filename == raw_input("Filename to load: ") instead of
filename = raw_input("Filename to load: ")
HTH,
Wolfram
Nathan Pinno wrote:
> Hi all,
>
> Here's one of the messages that pops up:
>
> Traceback (most recent call last):
> File "D:\password.py", line 77, in ?
> filename ==
41 matches
Mail list logo