Re: Is there a better way of doing this?

2009-03-07 Thread Tim Wintle
environmentally harmful something is) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python do shopping cart?

2009-03-06 Thread Tim Wintle
- then it's just your OS's limits that hold it back - so python is turing/register complete. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Roulette wheel

2009-03-04 Thread Tim Wintle
On Wed, 2009-03-04 at 18:02 +, mattia wrote: ri = randint(0, len(rw) - 1) print(Random index:, rw[ri], , value:, pop[rw[ri]]) you probably want random.choice(rw) -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle Problem

2009-03-03 Thread Tim Wintle
to import and reference it like you'd reference any other class you import. Hope that helps Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread Tim Wintle
On Thu, 2009-02-26 at 04:55 -0800, venutaurus...@gmail.com wrote: Hello all, I've a strange requirement where I need to run a python script just as we run an exe (by double clicking through windows explorer or by typing the script name at command prompt). I don't know how windows

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread Tim Wintle
On Thu, 2009-02-26 at 06:00 -0800, venutaurus...@gmail.com wrote: Thanks for the reply, Being a newbie to python, I am finding it difficult to understand the logic even after thorough reading of comments. Is there any simpler way where I can just run a python script from the main

Re: best way to parse a function-call-like string?

2009-02-26 Thread Tim Wintle
][:-1].split(,) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to parse a function-call-like string?

2009-02-26 Thread Tim Wintle
On Thu, 2009-02-26 at 21:39 +, Tim Wintle wrote: On Thu, 2009-02-26 at 21:29 +, m...@pixar.com wrote: junkpkg.f1, ['aaa','with,comma'] oops - missed this one, ignore my last reply. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python shell scripting and errors

2009-02-23 Thread Tim Wintle
On Mon, 2009-02-23 at 09:12 -0800, Phillip B Oldham wrote: I've got a python script running as a daemon (using someone else's daemon module). It runs fine for a while, but will occasionally balk and die. Since its running in the background, I'm getting no error from it. What's the best way

Re: Challenge: Please break this! [Python Security]

2009-02-23 Thread Tim Wintle
() Dinner and drinks on me for an evening -- when you are next in London or I am in your town -- to the first person who manages to break safelite.py and write to the filesystem. I'm in London on Wednesday ;-) Unfortunately I'm going to be too busy to take up your offer, lol Tim Wintle -- http

Re: Challenge: Please break this! [Python Security]

2009-02-23 Thread Tim Wintle
On Mon, 2009-02-23 at 13:20 -0800, Paul McNett wrote: tav wrote: I'm keen to know your experiences even if you don't manage to write to the filesystem -- and especially if you do! Does it count when it breaks some standard libs that aren't even trying to write to the filesystem? It

Re: more on unescaping escapes

2009-02-23 Thread Tim Wintle
and make things more easy to read. i.e. a = c:\\test\\t a 'c:\\test\\t' print a c:\test\t so when it displays strings in the interpreter it includes escape characters, when it is printed though the output is straight to stdout and isn't escaped. Hope that helps, Tim Wintle -- http

Re: Forwarding keyword arguments from one function to another

2009-02-22 Thread Tim Wintle
kwds, which will be passed separately. This is what the second form expects, but not what the first one expects. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Tim Wintle
On Fri, 2009-02-20 at 16:38 +, Nigel Rantor wrote: Luke Dunn wrote: snip That was my initial thought when I read this too - but I'm not certain that is guaranteed to find a solution (i.e. a solution that's optimal). I'd welcome a proof that it will though, a few minutes thought hasn't

os.fdopen giving Invalid Argument from pipes

2009-02-19 Thread Tim Wintle
Was wondering if someone could point out what the stupid thing I'm doing wrong is: {{{ import os, time def run_multi_proc(): server_send, logger_recieve = os.pipe() pid = os.fork() if pid == 0: # we are the logger #os.close(server_send) logger_recieve =

Re: os.fdopen giving Invalid Argument from pipes

2009-02-19 Thread Tim Wintle
On Thu, 2009-02-19 at 11:50 -0500, Jean-Paul Calderone wrote: You got server_send and logger_receive backwards Doh! (also, i before e *except* after c et cetera). Flip 'em around and all is well. Thanks - never was great at speling :-) Tim --

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
someone far cleverer than me (possibly someone who's on this list) will have solved that problem. The top experts in many fields use Python, and if they weren't able to make use of multiple core chips, then there wouldn't be any demand for them. Tim Wintle ~G -- http://mail.python.org/mailman

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
impact for numerical work. (3) Multiple cores scale processing power linearly at best with the number of cores (since you're normally going to be IO based at some point). Perhaps the GIL will be relaxed a bit, but it's not going to have a massive effect. Tim Wintle -- http://mail.python.org/mailman

Re: memory recycling/garbage collecting problem

2009-02-18 Thread Tim Wintle
On Tue, 2009-02-17 at 17:04 +0100, Christian Heimes wrote: Tim Wintle wrote: Basically malloc() and free() are computationally expensive, so Python tries to call them as little as possible - but it's quite clever at knowing what to do - e.g. if a list has already grown large then python

Re: Searching Google?

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 13:36 +0100, Johannes Bauer wrote: Curt Hash schrieb: You just need to change your User-Agent so that Google doesn't know a Python script is making the request: Why would Google not send a response if the User-Agent header field is not a recognized browser? I doubt

Re: Revision Control

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 09:08 -0800, Sam Clark wrote: Any suggestions for a beginer on what to use for version control? It's just me, the lone person programming. I've already nailed one version of my code accidentaly. MS VSS is too expensive for the stuff I'm doing, plus I really don't like

Re: Speedup Bitmap Parser

2009-02-17 Thread Tim Wintle
.) than done in Python - it's just too tough to do pointer-magic in Python. You may find that so much time is being spent by your application in the .create_line method that there's no other option - I'd highly recommend PIL though. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Tim Wintle
On Tue, 2009-02-17 at 00:40 -0800, Chris Rebert wrote: 'gc.collect()' -- I believe, but I'm not the specialist in it. If I understand correctly, that only effects objects that are part of a reference cycle and doesn't necessarily force the freed memory to be released to the OS. I

Re: Module to read/write MIDI ?

2009-02-16 Thread Tim Wintle
I had my first look around pypi.python.org/pypi yesterday and didn't see anything. Is there a MIDI-module for Python ? If not, I'll email Sean to ask if he'd mind me translating his module into Python3... http://www.mxm.dk/products/public/pythonmidi This is the only project I have seen that

Re: thread. question

2009-02-13 Thread Tim Wintle
On Mon, 2009-02-09 at 21:02 +0100, Christian Heimes wrote: The module was renamed to _thread to stop people from using it directly. The extension module is the interface to some low level types and functions. Especially the usage of thread.start_new_thread is problematic, since it bypasses

thread. question

2009-02-09 Thread Tim Wintle
the thread module direct the code doesn't seem to escape from C during the acquire() etc. or am I missing something important? Thanks, Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: thread. question

2009-02-09 Thread Tim Wintle
Thanks for both replies, On Mon, 2009-02-09 at 15:59 +0100, Christian Heimes wrote: You shouldn't use the thread module directly. It's not meant to be used by a user. Please stick to the threading module. You won't notice a slowdown, trust me :) I'm aware that thread is being renamed to

<    1   2