On 18 Nov 2005 09:09:24 -0800, Greg Miller [EMAIL PROTECTED]
wrote:
Thank you for all your suggestions. I ended up casting the string to
unicode prior to inserting into the database.
Don't do it by hand if it can be done by an automated system.
Try with:
from pysqlite2 import dbapi2 as
On my box (Fedora Core4, Python 2.4.1) I am getting following error:
import termios, sys
fd = sys.stdin.fileno()
oldSettings = termios.tcgetattr(fd)
Traceback (innermost last):
File stdin, line 1, in ?
error: (22, 'Invalid argument')
Thanks for your comments.
Petr Jakes
--
[EMAIL PROTECTED] wrote:
Ben Finney wrote:
How do we deal with the rampant proliferation of a zillion
implementations of some standard idiom in PyPI?
How about some kind of mega util package? One big package with all
those recurring reinventions. If it gets popular enough, I'm sure it
on 19.11.2005 06:56 Steven D'Aprano said the following:
[snip]
Perhaps Python should concatenate numeric literals at compile time:
123 456 is the same as 123456.
Off the top of my head, I don't think this should break any older code,
because 123 456 is not currently legal in Python.
+1
Steven D'Aprano:
Perhaps Python should concatenate numeric literals at compile time:
123 456 is the same as 123456.
I think using the underscore it is more explicit:
n = 123_456
Alternatively the underscore syntax may be used to separate the number
from its base:
22875 == 22875_10 == 595b_16
Steven D'Aprano wrote:
L = [zero if n == 0 else \
negative + (odd if n % 2 else even) if n 0 else \
odd if n % 2 else even for n in range(8)]
BTW, the continuation is not necessary I believe.
[ x==0 and zero or [,-][x 0] + (even, odd)[x%2] for x in
range(8) ]
isn't too bad.
Shi Mu a écrit :
On 11/17/05, Carl J. Van Arsdall [EMAIL PROTECTED] wrote:
(Carl's top-post corrrected. Carl, please do not top-post)
Ben Bush wrote:
I wrote the following code to test the use of try...exception,
and I want n to be printed out. However, the following code's output is:
Stefan Rank wrote:
The other idea of teaching int() about separator characters has
internationalis/zation issues:
In many European countries, one would naturally try::
int('500.000,23')
instead of::
int('500,000.23')
That is why I said
Of course, also support the locale variant
[EMAIL PROTECTED] a écrit :
Is there a function/class/module/whatever I can use to
look at objects? I want something that will print the object's
value (if any) in pretty-printed form, and list all it's attributes
and their values. And do all that recursively.
I want to be able to find out
Duncan Grisby [EMAIL PROTECTED] (DG) wrote:
DG In article [EMAIL PROTECTED],
DG Piet van Oostrum [EMAIL PROTECTED] wrote:
A more lightweight solution might be Ice. http://www.zeroc.com/ice.html
It is architecturally similar to Corba, but with less overhead.
DG More lightweight and less
KvS a écrit :
Ok, makes sense but didn't seem natural to me,
It will seem more natural if you understand that modules should be
modulars (ie: low coupling, high cohesion). A module should *never*
bother about no rely upon other modules being imported by the module it
imports itself. Err, not
On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
Is there any difference between a Python immutable value, and a
constant? I suppose constant also implies that the *name* binds
unchangeably to a particular value. Is that meaningful?
That's precisely how I understand constant to be
On Sat, 19 Nov 2005 01:33:40 -0800, bearophileHUGS wrote:
Steven D'Aprano:
Perhaps Python should concatenate numeric literals at compile time:
123 456 is the same as 123456.
I think using the underscore it is more explicit:
n = 123_456
It is also easy to make a typo:
n = 123-456
--
HI -
Sorry for maybe a too simple a question but I googled and also checked my
reference O'Reilly Learning Python
book and I did not find a satisfactory answer.
When I use readlines, what happens if the number of lines is huge?I have
a very big file (4GB) I want to
read in, but I'm sure
newer python should use for x in fh:, according to the doc :
fh = open(your file)
for x in fh: print x
which would only read one line at a time.
Ross Reyes wrote:
HI -
Sorry for maybe a too simple a question but I googled and also checked my
reference O'Reilly Learning Python
book and I did
Ross Reyes [EMAIL PROTECTED] wrote:
Sorry for maybe a too simple a question but I googled and also
checked my reference O'Reilly Learning Python book and I did not
find a satisfactory answer.
The Python documentation is online, and it's good to get familiar with
it:
Steve wrote:
AJAX works because browsers can execute javascript. I don't know of a
browser that can execute python. Basically your stuck with java or
javascript because everything else really isn't cross platform
Don't jump to conclusions...
http://dwahler.ky/python/
If you really, really
Thanks a lot for all the answers. After rereading everything said here
today it's become more clear to me what you guys are telling me and
I'll actively try to forget about from ... import * ;).
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
Money is made in many ways, essentially by creating (perceived) buyer
advantage and capturing some part of it -- but market segmentation is
just one of many ways. IF your predictions are ENORMOUSLY better than
those the competition can make, then offering for free
Hello
If I have the Vector class below, is there a means by which I can have
the following behaviour
A = Vector(1, 2)
print A
(1, 2)
A = 0
print A
(0, 0)
If there is such a means, will it still work with the __slots__
attribution uncommented?
Thanks
class Vector(object):
#__slots__ =
Gerard Flanagan wrote:
Hello
If I have the Vector class below, is there a means by which I can have
the following behaviour
A = Vector(1, 2)
print A
(1, 2)
A = 0
print A
(0, 0)
If there is such a means, will it still work with the __slots__
attribution uncommented?
No, you
Gerard Flanagan wrote:
If I have the Vector class below, is there a means by which I can have
the following behaviour
A = Vector(1, 2)
print A
(1, 2)
A = 0
that operation rebinds A; it doesn't affect the Vector instance in any way.
more here:
http://effbot.org/zone/python-objects.htm
Ross Reyes wrote:
When I use readlines, what happens if the number of lines is huge?I have
a very big file (4GB) I want to read in, but I'm sure there must be some
limitation to readlines and I'd like to know how it is handled by python.
readlines itself has no limitation, but it reads
On Sat, 19 Nov 2005 21:45:40 +1100, Steven D'Aprano [EMAIL PROTECTED] wrote:
On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
Is there any difference between a Python immutable value, and a
constant? I suppose constant also implies that the *name* binds
unchangeably to a particular
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings foo and bar. How can you obtain the
function foo.bar()?
Surely somebody knows..
TIA,
g
--
http://mail.python.org/mailman/listinfo/python-list
f = getattr(obj,bar)
f()
guy lateur wrote:
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings foo and bar. How can you obtain the
function foo.bar()?
Surely somebody knows..
TIA,
g
--
Bruno Desthuilliers enlightened us with:
(Carl's top-post corrrected. Carl, please do not top-post)
If you correct people and ask them to alter their posting style, at
least make sure you post in a proper way. Snip what you're not
directly referring to, so people don't have to scroll in order to
guy lateur wrote:
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings foo and bar. How can you obtain the
function foo.bar()?
Surely somebody knows..
getattr helps. However, your example won't work: it misses either a
[EMAIL PROTECTED] enlightened us with:
Of course, also support the locale variant where the meaning of ,
and . is swapped in most European countries.
This is exactly why I wouldn't use that notation. What happens if it
is hardcoded into the source? I mean, that's what we're talking about.
Then
Sybren Stuvel wrote:
[EMAIL PROTECTED] enlightened us with:
Of course, also support the locale variant where the meaning of ,
and . is swapped in most European countries.
This is exactly why I wouldn't use that notation. What happens if it
is hardcoded into the source? I mean, that's what
In VB, an easy way I indicate progress is something like
do while some process is not met
lblNotify.foreground = randomcolor
lblNotify.refresh ---
sleep
loop
I want to do the same thing in Python/Tkinter:
# Wait for
Thank you Don, thank you David,
I was convinced that there must be a simple solution at hand. A dummy
widget!
It does work to my needs. Don's ScrollToolView is very interesting
though not yet the right tool for my actual application, but I've got
some more ideas for long winter nights ...
I've seen this construct in a script
[x.capitalize() for x in ['a','b', 'c']]
['A', 'B', 'C']
I tried another myself
[x+1 for x in [1,2,3]]
[2, 3, 4]
Apparently you can do
[function(x) for x in list]
I tried to find a description of this in Library Reference but
couldn't find it. Could
Bruno Desthuilliers wrote:
[EMAIL PROTECTED] a écrit :
Is there a function/class/module/whatever I can use to
look at objects? I want something that will print the object's
value (if any) in pretty-printed form, and list all it's attributes
and their values. And do all that
Bruno Desthuilliers wrote:
[EMAIL PROTECTED] a écrit :
Is there a function/class/module/whatever I can use to
look at objects? I want something that will print the object's
value (if any) in pretty-printed form, and list all it's attributes
and their values. And do all that
On Sat, 19 Nov 2005 14:12:25 GMT, guy lateur [EMAIL PROTECTED] wrote:
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings foo and bar. How can you obtain the
function foo.bar()?
Why don't you type these things into an interactive python session
and
This type of construct seems to be called list comprehension.
Googling for
Python list comprehension
gives a lot of hints that describe the construct.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Alternatively the underscore syntax may be used to separate the number
from its base:
22875 == 22875_10 == 595b_16 == 123456_7
But probably this is less commonly useful (and not much explicit).
We already have a perfectly good syntax for entering octal and hex
Terrance N. Phillip wrote:
In VB, an easy way I indicate progress is something like
do while some process is not met
lblNotify.foreground = randomcolor
lblNotify.refresh ---
sleep
loop
I want to do the same thing in
guy lateur wrote:
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings foo and bar. How can you obtain the
function foo.bar()?
Surely somebody knows..
TIA,
g
Would that do?
class foo:
@staticmethod
def bar():
On Sat, 19 Nov 2005 14:12:25 GMT, guy lateur [EMAIL PROTECTED] wrote:
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings foo and bar. How can you obtain the
function foo.bar()?
Surely somebody knows..
Sorry, clean forgot about the strings.
[EMAIL PROTECTED] wrote:
Stefan Rank wrote:
The other idea of teaching int() about separator characters has
internationalis/zation issues:
In many European countries, one would naturally try::
int('500.000,23')
instead of::
int('500,000.23')
That is why I said
Of course, also
On 19 Nov 2005 07:06:30 -0800, [EMAIL PROTECTED] wrote:
I've seen this construct in a script
[x.capitalize() for x in ['a','b', 'c']]
['A', 'B', 'C']
I tried another myself
[x+1 for x in [1,2,3]]
[2, 3, 4]
Apparently you can do
[function(x) for x in list]
I tried to find a description of
Just try it, it is not that hard ... ;-)
/Jean Brouwers
PS) Here is what happens on Linux:
$ limit vmemory 1
$ python
...
s = file(bugfile).readlines()
Traceback (most recent call last):
File stdin, line 1 in ?
MemoryError
--
Attacked is a piece of code which first hits the login page
successfully and receives back login cookies. But then when I attempt
to hit a page which is restricted to logged in users only, I fail.
That seems to be because I am not successfully re-attaching the cookies
to the header portion of
Hello.
I'm writing a program that creates a series of batch operations to
convert movies to be used on iPodLinux. The programs that do the
encoding and conversions are seperate from mine and all mine does is
use os.system() to call the program.
However, it needs to get an input file and an
Thanks for the feedback, people.
I actually only need the bar part (instance methods). I added the foo
part to generalize the question without really thinking it through first.
Still, it has gotten me more information than I ever imagined. So thanks
again.
g
--
Looks OK to me. Just tried on my network - works with no exceptions
--
http://mail.python.org/mailman/listinfo/python-list
If I'd like to learn Python for web-development, what are the options
available?
Thanks. tony
--
http://mail.python.org/mailman/listinfo/python-list
On Sunday 20 November 2005 00:24, Tony wrote:
If I'd like to learn Python for web-development, what are the options
available?
Thanks. tony
A nice framework is CherryPy: http://www.cherrypy.org
or Turbogears, which is based on CherryPy: http://www.turbogears.org/
Michael.
--
To provide some feedback:
As Grant Edwards posted in this list, I was running my code inside of
IDE that replaces sys.stdin with some other. While running the program
from a shell prompt, everything goes fine.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Tony wrote:
If I'd like to learn Python for web-development, what are the options
available?
Thanks. tony
Nov 18th:
http://groups.google.co.uk/group/comp.lang.python/browse_frm/thread/c23b12dc0edf8af0/19f859dc43c77ac1#19f859dc43c77ac1
Gerard
--
Roy SmithWe already have a perfectly good syntax for entering octal
and hex integers,
There is this syntax:
1536 == int(600, 16)
that accepts strings only, up to a base of 36.
There are the hex() and oct() functions.
There is the %x and %o sintax, that isn't easy to remember.
There are the 0x600
[EMAIL PROTECTED] wrote:
Steven D'Aprano:
Perhaps Python should concatenate numeric literals at compile time:
123 456 is the same as 123456.
I think using the underscore it is more explicit:
n = 123_456
Alternatively the underscore syntax may be used to separate the number
from its base:
[EMAIL PROTECTED] wrote:
Look at the code below:
# mystringfunctions.py
def cap(s):
print s
print the name of this function is + ???
cap (hello)
Running the code above gives the following output
hello
the name of this function is ???
[EMAIL PROTECTED] wrote:
[edited slightly]
def cap():
print the name of this function is + ???
cap ()
sys._getframe() would help you here:
import sys
sys._getframe()
frame object at 0x00B496D0
def f():
... global x
... x = sys._getframe()
...
f()
x
frame object at
On 19 Nov 2005 05:29:07 -0800
Gerard Flanagan [EMAIL PROTECTED] wrote:
If I have the Vector class below, is there a means by
which I can have the following behaviour
A = Vector(1, 2)
print A
(1, 2)
A = 0
print A
(0, 0)
As has already been mentioned, A = 0 rebinds the name A
to the
[EMAIL PROTECTED] wrote:
I want to do the same thing in Python/Tkinter:
# Wait for network to recognize the workstation:
while os.system(slist) != 0:
self.notify[fg] = randcolor()
# how do I refresh label l3 at this point?
time.sleep(3)
Peter Hansen wrote:
Steven Bethard wrote:
Note that even though the tabs are internal, they are still removed by
textwrap.dedent(). The documentation[1] says:
...
So it looks to me like even if this is a feature it is undocumented.
I'm planning on filing a bug report, but I wanted
Thanks Diez and Peter,
Just what I was looking for. In Library Reference heading
3.11.1 Types and members
I found the info about the method you described. I also made a little
function to print out not just the name of the function but also the
parameter list. Here it is
# fname.py
Steve Holden wrote:
[EMAIL PROTECTED] wrote:
Stefan Rank wrote:
The other idea of teaching int() about separator characters has
internationalis/zation issues:
In many European countries, one would naturally try::
int('500.000,23')
instead of::
int('500,000.23')
That
NEVERMIND. My friend pointed out that I am simply hitting the wrong
URL when trying to test whether I am logged in or not. The correct
one is: http://www.dpreview.com/forums/editprofile.asp
But I still have one question, if anyone knows -- why is it that when I
print out the headers on my
OK that worked really well. In particular, the lastindex property of
the match object can be used to tell exactly which group matched,
without having to sequentially search the list of groups.
In fact, I was able to use your idea to cobble together a poor man's
lexer which I am calling reflex
Okay, thank you. This worked very well.
--
http://mail.python.org/mailman/listinfo/python-list
No templates, no python-like or special languages, only pure and simple
python.
You can embedd python into html or, if it better suits your programming
style, you can embed html into python. Why don't you give it a try?
I dislike embedding code or html in each other, apart from the
Bengt Richter [EMAIL PROTECTED] wrote:
On Sat, 19 Nov 2005 11:10:42 +1100 (EST), Ben Finney [EMAIL PROTECTED]
wrote:
Bengt Richter [EMAIL PROTECTED] wrote:
If [an enumeration has a fixed sequence], what is more natural
than using their index values as keys to other ordered info?
I don't
[EMAIL PROTECTED] wrote:
Steve Holden wrote:
[...]
I really wouldn't want it to become possible to write Python code in one
locale that had to be edited before the numeric literals were valid in
another locale. That way madness lies.
That is the fact, from the very beginning. 1.234 striaightly
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
Is there any difference between a Python immutable value, and a
constant? I suppose constant also implies that the *name* binds
unchangeably to a particular value. Is that meaningful?
That's
Steven Bethard wrote:
Thanks for double-checking this for me. I looked at expand_tabs, and
it's part of the definition of the TextWrapper class, which is not
actually used by textwrap.dedent(). So I think the textwrap.dedent()
expanding-of-tabs behavior is still basically undocumented.
I meant that it is not strictly necessary to use templates in
Karrigell, although you can use Cheetah if you want.
I'm not used to templates mainly because I'm familiar with the way PHP
works and, for simple dynamic sites like those I work on, this is the
simpliest approach.
Another reason is that
Peter Hansen wrote:
Kent Johnson wrote:
import path
files = path.path(pathToSearch).walkfiles(filename)
A minor enhancement (IMHO) (though I certainly agree with Kent's
recommendation here): since there is nothing else of interest in the
path module, it seems to be a fairly common idiom
Is there a way to create a button in either pygame or livewires, that is
able to be clicked and when clicked sends a command to restart the program?
You could try something like this using pygsear
(http://www.nongnu.org/pygsear/)
The button can call either start() which just makes
a new
[EMAIL PROTECTED] wrote:
I dislike embedding code or html in each other, apart from the
'impurity' of mixing code and user interface it makes them inseparable.
Using templates means that the code can work with different templates,
and this should be seamless, it also means that different code
Peter Hansen:
Compelling to whom? I wonder if it's even possible for Guido to find
compelling anything which obsoletes much of os.path and shutil and
friends (modules which Guido probably added first and has used the most
and feels most comfortable with).
To me, most uses of path.py
On Sat, 19 Nov 2005 13:08:57 -0500, Peter Hansen wrote:
Umm... in other words, the underscore is under-used so let's assign
some arbitrary meaning to it (to make the language more like Perl
perhaps?).
+1
I *really* don't like the idea of allowing underscores in numeric
literals. Firstly,
Steven D'Aprano wrote:
[...]
Likewise, base conversion into arbitrary bases is not, in my opinion,
common enough a task that support for it needs to be built into the syntax
for literals. If somebody cares enough about it, write a module to handle
it and try to get it included with the Python
Steve Holden wrote:
Being European myself I am well aware of the notational differences of
the different locales, and I am perfectly happy that users can enter
numbers in their preferred format when they execute a program.
However, I am not happy about the idea that a program source would
Steven D'Aprano wrote:
That's a tad unfair. Dealing with numeric literals with lots of digits is
a real (if not earth-shattering) human interface problem: it is hard for
people to parse long numeric strings. In the wider world outside of IT,
people deal with long numeric digits by grouping.
On Sun, 20 Nov 2005 08:56:33 +1100, Ben Finney wrote:
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
Is there any difference between a Python immutable value, and a
constant? I suppose constant also implies that the *name* binds
unchangeably
O/S: Win2K
Vsn of Python:2.4
Based on a search of other posts in this group, it appears as though
os.environ['PATH'] is one way to obtain the PATH environment variable.
My questions:
1) is it correct that os.environ['PATH'] contains the PATH environment
variable?
2) are there other ways to
On Sun, 20 Nov 2005 01:39:04 +, Steve Holden wrote:
Steven D'Aprano wrote:
[...]
Likewise, base conversion into arbitrary bases is not, in my opinion,
common enough a task that support for it needs to be built into the syntax
for literals. If somebody cares enough about it, write a
On Sun, 20 Nov 2005 08:42:48 +1100 (EST), Ben Finney [EMAIL PROTECTED] wrote:
Bengt Richter [EMAIL PROTECTED] wrote:
On Sat, 19 Nov 2005 11:10:42 +1100 (EST), Ben Finney [EMAIL PROTECTED]
wrote:
Bengt Richter [EMAIL PROTECTED] wrote:
If [an enumeration has a fixed sequence], what is more
Steven D'Aprano wrote:
Dealing with numeric literals with lots of digits is
a real (if not earth-shattering) human interface problem: it is hard for
people to parse long numeric strings.
I'm totally unconvinced that this _is_ a real problem, if we define
real as being even enough to jiggle my
Anton Vredegoor [EMAIL PROTECTED] wrote:
...
Suppose I grant all your theories about optimal marketing strategies.
This still doesn't account for the way the market is behaving *now*. It
isn't in any way logical or optimal. For example in Holland (where I
live) complete governmental
Neil Hodgson wrote:
To me, most uses of path.py are small incremental improvements over
os.path rather than being compelling. Do a number of small improvements
add up to be large enough to make this change?
If the number of small improvements is large enough then, as with other
such
Cameron Laird [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED], I mumbled:
.
.
.
Pyro might be perfect. My own instinct is to start even more
primitively, with a minimal asynchat client and server. I've
looked through
KvS [EMAIL PROTECTED] wrote:
Thanks a lot for all the answers. After rereading everything said here
today it's become more clear to me what you guys are telling me and
I'll actively try to forget about from ... import * ;).
I commend you for your decision. It's a construct that I sometimes
[EMAIL PROTECTED] wrote:
newer python should use for x in fh:, according to the doc :
fh = open(your file)
for x in fh: print x
which would only read one line at a time.
I have some other questions:
when fh will be closed?
And what shoud I do if I want to explicitly close the file
Steven D'Aprano [EMAIL PROTECTED] wrote:
That's a tad unfair. Dealing with numeric literals with lots of digits is
a real (if not earth-shattering) human interface problem: it is hard for
people to parse long numeric strings.
There are plenty of ways to make numeric literals easier to read
I'm writing a wrapper class to handle the line merging and filtering
for a log file analysis app
The problem I'm running into is that the StopIteration exception
raised when the wrapped file goes past EOF isn't causing the second
for loop to stop. Wrapping the second for loop in a try/except
Decorate any function with @aboutme(), which
will print the function name each time the function is called.
All the 'hello' stuff is in the aboutme() decorator code.
There is no code in the decorated functions themselves
doing anything to telling us the function name.
# The decorator
def
hi, does anyone know of a library that can query domain registry or any
site that provide information to such an activity? as i want to build a
simple domain name searching program for my own benefit.. thanks alot :D
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano [EMAIL PROTECTED] writes:
Brackets include:
parentheses or round brackets ( )
square brackets [ ]
braces or curly brackets { }
chevrons or angle brackets â© âª
The symbols for chevrons are not available on common keyboards, are not
available in ordinary ASCII, and may
On Sun, 20 Nov 2005 11:05:53 +0800, Xiao Jianfeng wrote:
I have some other questions:
when fh will be closed?
When all references to the file are no longer in scope:
def handle_file(name):
fp = file(name, r)
# reference to file now in scope
do_stuff(fp)
return fp
f =
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 19 Nov 2005 13:08:57 -0500, Peter Hansen wrote:
Umm... in other words, the underscore is under-used so let's assign
some arbitrary meaning to it (to make the language more like Perl
perhaps?).
+1
I *really* don't like the idea of allowing
Hello,
I've got a program that (ideally) perpetually monitors sys.stdin for
lines of text. As soon as a line comes in, my program takes some
action.
The problem is, it seems like a very large amount of data must
accumulate on sys.stdin before even my first invocation of readline()
returns. This
Mike Meyer [EMAIL PROTECTED] wrote:
I've seen at least one language (forget which one) that allowed such
separators, but only for groups of three.
That seems a bit silly. Not all numbers are naturally split into groups of
three. Credit card numbers are (typically) split into groups of four.
[EMAIL PROTECTED] writes:
I've seen this construct in a script
[x.capitalize() for x in ['a','b', 'c']]
['A', 'B', 'C']
I tried to find a description of this in Library Reference but
couldn't find it. Could somebody direct me where this type of construct
is described.
As others have pointed
james t kirk wrote:
I'm writing a wrapper class to handle the line merging and filtering
for a log file analysis app
The problem I'm running into is that the StopIteration exception
raised when the wrapped file goes past EOF isn't causing the second
for loop to stop.
Admiral Kirk,
The
Steven D'Aprano wrote:
On Sun, 20 Nov 2005 11:05:53 +0800, Xiao Jianfeng wrote:
I have some other questions:
when fh will be closed?
When all references to the file are no longer in scope:
def handle_file(name):
fp = file(name, r)
# reference to file now in scope
1 - 100 of 117 matches
Mail list logo