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
"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
"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
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
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
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
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 ?
> --
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 'requests' is not defined
You need to call mydown.requests, but I think you're mi
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
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" > > > > p4convert-cvs.py > EXCEPTION:
[
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] File exists: './LOGS'
> Traceback (most recent call la
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
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
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
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
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
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
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 very similar,
namely that the name 'xy' couldn't
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
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
--- 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
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:
>> >> >
--- 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
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
--- 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:
> &
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
--- 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
--- 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
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
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
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.
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
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!\
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!\
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!
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
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
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
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
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
[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
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
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
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
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
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
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[
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
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
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
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.
> >
[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
[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
thanks
--
http://mail.python.org/mailman/listinfo/python-list
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
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
76 matches
Mail list logo