An error in the CIE2000 Delta E equation has been found and corrected,
necessitating the immediate release of python-colormath 1.0.5. All
users of the 1.x series are encouraged to upgrade to avoid this
mathematical error.
What new in 1.0.5?
===
* The examples and unit tests may be ran
2009/9/29 rantingrick rantingr...@gmail.com:
On Sep 28, 8:04 pm, Chris Rebert c...@rebertia.com wrote:
On Mon, Sep 28, 2009 at 5:48 PM, Rudolf yellowblueyel...@gmail.com wrote:
How can i declare a global array in python?
Python has no concept of declarations.
And it doesn't have arrays, it
On Mon, Sep 28, 2009 at 6:55 PM, rantingrick rantingr...@gmail.com wrote:
On Sep 28, 8:04 pm, Chris Rebert c...@rebertia.com wrote:
On Mon, Sep 28, 2009 at 5:48 PM, Rudolf yellowblueyel...@gmail.com wrote:
How can i declare a global array in python?
Python has no concept of declarations.
Peng Yu wrote:
What python/OS are you using?
python 2.6.2 and CentOS
Just tried 2.6 on Darwin, and it does happen. So looks
like 2.6 has been changed to inherit the permission
bits from the .py. Makes sense, except that the x bits
should really be turned off.
--
Greg
--
Hello,
I am writing code that cycles through files in a directory and for each
file it writes out another file with info in it. It appears that as I am
iterating through the list returned by os.listdir it is being updated
with the new files that are being added to the directory. This occurs
On Mon, Sep 28, 2009 at 11:03 PM, Chris Adamson
chris.adam...@mcri.edu.au wrote:
Hello,
I am writing code that cycles through files in a directory and for each file
it writes out another file with info in it. It appears that as I am
iterating through the list returned by os.listdir it is
On Sep 28, 9:38 pm, John Gordon gor...@panix.com wrote:
If I didn't do all that in a class, where would I do it?
You could, for example, use the basicConfig() function to do it all
for you.
import logging
logging.basicConfig(filename='/path/to/my/log',level=logging.DEBUG)
logging.debug('This
On Tue, 29 Sep 2009 18:21:09 +1200, greg wrote:
Peng Yu wrote:
What python/OS are you using?
python 2.6.2 and CentOS
Just tried 2.6 on Darwin, and it does happen. So looks like 2.6 has been
changed to inherit the permission bits from the .py. Makes sense, except
that the x bits should
Chris Adamson wrote:
I am writing code that cycles through files in a directory and for each
file it writes out another file with info in it. It appears that as I am
iterating through the list returned by os.listdir it is being updated
with the new files that are being added to the directory.
On Tue, 29 Sep 2009 16:03:46 +1000, Chris Adamson wrote:
Hello,
I am writing code that cycles through files in a directory and for each
file it writes out another file with info in it. It appears that as I am
iterating through the list returned by os.listdir it is being updated
with the
If you can enumerate the language of possible inputs you could
generate a unique binary representation. Against a language of size
l that would only take you O(l*n) to build the repr for a dict
and for certain repr sizes the comparison could be O(1), making
the entire operation O(l*n+l*m) vs
On 2009-09-28, Hendrik van Rooyen hend...@microcorp.co.za wrote:
On Saturday, 26 September 2009 16:55:30 Grant Edwards wrote:
On 2009-09-26, Dave Angel da...@ieee.org wrote:
Actually even 64k looked pretty good, compared to the 1.5k of
RAM and 2k of PROM for one of my projects, a navigation
On this post, you are talking about Talend and Informatica like both
are
comparable... indeed both tools are comparable in power and
functionality.
But keep in mind Informatica is a proprietary solution, with no access
to the code. You have a license fee + other costs associated to the
use
of
On Sep 29, 5:48 am, Rudolf yellowblueyel...@gmail.com wrote:
How can i declare a global array in python?
As others have mentioned, you do not have concept of declaration. But
if you are looking for creating a global variable, it is like any
other language. Declare the same in a module, outside
Hello Everybody,
My doubt is about matrix data manipulation in python - I hope someone can
point me some direction.
I googled around, but there is not much good examples about playing with
matrix in python on internet.
My following function works pretty well, and gives me the outup from my
Steven D'Aprano ste...@remove.this.cybersource.com.au (SD) wrote:
SD What you describe is impossible -- os.listdir() returns an ordinary list,
SD it isn't a lazy iterator that updates automatically as the directory
SD changes. (At least not in Python2.5 -- I haven't checked Python 3.1.)
He's
On Sep 28, 9:41 pm, Daniel Fetchinson fetchin...@googlemail.com
wrote:
I'm new to using SQLObject, and having some problems with getting it
to recognise my current MySQL database.
I've set up my connection fine, but it won't recognise the names of
the columns (presumably because they're
Hello
From my C extension module I want to store a C pointer in a given PyObject.
The only way I figure how to do it is to use Py_BuildValues and store the
poiner casted to Py_ssize_t, thus:
Py_BuildValues(n, (Py_ssize_t)my_ptr)
Can it be done differently?
Regards,
Elias
--
On 28 Sep, 17:49, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Mon, 28 Sep 2009 03:35:44 -0700 (PDT), xera121
lolmcbr...@googlemail.com declaimed the following in
gmane.comp.python.general:
Hi
I have tuples in the format shown below:
Threader Slash wrote:
Hello Everybody,
My doubt is about matrix data manipulation in python - I hope someone
can point me some direction.
I googled around, but there is not much good examples about playing with
matrix in python on internet.
My following function works pretty well, and
Piet van Oostrum wrote:
Steven D'Aprano ste...@remove.this.cybersource.com.au (SD) wrote:
SD What you describe is impossible -- os.listdir() returns an ordinary list,
SD it isn't a lazy iterator that updates automatically as the directory
SD changes. (At least not in Python2.5 -- I haven't
Rudolf wrote:
How can i declare a global array in python?
import __builtin__
__builtin__.myList = []
Now you can use myList everywhere in your code.
Note that modifying __builtin__ is **not** recommended at all. I don't
have time to detail that point, google it if you want the answer. I
Hi all
For an exception defined as below
class OptionError(Exception):
def __init__(self, args):
self.args = args
def __str__(self):
return repr(self.v)
an iteration is happening when the exception is raised
Meanwhile for almost the same structured exception replacing
Visco Shaun wrote:
Hi all
For an exception defined as below
class OptionError(Exception):
def __init__(self, args):
self.args = args
This should read:
def __init__(self, *args):
self.args = args
(notice the * !)
self.args holds the constructor argument tuple or
Mark Dickinson a écrit :
On Sep 28, 9:37 am, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
Joel Juvenal Rivera Rivera a écrit :
Yeah i forgot the self an try the code then i see
an error that it was not defines _uno__a so that's
where i define the global and see
On Sep 29, 11:11 am, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
Mark Dickinson a écrit :
On Sep 28, 9:37 am, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
Looks like a bug to me. I Think you should fill a ticket...
I don't think it's a
Hi
I was wondering if there exists somme way to clear memory of all objects
created during a current IDLE session (with the same effect as if one
starts an IDLE session). Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
if myFile variable contains the actual filename then how can i open a
file for wirte so that complete filename appears as
actualname_kks.txt
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 29, 2009 at 3:35 PM, kks kkis.thek...@gmail.com wrote:
if myFile variable contains the actual filename then how can i open a
file for wirte so that complete filename appears as
actualname_kks.txt
open(myFile + _kks.txt, w)
--
André Engels, andreeng...@gmail.com
--
On Monday, 28 September 2009 18:54:09 Scott wrote:
I am new to Python but I have studied hard and written a fairly big
(to me) script/program. I have solved all of my problems by Googling
but this one has got me stumped.
I want to check a string for a substring and if it exists I want to
Hendrik van Rooyen wrote:
On Monday, 28 September 2009 18:54:09 Scott wrote:
I am new to Python but I have studied hard and written a fairly big
(to me) script/program. I have solved all of my problems by Googling
but this one has got me stumped.
I want to check a string for a substring and
Grant Edwards wrote:
I recently ran across this construct for grabbing the last
(whitespace delimited) word in a string:
s.rsplit(None,1)[1]
... I've always done this:
s.split()[-1]
I was wondering what the advantage of the rsplit(None,1)[1]
approach would be ...
Others have pointed out
On Sep 28, 7:37 pm, Scott scott.freem...@gmail.com wrote:
On Sep 28, 2:00 pm, Dave Angel da...@ieee.org wrote:
Scott wrote:
Thank you fine folks for getting back with your answers!
So down the road I do dictname[line42].append(new stuff). (or [var]
if I'm looping through the dict)
On Tuesday, 29 September 2009 11:03:17 Tim Chase wrote:
I think Steven may be remembering the conversation here on c.l.p
a month or two back where folks were asking to turn os.listdir()
into an iterator (or create an os.xlistdir() or os.iterdir()
function) because directories with lots of
On Sep 29, 3:11 am, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
Mark Dickinson a écrit :
On Sep 28, 9:37 am, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
Joel Juvenal Rivera Rivera a écrit :
Yeah i forgot the self an try the code
candide wrote:
Hi
I was wondering if there exists somme way to clear memory of all objects
created during a current IDLE session (with the same effect as if one
starts an IDLE session). Thanks.
Different than Shell / Restart Shell (Ctrl+F6) ?
Of course this doesn't work if you started Idle
I'm attempting to reformat an apache log file that was written with a
custom output format. I'm attempting to get it to w3c format using a
python script. The problem I'm having is the field-to-field matching.
In my python code I'm using split with spaces as my delimiter. But it
fails when it
Carl Banks a écrit :
On Sep 29, 3:11 am, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
Mark Dickinson a écrit :
(snip)
The double underscores and name mangling are a red herring:
I beg to disagree. The problem (well... what I think is a problem,
actually) IS that
2009/9/29 Scooter slbent...@gmail.com:
I'm attempting to reformat an apache log file that was written with a
custom output format. I'm attempting to get it to w3c format using a
python script. The problem I'm having is the field-to-field matching.
In my python code I'm using split with spaces
Thanks Carl, that does it!
--
Elias
Carl Banks pavlovevide...@gmail.com wrote in message
news:48ce343a-36ef-406f-bea3-851444785...@b18g2000vbl.googlegroups.com...
On Sep 28, 8:19 am, lallous lall...@lgwm.org wrote:
Hello
How to programmatically create a class instance of a given Python
Hello
Suppose I have this code:
class X:
def __init__(self, n):
self.L = [x for x in xrange(0, n+1)]
class Y:
def __init__(self, n):
self.M = [X(x) for x in xrange(0, n)]
t = Y(5)
How can I easily print t and all its nested attributes? (Something like
PHP's print_r())
Could soneone show me a simple example of a twisted server that loads
2 html pages
www..com:7899/page1/
www..com:7899/page2/
Thanx
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
A simple and silly if-else question.
I saw some code that has the following structure. My question is why
else is used there though removing else
has the same result. More important, is it not syntactically wrong :-(
for i in xrange(8):
if i 4:
print i
else:
print i
Björn Lindqvist wrote:
2009/9/29 Scooter slbent...@gmail.com:
I'm attempting to reformat an apache log file that was written with a
custom output format. I'm attempting to get it to w3c format using a
python script. The problem I'm having is the field-to-field matching.
In my python code I'm
Sandy wrote:
Hi all,
A simple and silly if-else question.
I saw some code that has the following structure. My question is why
else is used there though removing else
has the same result. More important, is it not syntactically wrong :-(
for i in xrange(8):
if i 4:
print i
else:
Sandy wrote:
Hi all,
A simple and silly if-else question.
I saw some code that has the following structure. My question is why
else is used there though removing else
has the same result. More important, is it not syntactically wrong :-(
for i in xrange(8):
if i 4:
print i
else:
Sandy wrote:
Hi all,
A simple and silly if-else question.
I saw some code that has the following structure. My question is why
else is used there though removing else
has the same result. More important, is it not syntactically wrong :-(
for i in xrange(8):
if i 4:
print i
else:
On Sep 29, 2:27 am, lallous lall...@lgwm.org wrote:
Hello
From my C extension module I want to store a C pointer in a given PyObject.
The only way I figure how to do it is to use Py_BuildValues and store the
poiner casted to Py_ssize_t, thus:
Py_BuildValues(n, (Py_ssize_t)my_ptr)
Can it
Hi,
I'm trying to post data to a short test script in php I wrote.
The python code to do the post is
import httplib
#server address
conn = httplib.HTTPConnection(localhost)
#file location
conn.request(POST, /programming/bots/test.php,ted=fred)
r1 = conn.getresponse()
print r1.status, r1.reason
On Sep 29, 10:24 am, tedpot...@gmail.com tedpot...@gmail.com
wrote:
Hi,
I'm trying to post data to a short test script in php I wrote.
The python code to do the post is
import httplib
#server address
conn = httplib.HTTPConnection(localhost)
#file location
conn.request(POST,
Dear Python users,
I just start to use python and love this language. I met this
problem when I try to save my functions in a separate file.
The question is how I can pass a global variable to a function which
is saved in another file. If I save the function I defined in the same
file with the
On 29 Sep, 10:27, lallous lall...@lgwm.org wrote:
Hello
From my C extension module I want to store a C pointer in a given PyObject.
The only way I figure how to do it is to use Py_BuildValues and store the
poiner casted to Py_ssize_t,
Formally, you should cast the pointer to Py_intptr_t, as
If I'm reading the indentation correctly, the else is applying to the for
loop, not the if statement.
When used in this way, the else occurs only if the for loop exits due to
completion (aka, the for loop does not exit due to a break or return
statement).
I would expect the output from that
Hi,
Am Tue, 29 Sep 2009 09:40:29 -0700 (PDT)
schrieb Mars creature jin...@gmail.com:
I just start to use python and love this language. I met this
problem when I try to save my functions in a separate file.
The question is how I can pass a global variable to a function which
is saved in
On Sep 29, 9:42 am, sturlamolden sturlamol...@yahoo.no wrote:
You can use PyCObject, or write your own extension type that wraps the
pointer (very easy to to with Cython or Pyrex). The advantage of using
an extension type is you have a guarantee from Python on the
deallocator method being
a month or two back where folks were asking to turn os.listdir()
into an iterator (or create an os.xlistdir() or os.iterdir()
function) because directories with lots of files were causing
inordinate slowdown. Yes, listdir() in both 2.x and 3.x both
return lists while such a proposed iterator
On Sep 29, 9:08 am, Gary Herron gher...@islandtraining.com wrote:
Sandy wrote:
Hi all,
A simple and silly if-else question.
I saw some code that has the following structure. My question is why
else is used there though removing else
has the same result. More important, is it not
On Sep 20, 8:19 am, Peng Yu pengyu...@gmail.com wrote:
I am wondering what is the best way of organizing python source code
in a large projects. There are package code, testing code. I'm
wondering if there has been any summary on previous practices.
(Sorry for the late reply.)
My advice:
Ethan Furman wrote:
Sandy wrote:
Hi all,
A simple and silly if-else question.
I saw some code that has the following structure. My question is why
else is used there though removing else
has the same result. More important, is it not syntactically wrong :-(
for i in xrange(8):
if i 4:
Mars creature wrote:
Dear Python users,
I just start to use python and love this language. I met this
problem when I try to save my functions in a separate file.
The question is how I can pass a global variable to a function which
is saved in another file. If I save the function I defined in
Carl Banks pavlovevide...@gmail.com wrote:
Hmm, I wonder if Python should emit a warning if an else is used on a
for block with no break inside. I don't think the else can be invoked
in any other way. As a bonus it could catch some cases where people
mistakenly use it thinking it will
On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote:
Dear Python users,
I just start to use python and love this language. I met this
problem when I try to save my functions in a separate file.
The question is how I can pass a global variable to a function which
is saved
I'm new to python and I'm trying to write a script which takes the
computer name from the variable 'name' and gets the uptime.
What I have so far:
query = win32pdh.OpenQuery()
counter = win32pdh.AddCounter(query, r'\System\System Up Time')
win32pdh.CollectQueryData(query)
var1,
On Sep 29, 1:08 pm, Jamie jamie.iva...@gmail.com wrote:
I'm new to python and I'm trying to write a script which takes the
computer name from the variable 'name' and gets the uptime.
What I have so far:
query = win32pdh.OpenQuery()
counter = win32pdh.AddCounter(query,
On 29 Sep, 19:11, Carl Banks pavlovevide...@gmail.com wrote:
CObjects can be passed a C function as a deallocator; this should work
as reliably as a custom class deallocator.
Carl Banks
Except that __del__ prevents cyclic GC.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com
wrote:
On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote:
Dear Python users,
I just start to use python and love this language. I met this
problem when I try to save my functions in a separate file.
The
On Tue, Sep 29, 2009 at 11:11 AM, Scooter slbent...@gmail.com wrote:
I'm attempting to reformat an apache log file that was written with a
custom output format. I'm attempting to get it to w3c format using a
python script. The problem I'm having is the field-to-field matching.
In my python
Mars creature wrote:
On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com
wrote:
On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote:
Dear Python users,
I just start to use python and love this language. I met this
problem when I try to save my functions in a
On Sep 29, 9:43 am, Andre Engels andreeng...@gmail.com wrote:
On Tue, Sep 29, 2009 at 3:35 PM, kks kkis.thek...@gmail.com wrote:
if myFile variable contains the actual filename then how can i open a
file for wirte so that complete filename appears as
actualname_kks.txt
open(myFile +
On Sep 29, 1:19 pm, Jamie jamie.iva...@gmail.com wrote:
On Sep 29, 1:08 pm, Jamie jamie.iva...@gmail.com wrote:
I'm new to python and I'm trying to write a script which takes the
computer name from the variable 'name' and gets the uptime.
What I have so far:
query =
On Sep 29, 10:38 am, Duncan Booth duncan.bo...@invalid.invalid
wrote:
Carl Banks pavlovevide...@gmail.com wrote:
Hmm, I wonder if Python should emit a warning if an else is used on a
for block with no break inside. I don't think the else can be invoked
in any other way. As a bonus it
Mars creature wrote:
I just start to use python and love this language. I met this
problem when I try to save my functions in a separate file.
The question is how I can pass a global variable to a function which
is saved in another file.
This question is somewhat mis-phrased. In Python, one
Scott David Daniels a écrit :
Different than Shell / Restart Shell (Ctrl+F6) ?
Of course this doesn't work if you started Idle ith the -n switch.
Thanks for the info : by default on my Ubuntu distrib, IDLE is launched
with the -n option ;) Now, all is clear !
--
Hello.
I have a problem can not run.
I'm not understand.
Help me please.
How to use and detail ?
Thanks.
#!/usr/bin/python2.5
import py_net_libs
class dissect:
def __init__(self,pkt,offset):
self.pkt, self.offset = py_net_libs.arp_dissect(pkt,offset)
self.next
I created a new class for each instance as you suggested and added the
descriptor to the class. It worked great. Thanks for the help.
Brian Huggins
--
http://mail.python.org/mailman/listinfo/python-list
Visco Shaun wrote:
Hi all
For an exception defined as below
class OptionError(Exception):
def __init__(self, args):
self.args = args
def __str__(self):
return repr(self.v)
an iteration is happening when the exception is raised
snip
What is self.v intended to
Bruno Desthuilliers wrote:
(snip)
Joel Juvenal Rivera Rivera wrote:
Hi i was playing around with my code the i realize of this
###
_uno__a = 1
class uno():
__a = 2
def __init__(self):
print __a
uno()
###
and prints 1
snip
I beg to disagree. The
I have a wx-based GUI application that I'd like to have read
streaming data from a serial port and plot that data using
matplotlib and a figure canvas. It's a robotic application where the
workflow goes something like this:
1) Connect to robot
2) Configure robot settings
3) Command robot
Mars creature wrote:
snip
I can understand the point that global variables tends to mess up
programs.
Assume that I have 10 parameters need to pass to the function. If
these parameters are fixed, I can use another module to store these 10
parameters, and import to the module, as suggested by
On 29 Sep, 23:56, Aaron Hoover ahoo...@eecs.berkeley.edu wrote:
how can I allow the thread
access to the connection for reading, but then have it give up control
over the connection when it's done so the main GUI thread can access
the connection again for writing?
Protect read/write
Mars creature jin...@gmail.com wrote:
Assume that I have 10 parameters need to pass to the function. If
these parameters are fixed, I can use another module to store these 10
parameters, and import to the module, as suggested by jean-michel. But
what if these 10 parameters will be changed in
Would the csv module be appropriate?
On 9/29/09, Scooter slbent...@gmail.com wrote:
I'm attempting to reformat an apache log file that was written with a
custom output format. I'm attempting to get it to w3c format using a
python script. The problem I'm having is the field-to-field matching.
On Sep 30, 1:30 am, Mikie thephantom6...@hotmail.com wrote:
Could soneone show me a simple example of a twisted server that loads
2 html pages
www..com:7899/page1/
www..com:7899/page2/
Thanx
Hey Mikie,
Jp Calderone has been writing a very handy 'Twisted Web in 60 seconds'
series,
On Monday, 28 September 2009 16:44:48 Grant Edwards wrote:
$10 is pretty expensive for a lot of applications. I bet that
processor also uses a lot of power and takes up a lot of board
space. If you've only got $2-$3 in the money budget, 200uA at
1.8V in the power budget, and 6mm X 6mm of
I have a directory that contains the following
login
rc
sum
_1
_2
_3
_4
What's the sanest way to print out all the files in the directory that
start with the underscore? Ie, I just want to list _1, _2, _3, _4.
--
http://mail.python.org/mailman/listinfo/python-list
On 2009-09-29, Hendrik van Rooyen hend...@microcorp.co.za wrote:
On Monday, 28 September 2009 16:44:48 Grant Edwards wrote:
$10 is pretty expensive for a lot of applications. I bet that
processor also uses a lot of power and takes up a lot of board
space. If you've only got $2-$3 in the
What's the sanest way to print out all the files in the directory that
start with the underscore? Ie, I just want to list _1, _2, _3, _4.
I'd use a string's join() method to combine the results of a
list-comprehension or generator that filtered the output of
os.listdir() based on the
Hi,
As part of my GUI, I have lots of fields that people can fill in,
defined like this:
self.selection = Pmw.EntryField(group.interior(),
labelpos='w',
label_text='Selection to use:
',
On Sep 29, 7:20 pm, Tim Chase python.l...@tim.thechases.com wrote:
What's the sanest way to print out all the files in the directory that
start with the underscore? Ie, I just want to list _1, _2, _3, _4.
I'd use a string's join() method to combine the results of a
list-comprehension or
On Sep 29, 7:52 pm, chad cdal...@gmail.com wrote:
On Sep 29, 7:20 pm, Tim Chase python.l...@tim.thechases.com wrote:
What's the sanest way to print out all the files in the directory that
start with the underscore? Ie, I just want to list _1, _2, _3, _4.
I'd use a string's join() method
Aaron Hoover wrote:
I have a wx-based GUI application that I'd like to have read streaming
data from a serial port and plot that data using matplotlib and a figure
canvas. It's a robotic application where the workflow goes something
like this:
1) Connect to robot
2) Configure robot
On Tue, 29 Sep 2009 19:48:51 -0700, Michael George Lerner wrote:
I then use self.selection.get_value() and self.selection.set_value(),
and those two functions are the only ways in which I care about
self.selection. I've never really used properties, getters or setters
before. I tried this,
I'm trying to write a decorator that causes a function to do nothing
if called more than once- the reason for this is trivial and to see if
I can (Read- I'm enjoying the challenge, please don't ruin it for me
=] )
However I'm getting strange results with Python 2.6.2 on win32.
With this code:
On Tue, 29 Sep 2009 19:09:16 -0700 (PDT),
chad cdal...@gmail.com wrote:
I have a directory that contains the following
login
rc
sum
_1
_2
_3
_4
What's the sanest way to print out all the files in the directory that
start with the underscore? Ie, I just want to list _1, _2, _3,
On Sep 30, 2:15 pm, Rich Healey healey.r...@gmail.com wrote:
I'm trying to write a decorator that causes a function to do nothing
if called more than once- the reason for this is trivial and to see if
I can (Read- I'm enjoying the challenge, please don't ruin it for me
=] )
However I'm
On Tue, Sep 29, 2009 at 9:15 PM, Rich Healey healey.r...@gmail.com wrote:
However:
def callonce(func):
def nullmethod(): pass
def __():
return func()
func = nullmethod
When Python sees this assignment to func as it compiles the __()
method, it marks func as a local
On Tue, Sep 29, 2009 at 9:41 PM, Chris Rebert c...@rebertia.com wrote:
On Tue, Sep 29, 2009 at 9:15 PM, Rich Healey healey.r...@gmail.com wrote:
However:
def callonce(func):
def nullmethod(): pass
def __():
return func()
func = nullmethod
Additionally, to rebind a
On Tue, 2009-09-29 at 21:15 -0700, Rich Healey wrote:
However:
def callonce(func):
def nullmethod(): pass
def __():
return func()
func = nullmethod
return ret
return __
@callonce
def t2():
print T2 called
t2()
Gives me:
On Sep 29, 1:15 pm, Carl Banks pavlovevide...@gmail.com wrote:
Hmm, I wonder if Python should emit a warning if an else is
used on a for block with no break inside. I don't think the
else can be invoked in any other way. As a bonus it could
catch some cases where people mistakenly use it
On Sep 29, 1:25 pm, MRAB pyt...@mrabarnett.plus.com wrote:
The example that makes it clearest for me is searching
through a list for a certain item and breaking out of
the 'for' loop if I find it. If I get to the end of the
list and still haven't broken out then I haven't found
the item, and
1 - 100 of 107 matches
Mail list logo