On Fri, Mar 22, 2019 at 1:01 AM Steve wrote:
>
> I believe I can see what is happening here but maybe someone can explain
> least I run into this again.
>
> Situation 1: I am using "ws.MessageBeep(1)" to generate a tone through the
> speakers. I wanted two tones to separate it from other tones t
On Jul 30, 2013 3:29 PM, "Chris Angelico" wrote:
>
> On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote:
> > hmm, now that you mention it, this is executing on a remote box with
access to the same file system my local calling program is on. That is,
there is a local call to an intermediate script that co
On Tue, Jul 30, 2013 at 4:37 PM, Tim wrote:
> Argg, this isn't the first time I've had troubles with the file system. This
> is FreeBSD and NFS. I will code up a progressive delay as you mentioned (with
> Steve's correction).
I've used several different networked file systems, including
NetBIOS
On Tuesday, July 30, 2013 9:27:10 AM UTC-4, Chris Angelico wrote:
> On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote:
> > hmm, now that you mention it, this is executing on a remote box with access
> > to the same file system my local calling program is on. That is, there is a
> > local call to an inte
On Tue, Jul 30, 2013 at 3:07 PM, Steven D'Aprano
wrote:
> On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote:
>
>> for delay in 100,300,600,1000,3000,5000,1:
>> if not os.path.exists(directory): break
>> sleep(delay)
>>
>> That'll sleep a maximum of 20 seconds, tune as required.
>
>
On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote:
> for delay in 100,300,600,1000,3000,5000,1:
> if not os.path.exists(directory): break
> sleep(delay)
>
> That'll sleep a maximum of 20 seconds, tune as required.
Actually, that will sleep a maximum of 5.55 hours, and a minimum of
On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote:
> hmm, now that you mention it, this is executing on a remote box with access
> to the same file system my local calling program is on. That is, there is a
> local call to an intermediate script that connects to a socket on the remote
> where the abov
On Monday, July 29, 2013 7:52:36 PM UTC-4, Chris Angelico wrote:
> On Mon, Jul 29, 2013 at 8:16 PM, Tim wrote:
> > My intent is to pass it a directory name or path and if it exists, use
> > shutil.rmtree to remove whatever is there (if it isn't a directory, try to
> > unlink it); then use os.make
On Mon, Jul 29, 2013 at 8:16 PM, Tim wrote:
> My intent is to pass it a directory name or path and if it exists, use
> shutil.rmtree to remove whatever is there (if it isn't a directory, try to
> unlink it); then use os.makedirs to create a new directory or path:
>
> def make_clean_dir(directory
On Mon, Jul 15, 2013 at 2:18 PM, Terry Reedy wrote:
> On 7/14/2013 10:56 AM, Chris Angelico wrote:
> As issue about finding stings in strings was opened last September and, as
> reported on this list, fixes were applied about last March. As I remember,
> some but not all of the optimizations were
On 7/14/2013 10:56 AM, Chris Angelico wrote:
On Sun, Jul 14, 2013 at 11:44 PM, wrote:
timeit.repeat("a = 'hundred'; 'x' in a")
[0.11785943134991479, 0.09850454944486256, 0.09761604599423179]
timeit.repeat("a = 'hundreœ'; 'x' in a")
[0.23955250303158593, 0.2195812612416752, 0.2213389699740
You could use pycallgraph module
Regards,
Alex Abushkevich
--
http://mail.python.org/mailman/listinfo/python-list
Thank you, it is so straightforward.
On Fri, Jul 16, 2010 at 9:58 PM, Chris Rebert wrote:
> On Fri, Jul 16, 2010 at 5:52 PM, Jia Hu wrote:
> > Hello:
> >
> > If I want to calculate the runtime of a section of a program. How can I
> do
> > it?
>
> Taking you extremely literally:
> from time impo
On Fri, Jul 16, 2010 at 5:52 PM, Jia Hu wrote:
> Hello:
>
> If I want to calculate the runtime of a section of a program. How can I do
> it?
Taking you extremely literally:
from time import time
start = time()
run_section_here()
end = time()
runtime = end-start
Assuming you're doing this in orde
On 2007-11-16, Robin Becker <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
> ...
>
>
> see why.
>>
>> You are no longer making m copies of active_nodes.
>
> my profiling indicated that the main problem was the removes.
Yeah, I should've added, "for one thing." I'm glad Chris
correctly poi
Neil Cerutti wrote:
...
see why.
>
> You are no longer making m copies of active_nodes.
my profiling indicated that the main problem was the removes.
>
>
> When you have to make many deletions from the middle of a
> sequence, you would normally choose a linked list. Python doe
Chris Mellon wrote:
>
> remove() does a linear search to find the item to remove, so it's O(n)
> + the actual deletion. Append() is amortized O(1) (overcommit). If you
> delete by index instead:
> for idx, node in active_nodes:
> if cond:
> del active_nodes[idx]
>
>
that's what I
On 2007-11-16, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> Instead, filter your list. It looks like you can't use filter
> directly, so just do it manually.
>
>for i in xrange(m):
>...
>saved_nodes = []
>for A in active_nodes[:]:
I meant to remove the slice. That line
On 2007-11-16, Robin Becker <[EMAIL PROTECTED]> wrote:
> I'm trying to get my head round a timing puzzle I find whilst
> optimizing A Kuchling's version of the Knuth line splitting
> algorithm from the oedipus project. The puzzle is as follows in
> highly abstract form (here active_nodes is a list
On Nov 16, 2007 12:42 PM, Robin Becker <[EMAIL PROTECTED]> wrote:
> I'm trying to get my head round a timing puzzle I find whilst optimizing A
> Kuchling's version of the Knuth line splitting algorithm from the oedipus
> project. The puzzle is as follows in highly abstract form (here
> active_nod
simplest way is just put a timer on start and another on the end,
then calc the elapse. You can also take a look timeit module too
which provides similar but more powerful functions...
-Jim
On Jul 7, 2007, at 12:21 PM, David wrote:
> Hi,
>
> In matlab, I'd calculate the time for a script nam
On Jul 8, 12:21 am, David <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In matlab, I'd calculate the time for a script named test.m to run
> with:
>
> >> tic, run, toc
>
> Is there some way to do this in python on a mac os x from the terminal
> window? Or whatever?
The timeit module may be of use:
http://d
David <[EMAIL PROTECTED]> wrote:
> Is there some way to do this in python on a mac os x from the terminal
> window? Or whatever?
You can use:
% time script.py
from the command line of the terminal
--
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand
something
On Fri, 03 Nov 2006 18:02:37 -0800, Carl Banks wrote:
import timeit
timeit.Timer("foo(1)","from __main__ import foo")
> 1.1497418880462646
Well, that was scarily simple.
Thank you.
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> The timeit module is ideal for measuring small code snippets; I want to
> measure large function objects.
>
> Because the timeit module takes the code snippet argument as a string, it
> is quite handy to use from the command line, but it is less convenient for
> timing lar
WIdgeteye <[EMAIL PROTECTED]> wrote:
>On Tue, 30 May 2006 16:15:44 +1000, John McMonagle wrote:
>
>> Tim Roberts is right. As you are on linux, I suggest you investigate the
>> at command - very user friendly and not at all complicated.
>
>I have been using Slackware for over 10 years I know all
WIdgeteye <[EMAIL PROTECTED]> wrote:
> BTW in the time it took me NOT to get an answer for my question in
> this so called Python NG, I figured it out for myself.
Maybe you want to post the solution in order to help others with similar
problems in the future?
--
John
On 31/05/2006 5:50 AM, WIdgeteye wrote:
>
> This PYTHON NG blows to high heaven. Whats worse, the answers I got were
> most likely from people who know SQUAT about Python scripting. That's why
> they gave me such lame [expletive deleted] answers.
>
> Idiots.
Kindly refer back to your post of
You can try this EnergyKey
http://www30.webSamba.com/SmartStudio
This may be help you.
Now I always use EnergyKey, it helps me so much in my work.
--
http://mail.python.org/mailman/listinfo/python-list
WIdgeteye wrote:
>
Thank you very much for your participation.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 30 May 2006 14:50:38 -0500, WIdgeteye <[EMAIL PROTECTED]> wrote:
>
> [snip]
>
>This PYTHON NG blows to high heaven. Whats worse, the answers I got were
>most likely from people who know SQUAT about Python scripting. That's why
>they gave me such lame fucking answers.
>
>Idiots.
While that
On Tue, 30 May 2006 16:15:44 +1000, John McMonagle wrote:
> Tue, 2006-05-30 at 00:23 -0500, WIdgeteye wrote:
>> On Tue, 30 May 2006 04:34:03 +, Tim Roberts wrote:
>>
>> > WIdgeteye <[EMAIL PROTECTED]> wrote:
>> >>HI,
>> >>I am trying to write a little program that will run a program on
>> >>s
WIdgeteye wrote:
> HI,
> I am trying to write a little program that will run a program on
> scedule.
There are usually existing programs to do so on most platforms (cron on
*n*x, the Windows scheduler, etc).
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('
Tue, 2006-05-30 at 00:23 -0500, WIdgeteye wrote:
> On Tue, 30 May 2006 04:34:03 +, Tim Roberts wrote:
>
> > WIdgeteye <[EMAIL PROTECTED]> wrote:
> >>HI,
> >>I am trying to write a little program that will run a program on scedule.
> >>I am having trouble understanding the datetime, time, sched
On Tue, 30 May 2006 04:34:03 +, Tim Roberts wrote:
> WIdgeteye <[EMAIL PROTECTED]> wrote:
>>HI,
>>I am trying to write a little program that will run a program on scedule.
>>I am having trouble understanding the datetime, time, sched modules. What
>>I would like is something like this:
>>
>>If
WIdgeteye <[EMAIL PROTECTED]> wrote:
>HI,
>I am trying to write a little program that will run a program on
>scedule. I am having trouble understanding the datetime, time, sched
>modules. What I would like is something like this:
>
>If date&time = 06-13-2006:18:00:00
>Then run this program
>
>I am
AOP would be a quite elegant way set timeouts for functions, in my
opinion. The nice thing in it is that, in principle, you can write a
single timeout advice code and then wrap it over any function you want
to timeout.
I wrote timeout_advice.py to demonstrate this a couple of years ago
(see http:/
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> > Is something stopping you from using sigalarm?
>
> Pure ignorance of its existence.
> Thanks, I'll check it out.
Two things to keep in mind:
- You can have only ONE alarm pending for the whole process. If
different things in the program need tim
On Sat, 24 Dec 2005 04:47:34 -0800, Paul Rubin wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
>> How do others handle something like this? What should I be looking for?
>> I'm after a lightweight solution, if any such thing exists.
>
> Is something stopping you from using sigalarm?
Pure ig
Steven D'Aprano wrote:
> I have a problem and I don't know where to start looking for a solution.
>
> I have a class that needs to call an arbitrary function and wait for a
> result. The function, being completely arbitrary and not under my control,
> may be very time consuming and possibly may not
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> How do others handle something like this? What should I be looking for?
> I'm after a lightweight solution, if any such thing exists.
Is something stopping you from using sigalarm?
--
http://mail.python.org/mailman/listinfo/python-list
41 matches
Mail list logo