Re: NameError: name '__version__' is not defined

2023-10-27 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2023-10-27 09:29 +0200: > ... >For the application with the system Python this mechanism works, but for >the non-system Python I get the error: > > NameError: name '__version__' is not defined If you get exceptions (they usually end in `Error` (such as `NameError`)), look a

Re: NameError: name '__version__' is not defined

2023-10-27 Thread Loris Bennett via Python-list
"Loris Bennett" writes: > "Loris Bennett" writes: > >> Hi, >> >> I have two applications. One uses the system version of Python, which >> is 3.6.8, whereas the other uses Python 3.10.8 installed in a non-system >> path. For both applications I am using poetry with a pyproject.toml >> file whic

Re: NameError: name '__version__' is not defined

2023-10-27 Thread Loris Bennett via Python-list
"Loris Bennett" writes: > Hi, > > I have two applications. One uses the system version of Python, which > is 3.6.8, whereas the other uses Python 3.10.8 installed in a non-system > path. For both applications I am using poetry with a pyproject.toml > file which contains the version information

Re: NameError: name 'msvcrt' is not defined

2019-09-26 Thread MRAB
On 2019-09-27 03:14, Hongyi Zhao wrote: Hi, I use python on Debian, when running some python codes, I meet the following error: --- input_username.py", line 18, in read_input if msvcrt.kbhit(): NameError: name 'msvcrt' is not defined How to solve this issue? That

Re: NameError

2016-11-25 Thread Cai Gengyang
I can't import it --- keep getting an importerror message. Can you try, let me know if it works and show me the code ? Thanks alot , appreciate it ... On Thu, Nov 24, 2016 at 1:22 PM, Nathan Ernst wrote: > I don't see anything in that output resembling an error, just a few > warnings that some f

Re: NameError

2016-11-24 Thread Cai Gengyang
This is what I got : CaiGengYangs-MacBook-Pro:~ CaiGengYang$ /usr/local/bin/python3 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pygame Traceback (

Re: NameError

2016-11-24 Thread Michael Torrie
As alister said, please do not just hit reply and type your message at the top. Instead, place your reply below the quoted text you are replying too. This is not hard. I realize there's a language barrier, but please patiently read what alister said and understand what he's saying. I know you're

Re: NameError

2016-11-24 Thread alister
On Thu, 24 Nov 2016 07:25:37 -0800, Cai Gengyang wrote: > I mean whats the solution to import pygame ? How to import pygame ? > > > On Thursday, November 24, 2016 at 11:22:07 PM UTC+8, alister wrote: >> On Thu, 24 Nov 2016 07:09:22 -0800, Cai Gengyang wrote: >> >> > Hmm, so whats the solution ?

Re: NameError

2016-11-24 Thread Cai Gengyang
CaiGengYangs-MacBook-Pro:~ CaiGengYang$ pip install pygame Collecting pygame Could not find a version that satisfies the requirement pygame (from versions: ) No matching distribution found for pygame You are using pip version 7.1.2, however version 9.0.1 is available. You should consider upgradi

Re: NameError

2016-11-24 Thread Cai Gengyang
I mean whats the solution to import pygame ? How to import pygame ? On Thursday, November 24, 2016 at 11:22:07 PM UTC+8, alister wrote: > On Thu, 24 Nov 2016 07:09:22 -0800, Cai Gengyang wrote: > > > Hmm, so whats the solution ? > > > > > The solution is to bottom post or interleave post as pre

Re: NameError

2016-11-24 Thread alister
On Thu, 24 Nov 2016 07:09:22 -0800, Cai Gengyang wrote: > Hmm, so whats the solution ? > > The solution is to bottom post or interleave post as previously stated > > On Thursday, November 24, 2016 at 11:07:05 PM UTC+8, alister wrote: >> On Thu, 24 Nov 2016 06:00:20 -0800, Cai Gengyang wrote: >

Re: NameError

2016-11-24 Thread alister
On Thu, 24 Nov 2016 06:00:20 -0800, Cai Gengyang wrote: > CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame -bash: import: > command not found > > > please do not top post as it makes the threads difficult to follow the preferred style is interleave posing (posting a reply after the text yo

Re: NameError

2016-11-24 Thread Cai Gengyang
CaiGengYangs-MacBook-Pro:~ CaiGengYang$ python Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pygame Traceback (most recent call last): File "", li

Re: NameError

2016-11-24 Thread Cai Gengyang
Hmm, so whats the solution ? On Thursday, November 24, 2016 at 11:07:05 PM UTC+8, alister wrote: > On Thu, 24 Nov 2016 06:00:20 -0800, Cai Gengyang wrote: > > > CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame -bash: import: > > command not found > > > > > > > please do not top post as

Re: NameError

2016-11-24 Thread Thomas Nyberg
On 11/24/2016 09:00 AM, Cai Gengyang wrote: CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame -bash: import: command not found That indicates you're running "import pygame" at the bash interpreter prompt. You should first start "python" (type the word python without quotes and press enter

Re: NameError

2016-11-24 Thread Cai Gengyang
CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame -bash: import: command not found On Thursday, November 24, 2016 at 1:22:56 PM UTC+8, Nathan Ernst wrote: > I don't see anything in that output resembling an error, just a few > warnings that some features may no be available. > > Have you tr

Re: NameError

2016-11-23 Thread Nathan Ernst
I don't see anything in that output resembling an error, just a few warnings that some features may no be available. Have you tried importing pygame after you did that? That's what'll prove one way or another that it worked. Regards, Nate On Wed, Nov 23, 2016 at 10:48 PM, Cai Gengyang wrote: >

Re: NameError

2016-11-23 Thread Cai Gengyang
Yea, using Mac Following the instructions here for Mac ---https://bitbucket.org/pygame/pygame/issues/82/homebrew-on-leopard-fails-to-install#comment-627494 GengYang Cai CaiGengYangs-MacBook-Pro:~ CaiGengYang$ brew install python ==> Installing dependencies for python: xz, pkg-config, readline,

Re: NameError

2016-11-23 Thread Thomas Nyberg
On 11/23/2016 10:02 PM, Cai Gengyang wrote: I tried to import pygame by using these commands https://www.google.com.sg/#q=how+to+import+pygame but this is the error I got : CaiGengYangs-MacBook-Pro:~ CaiGengYang$ sudo apt-get install python-pygam

Re: NameError

2016-11-23 Thread Cai Gengyang
I tried to import pygame by using these commands https://www.google.com.sg/#q=how+to+import+pygame but this is the error I got : CaiGengYangs-MacBook-Pro:~ CaiGengYang$ sudo apt-get install python-pygame sudo: apt-get: command not found On Thurs

Re: NameError

2016-11-23 Thread Joel Goldstick
On Wed, Nov 23, 2016 at 9:44 PM, Cai Gengyang wrote: pygame.draw.rect(screen, BROWN, [60, 400, 30, 45]) > Traceback (most recent call last): > File "", line 1, in > pygame.draw.rect(screen, BROWN, [60, 400, 30, 45]) > NameError: name 'pygame' is not defined > > How to solve this error ? > --

Re: NameError: name 'requests' is not defined ?

2014-07-27 Thread Steven D'Aprano
On Mon, 28 Jul 2014 11:52:03 +0800, 水静流深 wrote: > there is a simple file `mydown.py` saved in > `D:\Python34\Lib\site-packages` > there is only one line in mydown.py . > > import requests Just because mydown has imported requests, doesn't mean it is visible everywhere. Each module is a sepa

Re: NameError: name 'requests' is not defined ?

2014-07-27 Thread Miki Tebeka
Greetings, > there is only one line in mydown.py . >   > > import requests   > ... > >>> import mydown > >>> requests.get(url) > > Traceback (most recent call last): > >   File "", line 1, in > > NameError: name 'requests' is not defined You need to call mydown.requests, but I think you're mi

Re: NameError: name 'requests' is not defined ?

2014-07-27 Thread Dan Stromberg
On Sun, Jul 27, 2014 at 8:52 PM, 水静流深 <1248283...@qq.com> wrote: > there is a simple file `mydown.py` saved in `D:\Python34\Lib\site-packages` > there is only one line in mydown.py . > > import requests > > > > C:\Users\pengsir>d:\Python34\python > Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 1

Re: NameError: name 'pyver' is not defined

2014-03-06 Thread Pavan Rikhi
On Wed, Mar 05, 2014 at 10:53:46PM -0800, שולמית מירל wrote: > execfile(configfile,globals()) You could replace the above line in cvstop4lib.py with the following: exec(open(configfile).read(), globals()) signature.asc Description: GnuPG Digital Signature -- https://mail.python.org/mailman

Re: NameError: name 'pyver' is not defined

2014-03-06 Thread שולמית מירל
I tried first to run the script under 2.6 version, but than the "argparse" was missing. I couldn't find python 2.7 for unix download -- https://mail.python.org/mailman/listinfo/python-list

Re: NameError: name 'pyver' is not defined

2014-03-06 Thread שולמית מירל
בתאריך יום חמישי, 6 במרץ 2014 10:26:34 UTC+2, מאת Ned Deily: > In article , ?AIOE??OE?I wrote: > We have python 2.6 & 3.2 installed on Sun solaris. > When running py utility, we get the below error: > > "NameError: global name 'execfile' is not defined" > > > > p4convert-cvs.py > EXCEPTION: [

Re: NameError: name 'pyver' is not defined

2014-03-06 Thread Ned Deily
In article , Ned Deily wrote: > execfile() no long exists in Python 3 so chances are you are trying to > run a Python 3 program with Python 2. Try running the script explicitly > under Python 2: Er, "trying to run a Python 2 program with Python 3", of course. -- Ned Deily, n...@acm.org -

Re: NameError: name 'pyver' is not defined

2014-03-06 Thread Ned Deily
In article , ?AIOE??OE?I wrote: > We have python 2.6 & 3.2 installed on Sun solaris. > When running py utility, we get the below error: > > "NameError: global name 'execfile' is not defined" > > > > p4convert-cvs.py > EXCEPTION: [Errno 17] File exists: './LOGS' > Traceback (most recent call la

Re: NameError: name 'pyver' is not defined

2014-03-06 Thread Steven D'Aprano
On Wed, 05 Mar 2014 22:53:46 -0800, שולמית מירל wrote: > Hello, > > We have python 2.6 & 3.2 installed on Sun solaris. When running py > utility, we get the below error: > > "NameError: global name 'execfile' is not defined" Sounds like you are accidentally running a script intended for Python2

Re: NameError: global name '' is not defined , but a bit differences

2013-09-05 Thread Mohsen Pahlevanzadeh
On Wed, 2013-09-04 at 22:38 -0700, Benjamin Kaplan wrote: > On Wed, Sep 4, 2013 at 9:17 PM, Mohsen Pahlevanzadeh > wrote: > > Dear all , > > > > i get the error : > > > > NameError: global name 'ui' is not defined > > > > Complete question is at : > > http://stackoverflow.com/questions/18627608/na

Re: NameError: global name '' is not defined , but a bit differences

2013-09-05 Thread Terry Reedy
On 9/5/2013 1:38 AM, Benjamin Kaplan wrote: On Wed, Sep 4, 2013 at 9:17 PM, Mohsen Pahlevanzadeh wrote: i get the error : NameError: global name 'ui' is not defined Complete question is at : http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-but-differences M

Re: NameError: global name '' is not defined , but a bit differences

2013-09-04 Thread Benjamin Kaplan
On Wed, Sep 4, 2013 at 9:17 PM, Mohsen Pahlevanzadeh wrote: > Dear all , > > i get the error : > > NameError: global name 'ui' is not defined > > Complete question is at : > http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-but-differences > > Before answering, Thank

Re: NameError vs AttributeError

2012-08-01 Thread Terry Reedy
On 8/1/2012 11:53 AM, Ethan Furman wrote: Terry Reedy wrote: On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy wrote: one wants to catch both errors, one can easily enough. To continue the example above, popping an empty list and empty set produce IndexEr

Re: NameError vs AttributeError

2012-08-01 Thread Ethan Furman
Terry Reedy wrote: On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy wrote: Another example: KeyError and IndexError are both subscript errors, but there is no SubscriptError superclass, even though both work thru the same mechanism -- __getitem__. The reas

Re: NameError vs AttributeError

2012-07-31 Thread Terry Reedy
On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy mailto:tjre...@udel.edu>> wrote: Another example: KeyError and IndexError are both subscript errors, but there is no SubscriptError superclass, even though both work thru the same mechanism -- __ge

Re: NameError vs AttributeError

2012-07-31 Thread Chris Kaynor
On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy wrote: > Another example: KeyError and IndexError are both subscript errors, but > there is no SubscriptError superclass, even though both work thru the same > mechanism -- __getitem__. The reason is that there is no need for one. In > 'x[y]', x is us

Re: NameError vs AttributeError

2012-07-31 Thread Terry Reedy
On 7/31/2012 6:36 AM, Ulrich Eckhardt wrote: Hi! Using Python 2.7, I stumbled across the fact that 'self.xy' raises an AttributeError if self doesn't have an 'xy' as attribute, but 'xy' will instead raise a NameError. To some extent, these two are very similar, namely that the name 'xy' couldn't

Re: NameError: global name 'btn_Matlab' is not defined ?

2010-12-29 Thread Stef Mientki
On 28-12-2010 15:15, Steven D'Aprano wrote: > On Tue, 28 Dec 2010 14:34:19 +0100, Stef Mientki wrote: > >> hello, >> >> Never seen this before and I've no explanation whatsoever (Python 2.6) >> >> I've some dynamic generated code, >> one of objects generated is a wx.Button, called 'btn_Matlab'. > H

Re: NameError: global name 'btn_Matlab' is not defined ?

2010-12-28 Thread Steven D'Aprano
On Tue, 28 Dec 2010 14:34:19 +0100, Stef Mientki wrote: > hello, > > Never seen this before and I've no explanation whatsoever (Python 2.6) > > I've some dynamic generated code, > one of objects generated is a wx.Button, called 'btn_Matlab'. How do you generate the code? What code is generated

Re: NameError: how to get the name?

2010-04-24 Thread Yingjie Lan
--- On Sun, 4/25/10, Chris Rebert wrote: > From: Chris Rebert > Subject: Re: NameError: how to get the name? > To: "Yingjie Lan" > Cc: "python list" > Date: Sunday, April 25, 2010, 10:09 AM > On Sat, Apr 24, 2010, Yingjie Lan > > wrote: > > O

Re: NameError: how to get the name?

2010-04-24 Thread Chris Rebert
On Sat, Apr 24, 2010, Yingjie Lan wrote: > On Sun, 4/25/10, Chris Rebert wrote: >> On Sat, Apr 24, 2010, Yingjie Lan wrote: >> > On Sat, 4/24/10, Gary Herron wrote: >> >> Yingjie Lan wrote: >> >> > On Sat, 4/24/10, Steven D'Aprano wrote: >> >> >> On Sat, 24 Apr 2010, Yingjie Lan wrote: >> >> >

Re: NameError: how to get the name?

2010-04-24 Thread Yingjie Lan
--- On Sun, 4/25/10, Chris Rebert wrote: > From: Chris Rebert > Subject: Re: NameError: how to get the name? > To: "Yingjie Lan" > Cc: python-list@python.org > Date: Sunday, April 25, 2010, 3:27 AM > On Sat, Apr 24, 2010 at 4:17 PM, > Yingjie Lan > wrote: &g

Re: NameError: how to get the name?

2010-04-24 Thread Chris Rebert
On Sat, Apr 24, 2010 at 4:17 PM, Yingjie Lan wrote: > --- On Sat, 4/24/10, Gary Herron wrote: >> From: Gary Herron >> Date: Saturday, April 24, 2010, 8:03 PM >> Yingjie Lan wrote: >> > --- On Sat, 4/24/10, Steven D'Aprano >> wrote: >> >> Fro

Re: NameError: how to get the name?

2010-04-24 Thread Yingjie Lan
--- On Sat, 4/24/10, Gary Herron wrote: > From: Gary Herron > Subject: Re: NameError: how to get the name? > To: > Cc: python-list@python.org > Date: Saturday, April 24, 2010, 8:03 PM > Yingjie Lan wrote: > > --- On Sat, 4/24/10, Steven D'Aprano > wrote: > &

Re: NameError: how to get the name?

2010-04-24 Thread Gary Herron
Yingjie Lan wrote: --- On Sat, 4/24/10, Steven D'Aprano wrote: From: Steven D'Aprano Subject: Re: NameError: how to get the name? To: python-list@python.org Date: Saturday, April 24, 2010, 4:07 PM On Sat, 24 Apr 2010 04:19:43 -0700, Yingjie Lan wrote: I wanted to do some

Re: NameError: how to get the name?

2010-04-24 Thread Yingjie Lan
--- On Sat, 4/24/10, James Mills wrote: > From: James Mills > Subject: Re: NameError: how to get the name? > To: "Yingjie Lan" > Cc: "python list" > Date: Saturday, April 24, 2010, 4:03 PM > On Sat, Apr 24, 2010 at 9:19 PM, > Yingjie Lan > w

Re: NameError: how to get the name?

2010-04-24 Thread Yingjie Lan
--- On Sat, 4/24/10, Steven D'Aprano wrote: > From: Steven D'Aprano > Subject: Re: NameError: how to get the name? > To: python-list@python.org > Date: Saturday, April 24, 2010, 4:07 PM > On Sat, 24 Apr 2010 04:19:43 -0700, > Yingjie Lan wrote: > > &g

Re: NameError: how to get the name?

2010-04-24 Thread Steven D'Aprano
On Sat, 24 Apr 2010 04:19:43 -0700, Yingjie Lan wrote: > I wanted to do something like this: > > while True: > try: > def fun(a, b=b, c=c): pass > except NameError as ne: > name = get_the_var_name(ne) > locals()[name] = '' > else: break This won't work. Writing to locals() does

Re: NameError: how to get the name?

2010-04-24 Thread James Mills
On Sat, Apr 24, 2010 at 9:19 PM, Yingjie Lan wrote: > I wanted to do something like this: > > while True: >  try: >    def fun(a, b=b, c=c): pass >  except NameError as ne: >    name = get_the_var_name(ne) >    locals()[name] = '' >  else: break > > What's be best way to implement the function > g

Re: NameError: name '__main__' is not defined

2009-09-14 Thread Andre Engels
On Mon, Sep 14, 2009 at 4:29 AM, Sean DiZazzo wrote: > Is this a production program that you are using?? > > Please show us the point you are trying to make in something more > valuable. I find this a very bad comment. Not only is it rude, it is condemning a behaviour I would see as beneficial.

Re: NameError: name '__main__' is not defined

2009-09-14 Thread Hendrik van Rooyen
On Monday 14 September 2009 03:43:19 Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : > prin

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
On Sep 13, 6:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!\

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
On Sep 13, 6:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!\

Re: NameError: name '__main__' is not defined

2009-09-13 Thread André
On Sep 13, 10:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Xavier Ho
Try if __name__ == '__main__' :], Xav On Mon, Sep 14, 2009 at 11:43 AM, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python

Re: NameError function not found

2009-06-01 Thread Jean-Michel Pichavant
Cameron Pulsford wrote: Hey everyone, I am extremely stumped on this. I have 2 functions.. def _determinant(m): return m[0][0] * m[1][1] - m[1][0] * m[0][1] def cofactor(self): """Returns the cofactor of a matrix.""" newmatrix = [] for i, minor in enumerate(self.minors()): ne

Re: NameError function not found

2009-05-29 Thread Jason Tackaberry
On Fri, 2009-05-29 at 15:13 -0400, Cameron Pulsford wrote: > def _determinant(m): >return m[0][0] * m[1][1] - m[1][0] * m[0][1] Given that this has no self argument, I'm assuming this is not a class method. > def cofactor(self): >"""Returns the cofactor of a matrix.""" Given that this d

Re: NameError: name 'execfile' is not defined

2009-03-12 Thread Henrik Bechmann
On Mar 12, 3:15 am, Gary Herron wrote: > Henrik Bechmann wrote: > > Newbie issue: > > > I downloadedhttp://www.python.org/download/releases/3.0.1/(windows > > insaller), opened the interpreter, wrote a print "Hello World" program > > in helloworld.py, and in the interpreter typed > > > execfile("h

Re: NameError: name 'execfile' is not defined

2009-03-12 Thread Gary Herron
Henrik Bechmann wrote: Newbie issue: I downloaded http://www.python.org/download/releases/3.0.1/ (windows insaller), opened the interpreter, wrote a print "Hello World" program in helloworld.py, and in the interpreter typed execfile("helloworld.py") Got back NameError: name 'execfile' is not

Re: NameError question - def(self,master) - master not in namespace within class?

2008-10-09 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : bieffe, please, learn to snip irrelevant material... On 9 Ott, 17:43, harijay <[EMAIL PROTECTED]> wrote: (snip) NameError: name 'master' is not defined" (snip) #File runner.py #!/usr/bin/python import master import child if __name__=="__main__": print

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread harijay
Thanks Jerry and beiff , Jerry was right, it was an indent problem . Between using my text editor and running from commandline something went out of sync and I didnt catch it probably. I can now reproduce the error with a bad ident . These are my first posts to comp.lang.python..and I am very grat

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread harijay
Thanks beiff for your prompt reply - But I shouldnt need to import master in child. Actually and very strangely. The problem fixed itself without any change to my code. I dont understand how. It may have been a problem with a bad *.pyc lingering around . But now I cannot get the old NameError to r

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread Jerry Hill
On Thu, Oct 9, 2008 at 11:43 AM, harijay <[EMAIL PROTECTED]> wrote: > Hi I am new to writing module and object oriented python code. I am > trying to understand namespaces and classes in python. > > I have the following test case given in three files runner , master > and child. I am getting an err

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread bieffe62
On 9 Ott, 17:43, harijay <[EMAIL PROTECTED]> wrote: > Hi I am new to writing module and object oriented python code. I am > trying to understand namespaces and classes in python. > > I have the following test case given in three files runner , master > and child. I am getting an error within child

Re: NameError: name 'maketrans' is not defined, pythonchallenge

2008-06-24 Thread Guilherme Polo
On Tue, Jun 24, 2008 at 3:11 PM, cirfu <[EMAIL PROTECTED]> wrote: > from string import maketrans > > ok but how can i write: > pattern = maketrans('A-XY-Za-xy-z', 'C-ZA-Bc-za-b') > pattern = maketrans('A-Za-z', 'C-Bc-b') > none works maketrans doesn't work like that, you would need something l

Re: NameError: name 'maketrans' is not defined, pythonchallenge

2008-06-24 Thread cirfu
import string text = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." table = string.maketrans(string.ascii_lowercase, string.ascii_lowercase[

Re: NameError: name 'maketrans' is not defined, pythonchallenge

2008-06-24 Thread cirfu
from string import maketrans ok but how can i write: pattern = maketrans('A-XY-Za-xy-z', 'C-ZA-Bc-za-b') pattern = maketrans('A-Za-z', 'C-Bc-b') none works -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError: global name 'Response' is not defined

2008-04-24 Thread Ben Kaplan
Are you importing pylons? How are you doing it? If you are doing "from pylons import Response" or "from pylons import *", then you have another problem. If you are just doing "import pylons", then you need to do "return pylons.Response(...)" - Original Message From: Lalit <[EMAIL PROTE

Re: NameError: global name 'Response' is not defined

2008-04-24 Thread Diez B. Roggisch
Lalit schrieb: Hi I am very new to web development. I started with Pylons. I am using http://www.rexx.com/~dkuhlman/pylons_quick_site.html as reference to create a sample web page using pylons. I got stuck up at step 4.3 i.e when modifying controller to "return Response('firstapp default')" I

Re: NameError: name 'guess' is not defined

2008-03-22 Thread Dan Bishop
On Mar 22, 10:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > I am very new to both programming and Pyhton and while trying to do > > some practice using A byte of python an Error pops up on the IDLE > > shell. I am using windows XP. PLease see below. > >

Re: NameError: name 'guess' is not defined

2008-03-22 Thread Gary Herron
[EMAIL PROTECTED] wrote: > I am very new to both programming and Pyhton and while trying to do > some practice using A byte of python an Error pops up on the IDLE > shell. I am using windows XP. PLease see below. > while running: > guess = int(raw_input('Enter an integer : ')) > > if guess == numbe

Re: NameError: name 'guess' is not defined

2008-03-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am very new to both programming and Pyhton and while trying to do > some practice using A byte of python an Error pops up on the IDLE > shell. I am using windows XP. PLease see below. > while running: > guess = int(raw_input('Enter an integer : ')) > > if guess == nu

Re: NameError: name 'main' is not defined

2007-12-18 Thread jolly
thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError: name 'main' is not defined

2007-12-18 Thread Robert Kern
jolly wrote: > hey guys, > > When i try to run my code I get an error. NameError name 'main is not > defined' > > [code] > if __name__ == "__main__": > main() Put this at the end of the file. Currently, it is getting executed before the code that defines main(). -- Robert Kern "I have com

Re: nameerror upon calling function

2007-09-01 Thread Arnaud Delobelle
On Sep 1, 5:05 pm, seancron <[EMAIL PROTECTED]> wrote: > Hi, > > I have a program that makes a call to a function in a different python > script that I wrote. But, when I call the function I get the > following error: > > NameError: global name 'WSDL' is not defined > > I can't figure out why I'm