Re: Compiler for external modules for python

2006-07-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Under this circumstances I tried to find the VC7 compiler from > microsoft sites, however it deflect to the new version of VS2005, so I > "lost the cord and the goat" . > I do not know what to do. Does anybody has some guidelines about this > matter? You need to use VS 2

Re: getaddrinfo not found on SCO OpenServer 5.0.5

2006-07-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > 1) I've seen mention of native vs. Python getaddrinfo implementations. > If that's true, how can I force the program to use the Python one? > > 2) Is there an option to not use the BSD Library function? > > 3) Finally, is there a trick to searching for shared libaries?

Re: Sansung YH-920 + Linux + yh-925-db-0.1.py = AttributeError: 'module' object has no attribute 'decode'

2006-07-22 Thread rsd
> > You don't say which version of Python you are running ... but my guess > is that it's 2.3 or earlier. Yes, you're right. I was using version 2.3.5 I'll see if I can get it working with 2.4 Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Terry Reedy
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim, > > An object is iterable if it implements the iterator protocol There are presently two iterator protocols. The old one will be likely be dropped in 3.0 (currently being discussed). >. A good > enough check

""DRUG EMPIRE - INVEST IN QUANTUM COMPTERS GODS WEPON"""

2006-07-22 Thread switzerland qunatium computer
""DRUG EMPIRE - INVEST IN QUANTUM COMPTERS GODS WEPON""" http://www.beyond-science.com RUN THIS WITH A QUNATIUM COMPUTER THE GREATEST PROTECTION AND RIVAL'S ANY INTELLGENCE AGNECY'S -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Pyton Book For Newbies?

2006-07-22 Thread hanumizzle
W. D. Allen wrote: > I want to write a retirement financial estimating program. Python was > suggested as the easiest language to use on Linux. I have some experience > programming in Basic but not in Python. > > I have two questions: > 1. What do I need to be able to make user GUIs for the progr

Re: Python proficiency test

2006-07-22 Thread Richard Jones
Kent Johnson wrote: > I recently helped create an on-line Python proficiency test. The > publisher of the test is looking for beta testers to try the test and > give feedback. If you are interested, here is an announcement from the > publisher: Had a look. In between my browser blocking a popup on

Re: using names before they're defined

2006-07-22 Thread Patrick Maupin
[EMAIL PROTECTED] wrote: > I have a problem. I'm writing a simulation program with a number of > mechanical components represented as objects. When I create instances > of objects, I need to reference (link) each object to the objects > upstream and downstream of it, i.e. > > supply = supply() > c

Re: Which Pyton Book For Newbies?

2006-07-22 Thread pretoriano_2001
W. D. Allen wrote: > I want to write a retirement financial estimating program. Python was > suggested as the easiest language to use on Linux. I have some experience > programming in Basic but not in Python. > > I have two questions: > 1. What do I need to be able to make user GUIs for the progr

Re: Which Pyton Book For Newbies?

2006-07-22 Thread pretoriano_2001
W. D. Allen wrote: > I want to write a retirement financial estimating program. Python was > suggested as the easiest language to use on Linux. I have some experience > programming in Basic but not in Python. > > I have two questions: > 1. What do I need to be able to make user GUIs for the progr

Which Pyton Book For Newbies?

2006-07-22 Thread W. D. Allen
I want to write a retirement financial estimating program. Python was suggested as the easiest language to use on Linux. I have some experience programming in Basic but not in Python. I have two questions: 1. What do I need to be able to make user GUIs for the program, and 2. Which book would

Re: How to use pdb?

2006-07-22 Thread R. Bernstein
[EMAIL PROTECTED] writes: > R. Bernstein wrote: > > Perhaps what you are looking for is: > > python /usr/lib/python2.4/pdb.py Myprogram.py > > I tried this and it did not work. pdb did not load the file so it > could be debugged. lol. Yes, if you are not in the same directory as Myprogram.py

Compiler for external modules for python

2006-07-22 Thread pretoriano_2001
Hello: I have interesting external modules that I want to incorporate to python 2.4.3 and python 2.5b2 also. Some of them requires C/C++ compiler. I work with Win XP Sp2 and have installed VC2005 express (I do not know if the compiler is the one with optimizing characterisitics), when trying to ins

Re: Sansung YH-920 + Linux + yh-925-db-0.1.py = AttributeError: 'module' object has no attribute 'decode'

2006-07-22 Thread John Machin
rsd wrote: > Hi, > > I'm trying get Samsung YH-920 mp3 player to work with Debian GNU/Linux. > To do that I need to run >http://www.paul.sladen.org/toys/samsung-yh-925/yh-925-db-0.1.py > script, the idea behind the script is described at >http://www.paul.sladen.org/toys/samsung-yh-925/ > >

Dive Into Python -- Still Being Updated?

2006-07-22 Thread hanumizzle
I find Dive Into Python generally an excellent text, and I am not surprised to see people recommending it...but I have noticed a few errors already: http://diveintopython.org/getting_to_know_python/indenting_code.html The function called fib (presumably short for Fibonacci) appears to produce fac

Re: Type signature

2006-07-22 Thread hanumizzle
Yacao Wang wrote: > Hi, I'm a newbie to Python. I've recently read some books about this > language and none of them have answered my question. > As a dynamically-typed language Python doesn't need any form of type > signature which makes the syntax very clean and concise. OK... > However, type

Re: Type signature

2006-07-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Yacao Wang wrote: > However, type signatures are not only a kind of information provided for > the compiler, but also for the programmer, or more important, for the > programmer. Without it, we have to "infer" the return type or required > agument types of a function, and t

Re: httplib, threading, wx app freezing after 4 hours

2006-07-22 Thread Nick Vatamaniuc
Mark, httplib will block waiting for a server connection. I am not sure if that is your problem but you could try a quick and dirty workaround of recording a timestamp of the last data transfer and then have a timer in a separate thread and if too much time passed, restart the retrieval thread and

Type signature

2006-07-22 Thread Yacao Wang
Hi, I'm a newbie to Python. I've recently read some books about this language and none of them have answered my question. As a dynamically-typed language Python doesn't need any form of type signature which makes the syntax very clean and concise. However, type signatures are not only a kind of inf

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Nick Vatamaniuc
Tim, An object is iterable if it implements the iterator protocol. A good enough check to see if it does is to check for the presense of the __iter__() method. The way to do it is: hasattr(object,'__iter__') You are correct in the fact that you check if an object is iterable rather than using isi

Re: subprocess module

2006-07-22 Thread Tim Roberts
"placid" <[EMAIL PROTECTED]> wrote: >Hi all, > >If someone could give me an example of creating a subprocess (on >Windows) using the subprocess module and Popen class and connecting to >its stdout/stdin file handles. I googled for a bit but the only example >i found was here ; "Use the source, Lu

Re: using names before they're defined

2006-07-22 Thread Nick Vatamaniuc
Dave, Sometimes generating classes from .ini or XML files is not the best way. You are just translating one language into another and are making bigger headaches for your self. It is certainly cool and bragable to say that "my classes get generated on the fly from XML" but Python is terse and rea

Re: random shuffles

2006-07-22 Thread Ross Ridge
David G. Wonnacott wrote: > Couldn't we easily get an n*log(n) shuffle... Why are you trying to get an O(n*log(n)) shuffle when an O(n) shuffle algorithim is well known and implemented in Python as random.shuffle()? Ross Ridge -- http://mail.python.org/mailman/listinfo/

Re: Python website problem?

2006-07-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > >Does the Python.org website have a problem? I only get a directory >index, and clicking on any of the HTML files in there shows a page >without any CSS makeup. > >Anyone noticed this too? Yes, we're having problems

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : > In <[EMAIL PROTECTED]>, Bruno Desthuilliers wrote: > > >>Tim N. van der Leeuw a écrit : >> >>>Hi, >>> >>>I'd like to know if there's a way to check if an object is a sequence, >>>or an iterable. Something like issequence() or isiterable(). >>> >>>Does somethin

Re: function v. method

2006-07-22 Thread Bruno Desthuilliers
danielx a écrit : > Bruno Desthuilliers wrote: > >>danielx a écrit : >> >>>Bruno Desthuilliers wrote: >>> >>> danielx wrote: >Bruno Desthuilliers wrote: > > > >>danielx wrote: >> (snip) >>>Obviously, such things would be omitted from you

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Bruno Desthuilliers wrote: > Tim N. van der Leeuw a écrit : >> Hi, >> >> I'd like to know if there's a way to check if an object is a sequence, >> or an iterable. Something like issequence() or isiterable(). >> >> Does something like that exist? (Something which, in case

Re: function v. method

2006-07-22 Thread danielx
Bruno Desthuilliers wrote: > Antoon Pardon wrote: > > On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > > > >>danielx wrote: > >> > (snip) > >> > >> > >>if you prefix with a single underscore, that tells the user, DON'T MESS > >>WITH ME FROM OUTSIDE! I AM AN IMPLEMENTATION DETAIL! > > > > >

Re: function v. method

2006-07-22 Thread Bruno Desthuilliers
danielx a écrit : > (snip) > Sigh. I TOTALLY realize that Python works by politeness and not > enforcement. I think you are misinterpreting why I think this would be > a good idea. My concern is not with control, but with convenience. Having free access to implementation is convenient IMHO. > My

Re: function v. method

2006-07-22 Thread danielx
Bruno Desthuilliers wrote: > danielx a écrit : > > Bruno Desthuilliers wrote: > > > >>danielx wrote: > >> > >>>Bruno Desthuilliers wrote: > >>> > >>> > danielx wrote: > > >> > >>(snip) > >> > >Obviously, such things would be omitted from your docs, but users also > >learn by intera

Re: Isn't there a better way?

2006-07-22 Thread Dave Hansen
On 21 Jul 2006 07:51:15 -0700 in comp.lang.python, "T" <[EMAIL PROTECTED]> wrote: > >I am using an optparse to get command line options, and then pass them >to an instance of another class: > > > ># Class that uses optparse.OptionParser >foo = Parse_Option() > ># Class that does the real work >bar

Re: function v. method

2006-07-22 Thread danielx
fuzzylollipop wrote: > danielx wrote: > > Bruno Desthuilliers wrote: > > > danielx wrote: > > > > At first I was going to post the following: > > > > > > > > > > > > > > > (snip) > > > > > > > > > > > > > > > > but then I tried this: > > > > > > > > > > > res = Foo.__dict__['func'] > > >

Re: function v. method

2006-07-22 Thread Bruno Desthuilliers
danielx a écrit : > Bruno Desthuilliers wrote: > >>danielx wrote: >> >>>Bruno Desthuilliers wrote: >>> >>> danielx wrote: >> >>(snip) >> >Obviously, such things would be omitted from your docs, but users also >learn by interacting with Python, which is really one of Python's great

Re: function v. method

2006-07-22 Thread danielx
Gerhard Fiedler wrote: > On 2006-07-20 18:10:21, danielx wrote: > > >>> When supporting documents aren't sufficient to learn an api (I'm sure > >>> this never happens, so just humor me), you can always turn to > >>> interactive Python. > >> > >> ...and source code... > > > > *shudders* What happen

Re: New to threads. How do they work?

2006-07-22 Thread Edmond Dantes
Dennis Lee Bieber wrote: > On Sat, 22 Jul 2006 17:19:22 +1200, Lawrence D'Oliveiro > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> Perhaps because with threads, data is shared by default. Whereas with >> processes, it is private by default, and needs to be explicitly

Re: Nested function scope problem

2006-07-22 Thread Justin Azoff
Bruno Desthuilliers wrote: > Justin Azoff a écrit : > > if len(tok) > 0: > > should be written as > > if(tok): > > > > actually, the parenthesis are useless. yes, that's what happens when you edit something instead of typing it over from scratch :-) -- - Justin -- http://mail.python.or

Re: function v. method

2006-07-22 Thread danielx
Bruno Desthuilliers wrote: > danielx wrote: > > Bruno Desthuilliers wrote: > > > >>danielx wrote: > >> > (snip) > >>> > >>>Obviously, such things would be omitted from your docs, but users also > >>>learn by interacting with Python, which is really one of Python's great > >>>virtues. When supportin

Re: Python newbie needs constructive suggestions

2006-07-22 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : > In message <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > > >> b) give up on using an anonymous function and create a named "successor" >> function with "def", > > > This is what you have to do. Not necessarily. map(lambda x, one=1: one + x, range(42)) >

Re: Nested function scope problem

2006-07-22 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : > In message <[EMAIL PROTECTED]>, Justin > Azoff wrote: > > >>Simon Forman wrote: >> >>>That third option seems to work fine. >> >>Well it does, but there are still many things wrong with it >> >>if len(tok) > 0: >>should be written as >>if(tok): > > > I p

Re: Nested function scope problem

2006-07-22 Thread Bruno Desthuilliers
Justin Azoff a écrit : > Simon Forman wrote: > >>That third option seems to work fine. > > > Well it does, but there are still many things wrong with it > > if len(tok) > 0: > should be written as > if(tok): > actually, the parenthesis are useless. -- http://mail.python.org/mailman/l

Re: Nested function scope problem

2006-07-22 Thread Bruno Desthuilliers
Justin Azoff a écrit : > Simon Forman wrote: > >>That third option seems to work fine. > > > Well it does, but there are still many things wrong with it > (snip) > tok = '' > tok = toc + c > should be written as > tok = [] > tok.append(c) > and later > ''.join(toc) IIRC, s

Re: Nested function scope problem

2006-07-22 Thread Bruno Desthuilliers
Josiah Manson a écrit : > I found that I was repeating the same couple of lines over and over in > a function and decided to split those lines into a nested function > after copying one too many minor changes all over. The only problem is > that my little helper function doesn't work! It claims tha

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Terry Reedy
"Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I'd like to know if there's a way to check if an object is a sequence, > or an iterable. Something like issequence() or isiterable(). How about try: it = iter(possible_iterable) except TypeError: bail()

Re: How to automate user input at the command prompt?

2006-07-22 Thread M�ta-MCI
Hi! >>> There are typically only two output streams from a command line program. >>> stdout and stderr... Some of the OS triggered error messages (abort, retry, fail) might be going to stderr -- so if you were looking at stdout, you won't see them. - when you use RD TOTO/S , win show the text

Re: Converting argv to variable

2006-07-22 Thread Terry Reedy
"tgiles" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > (now that I've posted in the wrong flipping newsgroup the first thing, > here's my question to the lovely python folks) > > I've taken a year off (or so) using Python and the first thing I run > into utterly stumped me. Been t

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Tim N. van der Leeuw
Bruno Desthuilliers wrote: > Tim N. van der Leeuw a écrit : > > Hi, > > > > I'd like to know if there's a way to check if an object is a sequence, > > or an iterable. Something like issequence() or isiterable(). > > > > Does something like that exist? (Something which, in case of iterable, > > doe

Re: random shuffles

2006-07-22 Thread danielx
David G. Wonnacott wrote: > From: "danielx" <[EMAIL PROTECTED]> >Date: 22 Jul 2006 01:43:30 -0700 > >Boris Borcic wrote: >> does >> >> x.sort(cmp = lambda x,y : cmp(random.random(),0.5)) >> >> pick a random shuffle of x with uniform distribution ? > > ... > >Let e be

Re: Python newbie needs constructive suggestions

2006-07-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > What is the idiomatically appropriate Python way to pass, as a > "function-type parameter", code that is most clearly written with a > local variable? def functionWithLocal(andArg): localVar = 42 return andArg+localVar map(functionWithLocal, range(42)) > For

Re: How to test if object is sequence, or iterable?

2006-07-22 Thread Bruno Desthuilliers
Tim N. van der Leeuw a écrit : > Hi, > > I'd like to know if there's a way to check if an object is a sequence, > or an iterable. Something like issequence() or isiterable(). > > Does something like that exist? (Something which, in case of iterable, > doesn't consume the first element of the iter

Re: Isn't there a better way?

2006-07-22 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : > In message <[EMAIL PROTECTED]>, T wrote: > > >>I am using an optparse to get command line options, and then pass them >>to an instance of another class: >> >> >> >># Class that uses optparse.OptionParser >>foo = Parse_Option() >> >># Class that does the real work >

Sansung YH-920 + Linux + yh-925-db-0.1.py = AttributeError: 'module' object has no attribute 'decode'

2006-07-22 Thread rsd
Hi, I'm trying get Samsung YH-920 mp3 player to work with Debian GNU/Linux. To do that I need to run http://www.paul.sladen.org/toys/samsung-yh-925/yh-925-db-0.1.py script, the idea behind the script is described at http://www.paul.sladen.org/toys/samsung-yh-925/ I'm getting errors and ho

Re: Python website problem?

2006-07-22 Thread Tim N. van der Leeuw
Tim N. van der Leeuw wrote: > Hi, > > Does the Python.org website have a problem? I only get a directory > index, and clicking on any of the HTML files in there shows a page > without any CSS makeup. > > Anyone noticed this too? > > --Tim Well, it seems fixed again... --Tim -- http://mail.pyt

How to test if object is sequence, or iterable?

2006-07-22 Thread Tim N. van der Leeuw
Hi, I'd like to know if there's a way to check if an object is a sequence, or an iterable. Something like issequence() or isiterable(). Does something like that exist? (Something which, in case of iterable, doesn't consume the first element of the iterable) Regards, --Tim -- http://mail.pytho

Python website problem?

2006-07-22 Thread Tim N. van der Leeuw
Hi, Does the Python.org website have a problem? I only get a directory index, and clicking on any of the HTML files in there shows a page without any CSS makeup. Anyone noticed this too? --Tim -- http://mail.python.org/mailman/listinfo/python-list

GUIDE: Using xtopdf to create PDF from text and DBF files (including creating simple PDF e-books)

2006-07-22 Thread vasudevram
Hi, I'm giving below, steps to install and use my xtopdf PDF creation/conversion toolkit. This post is for end-users. xtopdf is both a set of end-user tools and a library for use by developers, to create PDF from various input formats. I'll post another message here about how developers can use

Re: Nested function scope problem

2006-07-22 Thread Justin Azoff
Josiah Manson wrote: > I just did some timings, and found that using a list instead of a > string for tok is significantly slower (it takes 1.5x longer). Using a > regex is slightly faster for long strings, and slightly slower for > short ones. So, regex wins in both berevity and speed! I think th

httplib, threading, wx app freezing after 4 hours

2006-07-22 Thread Mark rainess
The program displays images from a motion jpeg webcam. (Motion jpeg is a bastardization of multi-part mime.) It runs perfectly for about 4 hours, then freezes. I'm stuck. How do I debug this? (Using: Python 2.4.3, wxPython 2.6.3.2, Windows 2

Re: What is a type error?

2006-07-22 Thread Benjamin Franksen
Darren New wrote: > Chris Smith wrote: >> Specialized >> language already exist that reliably (as in, all the time) move array >> bounds checking to compile time; > > It sounds like this means the programmer has to code up what it means to > index off an array, yes? Otherwise, I can't imagine how

Re: How to force a thread to stop

2006-07-22 Thread bryanjugglercryptographer
Hans wrote: > Hi all, > > Is there a way that the program that created and started a thread also stops > it. > (My usage is a time-out). > > E.g. > > thread = threading.Thread(target=Loop.testLoop) > thread.start() # This thread is expected to finish within a second > thread.join(2)# Or ti

Re: IronPython and scipy/pyExcelerator

2006-07-22 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > I'm looking forward to the release IronPython, primarily for its IDE. I > currently use scipy and pyExcelerator to crunch numbers and write them > to Excel: does can these packages be used with IronPython as well? > > Thanks in advance You could try Python for .NET. Thi

Re: random shuffles

2006-07-22 Thread David G. Wonnacott
From: "danielx" <[EMAIL PROTECTED]> Date: 22 Jul 2006 01:43:30 -0700 Boris Borcic wrote: > does > > x.sort(cmp = lambda x,y : cmp(random.random(),0.5)) > > pick a random shuffle of x with uniform distribution ? ... Let e be the element which was in the first position t

Re: Application Generators

2006-07-22 Thread walterbyrd
Steve Hannah wrote: > I know that this is an older thread, but I came across it on Nabble.com. > Just wanted add some updated info on Walter's observations about Dataface > (http://fas.sfu.ca/dataface) . It is much further along in development now > and it does support authentication now. > Than

Re: New to threads. How do they work?

2006-07-22 Thread Grant Edwards
On 2006-07-22, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >> I've never understood the aversion people seem to have to >> threads. > > Perhaps because with threads, data is shared by default. > Whereas with processes, it is private by default, and needs to > be explicitly shared if you want th

Re: Converting argv to variable

2006-07-22 Thread Klaus Alexander Seistrup
Tom skrev: > newDirectory = str(sys.argv[1:]) Try newDir = '/'.join(sys.argv[1:]) or newDir = sys.argv[1] or for newDir in sys.argv[1:]: : or something along those lines, depending on how you wish to interpret the commandline. Cheers, -- Klaus Alexander

Re: Converting argv to variable

2006-07-22 Thread Tim Chase
> newDirectory = str(sys.argv[1:]) [cut] > Now, in a perfect universe I would get an output something > like the following (if I run the script with the argument > 'python': > > /Volumes/Home/myuser/python > > However, Python still hangs on to all the fluff and prints > out something else:

Converting argv to variable

2006-07-22 Thread tgiles
(now that I've posted in the wrong flipping newsgroup the first thing, here's my question to the lovely python folks) I've taken a year off (or so) using Python and the first thing I run into utterly stumped me. Been too long and none of the searches I've done seems to have helped any. Basically,

Re: Wxpython, using more than 1 timer?

2006-07-22 Thread janama
Thanks for that, cheers Regards nikie wrote: > janama wrote: > > > Hi all, > > > > Using wx > > When adding a second timer as i have the first, the second timer > > adding stops the first timer (updating or stops?) . In this example im > > updating a uptime and localtime label. It works fine f

How to force a thread to stop

2006-07-22 Thread Hans
Hi all, Is there a way that the program that created and started a thread also stops it. (My usage is a time-out). E.g. thread = threading.Thread(target=Loop.testLoop) thread.start() # This thread is expected to finish within a second thread.join(2)# Or time.sleep(2) ? if thread.isAliv

Re: Wxpython, using more than 1 timer?

2006-07-22 Thread nikie
janama wrote: > Hi all, > > Using wx > When adding a second timer as i have the first, the second timer > adding stops the first timer (updating or stops?) . In this example im > updating a uptime and localtime label. It works fine for displaying the > last "self.startTimer2()" called. But preve

Re: Python newbie needs constructive suggestions

2006-07-22 Thread David G. Wonnacott
Many thanks to those of you who responded to my question about anonymous functions with local variables, filling me in on e) do something else clever and Pythonic that I don't know about yet? by pointing out that I can use (among other good things) lambda with default arguments. That should sui

Wxpython, using more than 1 timer?

2006-07-22 Thread janama
Hi all, Using wx When adding a second timer as i have the first, the second timer adding stops the first timer (updating or stops?) . In this example im updating a uptime and localtime label. It works fine for displaying the last "self.startTimer2()" called. But prevents the previous self.startT

Re: using array as execute parameter in dbapi

2006-07-22 Thread gglegrp112
This is a really neat trick. Thank you very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, aldonnelley wrote: > (Oh, and if anyone still has a bright idea about how to get image > dimensions without downloading, it'd be great to hear!) Most image formats have some sort of header with the dimensions information so it's enough to download this header. Depends on

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi there: a bit of a left-field question, I think. > I'm writing a program that analyses image files downloaded with a basic > crawler, and it's slow, mainly because I only want to analyse files > within a certain size range, and I'm having to download all the files > on

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread aldonnelley
Thanks Josiah I thought as much... Still, it'll help me immensely to cut the downloads from a page to only those that are within a file-size range, even if this gets me some images that are out-of-spec dimensionally. Cheers, Al. (Oh, and if anyone still has a bright idea about how to get image d

Re: random shuffles

2006-07-22 Thread danielx
Boris Borcic wrote: > does > > x.sort(cmp = lambda x,y : cmp(random.random(),0.5)) > > pick a random shuffle of x with uniform distribution ? > > Intuitively, assuming list.sort() does a minimal number of comparisons to > achieve the sort, I'd say the answer is yes. But I don't feel quite > confor

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread Josiah Manson
In the head of an HTTP response, most servers will specify a Content-Length that is the number of bytes in the body of the response. Normally, when using the GET method, the header is returned with the body following. It is possible to make a HEAD request to the server that will only return header

Is it possible to get image size before/without downloading?

2006-07-22 Thread aldonnelley
Hi there: a bit of a left-field question, I think. I'm writing a program that analyses image files downloaded with a basic crawler, and it's slow, mainly because I only want to analyse files within a certain size range, and I'm having to download all the files on the page, open them, get their size

Re: Isn't there a better way?

2006-07-22 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, T wrote: > > I am using an optparse to get command line options, and then pass them > to an instance of another class: > > > > # Class that uses optparse.OptionParser > foo = Parse_Option() > > # Class that does the real work > bar = Processor() > > bar.index

Re: New to threads. How do they work?

2006-07-22 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Dennis Lee Bieber wrote: > On Sat, 22 Jul 2006 17:19:22 +1200, Lawrence D'Oliveiro > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> Perhaps because with threads, data is shared by default. Whereas with >> processes, it is private by def