Re: division by 7 efficiently ???

2007-01-31 Thread John Machin
On Feb 1, 2:36 pm, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Its not an homework. I appeared for EA sports interview last month. I > > was asked this question and I got it wrong. I have already fidlled > > around with the answer but I don't know the correct reasoning behi

urllib2 hangs "forever" where there is no network interface

2007-01-31 Thread dumbkiwi
I have written a script that uses the urllib2 module to download web pages for parsing. If there is no network interface, urllib2 hangs for a very long time before it raises an exception. I have set the socket timeout with socket.setdefaulttimeout(), however, where there is no network interface,

Re: division by 7 efficiently ???

2007-01-31 Thread Paul McGuire
On Jan 31, 11:36 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2:42 am, [EMAIL PROTECTED] wrote: > > > > > How to divide a number by 7 efficiently without using - or / operator. > > We can use the bit operators. I was thinking about bit shift operator > > but I don't know the correct answer. >

Re: Can I import a file without file extension .py?

2007-01-31 Thread Jia Lu
> > def make_module_from_file(module_name, file_name): > """ Make a new module object from the code in specified file """ > > from types import ModuleType > module = ModuleType(module_name) > > module_file = open(file_name, 'r') > exec module_file in modu

Re: I uncover the secret of visual consciousness

2007-01-31 Thread Ben Finney
[EMAIL PROTECTED] writes: > The electrochemical changes in the visual and cerebral cortex must be > firstly translated into an image. Then this image ought be changed > into the corresponding object. In comparison with image formation by a > plane mirror, we would elucidate the mechanisms and path

I uncover the secret of visual consciousness

2007-01-31 Thread mantaintai
I uncover the secret of visual consciousness Proof of visual consciousness >From image formation by a plane mirror to the generation of (human) visual consciousness image formation by a plane mirror , visual consciousness, transform, virtual image , overlap(superpose), dual identities, seeing an

Re: division by 7 efficiently ???

2007-01-31 Thread Ben Finney
"Paddy" <[EMAIL PROTECTED]> writes: > On Feb 1, 2:42 am, [EMAIL PROTECTED] wrote: > > How to divide a number by 7 efficiently without using - or / operator. > > >>> int.__div__(14,2) > 7 > >>> > > Not a minus or division operator in sight ;-) I salute you, sir. That's the perfect answer to the bo

Re: SyntaxError: 'return' outside function

2007-01-31 Thread Melih Onvural
Thanks all, I did a massive make sure everything is indents and not spaces across all of my files and now things are running much more smoothly. I appreciate the responses. --melih On Jan 31, 4:49 pm, [EMAIL PROTECTED] wrote: > Melih> Has anyone seen this error before and been able to solve i

Re: Can I import a file without file extension .py?

2007-01-31 Thread Ben Finney
"Jia Lu" <[EMAIL PROTECTED]> writes: > I wonder if I can import a file with other file extensions ? I use this function in most of my test infrastructures, to import programs as modules for unit testing. def make_module_from_file(module_name, file_name): """ Make a new module object

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Michele Simionato
On Jan 31, 8:31 pm, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > Well, since it will be io based, why not use threads? They are easy to > use and it would do the job just fine. Then leverage some other > technology on top of that. > > You could go as far as using wget via os.system() in a

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Michele Simionato
On Jan 31, 9:24 pm, "Carl Banks" <[EMAIL PROTECTED]> wrote: > Well, of all the things you can use threads for, this is probably the > simplest, so I don't see any reason to prefer asynchronous method > unless you're used to it. Well, actually there is a reason why I prefer the asynchronous approac

TimedRotatingFileHandler() isn't rotating at midnight?

2007-01-31 Thread Chris Shenton
I set this up 3 days ago and have not seen any of the logs I've created this way being rotated. I expected them to rotate every midnight. I'm calling the code that uses this logger many times, each a separate run, if that matters. Am I doing something stupid? I can't find anything on google and

Re: division by 7 efficiently ???

2007-01-31 Thread Paddy
On Feb 1, 2:42 am, [EMAIL PROTECTED] wrote: > How to divide a number by 7 efficiently without using - or / operator. > We can use the bit operators. I was thinking about bit shift operator > but I don't know the correct answer. >>> int.__div__(14,2) 7 >>> Not a minus or division operator in sight

Can I import a file without file extension .py?

2007-01-31 Thread Jia Lu
Hi all I wonder if I can import a file with other file extensions ? Can I do that only with python? Thank you Jia Lu -- http://mail.python.org/mailman/listinfo/python-list

Re: how to "free" an object/var ?

2007-01-31 Thread Paddy
On Feb 1, 1:45 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 31 Jan 2007 09:26:46 -0800, Paddy wrote: > > On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]> > > wrote: > > [snip] > > >> -- > >> Steven D'Aprano > > > Thanks Stephen for explaining my answer a bit more. > > Ste_ph_en??

ANN: nose 0.9.2 released

2007-01-31 Thread JP
nose is a discovery-based unittest extension that provides an alternate test discovery and running process for unittest, one that is intended to mimic the behavior of py.test as much as is reasonably possible without resorting to too much magic. nose 0.9.2 includes quite a few bug fixes and new fe

Re: How to sort using hash's key?

2007-01-31 Thread Steven Bethard
Ben Finney wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: > >> JoJo wrote: >>> I want to sort a dict via its key,but I have no idea on how to do >>> it. > d = dict(a=2, b=1) > for key in sorted(d): >> ... print key, d[key] >> ... >> a 2 >> b 1 > > That's not a solution to "sort t

Re: What is the Decisive "Clash" of Our Time?

2007-01-31 Thread Overlord
I never thought it would be possible for anyone to rival the lunacy of Bitter Anko, but I was wrong... OL -- http://mail.python.org/mailman/listinfo/python-list

Re: Germany issues warrants for 13 American CIA agents

2007-01-31 Thread Overlord
Fuck the Germans. Didn't we kick their ass a couple times already? OL -- http://mail.python.org/mailman/listinfo/python-list

Re: division by 7 efficiently ???

2007-01-31 Thread John Nagle
[EMAIL PROTECTED] wrote: > Its not an homework. I appeared for EA sports interview last month. I > was asked this question and I got it wrong. I have already fidlled > around with the answer but I don't know the correct reasoning behind > it. The answer to that question is that the fastest way

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Jean-Paul Calderone
On 31 Jan 2007 19:12:59 -0800, Aahz <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> >>You misunderstand. I wasn't expressing a lack of confidence in Python >>threads, but in the facility with which they can be used by programmers. > >

Re: win32com.client

2007-01-31 Thread Gabriel Genellina
En Wed, 31 Jan 2007 22:17:10 -0300, vithi <[EMAIL PROTECTED]> escribió: > This is not I was looking for. There is a module call > "win32com.client" in python some people used it If any body know about > it let me know. > > On Jan 31, 1:45 pm, Gary Herron <[EMAIL PROTECTED]> wrote: >> vithi wrote:

Re: division by 7 efficiently ???

2007-01-31 Thread krypto . wizard
Its not an homework. I appeared for EA sports interview last month. I was asked this question and I got it wrong. I have already fidlled around with the answer but I don't know the correct reasoning behind it. Thanks, On Jan 31, 10:01 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED]

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Aahz
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >You misunderstand. I wasn't expressing a lack of confidence in Python >threads, but in the facility with which they can be used by programmers. Based on my admittedly limited experience, I say the same about Twiste

Re: division by 7 efficiently ???

2007-01-31 Thread Steven D'Aprano
On Wed, 31 Jan 2007 18:42:54 -0800, krypto.wizard wrote: > How to divide a number by 7 efficiently without using - or / operator. > We can use the bit operators. I was thinking about bit shift operator > but I don't know the correct answer. I'd be surprised if there was a trick for dividing by se

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Jean-Paul Calderone
On Wed, 31 Jan 2007 17:19:07 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> On Wed, 31 Jan 2007 15:13:59 -0800, "Carl J. Van Arsdall" <[EMAIL >> PROTECTED]> wrote: >> >>> Jean-Paul Calderone wrote: >>> [snip] > You're right. Learning new

Re: division by 7 efficiently ???

2007-01-31 Thread Ben Finney
[EMAIL PROTECTED] writes: > How to divide a number by 7 efficiently without using - or / > operator. We can use the bit operators. I was thinking about bit > shift operator but I don't know the correct answer. I think you are asking for help on a homework assignment in violation of collusion and

Re: division by 7 efficiently ???

2007-01-31 Thread Paul Rubin
[EMAIL PROTECTED] writes: > How to divide a number by 7 efficiently without using - or / operator. > We can use the bit operators. I was thinking about bit shift operator > but I don't know the correct answer. Erm, sounds like a homework problem... suggestion: think of how many input bits you have

Re: ctypes error on exit of win32 application

2007-01-31 Thread Gabriel Genellina
En Wed, 31 Jan 2007 19:04:13 -0300, Rubic <[EMAIL PROTECTED]> escribió: > I'm attempting to use ctypes on a DLL with the following > signature: > > __declspec(dllimport) void process_record(char *, char *); > > An example .cpp file has code like this: > >int main(int argc, char **argv) >{

division by 7 efficiently ???

2007-01-31 Thread krypto . wizard
How to divide a number by 7 efficiently without using - or / operator. We can use the bit operators. I was thinking about bit shift operator but I don't know the correct answer. -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com.client

2007-01-31 Thread rzed
"vithi" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi > Any one tell me where I can get (or download) python modules > win32com or win32com.client because I have to use "Dispatch" > thanks > What distribution are you using? If you are using Windows and have downloaded the Python.

Re: parent-child object design question

2007-01-31 Thread Steven D'Aprano
On Wed, 31 Jan 2007 15:09:29 -0800, manstey wrote: > Thanks for your input. Here is my next version, which works very well, > but for one problem I explain below: > > class CacheProperty(object): > def __init__(self, insCacheClass, name): > self.Name = name > self._bind_to_par

Re: What is the Decisive "Clash" of Our Time?

2007-01-31 Thread thermate2
On Jan 31, 5:00 pm, "Frank Arthur" <[EMAIL PROTECTED]> wrote: > But, so far, it is not working. More realistic people, the planners at > the Pentagon for example, have tried to replace waves of human cannon > fodder by massive "strategic" bombing. This works only rarely -- in > Kosovo and Serbia i

Re: how to "free" an object/var ?

2007-01-31 Thread Steven D'Aprano
On Wed, 31 Jan 2007 09:26:46 -0800, Paddy wrote: > On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]> > wrote: [snip] >> -- >> Steven D'Aprano > > Thanks Stephen for explaining my answer a bit more. Ste_ph_en??? I know the ph-form of the name is marginally more popular, but dammit my nam

Re: parent-child object design question

2007-01-31 Thread Steven D'Aprano
On Wed, 31 Jan 2007 20:15:44 +1100, Ben Finney wrote: > "Steven D'Aprano" <[EMAIL PROTECTED]> writes: > >> > def _accumulate_properties(self, properties): >> > self.properties = [] >> >> Probably better to put that in the __init__ method, otherwise if >> somebody runs instance

Re: win32com.client

2007-01-31 Thread vithi
This is not I was looking for. There is a module call "win32com.client" in python some people used it If any body know about it let me know. On Jan 31, 1:45 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > vithi wrote: > > Hi > > Any one tell me where I can get (or download) python modules win32com >

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Carl J. Van Arsdall
Jean-Paul Calderone wrote: > On Wed, 31 Jan 2007 15:13:59 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> > wrote: > >> Jean-Paul Calderone wrote: >> >>> [snip] >>> >>> You're right. Learning new things is bad. My mistake. >>> >>> Jean-Paul >>> >>> >> That is

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Jean-Paul Calderone
On Wed, 31 Jan 2007 15:13:59 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> [snip] >>> >>> >> >> You're right. Learning new things is bad. My mistake. >> >> Jean-Paul >> >That isn't what I said at all. You have to look at it from a >cost/benefit relations

Re: from future module!!!!!!!

2007-01-31 Thread Michael
Stargaming wrote: > The 'from' clause is a keyword in python used for > imports in the module namespace. Typically, but in the case of "from __future__ ..." it actually changes the logic of the interpreter/compiler. As a result if you intend to use any features from __future__ you have to ensure

What is the Decisive "Clash" of Our Time?

2007-01-31 Thread thermate
Dr.Bricmont, We are extremely proud of you for your brilliant analysis and courage to come out and say it. Your article brings out not one but several key concepts, worth close reading. The physicists like myself are proud to have one among us like you who seems to have an acute sense of humanitari

Re: How to sort using hash's key?

2007-01-31 Thread Ben Finney
Steven Bethard <[EMAIL PROTECTED]> writes: > JoJo wrote: > > I want to sort a dict via its key,but I have no idea on how to do > > it. > > >>> d = dict(a=2, b=1) > >>> for key in sorted(d): > ... print key, d[key] > ... > a 2 > b 1 That's not a solution to "sort the dict"; that's getting a pa

Haim Ramon, Justice Minister, of sexual misconduct for forcibly kissing a YOUNG female soldier

2007-01-31 Thread thermate
I am sorry for the earlier triplicate post of 13 CIA due to technical problem with google post, i am sure those with google experience would know that it happens. I am sure many of you will enjoy the triplicate - the silent majority - the only ones to scream are the minority of dissidents, as usual

Re: How to sort using hash's key?

2007-01-31 Thread Steven Bethard
JoJo wrote: > I want to sort a dict via its key,but I have no idea on how to do it. >>> d = dict(a=2, b=1) >>> for key in sorted(d): ... print key, d[key] ... a 2 b 1 STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: Germany issues warrants for 13 American CIA agents

2007-01-31 Thread Frank Arthur
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Here is the daily good news. > Is it now 39 "American CIA agents" or did you just posted this 3 times? -- http://mail.python.org/mailman/listinfo/python-list

Germany issues warrants for 13 American CIA agents

2007-01-31 Thread thermate
Here is the daily good news. It was established at the Nuremberg that simple excuse of "following the orders" will not save your skin from crimes. You must at ALL TIMES work according to the International law and also in the USA according to the constitution, no matter who

Germany issues warrants for 13 American CIA agents

2007-01-31 Thread thermate2
Here is the daily good news. It was established at the Nuremberg that simple excuse of "following the orders" will not save your skin from crimes. You must at ALL TIMES work according to the International law and also in the USA according to the constitution, no matter who

Germany issues warrants for 13 American CIA agents

2007-01-31 Thread thermate2
Here is the daily good news. It was established at the Nuremberg that simple excuse of "following the orders" will not save your skin from crimes. You must at ALL TIMES work according to the International law and also in the USA according to the constitution, no matter who

Re: parent-child object design question

2007-01-31 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > However, the problem is now that I can also write: > >>> insOref.Chapter=67 > but we want to disallow this, as insOref.Chapter must remain = > insProperty Then don't do that. Python allows any name to be reassigned to any value, with the attitude of "we're

Sorting a dict (was: How to sort using hash's key?)

2007-01-31 Thread Ben Finney
JoJo <[EMAIL PROTECTED]> writes: > I want to sort a dict via its key,but I have no idea on how to do > it. The 'dict' type is explicitly unordered. Sorting it isn't possible. (Also note that a 'hash' is something entirely different in Python.) You can create your own type, inheriting from 'dict'

pil, histogram, mask

2007-01-31 Thread Daniel Nogradi
How does one do a histogram on only a part of an image? This is what I found in the PIL documentation about histogram( ): """ im.histogram(mask) => list Returns a histogram for those parts of the image where the mask image is non-zero. The mask image must have the same size as the image, and be e

Re: How to sort using hash's key?

2007-01-31 Thread Cliff Wells
On Thu, 2007-02-01 at 04:54 +0800, JoJo wrote: > I want to sort a dict via its key,but I have no idea on how to do it. > Please help me,thanks. You can't. There is, however, a recipe for an "ordered dict" on ASPN: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/438823 > 3webXS HiSpeed

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Carl J. Van Arsdall
Jean-Paul Calderone wrote: > [snip] >> >> > > You're right. Learning new things is bad. My mistake. > > Jean-Paul > That isn't what I said at all. You have to look at it from a cost/benefit relationship. Its a waste of time/money to learn something complex to do something simple. For

Re: parent-child object design question

2007-01-31 Thread manstey
Thanks for your input. Here is my next version, which works very well, but for one problem I explain below: class CacheProperty(object): def __init__(self, insCacheClass, name): self.Name = name self._bind_to_parent(insCacheClass) self.__parent = insCacheClass s

How to sort using hash's key?

2007-01-31 Thread JoJo
Hello, I want to sort a dict via its key,but I have no idea on how to do it. Please help me,thanks. --- 3webXS HiSpeed Dial-up...surf up to 5x faster than regular dial-up alone... just $14.90/mo...visit www.get3web.com for de

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Jean-Paul Calderone
On Wed, 31 Jan 2007 13:52:35 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> On 31 Jan 2007 12:24:21 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: >> >>> Michele Simionato wrote: >>> On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: >

ctypes error on exit of win32 application

2007-01-31 Thread Rubic
I'm attempting to use ctypes on a DLL with the following signature: __declspec(dllimport) void process_record(char *, char *); An example .cpp file has code like this: int main(int argc, char **argv) { char record[100]; char code[6]; ... process_record(code, recor

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Carl J. Van Arsdall
Jean-Paul Calderone wrote: > On 31 Jan 2007 12:24:21 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: > >> Michele Simionato wrote: >> >>> On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: >>> I want to find a multithreaded downloading lib in python, can someone rec

Re: Python tools to manipulate JARs ?

2007-01-31 Thread [EMAIL PROTECTED]
On Jan 31, 1:50 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > Andy Dingley írta:> I run build processes for a Java shop using Python (and > some Ant). > > > Would anyone care to suggest favoured tools for manipulating the > > innards of JARs? Or do I just treat them as plain zipfiles and get > > st

Re: SyntaxError: 'return' outside function

2007-01-31 Thread skip
Melih> Has anyone seen this error before and been able to solve it? I Melih> can't seem to find anything that leads to a solution. Your code is incorrectly indented. Try: def legiturl(self, url): # this breaks down the url into 6 components to make sure it's "legit" t =

Re: win32com.client

2007-01-31 Thread Gary Herron
vithi wrote: > Hi > Any one tell me where I can get (or download) python modules win32com > or win32com.client because I have to use "Dispatch" thanks > > You want the "python for windows" extension, available from http://sourceforge.net/projects/pywin32/ Gary Herron -- http://mail.python.

Re: SyntaxError: 'return' outside function

2007-01-31 Thread Steven Bethard
Melih Onvural wrote: > Has anyone seen this error before and been able to solve it? I can't > seem to find anything that leads to a solution. I found this post > http://zope.org/Collectors/Zope/1809, but can't really understand it. > I've attached my code below to see if anything looks funny. It ha

RE: Conditional expressions - PEP 308

2007-01-31 Thread Delaney, Timothy (Tim)
Colin J. Williams wrote: > Yes, I agree. The ternary operator is a step forward. That's still debateable ;) Pro: It puts paid to the "python doesn't have a ternary operator" and and/or abuse. Con: It shouldn't ever be used. Cheers, Tim Delaney -- http://mail.python.org/mailman/listinfo/pyth

win32com.client

2007-01-31 Thread vithi
Hi Any one tell me where I can get (or download) python modules win32com or win32com.client because I have to use "Dispatch" thanks -- http://mail.python.org/mailman/listinfo/python-list

SyntaxError: 'return' outside function

2007-01-31 Thread Melih Onvural
Has anyone seen this error before and been able to solve it? I can't seem to find anything that leads to a solution. I found this post http://zope.org/Collectors/Zope/1809, but can't really understand it. I've attached my code below to see if anything looks funny. It happens at the very last return

Re: Python 2.5 Tkinter not configured

2007-01-31 Thread Jim
Diez B. Roggisch wrote: > Jim schrieb: >> I compiled Python 2.5 from python.org and I get an error message when I >> try to import the Tkinter module. Python reports that there is no such >> module. It says my Python isn't configured for Tkinter. How do I >> configure it? I'm using GCC 4.1.1 to co

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Jean-Paul Calderone
On 31 Jan 2007 12:24:21 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: >Michele Simionato wrote: >> On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: >> > I want to find a multithreaded downloading lib in python, >> > can someone recommend one for me, please? >> > Thanks~ >> >> Why do you

Re: Python **kwargs ?

2007-01-31 Thread Szabolcs Nagy
johnny wrote: > What is **kwargs mean in python? When you put double **, does it mean > passing by reference? here's a little example: >>> def f(a, *args, **kw): ... print 'a:',a ... print 'args:',args ... print 'kw:',kw ... >>> f(1,2,3,x=4) a: 1 args: (2, 3) kw: {'x': 4} >>> f(a=1,

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Carl Banks
Michele Simionato wrote: > On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: > > I want to find a multithreaded downloading lib in python, > > can someone recommend one for me, please? > > Thanks~ > > Why do you want to use threads for that? Twisted is the > obvious solution for your pr

Re: DCOP memory leak?

2007-01-31 Thread [EMAIL PROTECTED]
On 31 jan, 19:51, "David Boddie" <[EMAIL PROTECTED]> wrote: > On Jan 31, 6:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > The code I posted is not my actual program and was only to demonstrate > > my problem. The complete program I'm writing uses QT and so the loop > > is replaced by a

Re: Sorting a List of Lists

2007-01-31 Thread Bruno Desthuilliers
Paddy a écrit : > On Jan 31, 12:35 pm, Bruno Desthuilliers >Also, using comparison functions is usually not the most efficient way >>to do such a sort. In your case, I'd go for a good old >>Decorate/sort/undecorate (AKA schwarzian transform): >> >>events = [evt for date, evt in >> sorted(

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Carl J. Van Arsdall
Michele Simionato wrote: > On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: > >> I want to find a multithreaded downloading lib in python, >> can someone recommend one for me, please? >> Thanks~ >> > > Why do you want to use threads for that? Twisted is the > obvious solution f

Re: emulate a serial port in windows (create a virtual 'com' port)

2007-01-31 Thread Bas-i
On Jan 30, 7:34 am, Pom <[EMAIL PROTECTED]> wrote: > how can I emulate a serial port in windows? Google for ComEmulDrv3 This may do what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to "free" an object/var ?

2007-01-31 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |If your data structure has no backlinks, it will go away | as soon as the last reference to it disappears. |In Python, garbage collection is mostly a backup to | the reference counting system. These both are true o

Re: subway

2007-01-31 Thread Daniel Nogradi
> > the egg file can not be downloaded completely, the connection is > > closed at byte 138903 all the time and the file is bigger than that. > > If anyone managed to grab the file please let me know so far I tried > > wget and firefox. > > I've checked on my hd and found a recent (Jun 2006) checko

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Michele Simionato
On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: > I want to find a multithreaded downloading lib in python, > can someone recommend one for me, please? > Thanks~ Why do you want to use threads for that? Twisted is the obvious solution for your problem, but you may use any asynchronou

Re: DCOP memory leak?

2007-01-31 Thread David Boddie
On Jan 31, 6:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > The code I posted is not my actual program and was only to demonstrate > my problem. The complete program I'm writing uses QT and so the loop > is replaced by a Timer event. > I tried out the suggestion. I had already tried the d

Re: Python tools to manipulate JARs ?

2007-01-31 Thread Laszlo Nagy
Andy Dingley írta: > I run build processes for a Java shop using Python (and some Ant). > > Would anyone care to suggest favoured tools for manipulating the > innards of JARs? Or do I just treat them as plain zipfiles and get > stuck right in there? > > Mainly I'm trying to query lists of classes a

Re: subway

2007-01-31 Thread deelan
Daniel Nogradi wrote: (...) > > the egg file can not be downloaded completely, the connection is > closed at byte 138903 all the time and the file is bigger than that. > If anyone managed to grab the file please let me know so far I tried > wget and firefox. I've checked on my hd and found a rece

RE: Python tools to manipulate JARs ?

2007-01-31 Thread Sells, Fred
I have not tried this, but... Assuming jython is out of the question You might want to try a simple java command line program you could run from popen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Andy Dingley Sent: Wednesday, January 31, 2007 11:11 AM

Re: "Correct" db adapter

2007-01-31 Thread Diez B. Roggisch
king kikapu wrote: > Thanks for the replies. > > I think i do not need something like ORM, but just a db-module that i > can "work" the database with it. > I just want to know if pyodbc is the "correct" solution to do so or if > it is another db-module that is more > usefull for this job. I thin

Re: Sorting a List of Lists

2007-01-31 Thread Paddy
On Jan 31, 12:35 pm, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > > I can't seem to get this nailed down and I thought I'd toss it out > > there as, by gosh, its got to be something simple I'm missing. > > > I have two different database tables of events that use different > > sche

Re: where has Stani's Py Editor gone?

2007-01-31 Thread Stargaming
John Pote schrieb: > Hi everyone, > > Been trying to get the latest version of Stani's Python Editor the last few > days. But I cannot get any response out of 'pythonide.stani.be'. Anyone know > what's happened? > > Ta much, > > John Pote > > http://developer.berlios.de/project/showfiles.p

Re: subway

2007-01-31 Thread Daniel Nogradi
> Daniel> Does anyone know what has happened to the codebase of the subway > Daniel> project? It seems the whole project has been shut down leaving > Daniel> no trace of the code on net but I would be very happy to see it, > Daniel> apparently it had some cool features that would be

Re: DCOP memory leak?

2007-01-31 Thread [EMAIL PROTECTED]
On 31 jan, 01:03, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > I'm writing a python script for Amarok, I communicate with Amarok > > using DCOP. > > Now, I have to call DCOP very often and I noticed that every time I > > make a DCOP call my program keeps growin

Re: how to "free" an object/var ?

2007-01-31 Thread Aahz
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: >> On Tue, 30 Jan 2007 15:48:37 -0800, James Stroud wrote: >> >> >>>Stef Mientki wrote: >>> If I create a large array of data or class, how do I destroy it (when not needed anymore) ? > >If

Re: Python **kwargs ?

2007-01-31 Thread Bruno Desthuilliers
johnny a écrit : > What is **kwargs mean in python? When you put double **, does it mean > passing by reference? Nope. Python as support for both positional (*args) and named (**kwargs) varargs. > For example: > def redirect_to(request, url, **kwargs): means that redirect_to expect a positiona

Re: how to "free" an object/var ?

2007-01-31 Thread Paddy
On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 30 Jan 2007 23:22:52 -0800, Paddy wrote: > >> As far as I know there is no way to force the deletion of an object > >> even if it is in use. This is a Good Thing. > > >> -- > >> Steven D'Aprano > > > The folowing will make the

Re: "Correct" db adapter

2007-01-31 Thread Bruno Desthuilliers
king kikapu a écrit : > Thanks for the replies. > > I think i do not need something like ORM, but just a db-module that i > can "work" the database with it. FWIW, SQLAlchemy is not an ORM, but an higher-level API for SQL integration. The ORM part is an optional feature built on top of this API.

how to make a python windows service know it's own identity

2007-01-31 Thread Chris Curvey
Hi all, I have used the win32com libraries to set up a service called MyService under Windows. So far, so good. Now I need to run multiple copies of the service on the same machine. I also have that working. For monitoring and logging, I'd like each instance of the service to know it's own iden

Re: What is the dummy statement that do nothing in Python?

2007-01-31 Thread Dongsheng Ruan
Yes, that's just what I want. Thanks! - Original Message - From: Analog Kid To: Dongsheng Ruan Cc: python-list@python.org Sent: Wednesday, January 31, 2007 12:04 PM Subject: Re: What is the dummy statement that do nothing in Python? hey dongsheng: not too sure what yo

where has Stani's Py Editor gone?

2007-01-31 Thread John Pote
Hi everyone, Been trying to get the latest version of Stani's Python Editor the last few days. But I cannot get any response out of 'pythonide.stani.be'. Anyone know what's happened? Ta much, John Pote -- http://mail.python.org/mailman/listinfo/python-list

Python **kwargs ?

2007-01-31 Thread johnny
What is **kwargs mean in python? When you put double **, does it mean passing by reference? For example: def redirect_to(request, url, **kwargs): -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the dummy statement that do nothing in Python?

2007-01-31 Thread Tim Daneliuk
Dongsheng Ruan wrote: > I remember that in python there is some kind of dummy statement that just > holds space and does nothing. > > I want it to hold the place after a something like if a>b: do nothing > > I can't just leave the space blank after if statement because there will be > error mes

Re: subway

2007-01-31 Thread deelan
Daniel Nogradi wrote: > Does anyone know what has happened to the codebase of the subway > project? It seems the whole project has been shut down leaving no > trace of the code on net but I would be very happy to see it, > apparently it had some cool features that would be fun to look at. > Does an

RE: What is the dummy statement that do nothing in Python?

2007-01-31 Thread Carroll, Barry
> -Original Message- > From: Dongsheng Ruan [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 31, 2007 8:50 AM > To: python-list@python.org > Subject: What is the dummy statement that do nothing in Python? > > I remember that in python there is some kind of dummy statement that just >

Re: What is the dummy statement that do nothing in Python?

2007-01-31 Thread Stew Pid
On Wed, 31 Jan 2007 11:49:53 -0500, Dongsheng Ruan wrote: > I remember that in python there is some kind of dummy statement that just > holds space and does nothing. > > I want it to hold the place after a something like if a>b: do nothing > > I can't just leave the space blank after if stateme

Re: What is the dummy statement that do nothing in Python?

2007-01-31 Thread Analog Kid
hey dongsheng: not too sure what you are looking for ... but i guess a simple "pass" statement should do it ... if a > b: pass hth, -ajay On 1/31/07, Dongsheng Ruan <[EMAIL PROTECTED]> wrote: I remember that in python there is some kind of dummy statement that just holds space and does noth

Re: What is the dummy statement that do nothing in Python?

2007-01-31 Thread Jean-Paul Calderone
On Wed, 31 Jan 2007 11:49:53 -0500, Dongsheng Ruan <[EMAIL PROTECTED]> wrote: >I remember that in python there is some kind of dummy statement that just >holds space and does nothing. > >I want it to hold the place after a something like if a>b: do nothing > >I can't just leave the space blank afte

Python module for the IPod shuffle ...

2007-01-31 Thread Analog Kid
Hi all: Im looking for a python module thatll let me do simple reads/writes from and to an iPod shuffle similar to iTunes ... I read about the gPod module ... but Im not sure whether it will work in Windows ... Any help is greatly appreciated. Thanks in advance ... -Ajay -- http://mail.python.o

What is the dummy statement that do nothing in Python?

2007-01-31 Thread Dongsheng Ruan
I remember that in python there is some kind of dummy statement that just holds space and does nothing. I want it to hold the place after a something like if a>b: do nothing I can't just leave the space blank after if statement because there will be error message. Does anybody know what to ins

  1   2   >