On Mar 25, 9:22 pm, Doug Morse wrote:
> On Wed, 25 Mar 2009 19:56:13 -0700 (PDT), *nixtechno
> wrote:
>
>
>
> > I have a fedora box and just installed python 2.6.1 along with 2.5.2,
> > so here's my issue, if I removed the "systems" garbage RPM it would
> > uninstall all the other crap along w
As you know , we can see the file version from by "right click menu
and click the detail tab".
Now i am wondering how to get this version number using python?
Thanks very much!
BR
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 26, 2:06 pm, Coonay wrote:
> see,the zipimort takes nearly 0.5 second
>
> D 03-25 07:53PM 21.374
> Loading __main__
> I 03-25 07:53PM 21.455
> zipimporter('/base/data/home/apps/coonay/1.332322118600950324/
> django.zip', '')
?? zipimport.Zipimporter() has one arg, not two.
> W 03-25 07:53
Jean-Paul Calderone wrote:
On Tue, 24 Mar 2009 22:20:49 -0700, John Nagle wrote:
Jean-Paul Calderone wrote:
On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood
wrote:
Jean-Paul Calderone wrote:
[snip]
After bringing in all the heavy machinery of Twisted,
you're still polling at 10Hz. T
On Wed, 25 Mar 2009 21:26:10 +, Martin P. Hellwig wrote:
> Raymond Hettinger wrote:
>> On Mar 25, 7:38 am, srinivasan srinivas
>> wrote:
>>> For ex: to check list 'A' is empty or not.. if A == []:
>>> if A.count == 0:
>>> if len(A) == 0:
>>> if not A:
...
> Personally I would go for the len
On Wed, 25 Mar 2009 19:56:13 -0700 (PDT), *nixtechno
wrote:
> I have a fedora box and just installed python 2.6.1 along with 2.5.2,
> so here's my issue, if I removed the "systems" garbage RPM it would
> uninstall all the other crap along with it, so I went ahead and
> trunked in and ./configu
On Mar 26, 3:06 pm, alex23 wrote:
> On Mar 26, 8:05 am, Scott David Daniels wrote:
>
> > Well, yes in a way, but lots of places in windows you can get a copy
> > of a full file spec into the cut buffer, so you cut/paste rather than
> > type. If you do that, you get the backslashes (and you bette
On Mar 26, 8:05 am, Scott David Daniels wrote:
> Well, yes in a way, but lots of places in windows you can get a copy
> of a full file spec into the cut buffer, so you cut/paste rather than
> type. If you do that, you get the backslashes (and you better be
> prepared for that by using r'' to past
On Mar 26, 10:27 am, "W. Martin Borgert" wrote:
> Is this also true for this code?
>
> for line in map(myfunction, myfile.readlines()):
> dosomethingwith(line)
>
> Or would use of map() mean, that the complete "myfile" is read into
> the RAM?
As Christian explained, you're really after just '
Steve Holden wrote:
>Johannes Bauer wrote:
>> Sebastian Bassi schrieb:
>>
>>> No, there is no certification for Python. Maybe in the future...
>>
>> I'll hand out the "Johannes Bauer Python Certificate of Total
>> Awesomeness" for anyone who can write a hello world in python and hands
>> me $25
Stef Mientki wrote:
> andrew cooke wrote:
>> Andre Engels wrote:
>>
>>> On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke wrote:
>>>
i will go against the grain slightly and say that "len" is probably the
best compromise in most situations (although i admit i don't know what
John Posner wrote:
> On Mon Mar 16 03:42:42, I said:
>
>> RTFM, in section "Augmented assignment statements" of python301.chm:
>>
>> ---
>> For targets which are attribute references, the initial value is retrieved
>
>> with a getattr() and the result is assigned with a setattr(). Notice that
> t
see,the zipimort takes nearly 0.5 second
D 03-25 07:53PM 21.374
Loading __main__
I 03-25 07:53PM 21.455
zipimporter('/base/data/home/apps/coonay/1.332322118600950324/
django.zip', '')
W 03-25 07:53PM 22.046
appengine_django module
On Mar 26, 10:41 am, Coonay wrote:
> in my mudule ,i impor
I have a fedora box and just installed python 2.6.1 along with 2.5.2,
so here's my issue, if I removed the "systems" garbage RPM it would
uninstall all the other crap along with it, so I went ahead and
trunked in and ./configure, build && build install and built python
2.6.1 along with this. Howeve
On Mon Mar 16 03:42:42, I said:
> RTFM, in section "Augmented assignment statements" of python301.chm:
>
> ---
> For targets which are attribute references, the initial value is retrieved
> with a getattr() and the result is assigned with a setattr(). Notice that
the
> two methods do not necess
I believe "if not A:" is the most pythonic, but depending on what
you're doing a list might not be the right thing to use at all. A
little while ago I got some help from this malining list in dealing
with a situation where lists really were not efficient (finding prime
numbers...for fun). In my cas
Big thanks tkc, and I was wondering what your thoughts are on logging
module: http://docs.python.org/library/logging.html
"Instead of using many print statements for debugging, use
logger.debug: Unlike the print statements, which you will have to
delete or comment out later, the logger.debug state
Hi,
if I understand correctly, this code would not read the complete file
into the memory:
for line in myfile.readlines():
dosomethingwith(line)
Is this also true for this code?
for line in map(myfunction, myfile.readlines()):
dosomethingwith(line)
Or would use of map() mean, that the
For ex: to check list 'A' is empty or not..
if A == []:
if A.count == 0:
if len(A) == 0:
if not A:
Connect with friends all over the world. Get Yahoo! India Messenger at
http://in.messenger.yahoo.com/?wm=n/
--
http://mail.python.org/mailman/listinfo/python-list
> sorry for not reporting a bug - i assumed you'd know (and the workarounds
> described above meant i wasn't stalled).
>
> i also have eclipse 3.4.2 with pydev 1.4.4.2636 on a separate machine (ie
> new versions), and i can try there if you want (it will take a while to
> get the source there, but
On 2009-03-26 01:41, Christian Heimes wrote:
> No, you are wrong. file.readlines() reads the entire file into memory
> and returns a list of strings. If you want to iterate over the lines of
> a text file you can simply write:
>
> for line in myfile:
> dosomethingwith(line)
>
> It won't work fo
On 26/03/2009 9:05 AM, Mark Hammond wrote:
On 25/03/2009 11:41 PM, John Machin wrote:
This all sounds good. I presume that "this version of distutils" means
the 2.6.2/3.1 version.
Yep.
In the meantime, until 2.6.2 final is released, is my suggestion of
using Python 2.5 to build installers
W. Martin Borgert schrieb:
> (Resend, because of funny error message:
>> Your mail to 'Python-list' with the subject
>> Iterating over readlines() and map()
>> Is being held until the list moderator can review it for approval.
> Whatever this means.)
>
> Hi,
>
> if I understand correctly, thi
(Resend, because of funny error message:
> Your mail to 'Python-list' with the subject
> Iterating over readlines() and map()
> Is being held until the list moderator can review it for approval.
Whatever this means.)
Hi,
if I understand correctly, this code would not read the complete file
in
In article ,
Chris Rebert wrote:
>On Sun, Mar 15, 2009 at 10:24 PM, venutaurus...@gmail.com
> wrote:
>> Hi all,
>> I have to write an application which does a move and
>copy of a
>> file from a remote machine to the local machine. I tried something
>> like:
>>
>> file =3D ur"venuwin2008\\C\\4
On Mar 25, 7:38 am, srinivasan srinivas
wrote:
> For ex: to check list 'A' is empty or not..
> if A == []:
> if A.count == 0:
> if len(A) == 0:
> if not A:
PEP 8 recommends the last one, and most Pythonistas here probably
would as well, so that is probably what you should do if you don't
otherwis
On Mar 25, 8:27 am, Andre Engels wrote:
> On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke wrote:
>
> > but i may be wrong - are there any containers (apart from pathological
> > hand-crafted examples) that would not define __len__()?
>
> When writing my answer, I thought of generators, but I now fi
On Mar 25, 1:19 pm, "andrew cooke" wrote:
> actually, the implication of what you said is probably worth emphasising
> to the original poster: often you don't need to test whether a list is
> empty or not, you simply iterate over its contents:
>
> for x in foo:
> # do something
>
> this will
Albert Hopkins wrote:
On Wed, 2009-03-25 at 21:26 +, Martin P. Hellwig wrote:
PEP 8 recommends the latter.
Raymond
I can't seem to find where this recommendation is mentioned or implied.
Wow, you must not have looked very hard:
1. Point your browser to http://www.python.org/dev/pe
In article <33f40372-13fb-4d52-921d-8ab00685c...@q30g2000prq.googlegroups.com>,
Sean DiZazzo wrote:
>
>Why is it that you can setattr() on an instance of a class that
>inherits from "object", but you can't on an instance of "object"
>itself?
>
o = object()
setattr(o, "x", 1000)
>Traceba
On 25 Mar 2009, at 21:29 , Stef Mientki wrote:
Now it would be nice to allow iteration over others too, like None .
a = None
for item in a :
do_something_with_item
I saw this technique used in CherryPy:
>>> a=None
>>> for item in a or []:
...print item
...
>>> a=[1,2,3]
my messages are _not_ spam.
-Alex Goretoy
http://www.goretoy.com
Robert Benchley - "I have tried to know absolutely nothing about a great
many things, and I have succeeded fair...
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 2009-03-25 at 21:26 +, Martin P. Hellwig wrote:
> >
> > PEP 8 recommends the latter.
> >
> >
> > Raymond
> I can't seem to find where this recommendation is mentioned or implied.
Wow, you must not have looked very hard:
1. Point your browser to http://www.python.org/dev/peps/p
En Wed, 25 Mar 2009 17:28:30 -0300, W. Martin Borgert
escribió:
I'm looking for an installer builder similar to IzPack (which is based on
Java). Isn't there anything like that in the Python world? Extra points,
if GTK+ or wxWindows is used...
To distribute modules/packages, I use distutils.
On 26/03/2009 2:19 AM, Christopher Panici wrote:
Has anyone solved the GetGeneratePath Error?
I am getting this when I use
win32com.client.DispatchWithEvents('iTunes.Application',
customEventHandler). I have drilled down to the file and found it in
that path.
Does anyone have any ideas?
HERE I
On 25/03/2009 11:41 PM, John Machin wrote:
This all sounds good. I presume that "this version of distutils" means
the 2.6.2/3.1 version.
Yep.
In the meantime, until 2.6.2 final is released, is my suggestion of
using Python 2.5 to build installers reasonable?
Yep.
Is there a better appro
afri...@yahoo.co.uk wrote:
Wouldn't it be easier just to avoid the windows slashes altogether and
stick to the posix:
title = 'c:/thesis/refined_title.txt'
Well, yes in a way, but lots of places in windows you can get a copy
of a full file spec into the cut buffer, so you cut/paste rather than
On Mar 25, 1:07 am, Kay Schluehr wrote:
> On 25 Mrz., 05:56, Carl Banks wrote:
>
>
>
>
>
> > On Mar 24, 8:32 pm, Istvan Albert wrote:
>
> > > On Mar 24, 9:35 pm, Maxim Khitrov wrote:
>
> > > > Works perfectly fine with relative imports.
>
> > > This only demonstrates that you are not aware of w
Martin P. Hellwig wrote:
> Raymond Hettinger wrote:
>> On Mar 25, 7:38 am, srinivasan srinivas
>> wrote:
>>> if not A:
>> PEP 8 recommends the latter.
> I can't seem to find where this recommendation is mentioned or implied.
it's the next-to-last sub-item, just before the references.
http://www.p
On Mar 25, 7:38 pm, MRAB wrote:
> TYR wrote:
> > A server that runs one of my programs was upgraded to Debian Lenny
> > last night, which moved it from Python 2.4.4 to 2.5.2. This caused
> > immediate trouble. At one point, data is parsed from a Web page, and
> > among other things a time date gro
Raymond Hettinger wrote:
On Mar 25, 7:38 am, srinivasan srinivas
wrote:
For ex: to check list 'A' is empty or not..
if A == []:
if A.count == 0:
if len(A) == 0:
if not A:
PEP 8 recommends the latter.
Raymond
I can't seem to find where this recommendation is mentioned or implied.
Personall
En Tue, 24 Mar 2009 21:57:12 -0300, Istvan Albert
escribió:
On Mar 24, 3:16 pm, "Gabriel Genellina"
wrote:
Did you know, once a module is imported by the first time
yeah yeah, could we not get sidetracked with details that are not
relevant? what it obviously means is to import it in all of
On Mar 24, 2:23 pm, "Martin v. Löwis" wrote:
> > So, for example, if I upgrade to libpython2.6.so.1.1
>
> How do you do that? There won't ever be such a library. They
> will always be called libpython2.6.so.1.0.
>
> So no, no minor revision gets encoded into the SONAME.
Then what's the significan
On Mar 7, 9:40 am, Jani Hakala wrote:
> > After reading the docs and seeing a few examples i think this should
> > work ?
> > Am I forgetting something here or am I doing something stupid ?
> > Anyway I see my yellow screen, that has to count for something :)
>
> I have been using the following sc
andrew cooke wrote:
Andre Engels wrote:
On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke wrote:
i will go against the grain slightly and say that "len" is probably the
best compromise in most situations (although i admit i don't know what
[...]
but i may be wrong - are there a
Hi,
I'm looking for an installer builder similar to IzPack (which is based on
Java). Isn't there anything like that in the Python world? Extra points,
if GTK+ or wxWindows is used...
TIA!
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 2009-03-18 at 08:18 -0700, Adam wrote:
> On Mar 18, 10:33 am, "J. Cliff Dyer" wrote:
> > You might be interested in redefining __getattribute__(self, attr) on
> > your class. This could operate in conjunction with the hash tables
> > (dictionaries) mentioned by andrew cooke. i.e. (untest
Andre Engels wrote:
> On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke wrote:
>> i will go against the grain slightly and say that "len" is probably the
>> best compromise in most situations (although i admit i don't know what
[...]
>> but i may be wrong - are there any containers (apart from patholo
Josh Dukes wrote:
> $ python --version
> Python 2.5.2
>
> $ ruby --version
> ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
>
> but I was more talking about the speed differences between ruby and python.
I heard that Ruby 1.9 is supposed to be a lot faster than 1.8 in many
aspects (as is
On Mar 25, 7:38 am, srinivasan srinivas
wrote:
> For ex: to check list 'A' is empty or not..
> if A == []:
> if A.count == 0:
> if len(A) == 0:
> if not A:
PEP 8 recommends the latter.
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
TYR wrote:
A server that runs one of my programs was upgraded to Debian Lenny
last night, which moved it from Python 2.4.4 to 2.5.2. This caused
immediate trouble. At one point, data is parsed from a Web page, and
among other things a time date group is collected. This is in a nice
human readable
On 2009-03-25, Marco Nawijn wrote:
> Hello,
>
> In short I would like to know if somebody knows if it is possible to
> re-execute a statement that raised an exception? I will explain the
> reason by providing a small introduction on why this might be nice in
> my case
> and some example code.
>
>
well if we're interested in that...
$ uname -a
Linux IT2-JD 2.6.27-gentoo-r8 #1 SMP Tue Mar 17 14:28:19 PDT 2009 x86_64
Intel(R) Pentium(R) D CPU 2.80GHz GenuineIntel GNU/Linux
$ python --version
Python 2.5.2
$ ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
but I was more
A server that runs one of my programs was upgraded to Debian Lenny
last night, which moved it from Python 2.4.4 to 2.5.2. This caused
immediate trouble. At one point, data is parsed from a Web page, and
among other things a time date group is collected. This is in a nice
human readable format, but
Josh Dukes wrote:
> $ time python -c 'a = "A";
> for r in xrange(10): a += "A" '
>
> real 0m0.109s
> user 0m0.100s
> sys 0m0.010s
>
> Anyone get different results?
Sure:
$ time python -c 'a = "A";
for r in xrange(10): a += "A" '
real0m0.140s
user0m0.132s
sys 0m0.008s
Also, instead of caching exceptions you can do lazy lookups kinda like
this:
-
# a.py
class A:
pass
-
# b.py
class B:
So The metasploit framework was suffering from some performance issues
which they fixed. http://www.metasploit.com/blog/
I was interested in comparing this to python. Language comparisons are
not generally very useful for a number of reasons, but some might find
this interesting.
Clearly the pyt
Marco Nawijn wrote:
In short I would like to know if somebody knows if it is possible to
re-execute a statement that raised an exception?
In short, no.
As an example, look at the following statement
aPoint = gp_Pnt(1.0, 0.0, 0.0) # Oops, this will raise a NameError, since
MRAB wrote:
Python Newsgroup wrote:
Gotcha, I got started from the telnet example listed in the docs. The
linux install was via yum and installed 2.x instead. That explains it.
Althought print (tn.read_all () ) runs in 2.x on linux.
I have another problem maybe you cna help me with. My telnet
On Mar 25, 10:23 am, Marco Nawijn wrote:
> Hello,
>
> In short I would like to know if somebody knows if it is possible to
> re-execute a statement that raised an exception? I will explain the
> reason by providing a small introduction on why this might be nice in
> my case
> and some example code
Python Newsgroup wrote:
Gotcha, I got started from the telnet example listed in the docs. The
linux install was via yum and installed 2.x instead. That explains it.
Althought print (tn.read_all () ) runs in 2.x on linux.
I have another problem maybe you cna help me with. My telnet output
jibb
Gotcha, I got started from the telnet example listed in the docs. The linux
install was via yum and installed 2.x instead. That explains it. Althought
print (tn.read_all () ) runs in 2.x on linux.
I have another problem maybe you cna help me with. My telnet output
jibberish in windows: I cna p
Try the following, to call your function yourself in this way:
def myfunction(string,sleeptime,*args):
while 1:
print "string is ", string
time.sleep(sleeptime) #sleep for a specified amount of time.
f = myfunction
r = ("Thread No:1",2)
f(*r)
The key here is the *r synt
Thanks! I'll try that.
Sorry for replying so late - just didn't get to it.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
thread.start_new_thread(myfunc, "some string", 42)
This should have been
thread.start_new_thread(myfunc, ("some string", 42))
because all the subsequent values after the function-handle/name
get passed into the function when it gets called. As if the
start_new_thread() function was def
Thats newbe experience for ya ;-) thanks. Its seems to work and leads to
another question. whether running the script or stepping thru the process at
the command line I get what looks like hex
C:\Python30>python \Python30\scripts\telnet-tftp1.py
b'\x1b[24;1H\x1b[24;31H\x1b[24;1H\x1b[?25h\x1b[24
On 25 Mrz., 15:23, Marco Nawijn wrote:
> Hello,
>
> In short I would like to know if somebody knows if it is possible to
> re-execute a statement that raised an exception? I will explain the
> reason by providing a small introduction on why this might be nice in
> my case
> and some example code.
Maybe I'm missing it, but in the original code, the line had
thread.start_new_thread(myfunction,("Thread No:1",2))
It has a single arg ("Thread No:1",2) versus something like
thread.start_new_thread(myfunction,1, 2, ("Thread No:1",2))
But
def myfunction(string,sleeptime,*args):
clearly take
Anita Whitney wrote:
> A window comes up saying "hotkeyapp has stopped working." How do I
> get in there to "move the RegisterHotKey line to within the thread's
> run method," etc.? Im trying to do this myself and not pay Acer tech
> support. Thanks, Anita Whitney
Is this a wxPython application t
Python Newsgroup wrote:
I'm a total newbe to scripting not to mention python. However I was able
to successfully create a telnet script to initiate login, initiate tftp,
exit, exit, confirm and close session. Frustrated, possibly causing my
own misery. I replace the sript the script with the st
I'm just wondering if you all have any resources on Debugging that you
all would "recommend." Due to the fact I'm doing some debugging as a
beginner and this has the best of me, and I'm looking at trying to
learn more about what and how to debug within Py using print, and
etc...
For most of what
Python Newsgroup wrote:
I'm a total newbe to scripting not to mention python. However I was
able to successfully create a telnet script to initiate login,
initiate tftp, exit, exit, confirm and close session. Frustrated,
possibly causing my own misery. I replace the sript the script with
the s
On Mar 25, 8:28 am, Tim Chase wrote:
> grocery_stocker wrote:
> > On Mar 25, 7:05 am, grocery_stocker wrote:
> >> Given the following code...
>
> >> #!/usr/bin/env python
>
> >> import time
> >> import thread
>
> >> def myfunction(string,sleeptime,*args):
> >> while 1:
>
> >> print st
I'm a total newbe to scripting not to mention python. However I was able to
successfully create a telnet script to initiate login, initiate tftp, exit,
exit, confirm and close session. Frustrated, possibly causing my own misery.
I replace the sript the script with the standard example.
import
On Mar 26, 2:21 am, "andrew cooke" wrote:
> i will go against the grain slightly and say that "len" is probably the
> best compromise in most situations (although i admit i don't know what
> count is) because i think it will work when you expect it to and break
> when you have a bug in your progra
grocery_stocker wrote:
On Mar 25, 7:05 am, grocery_stocker wrote:
Given the following code...
#!/usr/bin/env python
import time
import thread
def myfunction(string,sleeptime,*args):
while 1:
print string
time.sleep(sleeptime) #sleep for a specified amount of time.
if __
On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke wrote:
>
> i will go against the grain slightly and say that "len" is probably the
> best compromise in most situations (although i admit i don't know what
> count is) because i think it will work when you expect it to and break
> when you have a bug i
Bruno Desthuilliers schrieb:
> Sibylle Koczian a écrit :
> (snip)
>>
>>
>> The print command inside the __init__ method isn't executed, so that
>> method doesn't seem to start at all.
>
> this often happens with (usually C-coded) immutable types. The
> initializer is not called, only the "proper"
On Mar 26, 1:17 am, grocery_stocker wrote:
> On Mar 25, 7:05 am, grocery_stocker wrote:
>
>
>
> > Given the following code...
>
> > #!/usr/bin/env python
>
> > import time
> > import thread
>
> > def myfunction(string,sleeptime,*args):
> > while 1:
>
> > print string
> > time.
I'm just wondering if you all have any resources on Debugging that you
all would "recommend." Due to the fact I'm doing some debugging as a
beginner and this has the best of me, and I'm looking at trying to
learn more about what and how to debug within Py using print, and
etc...
There is so much o
Has anyone solved the GetGeneratePath Error?
I am getting this when I use
win32com.client.DispatchWithEvents('iTunes.Application', customEventHandler). I
have drilled down to the file and found it in that path.
Does anyone have any ideas?
HERE IS THE ERROR. If anyone is good at this please
i will go against the grain slightly and say that "len" is probably the
best compromise in most situations (although i admit i don't know what
count is) because i think it will work when you expect it to and break
when you have a bug in your program.
using a simple boolean is more robust (and wha
Bruno Desthuilliers
writes:
>> The print command inside the __init__ method isn't executed, so that
>> method doesn't seem to start at all.
>
> this often happens with (usually C-coded) immutable types. The
> initializer is not called, only the "proper" constructor (__new__).
More specifically,
On Mar 26, 1:38 am, srinivasan srinivas
wrote:
Depends on what you mean by "best"; like graduation day at
kindergarten, everyone gets a prize:
> For ex: to check list 'A' is empty or not..
> if A == []:
most obviously correct
> if A.count == 0:
best use of imagination
> if len(A) == 0:
best
srinivasan srinivas:
> For ex: to check list 'A' is empty or not..
Empty collections are "false":
if somelist:
... # somelist isn't empty
else:
... # somelist is empty
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
srinivasan srinivas wrote:
For ex: to check list 'A' is empty or not..
if A == []:
if A.count == 0:
if len(A) == 0:
if not A:
"if not A"
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Mar 25, 2009 at 3:38 PM, srinivasan srinivas
wrote:
>
> For ex: to check list 'A' is empty or not..
> if A == []:
> if A.count == 0:
> if len(A) == 0:
> if not A:
I would go for the last one, because it has the highest likelihood of
doing what is intended when fed with something that is '
On Mar 26, 12:51 am, Tim Chase wrote:
> > I have a date expressed in seconds.
> > I'd want to pretty print it as "%H:%M" if the time refers to today and
> > "%b%d" (month, day) if it's of yesterday or before.
>
> > I managed to do that with the code below but I don't like it too much.
> > Is there
For ex: to check list 'A' is empty or not..
if A == []:
if A.count == 0:
if len(A) == 0:
if not A:
Thanks,
Srini
Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/
--
http://mail.python.org/mailman/listinfo/python-list
A window comes up saying "hotkeyapp has stopped working." How do I get in
there to "move the RegisterHotKey line to within the thread's run method,"
etc.? Im trying to do this myself and not pay Acer tech support. Thanks, Anita
Whitney--
http://mail.python.org/mailman/listinfo/python-list
In article <5cffe00b-2cd3-45dc-a674-87466e8ff...@f19g2000vbf.googlegroups.com>,
msoulier wrote:
>On Mar 20, 10:22=A0am, a...@pythoncraft.com (Aahz) wrote:
>>
>> Have you tried dumping core and using gdb to find out more about the
>> process state?
>
>Yeah, just did. I need the debuginfo for prop
Hello,
In short I would like to know if somebody knows if it is possible to
re-execute a statement that raised an exception? I will explain the
reason by providing a small introduction on why this might be nice in
my case
and some example code.
I am using the python bindings to a *very* large C++
Doerte wrote:
> from pylab import *
> from numpy import *
> from scipy import *
> from math import *
Don't do this, read the style guide on writing Python code.
> res = integrate.quad(func=f, a=x0, b=x1)
[...]
> NameError: name 'integrate' is not defined
# try this instead
from scipy import inte
On 25 Mar, 14:51, Tim Chase wrote:
> > I have a date expressed in seconds.
> > I'd want to pretty print it as "%H:%M" if the time refers to today and
> > "%b%d" (month, day) if it's of yesterday or before.
>
> > I managed to do that with the code below but I don't like it too much.
> > Is there a
On Mar 25, 7:05 am, grocery_stocker wrote:
> Given the following code...
>
> #!/usr/bin/env python
>
> import time
> import thread
>
> def myfunction(string,sleeptime,*args):
> while 1:
>
> print string
> time.sleep(sleeptime) #sleep for a specified amount of time.
>
> if __nam
Given the following code...
#!/usr/bin/env python
import time
import thread
def myfunction(string,sleeptime,*args):
while 1:
print string
time.sleep(sleeptime) #sleep for a specified amount of time.
if __name__=="__main__":
thread.start_new_thread(myfunction,("Thread N
Hello,
some time ago I implemented a Python script, which uses integrate.quad
(...). This was done with Python 2.4 / Win2000.
I'm working with Python 2.5 now, and installed Numpy, Scipy and
Matplotlib. My script and also the test described below do not work
anymore:
from pylab import *
from nump
On Mar 24, 4:55 am, "Martin v. Löwis" wrote:
> > So, both Py_UNICODE and wchar_t are 4 bytes and since it contains 3
> > \0s after a char, printf or wprintf is only printing one letter.
>
> No. printf indeed will see a terminating character. However, wprintf
> should correctly know that a wchar_t
Soumen banerjee wrote:
> Hello
> I have not tried the code because in no part of the code is the array
> "out" being created. As such, it is bound to return an error that out
> isnt created. The point here is how i can get sampled values from the
> dat file which has lines like this:-
>
>
I have a date expressed in seconds.
I'd want to pretty print it as "%H:%M" if the time refers to today and
"%b%d" (month, day) if it's of yesterday or before.
I managed to do that with the code below but I don't like it too much.
Is there a better way to do that?
Thanks in advance.
import time
1 - 100 of 134 matches
Mail list logo