>>> 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 ?
--
https://mail.python.org/mailman/listinfo/python-list
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'
game.draw.rect(screen, BROWN, [60, 400, 30, 45])
> > NameError: name 'pygame' is not defined
> >
> > How to solve this error ?
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
> have you imported pygame?
>
> --
> Jo
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
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,
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:
>
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
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
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
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
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
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:
>
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
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
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 ?
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
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 (
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
I don't understand what I don't understand in the following:
--
# reader.py - testing char-by-char marching methods
f = open('sample_decaf.d', 'r')
text = f.readlines()
f.close()
# this is C-style, 15 lines, in Python:
end_line = len(text)
line_ptr = 0
whi
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' c
ot;/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line 22, in
main
NameError: getopt
I thought I was importing the "getopt" as shown below.
Thanks for you help in advance,
Mustafa
#Conditionally import wlstModule only when script is executed with jython
if __name__ ==
Hello,
I'm using the version 3.2.3 of Python and I am having an issue in my program
and I don't know how to fix it:
counterLabel["text"] = str(counter)
NameError: global name 'counterLabel' is not defined
Here is my program:
from tkinter import *
class C
rs()):
newmatrix.append(_determinant(minor.matrix) * ((i%2) * -1))
return newmatrix
And I get the following error when I try to run a.cofactor()...
"NameError: global name '_determinant' is not defined"
When I put the _determinant function nested within the cofactor function
Hello,
I want to append new input to list SESSION_U without erasing its
content. I try this:
...
try:
SESSION_U.append(UNIQUES)
except NameError:
SESSION_U = []
SESSION_U.append(UNIQUES)
...
I would think that at first try I would get the
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 getting this error since WSDL should be
defin
gy-code.blogspot.com/2007/02/minimal-working-examples-how-to-
why-and.html) where working means it works to demonstrate the problem
you are having. You need to actually show us what is breaking, which
means the traceback that gives you the NameError.
As for the problem itself, I am not go
On Dec 12, 5:51 pm, Paul Rudin <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
> > I don't understand what I don't understand in the following:
>
> I haven't tried to understand what your code is doing - but the
> NameError arises because you try to u
[EMAIL PROTECTED] writes:
> I don't understand what I don't understand in the following:
I haven't tried to understand what your code is doing - but the
NameError arises because you try to use Loc before its definition. Put
the definition first and the error should g
<[EMAIL PROTECTED]> wrote:
>I don't understand what I don't understand in the following:
> [ ... ]
You've already got an answer as to what's causing your name error.
But that's not your only problem. It looks like you need an
introduction to enumerate():
for line_ptr, text in enumerate(file('sam
27;s
a reference to the current instance. If you want to define instance
attributes, you have to set these attributes on the current instance.
def __init__(self, line, char):
self.line = line
self.char = char
> def nextChar(self):
> char += 1
NameError here. You want self.char
[EMAIL PROTECTED] writes:
> On Dec 12, 5:51 pm, Paul Rudin <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] writes:
>> > I don't understand what I don't understand in the following:
>>
>> I haven't tried to understand what your code is doing - but
On Wed, 2007-12-12 at 12:48 -0800, [EMAIL PROTECTED] wrote:
> Thanks to all!
>
> I will put my class defs first (tho not without expressing my
> disappointment that this is required in a late 20th century language);
You don't have to physically *put* class definitions first in your code.
What mat
Thanks to all!
I will put my class defs first (tho not without expressing my
disappointment that this is required in a late 20th century language);
learn about enumerate as it looks like exactly what I need and discard
my C++/Java based object model because this is a totally other thing.
If someo
[EMAIL PROTECTED] a écrit :
> Thanks to all!
>
> I will put my class defs first (tho not without expressing my
> disappointment that this is required in a late 20th century language);
That's because you dont get the "execution model" of Python.
First point, remember that Python in Python everyth
>
> >> I haven't tried to understand what your code is doing - but the
> >> NameError arises because you try to use Loc before its definition. Put
> >> the definition first and the error should go away.
>
> > Class Loc must be placed ABOVE the code tha
success.
So, attempting this at runtime I get a plethora of wonderful errors that I
suspect has broken my brain.
Here is what i've tried:
# trying with just an empty object of type BaseClass
obj = type("Object", (BaseClass,), {})
whatever = type("WhatEver", (obj,), {
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 ver
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
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
, so there is. Added in 1.5 strictly as a never-directly-raised base
class for the above pair, now also directly raised in codecs.lookup. I
have not decided if I want to replace the tuple in the code in my book.
I think I'd stick with the tuple -- LookupError could just as easily
encompas
mpass NameError and AttributeError.
Thank you. Having to remember exactly which lookup error is encompassed
by LookupError illustrates my point about the cost of adding entities
without necessity. It also illustrates the importance of carefull
naming. SubscriptError might have been better.
--
Terr
gt; File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line
> 80, in
> ?
> File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line
> 22, in
> main
> NameError: getopt
>
> I thought I was importing the "getopt" as shown belo
On 03/21/2013 07:43 PM, maiden129 wrote:
Hello,
I'm using the version 3.2.3 of Python and I am having an issue in my program
and I don't know how to fix it:
counterLabel["text"] = str(counter)
NameError: global name 'counterLabel' is not defined
Please inc
On Thu, Mar 21, 2013 at 7:43 PM, maiden129 wrote:
> Hello,
>
> I'm using the version 3.2.3 of Python and I am having an issue in my program
> and I don't know how to fix it:
>
> counterLabel["text"] = str(counter)
> NameError: global name 'count
On Thursday, March 21, 2013 7:24:17 PM UTC-5, Dave Angel wrote:
> On 03/21/2013 07:43 PM, maiden129 wrote:
> > Hello,
>
> > I'm using the version 3.2.3 of Python and I am having an
> > issue in my program and I don't know how to fix it:
>
> > counte
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
minor in enumerate(self.minors()):
newmatrix.append(_determinant(minor.matrix) * ((i%2) * -1))
return newmatrix
And I get the following error when I try to run a.cofactor()...
"NameError: global name '_determinant' is not defined"
When I put the _determinant function nested withi
Zeynel wrote:
> I want to append new input to list SESSION_U without erasing its
> content. I try this:
>
> ...
> try:
> SESSION_U.append(UNIQUES)
> except NameError:
> SESSION_U = []
> SESSION_U.append(UNIQUES)
&g
RCHIVE
is erased:
If I do this:
K = []
ARCHIVE.append(K)
I get NameError: "Name ARCHIVE not defined"
What is the solution?
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
>> The problem I am having is this: If I do:
>>
>> K = []
>> ARCHIVE = []
>> ARCHIVE.append(K)
>>
>> any time K is updated (user submits new input) the content of ARCHIVE
>> is erased:
>>
> No, it is NOT erased... It is MUTATED...
But he rebinds the ARCHIVE name.
--
ht
blem I am having is this: If I do:
>
> K = []
> ARCHIVE = []
> ARCHIVE.append(K)
>
> any time K is updated (user submits new input) the content of ARCHIVE
> is erased:
>
> If I do this:
>
> K = []
> ARCHIVE.append(K)
>
> I get NameError: "Name ARCHIVE
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 d
whatever = type("WhatEver", (obj,), {"method1": super(WhatEver,
self).request("method1")})
'method1' has to be mapped to a function object.
but when i try this I get 'NameError: name 'self' is not defined'
defining these c
>
> > So, attempting this at runtime I get a plethora of wonderful errors that I
> > suspect has broken my brain.
>
> >
>
> > Here is what i've tried:
>
> >
>
> > # trying with just an empty object of type BaseClass
>
> >
x27;ve been trying to do this using the python cli, with out success.
>
> So, attempting this at runtime I get a plethora of wonderful errors that
> I suspect has broken my brain.
>
> Here is what i've tried:
>
> # trying with just an empty object of type BaseClass
> obj
id_data
>
> >
>
> > def method2(self):
>
> > stupid_data = super(Whatever, self).request("method1")
>
> > return stupid_data
>
>
>
>
>
> Since request is not the method you are currently in, the above i
uot;C:/a/b/c/mod3.py", line 2, in
import mod2
File "C:/a/b/c/mod2.py", line 1, in
import mod1
File "C:/a/b/c/mod1.py", line 2, in
print symbolNonExistant
NameError: name 'symbolNonExistant' is not defined
Why did i need to see all that junk w
:
NameError: name '__version__' is not defined
For the 3.6 application I have
PYTHONPATH=/nfs/local/lib/python3.6/site-packages
PYTHONUSERBASE=/nfs/local
PYTHON_VERSION=3.6
PYTHON_VIRTUALENV=
and for the 3.10 application I have
PYTHONPATH=/nfs/easybuild/software/Python/3.10
recent call last):
File "./test.py", line 3, in
if __main__ == '__main__' :
NameError: name '__main__' is not defined
--
http://mail.python.org/mailman/listinfo/python-list
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
elf.runctx(cmd, dict, dict)
File "/usr/lib/python2.5/profile.py", line 462, in runctx
exec cmd in globals, locals
File "", line 1, in
NameError: name 'foo' is not defined
The very same error I get using cProfile.
It works when I call
profile.runctx('foo()
cause get_selected_paths to throw
a NameError. For example, say I delete the "project1" variable from
my_paths; now I'll get a NameError when I call get_selected_paths.
So everything that depends on the get_selected_paths function is
crashing. I am wondering if there is an easy way to just
py /var/log/system.log
Traceback (most recent call last):
File "logTail.py", line 52, in
main()
File "logTail.py", line 49, in main
process(arg) # process() is defined elsewhere
NameError: global name 'process' is not defined
--
http://mail.python.org/mailman/listinfo/python-list
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
get_the_var_name(ne) that returns the name
of th
()
once compiling iam getting the error
Traceback (most recent call last):
File "C:\chk.py", line 20, in
**frame.pack()
*NameError: name 'frame' is not defined
*
thanks
--
http://mail.python.org/mailman/listinfo/python-list
hey guys,
When i try to run my code I get an error. NameError name 'main is not
defined'
[code]
if __name__ == "__main__":
main()
filename = "addbook.dat"
def main():
theMenu = '''
1) Add Entry
2) Remove Entry
3) Find E
do here
print 'Done'
After typing the above as the book says, I get the error NameError:
name 'guess' is not defined
What Am I doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list
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"
> p4convert-cvs.py
EXCEPTION: [Errno 17] File exists: './LOGS'
Traceback (most recent call last)
_package__', '__spec__', 'requests']
>>> url='http://quote.eastmoney.com/hk/0.html?StockCode=0'
>>> requests.get(url)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'requests' is not defined
why it run into "NameError: name 'requests' is not defined"?--
https://mail.python.org/mailman/listinfo/python-list
> offensive lookup of a name that does not exist.
[SNIP]
NameErrors can occur conditionally depending on e.g. the arguments to
a function. Consider the following script:
# tmp.py
def broken(x):
if x > 2:
print(x)
else:
print(undefined_name)
broken(1)
tph = ToiletPaperHolder()
if not tph.has_roll():
tph.load_roll()
roll = tph.get_active_roll()
roll.bind("", maybeGoBoom)
> The traceback shows the arguments passed to the broken
> function that caused the NameError to be generated.
> Different arguments would not have generat
On 16 March 2013 22:39, Rick Johnson wrote:
> On Saturday, March 16, 2013 4:19:34 PM UTC-5, Oscar Benjamin wrote:
>
>> The traceback shows the arguments passed to the broken
>> function that caused the NameError to be generated.
>> Different arguments would not have ge
On 2013-03-16 15:39, Rick Johnson wrote:
> On Saturday, March 16, 2013 4:19:34 PM UTC-5, Oscar Benjamin wrote:
> > # tmp.py
> > def broken(x):
> > if x > 2:
> > print(x)
> > else:
> > print(undefined_name)
> >
> > broken(1)
>
> Why would anyone write code lik
arder(intelligence_level)
> broken(op.iq)
>
> Pylint, pyflakes or some other such linter should catch it, but this
> happens ALL THE TIME in actual development, occasionally leaking into
> production.
That's actually an argument in favour of declared variables. NameError
beco
g. the arguments to a
> function. Consider the following script:
[...]
Correct, although in your example, simply pointing at the relevant line
of code is enough to establish the error.
But that's an easy case. Tracebacks aren't printed because you need them
to fix the easy bugs. Traceb
On Saturday, March 16, 2013 6:29:52 PM UTC-5, Oscar Benjamin wrote:
> I wasn't looking to convince *you*, just to set the record
> straight that this behaviour is sometimes useful.
And you claim to "set the record strait" by posting code that *purposely*
raises a NameErr
merely the side-effect. The actual problem occurs in the caller,
> fail(). If NameError suppressed the traceback, that would be more
> difficult to solve.
A good example. It would be logically equivalent to set spam=None in
stop(), and nobody would expect the TypeError to omit the traceba
On Sun, Mar 17, 2013 at 10:50 AM, Rick Johnson
wrote:
> * Superfluous trackbacks are not only ugly, they damage
>productivity.
Extraordinary claims require extraordinary evidence. Start evidencing.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
On Saturday, March 16, 2013 6:48:01 PM UTC-5, Steven D'Aprano wrote:
> On Sat, 16 Mar 2013 21:19:34 +, Oscar Benjamin wrote:
> > [...]
> > NameErrors can occur conditionally depending on e.g. the
> > arguments to a function. Consider the following script:
> [...]
>
> Correct, although in your e
On 03/16/2013 06:11 PM, Rick Johnson wrote:
> No, the "ACTUAL PROBLEM" is in the author.
Surely any NameException can also be blamed on the author then, by your
logic?
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 16 Mar 2013 19:58:41 -0600, Michael Torrie wrote:
> On 03/16/2013 06:11 PM, Rick Johnson wrote:
>> No, the "ACTUAL PROBLEM" is in the author.
>
> Surely any NameException can also be blamed on the author then, by your
> logic?
Any exception at all is obviously the author's fault. I propo
On Sun, Mar 17, 2013 at 2:14 PM, Steven D'Aprano
wrote:
> On Sat, 16 Mar 2013 19:58:41 -0600, Michael Torrie wrote:
>
>> On 03/16/2013 06:11 PM, Rick Johnson wrote:
>>> No, the "ACTUAL PROBLEM" is in the author.
>>
>> Surely any NameException can also be blamed on the author then, by your
>> logic
On Sat, Mar 16, 2013 at 8:14 PM, Steven D'Aprano
wrote:
> On Sat, 16 Mar 2013 19:58:41 -0600, Michael Torrie wrote:
>
>> On 03/16/2013 06:11 PM, Rick Johnson wrote:
>>> No, the "ACTUAL PROBLEM" is in the author.
>>
>> Surely any NameException can also be blamed on the author then, by your
>> logic
line of that module
> contains the offensive lookup of a name that does not exist.
> [snip more junk]
2 comments here.
1) Where's the consistency?? NameError is an exception. All other
exceptions get full tracebacks. A NameError is not special enough to
deserve special treatment (zen of P
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?
--
https://mail.python.org/m
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
>
> For the 3.6 application I have
>
> PYTHONPATH=/nfs/local/lib/python3.6/site-packages
>
port importlib_metadata
>>
>> __version__ = importlib_metadata.version(__name__)
>>
>> For the application with the system Python this mechanism works, but for
>> the non-system Python I get the error:
>>
>> NameError: name '__versio
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` (su
g
>
> $ cat test.py
> #!/usr/bin/env python
>
> if __main__ == '__main__' :
> print "Hello World!\n"
> $ ./test.py
> Traceback (most recent call last):
> File "./test.py", line 3, in
>if __main__ == '__main__' :
> Na
__ == '__main__' :
> print "Hello World!\n"
> $ ./test.py
> Traceback (most recent call last):
> File "./test.py", line 3, in
> if __main__ == '__main__' :
> NameError: name '__main__' is not defined
You wrote __main__
__ == '__main__' :
> print "Hello World!\n"
> $ ./test.py
> Traceback (most recent call last):
> File "./test.py", line 3, in
> if __main__ == '__main__' :
> NameError: name '__main__' is not defined
Is this a produc
__ == '__main__' :
> print "Hello World!\n"
> $ ./test.py
> Traceback (most recent call last):
> File "./test.py", line 3, in
> if __main__ == '__main__' :
> NameError: name '__main__' is not defined
erI was jus
python
>
> if __main__ == '__main__' :
> print "Hello World!\n"
> $ ./test.py
> Traceback (most recent call last):
> File "./test.py", line 3, in
> if __main__ == '__main__' :
> NameError: name '__main__' is not defined
You ar
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.
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: na
in the interpreter typed
>
> > execfile("helloworld.py")
>
> > Got back
>
> > NameError: name 'execfile' is not defined
>
> > (following tutorial in David Beazley's Python Essential Reference).
>
> > Is execfile not support
thon2.5/profile.py", line 456, in run
return self.runctx(cmd, dict, dict)
File "/usr/lib/python2.5/profile.py", line 462, in runctx
exec cmd in globals, locals
File "", line 1, in
NameError: name 'foo' is not defined
The very same error I get using c
list has around 50 entries. Occasionally I'll
> remove a variable from my_paths and cause get_selected_paths to throw
> a NameError. For example, say I delete the "project1" variable from
> my_paths; now I'll get a NameError when I call get_selected_paths.
> So ev
Nevermind, I figured it out right after I clicked the send button :\
from my_paths import *
def get_selected_paths():
return [globals()[s] for s in
["home", "desktop", "project1", "project2"]
if s in globals()]
--
http://mail.python.org/mailman/listinfo/python-list
n like this which returns a list containing a bunch
> > of variables. The real list has around 50 entries. Occasionally I'll
> > remove a variable from my_paths and cause get_selected_paths to throw
> > a NameError. For example, say I delete the "project1" varia
1 - 100 of 242 matches
Mail list logo