Re: What does it mean for Python to have “constants”?

2015-10-21 Thread Nagy László Zsolt
Dennis Lee Bieber writes: >> (Python does not have anything that one might consider a true constant >> -- other than the language defined singletons: None, and maybe by now >> True and False). > Python now deals with those by making the names keywords:: > > >>> True =

What does it mean for Python to have “constants”? (was: variable scope of class objects)

2015-10-20 Thread Ben Finney
Dennis Lee Bieber writes: > (Python does not have anything that one might consider a true constant > -- other than the language defined singletons: None, and maybe by now > True and False). Python now deals with those by making the names keywords:: >>> True =

What does it mean when io.TextIOBase.encoding is None

2015-03-19 Thread Rocco
When using nose to run unittests, i discovered that depending on nose' command line parameters, sys.stdout.encoding can be None. I wonder what that means for an io.TextIOBase object. Is None a valid value for 'encoding'? Is None equivalent to 'ascii' in this case? If None is a valid value for

Re: What does zip mean?

2014-11-14 Thread Steven D'Aprano
Grant Edwards wrote: What the zipper on a coat does is convert two separate sequences into a single sequence where the members alternate between the two input sequences.  IOW if we want to do something analogous to a zipper fastener it should do this: zip([a,b,c,d,e,f],[1,2,3,4,5,6])  =

Re: What does zip mean?

2014-11-13 Thread giacomo boffi
Grant Edwards invalid@invalid.invalid writes: No, you don't. That's not how a zipper works. Each tooth from side A, isn't bound with one from side B. It's bound with _two_ of them from side B. And each of those is in turn bound with an additional tooth from side A, and so on... In your

Re: What does zip mean?

2014-11-10 Thread giacomo boffi
On 11/09/2014 11:44 AM, satishmlm...@gmail.com wrote: What does zip return in the following piece of code? To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or _zipper_ in your bag or in your trousers In the bag you have two

Re: What does zip mean?

2014-11-10 Thread Grant Edwards
On 2014-11-10, giacomo boffi giacomo_bo...@inwind.it wrote: On 11/09/2014 11:44 AM, satishmlm...@gmail.com wrote: What does zip return in the following piece of code? To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or

Re: What does zip mean?

2014-11-10 Thread Gregory Ewing
Grant Edwards wrote: What the zipper on a coat does is convert two separate sequences into a single sequence where the members alternate between the two input sequences. True, the zipper analogy isn't quite accurate. It's hard to think of an equally concise and suggestive name, however. --

Re: What does zip mean?

2014-11-10 Thread Cameron Simpson
On 10Nov2014 17:19, Grant Edwards invalid@invalid.invalid wrote: On 2014-11-10, giacomo boffi giacomo_bo...@inwind.it wrote: To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or _zipper_ in your bag or in your trousers In the

Re: What does zip mean?

2014-11-10 Thread Terry Reedy
On 11/10/2014 3:36 PM, Cameron Simpson wrote: On 10Nov2014 17:19, Grant Edwards invalid@invalid.invalid wrote: On 2014-11-10, giacomo boffi giacomo_bo...@inwind.it wrote: To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or

What does zip mean?

2014-11-09 Thread satishmlmlml
What does zip return in the following piece of code? curs.execute('select * from people') colnames = [desc[0] for desc in curs.description] rowdicts = [] for row in curs.fetchall(): rowdicts.append(dict(zip(colnames, row))) -- https://mail.python.org/mailman/listinfo/python-list

Re: What does zip mean?

2014-11-09 Thread Steven D'Aprano
satishmlm...@gmail.com wrote: What does zip return in the following piece of code? Have you read the Fine Manual? In Python 2, zip returns a list: zip(['a', 'b', 'c'], [1, 2, 3]) = [('a', 1), ('b', 2), ('c', 3)] https://docs.python.org/2/library/functions.html#zip In Python 3, zip does

Re: What does zip mean?

2014-11-09 Thread milos zorica
sorry my bad On Sun, Nov 9, 2014 at 7:58 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: satishmlm...@gmail.com wrote: What does zip return in the following piece of code? Have you read the Fine Manual? In Python 2, zip returns a list: zip(['a', 'b', 'c'], [1, 2, 3])

Re: TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-28 Thread Jesse McDonnell
On Wed, 26 May 2010 14:30:21 -0400 Terry Reedy tjre...@udel.edu wrote: On 5/24/2010 2:52 PM, Jesse McDonnell wrote: I'm attempting to install Powerline http://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python using a MYSql database, at my local library

TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-26 Thread Jesse McDonnell
I'm attempting to install Powerline http://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python usinga MYSql database,at my local library and I've run up against an errorthat I cannot google my way out of! The google groups for the application is inactive so I'm

Re: TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-26 Thread Terry Reedy
On 5/24/2010 2:52 PM, Jesse McDonnell wrote: I'm attempting to install Powerline http://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python using a MYSql database, at my local library and I've run up against an error that I cannot google my way out of! The

Re: TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-26 Thread Carl Banks
[Again, can't see the original, sorry] On May 26, 11:30 am, Terry Reedy tjre...@udel.edu wrote: On 5/24/2010 2:52 PM, Jesse McDonnell wrote: I'm attempting to install Powerlinehttp://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python using a MYSql

Re: what does execfile mean within profiler output and why does it not have a attached line number

2009-04-06 Thread Rahul
Robert Kern robert.k...@gmail.com wrote in news:mailman.3316.1238893185.11746.python-l...@python.org: To quickly find your hotspots, start by sorting by 'time' (that would be displayed as the 'tottime' column in the human-readable output). That tells you how much time is spent in each

Re: what does execfile mean within profiler output and why does it not have a attached line number

2009-04-06 Thread Robert Kern
On 2009-04-06 19:09, Rahul wrote: Robert Kernrobert.k...@gmail.com wrote in news:mailman.3316.1238893185.11746.python-l...@python.org: To quickly find your hotspots, start by sorting by 'time' (that would be displayed as the 'tottime' column in the human-readable output). That tells you how

Re: what does execfile mean within profiler output and why does it not have a attached line number

2009-04-04 Thread John Machin
On Apr 5, 9:56 am, Rahul nos...@nospam.invalid wrote: profile tells me that most of my runtime was spent in just one part (1.28 sec cumulatively out of 1.29 secs. But what is execfile? I don't see this as a function call with my python code. Also what's the 0 in the snippet:   :0(execfile)?

what does execfile mean within profiler output and why does it not have a attached line number

2009-04-04 Thread Rahul
profile tells me that most of my runtime was spent in just one part (1.28 sec cumulatively out of 1.29 secs. But what is execfile? I don't see this as a function call with my python code. Also what's the 0 in the snippet: :0(execfile)? Isn't there supposed to be a line-number? Looking up

Re: what does execfile mean within profiler output and why does it not have a attached line number

2009-04-04 Thread Robert Kern
On 2009-04-04 18:56, Rahul wrote: profile tells me that most of my runtime was spent in just one part (1.28 sec cumulatively out of 1.29 secs. But what is execfile? I don't see this as a function call with my python code. Also what's the 0 in the snippet: :0(execfile)? Isn't there supposed to be

Re: what does this mean....?

2009-02-28 Thread Gabriel Genellina
En Sat, 28 Feb 2009 04:44:28 -0200, zaheer.ag...@gmail.com escribió: One question off the topic., Usually it's better to post a separate message. How to create a .pyz file. I have python project that has some modules in it , I want to create a zip file so that I can use it as we use java

Re: what does this mean....?

2009-02-28 Thread Ben Finney
Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Sat, 28 Feb 2009 04:44:28 -0200, zaheer.ag...@gmail.com escribió: One question off the topic., Usually it's better to post a separate message. More specifically (and I only say this because many people seem not to observe the

Re: what does this mean....?

2009-02-28 Thread zaheer . agadi
On Feb 28, 1:50 pm, Ben Finney bignose+hates-s...@benfinney.id.au wrote: Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Sat, 28 Feb 2009 04:44:28 -0200, zaheer.ag...@gmail.com escribió: One question off the topic., Usually it's better to post a separate message. More specifically

what does this mean....?

2009-02-27 Thread zaheer . agadi
I am trying to download a file from the server, I am getting this error,what does this mean localFile = open(localFileName, 'wb') TypeError: coercing to Unicode: need string or buffer, type found -- http://mail.python.org/mailman/listinfo/python-list

Re: what does this mean....?

2009-02-27 Thread Rhodri James
On Sat, 28 Feb 2009 05:17:41 -, zaheer.ag...@gmail.com wrote: I am trying to download a file from the server, I am getting this error,what does this mean localFile = open(localFileName, 'wb') TypeError: coercing to Unicode: need string or buffer, type found The rest of the traceback

Re: what does this mean....?

2009-02-27 Thread John Machin
On Feb 28, 4:17 pm, zaheer.ag...@gmail.com wrote: I am trying to download a file from the server, I am getting this error,what does this mean    localFile = open(localFileName, 'wb') TypeError: coercing to Unicode: need string or buffer, type found the name localFileName is bound to a type

Re: what does this mean....?

2009-02-27 Thread zaheer . agadi
On Feb 28, 10:50 am, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sat, 28 Feb 2009 05:17:41 -, zaheer.ag...@gmail.com wrote: I am trying to download a file from the server, I am getting this error,what does this mean localFile = open(localFileName, 'wb') TypeError: coercing

Re: what does **kw mean?

2008-01-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I've been reading the following example, and couldn't figure out, what **kw mean. (It's an empty dictionary, but what's the semantics): Keyword varargs. And FWIW, *args is for positional varargs. -- http://mail.python.org/mailman/listinfo/python-list

Re: what does **kw mean?

2008-01-11 Thread Lie
On Jan 11, 4:38 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've been reading the following example, and couldn't figure out, what **kw mean. (It's an empty dictionary, but what's the semantics): It's a keyword argument. It's some kind of repository for arguments that aren't recognized. If

what does **kw mean?

2008-01-11 Thread [EMAIL PROTECTED]
I've been reading the following example, and couldn't figure out, what **kw mean. (It's an empty dictionary, but what's the semantics): def wrap(method): def wrapped(self, *args, **kw): print begin method(self, *args, **kw) print end return wrapped class

Re: what does **kw mean?

2008-01-11 Thread Shane Geiger
Does this help? def foobar(first_name,last_name, *args, **kwargs): print first_name print last_name print Tuple:,args print Dict:,kwargs x = has y = demonstrated foobar('Shane','Geiger', x, y, adjective='useful', thing='PYTHON trick known as extended call syntax',

Re: what does **kw mean?

2008-01-11 Thread [EMAIL PROTECTED]
On Jan 11, 12:24 pm, Lie [EMAIL PROTECTED] wrote: On Jan 11, 4:38 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've been reading the following example, and couldn't figure out, what **kw mean. (It's an empty dictionary, but what's the semantics): It's a keyword argument. It's some kind

what does %u mean?

2006-06-08 Thread yaru22
Hi. I just started learning python. In the exercise in my book, it asks me to try print %u % (-5) I'm wondering what this %u mean? Thank you. Regards, Brian. -- http://mail.python.org/mailman/listinfo/python-list

Re: what does %u mean?

2006-06-08 Thread K.S.Sreeram
See: http://docs.python.org/lib/typesseq-strings.html u - Unsigned decimal signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: what does %u mean?

2006-06-08 Thread K.S.Sreeram
yaru22 wrote: In the exercise in my book, it asks me to try print %u % (-5) I'm wondering what this %u mean? Looks like there is *no* difference between '%u' and '%d' in Python. Python 2.4.3 source code: from stringobject.c, formatint function if (x 0 type == 'u') {

Re: what does %u mean?

2006-06-08 Thread scruffy . mogwai
I'm not sure, but I think it has something to do with unicode. print %i % 1 // Prints the integer 1 as a string. print %u % (-5) // Prints -5 as a unicode string??? yaru22 wrote: Hi. I just started learning python. In the exercise in my book, it asks me to try print %u % (-5) I'm wondering

Re: what does %u mean?

2006-06-08 Thread scruffy . mogwai
Someone beat me to the reply -- and their explanation sounds a lot better than mine! i guess you learn something new everyday... [EMAIL PROTECTED] wrote: I'm not sure, but I think it has something to do with unicode. print %i % 1 // Prints the integer 1 as a string. print %u % (-5) // Prints

what does this mean?

2005-12-13 Thread bobueland
restricted to code that is byte-compiled together. The same restriction applies to getattr(), setattr() and delattr(), as well as when referencing __dict__ directly. What does this mean? Could someone give a simple example or point to a web page explaining this. Bob -- http://mail.python.org/mailman

Re: what does this mean?

2005-12-13 Thread bobueland
Brian van den Broek has answered this in the topic newbie-one more example of difficulty in van Rossum's tutorial -- http://mail.python.org/mailman/listinfo/python-list

Re: what does 0 mean in MyApp(0)

2005-10-19 Thread James Stroud
From Google: Results 1 - 10 of about 1,340,000,000 for 0. (0.09 seconds) James On Friday 30 September 2005 07:15, Alex wrote: I'm looking at a tutorial with the code below from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, winApp, size =

Re: what does 0 mean in MyApp(0)

2005-10-04 Thread Magnus Lycka
Alex wrote: Alterbnative 2 is simple and useful, so that's why everybody use that alternative. Everybody doesn't... Particularly in Windows, it's common that people make a .pyw-file, and then you don't see any console, or otherwise they double-click on a .py-file, and if the app dies with an

Re: what does 0 mean in MyApp(0)

2005-10-02 Thread Peter Hansen
Alex wrote: Thanks for the replies. It seems that I have three options 1. app=MyApp() 2. app=MyApp(0) 3. app=MyApp('myfile.txt') I just want to emphasize the part of vincent's reply in which he points out that using the keyword arguments makes this more readable. If more examples and actual

Re: what does 0 mean in MyApp(0)

2005-10-02 Thread MrJean1
See the documentation for the __init__() method here http://www.wxpython.org/docs/api/wx.App-class.html Btw, this is wxPython 2.6, AFAIK. /Jean Brouwers -- http://mail.python.org/mailman/listinfo/python-list

Re: what does 0 mean in MyApp(0)

2005-10-01 Thread vincent wehren
Alex [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Thanks for the replies. It seems that I have three options | 1. app=MyApp() | 2. app=MyApp(0) | 3. app=MyApp('myfile.txt') | | 1. In the first case the output stream will be set to stdout/stderr, | which means that errors will

what does 0 mean in MyApp(0)

2005-09-30 Thread Alex
I'm looking at a tutorial with the code below from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, winApp, size = (800,640)) frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop() Everything

Re: what does 0 mean in MyApp(0)

2005-09-30 Thread Ido . Yehieli
i see you inherit from wxApp. mybe the constructor of that object takes an int value? -- http://mail.python.org/mailman/listinfo/python-list

Re: what does 0 mean in MyApp(0)

2005-09-30 Thread vincent wehren
Alex [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | I'm looking at a tutorial with the code below | | from wxPython.wx import * | | class MyApp(wxApp): |def OnInit(self): |frame = wxFrame(NULL, -1, winApp, size = (800,640)) |frame.Show(true) |

Re: what does 0 mean in MyApp(0)

2005-09-30 Thread Alex
Thanks for the replies. It seems that I have three options 1. app=MyApp() 2. app=MyApp(0) 3. app=MyApp('myfile.txt') 1. In the first case the output stream will be set to stdout/stderr, which means that errors will be sent to a window which will be closed when the app crashes. 2. In the second

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-29 Thread Kilian A. Foth
Christophe [EMAIL PROTECTED] wrote: Kilian A. Foth a écrit : I just found this amazing video puzzle game written with the pygame library, which promises to be infinite fun - but I can't get it to decode any video file I own, except the game's own example .mpg. All I have is lots and lots

What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Kilian A. Foth
I just found this amazing video puzzle game written with the pygame library, which promises to be infinite fun - but I can't get it to decode any video file I own, except the game's own example .mpg. All I have is lots and lots of useless .avi, .mp2, .wmv, and so on... Now, the pygame.Movie

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread accolades
An MPEG is a type of video file, you are correct in that assumption. Things such as DivX and Xvid are called codec's (COmpressor/DECompressor) codec's are used to conserve disk space, raw video files are very large. It is quite likely that PyGame does not support the compression being used by

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Christophe
Kilian A. Foth a écrit : I just found this amazing video puzzle game written with the pygame library, which promises to be infinite fun - but I can't get it to decode any video file I own, except the game's own example .mpg. All I have is lots and lots of useless .avi, .mp2, .wmv, and so on...

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Thomas Jollans
Christophe wrote: Kilian A. Foth a écrit : I just found this amazing video puzzle game written with the pygame library, which promises to be infinite fun - but I can't get it to decode any video file I own, except the game's own example .mpg. All I have is lots and lots of useless .avi,

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Grant Edwards
On 2005-09-28, Kilian A. Foth [EMAIL PROTECTED] wrote: I just found this amazing video puzzle game written with the pygame library, which promises to be infinite fun - but I can't get it to decode any video file I own, except the game's own example .mpg. All I have is lots and lots of useless

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Roel Schroeven
Grant Edwards schreef: There are two issues when it comes to video files: 1) The container format. That defines the mechanism used to combine the video and audio data streams into a single byte stream (e.g. a file). This is what is usually denoted by file file suffix. Mpeg,

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Grant Edwards
On 2005-09-28, Roel Schroeven [EMAIL PROTECTED] wrote: Grant Edwards schreef: There are two issues when it comes to video files: 1) The container format. That defines the mechanism used to combine the video and audio data streams into a single byte stream (e.g. a file). This is