>>> a = 1
>>> b = 25
>>> a / b
0
>>> float(a) / b
0.040001
>>>
>>> from __future__ import division
>>> a = 1
>>> b = 25
>>> a / b
0.040001
>>>
In what simple way can I get just 0.04 ?
--
Anjanesh Lekshmnarayanan
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jun 19, 2009 at 12:22 AM, Anjanesh
Lekshminarayanan wrote:
a = 1
b = 25
a / b
> 0
float(a) / b
> 0.040001
>
from __future__ import division
a = 1
b = 25
a / b
> 0.040001
>
> In what simple way can I get just 0.04 ?
N
I've done some further testing on the subject:
I also added some calculations in the main loop to see what effect
they would have on speed. Of course, I also added the same
calculations to the single threaded functions.
They were simple summary functions, like average, sum, etc. Almost no
interact
On Fri, 19 Jun 2009 17:53:40 +1200
Lawrence D'Oliveiro wrote:
> In message <20090618081423.2e035...@coercion>, Mike Kazantsev wrote:
>
> > On Thu, 18 Jun 2009 10:33:49 +1200
> > Lawrence D'Oliveiro wrote:
> >
> >> In message <20090617214535.10866...@coercion>, Mike Kazantsev
> >> wrote:
> >>
I'm pleased to announce a new release of Mailinglogger.
Mailinglogger provides two handlers for the standard python
logging framework that enable log entries to be emailed either as the
entries are logged or as a summary at the end of the running process.
The handlers have the following features
On Jun 19, 8:22 am, Anjanesh Lekshminarayanan
wrote:
> >>> a = 1
> >>> b = 25
> >>> a / b
> 0
> >>> float(a) / b
>
> 0.040001
Python typically stores floats in binary, not decimal. The
value 0.04 isn't exactly representable in binary, so the
division float(1)/25 can't produce 0.04:
Hello there,
this might be my first post here and it is slightly off
topic since it is not about something I am developing.
At work use a nifty little program called Task Coach.
It helps me keep track of what I spend time on.
Here is my problem. When I use it on a Vista box its
user interface is
Digging further, I found this:
http://www.oreillynet.com/onlamp/blog/2005/10/does_python_have_a_concurrency.html
Looking up on this info, I found this:
http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock
If this is correct, no amount of threading would ever help in
On 2009-06-19, =?windows-1252?Q?Jure_Erzno=9Enik?=
wrote:
> If this is correct, no amount of threading would ever help in Python
> since only one core / CPU could *by design* ever be utilized. Except
> for the code that accesses *no* functions / memory at all.
Don't multithread...multiprocess.
> Vishal Shetye (VS) wrote:
>VS> I want to synchronize calls using rw locks per 'group' and my
>implementation is similar to
>VS> http://code.activestate.com/recipes/465057/
>VS> except that I have my own Lock implementation.
>VS> All my synchronized functions take 'whatGroup' as param. My
Hans Müller wrote:
> Thanks for all your informative replies.
>
> If I understand you right, for a commercial, closed source program I
> only need a commercial PyQt license for ~ 500€ ?
Why not ask the guys at riverbankcomputing?
http://www.riverbankcomputing.co.uk/commercial/pyqt
This page
h
> John Machin (JM) wrote:
>JM> [1] No kidding: http://www.google.com/patents/about?id=QMwnEBAJ
Apart from these patents probably being silly, why don't they just write
the code in Python? :=)
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@
I'm pleased to finally get around to announcing the release of ErrorHandler.
This is a handler for the python standard logging framework that can
be used to tell whether messages have been logged at or above a
certain level.
This can be useful when wanting to ensure that no errors have been
logg
Piet van Oostrum wrote:
John Machin (JM) wrote:
JM> [1] No kidding: http://www.google.com/patents/about?id=QMwnEBAJ
Apart from these patents probably being silly, why don't they just write
the code in Python? :=)
Would be cool, but there are things like
Resolver One (http://www.resol
On Thu, 18 Jun 2009 13:39:28 +0200, Anthra Norell wrote:
> I had a look at Blender. It looks impressive too. It might be an
> alternative to Sketch Up. I'll worry about that later. My immediate need
> is a file conversion utility. A cursory inspection of Blender's menu
> tabs and the various
MRAB a écrit :
Wells Oliver wrote:
NB : answering the OP (original post didn't show up on c.l.py ???)
In writing out python classes, it seems the 'self' is optional,
You mean, inside a method ?
meaning that inside a class method,
In Python, a "class method" is a method that operates on
See here for introduction:
http://groups.google.si/group/comp.lang.python/browse_thread/thread/370f8a1747f0fb91
Digging through my problem, I discovered Python isn't exactly thread
safe and to solve the issue, there's this Global Interpreter Lock
(GIL) in place.
Effectively, this causes the interp
Gabriel Rossetti wrote:
> Hello everyone,
>
> I get an OperationalError with sqlite3 if I put the wrong column name,
> but shouldn't that be a ProgrammingError instead? I read PEP 249 and it
> says :
>
> "OperationalError
>Exception raised for errors that are related t
In article ,
>
>
>But practicality beats purity -- there are many scenarios where we make
>compromises in our meaning in order to get correct, efficient code. E.g.
>we use floats, despite them being a poor substitute for the abstract Real
>numbers we mean.
>
>In addition, using a tuple or a list in
I think I found the answer to my own question. Can anyone spot any
issues with the following solution? The application I'm writing will
be hitting these callbacks pretty heavily so I'm nervous about mucking
up the memory management and creating one of those bugs that passes
undetected through test
On Fri, 19 Jun 2009 10:16:39 +0200, martin.sch...@gmail.com (Martin
Schöön) wrote:
> Here is my problem. When I use it on a Vista box its
> user interface is very, very slow when it comes to
> some but not all operations. On any other Windows
> version it reacts instantaneously. I have not tried
>
> Jure Erznožnik (JE) wrote:
>JE> Digging further, I found this:
>JE>
>http://www.oreillynet.com/onlamp/blog/2005/10/does_python_have_a_concurrency.html
>JE> Looking up on this info, I found this:
>JE>
>http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock
>J
> Anjanesh Lekshminarayanan (AL) escribió:
> a = 1
> b = 25
> a / b
>AL> 0
> float(a) / b
>AL> 0.040001
>
> from __future__ import division
> a = 1
> b = 25
> a / b
>AL> 0.040001
>
>AL> In what simple way can I get just 0.04
> Chris Withers (CW) wrote:
>CW> Piet van Oostrum wrote:
John Machin (JM) wrote:
>>>
>JM> [1] No kidding: http://www.google.com/patents/about?id=QMwnEBAJ
>>>
>>> Apart from these patents probably being silly, why don't they just write
>>> the code in Python? :=)
>CW> Would be
> Jure Erznožnik (JE) wrote:
>JE> Digging further, I found this:
>JE>
>http://www.oreillynet.com/onlamp/blog/2005/10/does_python_have_a_concurrency.html
>JE> Looking up on this info, I found this:
>JE>
>http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock
>J
Anjanesh Lekshminarayanan wrote:
a = 1
b = 25
a / b
0
float(a) / b
0.040001
from __future__ import division
a = 1
b = 25
a / b
0.040001
In what simple way can I get just 0.04 ?
Your subject line says "Integer Division" but
Albert van der Horst writes:
> But I greatly prefer a set
>
> "
> for i in {point1,point2,point3}:
> statements
> "
Agreed, for the reasons you cite. I think this idiom can be expected to
become more common and hopefully displace using a tuple literal or list
literal, as the
Emile van Sebille a écrit :
On 6/17/2009 3:54 PM ssc said...
Wow! Didn't expect that kind of instant support. Thank you very much,
I'll give both zip and enumerate a try.
The code I've shown is actually copied pretty straight from a Django
form class, but I didn't want to mention that as not to
Hi all,
I have been trying out to wrap my mind around the advantages of
decorators and thought I found a use in one of my experiments. (see code
after my sig).
Although it works, I think it should be able to do it better.
My particular problem is that I want to remove an argument (say always
On Jun 19, 1:45 pm, Bruno Desthuilliers wrote:
> [...]
> but it indeed looks like using bar.index *in a generator expression*
> fails (at least in 2.5.2) :
>
> >>> class Foo(object):
> ... bar = ['a', 'b', 'c']
> ... baaz = list((bar.index(b), b) for b in bar)
> ...
> Traceback (most rec
On Jun 17, 3:53 pm, "Rhodri James"
wrote:
> On Wed, 17 Jun 2009 16:06:22 +0100, Aaron Brady
> wrote:
>
>
>
> > On Jun 16, 10:09 am, Mike Kazantsev wrote:
> >> On Tue, 16 Jun 2009 06:57:13 -0700 (PDT)
>
> >> Aaron Brady wrote:
> >> > Making the charitable interpretation that this was the exten
On Fri 19 Jun 2009 02:55:52 AM EDT, Terry Reedy wrote:
>> if c == "today":
>> c = datetime.today()
>
> Now I guess that you actually intend c to be passed as a datetime
> object. You only used the string as a type annotation, not as a real
> default value. Something li
This is a very long-running issue, that has been discussed many times. Here
are the two sides to keeping the gil or removing it:
Remove the GIL:
- True multi-threaded programming
- Scalable performance across a multi-core machine
- Unfortunately, this causes a slow-down in single core/th
Jure Erznožnik wrote:
> See here for introduction:
> http://groups.google.si/group/comp.lang.python/browse_thread/thread/370f8a1747f0fb91
>
> Digging through my problem, I discovered Python isn't exactly thread
> safe and to solve the issue, there's this Global Interpreter Lock
> (GIL) in place.
>
On Fri, 19 Jun 2009 14:36:01 +0100, Matthew Wilson wrote:
On Fri 19 Jun 2009 02:55:52 AM EDT, Terry Reedy wrote:
if c == "today":
c = datetime.today()
Now I guess that you actually intend c to be passed as a datetime
object. You only used the string as a type anno
On Fri, 19 Jun 2009 14:24:34 +0100, Aaron Brady
wrote:
You are not being any help, Rhodri, in your question.
To you, perhaps not. To me, it has at least had the effect of making
what you're trying to do (write a pythonic object database) clearer.
--
Rhodri James *-* Wildebeest Herder to t
Digging through my problem, I discovered Python isn't exactly thread
safe and to solve the issue, there's this Global Interpreter Lock
(GIL) in place.
It's the opposite: Python is exactly thread safe precisely because it
has the GIL in place.
Is there any other way to work around the issue asi
Digging through my problem, I discovered Python isn't exactly thread
safe and to solve the issue, there's this Global Interpreter Lock
(GIL) in place.
It's the opposite: Python is exactly thread safe precisely because it
has the GIL in place.
Is there any other way to work around the issue asi
Am Fri, 19 Jun 2009 00:56:18 + schrieb Matthew Wilson:
> Here's the code that I'm feeding to pylint:
>
> $ cat f.py
> from datetime import datetime
>
> def f(c="today"):
>
> if c == "today":
> c = datetime.today()
>
> return c.date()
>
>
>
Hi,
I'm making use of the multiprocessing module, and I was wondering if there
is an easy way to find out how long a given process has been running for.
For example, if I do
import multiprocessing as mp
import time
def time_waster():
time.sleep(1000)
p = mp.Process(target=time_waster)
p.s
On 19 juin, 11:52, Jure Erznožnik wrote:
> See here for
> introduction:http://groups.google.si/group/comp.lang.python/browse_thread/thread/3...
>
> Digging through my problem, I discovered Python isn't exactly thread
> safe and to solve the issue, there's this Global Interpreter Lock
> (GIL) in p
On 2009-06-19, Anjanesh Lekshminarayanan wrote:
a = 1
b = 25
a / b
> 0
float(a) / b
> 0.040001
>
from __future__ import division
a = 1
b = 25
a / b
> 0.040001
>
> In what simple way can I get just 0.04 ?
You can't. There _
Hi,
Is there a way of retrieving the value of columns in the rows returned by
fetchall, by column name instead of index on the row?
Code Snippet:
query="select * from employees"
db=MySQLdb.connect(host=host,user=user,passwd=passwd,db=database)
cursor = db.cursor ()
cursor.execu
In article ,
Aaron Brady wrote:
>
>You are not being any help, Rhodri, in your question.
Maybe not, but honestly, you're getting pretty close to going back in my
killfile. Although you're no longer trolling this group, I find your
writing difficult to read at best; answering questions from pe
So no one has an answer for why passing flags and the values the flags need
through subprocess does not work? I would like an answer. I've examined all
the examples I could find online, which were all toy examples, and not
helpful to my problem.
On Thu, Jun 18, 2009 at 7:40 PM, Tyler Laing wrote:
On Fri, 19 Jun 2009 07:40:11 -0700 (PDT)
Thomas Robitaille wrote:
> I'm making use of the multiprocessing module, and I was wondering if there
> is an easy way to find out how long a given process has been running for.
> For example, if I do
>
> import multiprocessing as mp
> import time
>
> de
Hello,
The problem might be that, aside from creating the Popen object, to
get the command run you need to call 'communicate' (other options, not
used with the Popen object directly, are 'call' or 'waitpid' as
explained in the documentation). Did you do that?
Best regards,
Javier
2009/6/19 T
On Fri, Jun 19, 2009 at 12:22 AM, Wei, Xiaohai wrote:
> Thanks for your reply.
>
> where is the error log? I can not find it at /var/log
Take a look at http://pydev.sourceforge.net/faq.html#how_do_i_report_a_bug
(it gives the details on how to find the needed info).
> I have a virtual network car
I can't use communicate, as it waits for the child process to terminate.
Basically it blocks. I'm trying to have dynamic communication between the
python program, and vlc.
On Fri, Jun 19, 2009 at 8:05 AM, Charles Yeomans wrote:
>
> On Jun 19, 2009, at 10:55 AM, Tyler Laing wrote:
>
> So no one ha
On Fri, 19 Jun 2009 07:55:19 -0700
Tyler Laing wrote:
> I want to execute this command string: vlc -I rc
>
> This allows vlc to be controlled via a remote interface instead of the
> normal gui interface.
>
> Now, say, I try this from subprocess:
>
> >>>p=subprocess.Popen('vlc -I rc test.avi'.spl
On Fri, 19 Jun 2009 08:07:29 -0700
Tyler Laing wrote:
> I can't use communicate, as it waits for the child process to terminate.
> Basically it blocks. I'm trying to have dynamic communication between the
> python program, and vlc.
Unfortunately, subprocess module doesn't allow it out-of-the-box
On 19 juin, 16:40, Thomas Robitaille
wrote:
> Hi,
>
> I'm making use of the multiprocessing module, and I was wondering if there
> is an easy way to find out how long a given process has been running for.
> For example, if I do
>
> import multiprocessing as mp
> import time
>
> def time_waster():
On Fri, Jun 19, 2009 at 8:16 PM, jorma kala wrote:
> Hi,
> Is there a way of retrieving the value of columns in the rows returned by
> fetchall, by column name instead of index on the row?
> Code Snippet:
>
> query="select * from employees"
> db=MySQLdb.connect(host=host,user=user,passwd=
Ethan Furman wrote:
This body part will be downloaded on demand.
Not sure what happened there... here's the text...
Howdy, Pierre!
I have also written a pure Python implementation of a database, one that
uses dBase III or VFP 6 .dbf files. Any chance you could throw it into
the mix to se
Thanks mike, the idea that maybe some of the info isn't being passed is
certainly interesting.
Here's the output of os.environ and sys.argv:
ty...@surak:~$ cat environ
{'XAUTHORITY': '/home/tyler/.Xauthority', 'GNOME_DESKTOP_SESSION_ID':
'this-is-deprecated', 'ORBIT_SOCKETDIR': '/tmp/orbit-tyler'
jorma kala wrote:
Hi,
Is there a way of retrieving the value of columns in the rows returned by
fetchall, by column name instead of index on the row?
Code Snippet:
query="select * from employees"
db=MySQLdb.connect(host=host,user=user,passwd=passwd,db=database)
cursor = db.cursor
On Jun 19, 8:20 pm, Gerhard Häring wrote:
> Gabriel Rossetti wrote:
> > Hello everyone,
>
> > I get an OperationalError with sqlite3 if I put the wrong column name,
> > but shouldn't that be a ProgrammingError instead? I read PEP 249 and it
> > says :
>
> > " OperationalError
> >
Martin P. Hellwig a écrit :
Hi all,
I have been trying out to wrap my mind around the advantages of
decorators and thought I found a use in one of my experiments. (see code
after my sig).
Although it works, I think it should be able to do it better.
My particular problem is that I want to re
On Fri, 19 Jun 2009 15:46:46 +0100
jorma kala wrote:
> Is there a way of retrieving the value of columns in the rows returned by
> fetchall, by column name instead of index on the row?
Try this:
db = MySQLdb.Connection(host=host,user=user,passwd=passwd,db=database)
db.query(query)
result
On Fri, 19 Jun 2009 10:32:32 -0500
Tim Chase wrote:
> Mike gave you a good answer, though I think it's MySQL specific.
I don't have to deal with MySQL frequently but I've remembered that I
used got the fields out somehow, and now, looking at the code, I wonder
myself, why "how" is 1 and wtf is
Matthew Wilson wrote:
Thanks for the feedback. I think I should have used a more obvious
string in my original example and a more descriptive parameter name.
So, pretend that instead of
c="today"
I wrote
record_date="defaults to today's date".
I know my way is unorthodox,
Jure Erznožnik wrote:
> See here for introduction:
> http://groups.google.si/group/comp.lang.python/browse_thread/thread/370f8a1747f0fb91
>
> Digging through my problem, I discovered Python isn't exactly thread
> safe and to solve the issue, there's this Global Interpreter Lock
> (GIL) in place.
>
On Fri, 19 Jun 2009 08:28:17 -0700
Tyler Laing wrote:
> Thanks mike, the idea that maybe some of the info isn't being passed is
> certainly interesting.
>
> Here's the output of os.environ and sys.argv:
>
...
I'm afraid these doesn't make much sense without the output from the
second results, f
Anjanesh Lekshminarayanan wrote:
a = 1
b = 25
a / b
0
float(a) / b
0.040001
from __future__ import division
a = 1
b = 25
a / b
0.040001
In what simple way can I get just 0.04 ?
Short answer: use 3.1:
>>> 1//25
0
>>> 1/25
0.04
;-)
But you should really try to unde
On Fri, 19 Jun 2009 22:00:28 +0600
Mike Kazantsev wrote:
> On Fri, 19 Jun 2009 08:28:17 -0700
> Tyler Laing wrote:
>
> > Thanks mike, the idea that maybe some of the info isn't being passed is
> > certainly interesting.
> >
> > Here's the output of os.environ and sys.argv:
> >
> ...
>
> I'm a
Jure Erznožnik wrote:
See here for introduction:
http://groups.google.si/group/comp.lang.python/browse_thread/thread/370f8a1747f0fb91
Digging through my problem, I discovered Python isn't exactly thread
safe and to solve the issue, there's this Global Interpreter Lock
(GIL) in place.
Effectively
Writing a class which essentially spiders a site and saves the files
locally. On a URLError exception, it sleeps for a second and tries again (on
404 it just moves on). The relevant bit of code, including the offending
method:
class Handler(threading.Thread):
def __init__(self, url):
Sorry, XD. I'll ask the VLC people if they happen to know why VLC won't open
up the remote interface.
-Tyler
On Fri, Jun 19, 2009 at 9:09 AM, Mike Kazantsev wrote:
> On Fri, 19 Jun 2009 22:00:28 +0600
> Mike Kazantsev wrote:
>
> > On Fri, 19 Jun 2009 08:28:17 -0700
> > Tyler Laing wrote:
> >
>
On Fri, 19 Jun 2009 11:16:38 -0500
Wells Oliver wrote:
> def save(self, uri, location):
> try:
> handler = urllib2.urlopen(uri)
> except urllib2.HTTPError, e:
> if e.code == 404:
>
On Jun 19, 10:16 am, Wells Oliver wrote:
> Writing a class which essentially spiders a site and saves the files
> locally. On a URLError exception, it sleeps for a second and tries again (on
> 404 it just moves on). The relevant bit of code, including the offending
> method:
>
> [snip]
>
> But wha
Wells Oliver schrieb:
Writing a class which essentially spiders a site and saves the files
locally. On a URLError exception, it sleeps for a second and tries again
(on 404 it just moves on). The relevant bit of code, including the
offending method:
class Handler(threading.Thread):
def
It appears to be an issue specifically with VLC, not subprocess. Thank you
guys. The remote interface works through sockets, which is perfectly fine...
if I create a local socket, I can have it connect to the socket with command
line arguments.
On Fri, Jun 19, 2009 at 9:30 AM, Tyler Laing wrote:
On 19 juin, 16:16, Martin von Loewis If you know that your (C) code is thread safe on its own, you can
> release the GIL around long-running algorithms, thus using as many
> CPUs as you have available, in a single process.
what do you mean ?
Cpython can't benefit from multi-core without multiple
CPython itself can't... but the c extension can. Mine did.
On Fri, Jun 19, 2009 at 9:50 AM, OdarR wrote:
> On 19 juin, 16:16, Martin von Loewis > If you know that your (C) code is thread safe on its own, you can
> > release the GIL around long-running algorithms, thus using as many
> > CPUs as
>> If you know that your (C) code is thread safe on its own, you can
>> release the GIL around long-running algorithms, thus using as many
>> CPUs as you have available, in a single process.
Olivier> what do you mean ?
Olivier> Cpython can't benefit from multi-core without mu
On 19 juin, 19:13, s...@pobox.com wrote:
> Olivier> what do you mean ?
>
> Olivier> Cpython can't benefit from multi-core without multiple
> Olivier> processes.
>
> It can, precisely as Martin indicated. Only one thread at a time can hold
> the GIL. That doesn't mean that multiple thr
Hello,
I am retrieving values from a database in the form of a dictionary so
I can access the values as d['column'] and I was wondering if there is
a way to convert the hash to a struct like format so i can just say
d.column. Makes it easier to read and understand.
Thanks
Amita
--
Amita Ekbote
Evidently my posts are appearing, since I see replies.
I guess the question of why I don't see the posts themselves
\is ot here...
On Thu, 18 Jun 2009 17:01:12 -0700 (PDT), Mark Dickinson
wrote:
>On Jun 18, 7:26 pm, David C. Ullrich wrote:
>> On Wed, 17 Jun 2009 08:18:52 -0700 (PDT), Mark Dicki
On Fri, 19 Jun 2009 13:17:24 -0500
Amita Ekbote wrote:
> I am retrieving values from a database in the form of a dictionary so
> I can access the values as d['column'] and I was wondering if there is
> a way to convert the hash to a struct like format so i can just say
> d.column. Makes it easier
Lawrence D'Oliveiro wrote:
> In message <%zv_l.19493$y61.5...@news-server.bigpond.net.au>, Lie Ryan
> wrote:
>
>> Yeah, it might be possible to just mv the file from outside, but not
>> being able to enter a directory just because you've got too many files
>> in it is kind of silly.
>
> Sounds l
Amita Ekbote wrote:
> Hello,
>
> I am retrieving values from a database in the form of a dictionary so
> I can access the values as d['column'] and I was wondering if there is
> a way to convert the hash to a struct like format so i can just say
> d.column. Makes it easier to read and understand.
Hello, everyone.
I've noticed that if I have a class with so-called "rich comparison"
methods
(__eq__, __ne__, etc.), when its instances are included in a set,
set.__contains__/__eq__ won't call the .__eq__ method of the elements
and thus
the code below:
"""
obj1 = RichComparisonClass()
obj2 = Ric
OdarR wrote:
> I don't see such improvement in the Python library, or maybe you can
> indicate us some meaningfull example...?
>
> I currently only use CPython, with PIL, Reportlab...etc.
> I don't see improvement on a Core2duo CPU and Python. How to proceed
> (following what you wrote) ?
I've se
On Jun 19, 6:53 am, Ben Charrow wrote:
> Jure Erznožnik wrote:
> > See here for introduction:
> >http://groups.google.si/group/comp.lang.python/browse_thread/thread/3...
>
> > Digging through my problem, I discovered Python isn't exactly thread
> > safe and to solve the issue, there's this Global
On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote:
Evidently my posts are appearing, since I see replies.
I guess the question of why I don't see the posts themselves
\is ot here...
On Thu, 18 Jun 2009 17:01:12 -0700 (PDT), Mark Dickinson
wrote:
On Jun 18, 7:26 pm, David C. Ullrich
wrot
I wanted to time something that uses with_statement, in python2.5.
Importing __future__ in the statement or the setup doesn't work
since it's not the beginning of the code being compiled. Other
than using a separate module, I could only come up with this:
timeit.template = 'from __future__ i
Hi Folks,
Not being very familiar with python, nor with cgi/http, I intend to
have 3 of buttons in a webpage, each of them is associate with a file
(so I have 3 files, too)
What I would like to have is, when users choose a button, the droplist
update automatically to load the contents of the ass
On Fri 19 Jun 2009 03:02:44 PM EDT, Gustavo Narea wrote:
> Hello, everyone.
>
> I've noticed that if I have a class with so-called "rich comparison"
> methods
> (__eq__, __ne__, etc.), when its instances are included in a set,
> set.__contains__/__eq__ won't call the .__eq__ method of the elements
Wells Oliver wrote:
Writing a class which essentially spiders a site and saves the files
locally. On a URLError exception, it sleeps for a second and tries again (on
404 it just moves on). The relevant bit of code, including the offending
method:
class Handler(threading.Thread):
def __in
On Jun 18, 8:56 pm, Matthew Wilson wrote:
> Here's the code that I'm feeding to pylint:
>
> $ cat f.py
> from datetime import datetime
>
> def f(c="today"):
>
> if c == "today":
> c = datetime.today()
>
> return c.date()
>
> And here's what pylint sa
Gustavo Narea wrote:
> I've noticed that if I have a class with so-called "rich comparison"
> methods
> (__eq__, __ne__, etc.), when its instances are included in a set,
> set.__contains__/__eq__ won't call the .__eq__ method of the elements
> and thus
> the code below:
> """
> obj1 = RichComparis
On Jun 19, 7:43 pm, David C. Ullrich wrote:
> Evidently my posts are appearing, since I see replies.
> I guess the question of why I don't see the posts themselves
> \is ot here...
Judging by this thread, I'm not sure that much is off-topic
here. :-)
> Perhaps not. I'm very surprised to see tho
On Jun 18, 8:56 pm, Matthew Wilson wrote:
> Here's the code that I'm feeding to pylint:
>
> $ cat f.py
> from datetime import datetime
>
> def f(c="today"):
>
> if c == "today":
> c = datetime.today()
>
> return c.date()
>
> And here's what pylint sa
On Jun 19, 11:08 am, OdarR wrote:
> On 19 juin, 19:13, s...@pobox.com wrote:
>
> > Olivier> what do you mean ?
>
> > Olivier> Cpython can't benefit from multi-core without multiple
> > Olivier> processes.
>
> > It can, precisely as Martin indicated. Only one thread at a time can hold
On Jun 17, 8:28 pm, per wrote:
> hi all,
>
> i'm looking for a native python package to run a very simple data
> base. i was originally using cpickle with dictionaries for my problem,
> but i was making dictionaries out of very large text files (around
> 1000MB in size) and pickling was simply too
On Jun 18, 8:56 pm, Matthew Wilson wrote:
> Here's the code that I'm feeding to pylint:
>
> $ cat f.py
> from datetime import datetime
>
> def f(c="today"):
>
> if c == "today":
> c = datetime.today()
>
> return c.date()
>
> And here's what pylint sa
Dennis Lee Bieber wrote:
On Thu, 18 Jun 2009 13:39:28 +0200, Anthra Norell
declaimed the following in
gmane.comp.python.general:
utility. So, my question is: How do I convert a bunch of
three-dimensional coordinates defining lines into a file format Sketch
Up can read (skp, dwg, dxf, 3ds,
> Thomas Robitaille (TR) wrote:
>TR> Hi,
>TR> I'm making use of the multiprocessing module, and I was wondering if there
>TR> is an easy way to find out how long a given process has been running for.
>TR> For example, if I do
>TR> import multiprocessing as mp
>TR> import time
>TR> def time
On Fri, Jun 19, 2009 at 12:02 PM, Gustavo Narea wrote:
> Hello, everyone.
>
> I've noticed that if I have a class with so-called "rich comparison"
> methods
> (__eq__, __ne__, etc.), when its instances are included in a set,
> set.__contains__/__eq__ won't call the .__eq__ method of the elements
>
Chris,
Do you have any online tutorial for this topic?
Thanks,
JJ
On Thu, 2009-06-18 at 08:38 -0700, Chris Withers wrote:
> Hi All,
>
> Too many people in the Python community *still* think the only way to
> work with Excel files in Python is using COM on Windows.
>
> To try and correct this, I
1 - 100 of 181 matches
Mail list logo