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 =
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 =
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
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]) =
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
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
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
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.
--
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
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 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
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
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])
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
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
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
[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
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
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
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)?
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
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
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
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
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
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
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
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
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
[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
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
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
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',
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
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
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
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') {
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
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
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
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
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 =
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
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
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
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
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
i see you inherit from wxApp.
mybe the constructor of that object takes an int value?
--
http://mail.python.org/mailman/listinfo/python-list
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)
|
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
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
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
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
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...
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,
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
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,
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
58 matches
Mail list logo