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
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
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
>
:
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
n this function is defined, the class "Pnt" has not yet been defined.
That happens afterwards.
You want a forward reference, eg:
def __add__(self, other: PNT) -> "Pnt":
A type checker will resolve this after the fact, when it encounters the
string in the type annotation.
quot;", line 1, in
File "/home/sisc/projecten/iudex/problem.py", line 10, in
class Pnt (NamedTuple):
File "/home/sisc/projecten/iudex/problem.py", line 14, in Pnt
def __add__(self, other: PNT) -> Pnt:
^^^
NameError: nam
problem.py", line 10, in
class Pnt (NamedTuple):
File "/home/sisc/projecten/iudex/problem.py", line 14, in Pnt
def __add__(self, other: PNT) -> Pnt:
^^^
NameError: name 'Pnt' is not defined. Did you mean: 'PN
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 th
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
>
> Hi when I disconnect the internet I get an error NameError: name 'self' is
> not defined. I really dont get it.. thanks all. Is that a bug? or my fault?
Exception in thread Thread-1:
> Traceback (most recent call last):
> File "C:\programming Alon\stock market
Hi when I disconnect the internet I get an error NameError: name 'self' is not
defined. I really dont get it.. thanks all. Is that a bug? or my fault?
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\programming Alon\stock market app\PROJECT\AlonStockM
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
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 (
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
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 ?
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
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
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:
>
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
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 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$ 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
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:
>
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,
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
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 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'
>>> 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 Fri, Sep 23, 2016 at 4:40 PM, Peter Otten <__pete...@web.de> wrote:
> By the way, the current help() already loads a module if you pass its name
> as a string:
>
Yes, which is the basis of my alternate exec trick:
exec(tb.tb_frame.f_code, tb.tb_frame.f_globals, {n: n})
Basically it creates a
Veek M wrote:
> Is there a way to use .pythonrc.py to provide a help function that
> autoloads whatever module name is passed like so:
By the way, the current help() already loads a module if you pass its name
as a string:
$ echo 'print("importing foo")' > foo.py
$ python3
Python 3.4.3 (defaul
erriding __init__ and __call__
>> but that didn't work, also I don't know how to deal/trap/catch the
>> NameError (no quotes on h(re)) - is there a way to insert a
>> try/except block around the >>> prompt?
>>
>> I hate having to: import whatever ev
n't work, also I don't know how to deal/trap/catch the NameError
> (no quotes on h(re)) - is there a way to insert a try/except block
> around the >>> prompt?
>
> I hate having to: import whatever every-time i forget. Actually could I
> ditch the () in h(re) and jus
Is there a way to use .pythonrc.py to provide a help function that
autoloads whatever module name is passed like so:
\>>> h(re)
I tried inheriting site._Helper and overriding __init__ and __call__ but
that didn't work, also I don't know how to deal/trap/catch the NameError
Steven D'Aprano wrote:
> On Monday 07 March 2016 17:13, Veek. M wrote:
>
>> import foo
>> class Bar(object):
>> def __del__(self, foo=foo):
>> foo.bar()# Use something in module foo
>>
>> ### Why the foo=foo? import foo, would increment the ref-count for
>> object 'foo'
>
> Yes. And
On Monday 07 March 2016 17:13, Veek. M wrote:
> import foo
> class Bar(object):
> def __del__(self, foo=foo):
> foo.bar()# Use something in module foo
>
> ### Why the foo=foo? import foo, would increment the ref-count for
> object 'foo'
Yes. And then at shutdown, the module globals
ys so why be finicky about circular
> references - why can't we go ahead and call __dell_ and run gc?
>
> 3.
> import foo
> def __del__(self, foo=foo):
> foo.bar()
>
> What happens here to prevent a NameError? Apparently without the
> foo=foo a NameError can occ
stand the GC well enough to answer that question.
> 3.
> import foo
> def __del__(self, foo=foo):
> foo.bar()
>
> What happens here to prevent a NameError? Apparently without the foo=foo
> a NameError can occur? But why? import foo creates a reference to the
> object anyways so
"Veek. M" writes:
> 1. What are the rules for using __del__ besides: 'don't use it'.
What do you mean by “rules”?
If you want advice on using that method, I don't think a canonical
exhaustive “rules” set exists.
For example: Use ‘__del__’ to mark an object as no longer used; don't
expect that
x27;t
inherit from Exception, so it's usually left uncaught); the assumption
is that all resources will be cleaned up on process termination
anyway, so there's no need to run the GC to clean up reference cycles.
It's a total waste of effort.
> 3.
> import foo
> def __del__(
ferences - why can't we go ahead and call __dell_ and run gc?
3.
import foo
def __del__(self, foo=foo):
foo.bar()
What happens here to prevent a NameError? Apparently without the foo=foo
a NameError can occur? But why? import foo creates a reference to the
object anyways so it's re
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
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 'reque
, '__cached__', '__doc__', '__file__', '__loader__',
> '__name__',
> '__package__', '__spec__', 'requests']
>>>> url='http://quote.eastmoney.com/hk/0.html?StockCode=0'
>
_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
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
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
בתאריך יום חמישי, 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&quo
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
-
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]
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
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)
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 questi
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-d
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-bu
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 you for your attention...!
Yours,
Mohsen
--
https://mail.
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
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
>
> > 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
>
> >
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
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 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 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 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
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
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
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
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, 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 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 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 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
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 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
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
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
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
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
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
> 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)
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
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
, 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
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
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 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
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
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
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__ == &#
nt locals()['btn_Matlab']
>>
>> > 0x3602d28> >
>>
>> but if I try to print the button (at exactly the same location), I get
>> an error
>>
>> print btn_Matlab
>>
>> NameError: global name 'btn_Matlab' is not defined ?
&
o you generate the code?
What code is generated? What does it do?
> After the code is generated, I can see that the button is created in the
> local namespace
>
>print locals()['btn_Matlab']
>
> 0x3602d28> >
>
> but if I try to print the button (at exactly
locals()['btn_Matlab']
>
but if I try to print the button (at exactly the same location), I get an error
print btn_Matlab
NameError: global name 'btn_Matlab' is not defined ?
Why isn't the compiler first checking the local namespace ?
any clues ?
thanks,
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
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
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
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
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
--- 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
e:
>> >> >> On Sat, 24 Apr 2010, Yingjie Lan wrote:
>> >> >>> I wanted to do something like this:
>> >> >>>
>> >> >>> while True:
>> >> >>> try:
>> >> >>> d
--- 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
1 - 100 of 242 matches
Mail list logo