Re: os.path.join

2007-05-02 Thread half . italian
On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 02 May 2007 02:31:43 -0300, <[EMAIL PROTECTED]> escribió: > > > A better question is why this doesn't work. > > pathparts = ["/foo", "bar"] > os.path.join(pathparts) > > ['/foo', 'bar'] > > > This should return a

Re: Why are functions atomic?

2007-05-02 Thread Gabriel Genellina
En Wed, 02 May 2007 01:42:17 -0300, Martin v. Löwis <[EMAIL PROTECTED]> escribió: > Michael schrieb: >> A bit more info, but still no clear picture about why functions are >> mutable but have immutable copy symantics. There are arguments why >> functions should be immutable, but the decision wa

Re: os.path.join

2007-05-02 Thread Gabriel Genellina
En Wed, 02 May 2007 04:03:56 -0300, <[EMAIL PROTECTED]> escribió: > On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> The right usage is os.path.join(*pathparts) > > Wow. What exactly is that * operator doing? Is it only used in > passing args to functions? Does it just e

Re: os.path.join

2007-05-02 Thread Ant
On May 2, 8:03 am, [EMAIL PROTECTED] wrote: > On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> ... > > I think it's a bug, but because it should raise TypeError instead. > > The right usage is os.path.join(*pathparts) ... > Wow. What exactly is that * operator doing? Is it only used in

Re: Tcl-tk 8.5?

2007-05-02 Thread James Stroud
Méta-MCI wrote: > Hi! > > > See http://wiki.tcl.tk/10630 > > Any plan to integrate Tcl 8.5 in standard Python? > > > > @+ > > MCI > Better would be to outegrate it and instead use another gui kit as the standard. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic File Name Open()

2007-05-02 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm trying to open a file using open() but the name of the file is created > dynamically as a variable, but also has part of a static path. For instance, > the file may be called 'dave' and will always be in '/my/files/here/'. Well that's an absolutely normal w

Re: Killing Threads

2007-05-02 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I've got an application which I've fearfully placed a couple of threads into > however when these threads are running it seems as if I try and quite the > application from the bash prompt it just seems to freeze the SSH client. > I've also seen that if I have my

Re: os.path.join

2007-05-02 Thread half . italian
On May 2, 12:36 am, Ant <[EMAIL PROTECTED]> wrote: > On May 2, 8:03 am, [EMAIL PROTECTED] wrote: > > > On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > ... > > > I think it's a bug, but because it should raise TypeError instead. > > > The right usage is os.path.join(*pathparts) > ... >

Re: Killing Threads

2007-05-02 Thread Diez B. Roggisch
> You probably need to setDaemon (True) on your threads > after you've created them and before they run. That > tells the OS: don't bother waiting for these ones to > finish if the program exits. (At least I think that's > what it does; I don't use threads all that much) Actually all it does is to

Re: regexp match string with word1 and not word2

2007-05-02 Thread Flyzone
On 30 Apr, 20:00, Steven Bethard <[EMAIL PROTECTED]> wrote: > Well then it seems like you might want to rethink this rule-file > approach since your problem is clearly not amenable to regular expressions. [cut] > That said, here's a regexp that might work:: > ((?!two:).)*one((?!two:).)* > That

RE: Killing Threads

2007-05-02 Thread Robert Rawlins - Think Blue
Thanks for this Diez and Tim, I'll take a look into this today, sorry for not posting any code fragments, its not so much a fragment as it is a bloody great big monster :-D Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Diez B. Roggisch Sent: 02 May

DiffLib Question

2007-05-02 Thread whitewave
Hi Guys, I'm a bit confused in difflib. In most cases, the differences found using difflib works well but when I have come across the following set of text: >>> d1 = '''In addition, the considered problem does not have a meaningful >>> traditional type of adjoint ... problem even for the sim

Re: DiffLib Question

2007-05-02 Thread Michele Simionato
On May 2, 10:46 am, whitewave <[EMAIL PROTECTED]> wrote: > Is there a way for me to disregard > the newlines and spaces? > > Python 2.3 > WINXP > > Thanks. > Jen HTH: >> help(difflib.Differ.__init__) Help on method __init__ in module difflib: __init__(self, linejunk=None, charjunk=None) unbound

Re: DiffLib Question

2007-05-02 Thread whitewave
Hi, Thank you for your reply. But I don't fully understand what the charjunk and linejunk is all about. I'm a bit newbie in python using the DiffLib. I'm I using the right code here? I will I implement the linejunk and charjunk using the following code? >>> a = difflib.Differ().compare(d1,d2)

Re: Want to build a binary header block

2007-05-02 Thread Nick Craig-Wood
Bob Greschke <[EMAIL PROTECTED]> wrote: > This is the idea > > Block = pack("240s", "") > Block[0:4] = pack(">H", W) > Block[4:8] = pack(">H", X) > Block[8:12] = pack(">B", Y) > Block[12:16] = pack(">H", Z)) > > but, of course, Block, a str, can't be sliced. You could do th

Re: Comparing bitmap images for differences?

2007-05-02 Thread [EMAIL PROTECTED]
On May 1, 3:42 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > With that, you can approach your problem. What is usually done is that a > sequence of background images is sampled & an average is built. Then the > actual image is subtracted from that image, with an epsilon to account > for noise

What do people use for code analysis.

2007-05-02 Thread Steven W. Orr
Lots of code, calls to, calls by, inheritance, multiple tasks, etc. What do people use to figure out what's happening? TIA -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black

Re: Comparing bitmap images for differences?

2007-05-02 Thread [EMAIL PROTECTED]
On May 1, 7:15 pm, "3c273" <[EMAIL PROTECTED]> wrote: > This might get you started.http://tinyurl.com/7qexl Wow, I thought briefly along those lines but then thought "No, it can't possibly be that easy" :-) It looks like the approach given in that link could benefit hugely from using numpy to tre

Calling Exe from Python

2007-05-02 Thread muhamad.abbas
Hello Folks, This is what i am required to do. Call an executable from my python script, and when the executable is finished running, i should continue with my python script. I have tried "os.exec()" but it calls the executable and never returns to the calling python script. I tried "os.fork" it

Re: What do people use for code analysis.

2007-05-02 Thread Daniel Nogradi
> Lots of code, calls to, calls by, inheritance, multiple tasks, etc. > > What do people use to figure out what's happening? This is a pretty cool project just for that: http://codeinvestigator.googlepages.com/codeinvestigator HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Calling Exe from Python

2007-05-02 Thread M Abbas
Hello Folks, This is what i am required to do. Call an executable from my python script, and when the executable is fininshed running, i should continue with my python script. I have tried "os.exec()" but it calls the executable and never returns to the calling python script. I tried "os.fork" it

Re: Problem with PyQt4

2007-05-02 Thread [EMAIL PROTECTED]
On Apr 30, 10:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am having some serious problems with PyQT4, > when i run pyqt script, I always get 'Segmentation fault'. > > the script is simple: > == > %less qttest.py > from PyQt4 import QtGui, QtCore > import sy

Re: Calling Exe from Python

2007-05-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, M Abbas wrote: > This is what i am required to do. > Call an executable from my python script, and when the executable is > fininshed running, i should continue with my python script. > > I have tried "os.exec()" but it calls the executable and never returns > to the calli

Leaving Python List

2007-05-02 Thread Gurpreet Singh
This mail is to confirm that i want to leave the python list. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

Re: relative import broken?

2007-05-02 Thread Alan Isaac
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So what do you think the answer should be? Well I'm clearly not seeing into the depths of this, so I'm not going to propose anything. But to stick close to my example, I am not clear why a script when executed could not

Re: Dynamic File Name Open()

2007-05-02 Thread tahiriman
On May 2, 7:47 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Robert Rawlins - Think Blue wrote: > > > I'm trying to open a file using open() but the name of the file is created > > dynamically as a variable, but also has part of a static path. For instance, > > the file may be called 'dave' and will

Need Help in Preparing for Study of Python by Forrester Research

2007-05-02 Thread Jeff Rush
Forrester Research is doing a study on dynamic languages and has asked that Python be represented. As advocacy coordinator I've volunteered to drive this, collecting answers from the community and locating representatives to participate in interviews. The goal of the study is to: - identify the

Re: Why are functions atomic?

2007-05-02 Thread Carsten Haese
On Tue, 2007-05-01 at 22:21 -0700, Michael wrote: > Is there a reason for using the closure here? Using function defaults > seems to give better performance:[...] It does? Not as far as I can measure it to any significant degree on my computer. > This is definitely one viable solution and is ess

Re: More urllib timeout issues.

2007-05-02 Thread Facundo Batista
John Nagle wrote: > I took a look at Facundo Batista's work in the tracker, and he > currently seems to be trying to work out a good way to test the > existing SSL module. It has to connect to something to be tested, Right now, test_socket_ssl.py has, besides the previous tests, the capabil

Re: More urllib timeout issues.

2007-05-02 Thread Facundo Batista
Steve Holden wrote: > 1) There is work afoot to build timeout arguments into network libraries > for 2.6, and I know Facundo Batista has been involved, you might want to > Google or email Facundo about that. Right now (in svn trunk) httplib, ftplib, telnetlib, etc, has a timeout argument. If y

Re: What do people use for code analysis.

2007-05-02 Thread Steven W. Orr
On Wednesday, May 2nd 2007 at 12:48 +0200, quoth Daniel Nogradi: =>> Lots of code, calls to, calls by, inheritance, multiple tasks, etc. =>> =>> What do people use to figure out what's happening? => =>This is a pretty cool project just for that: => =>http://codeinvestigator.googlepages.com/codeinv

Re: What do people use for code analysis.

2007-05-02 Thread Laurent Pointal
Steven W. Orr a écrit : > Lots of code, calls to, calls by, inheritance, multiple tasks, etc. > > What do people use to figure out what's happening? > > TIA > I've collected some links over time: http://www.limsi.fr/Individu/pointal/python.html#liens-metaprog You may look at # depgraph - graph

pack/unpack zero terminated string

2007-05-02 Thread tmp123
Hello, Thanks for your time. After review the "struct" documentation, it seems there are no option to pack/unpack zero terminated strings. By example, if the packed data contains: byte + zero terminated string + zero terminated string + byte, it seems no possible to unpack it using "struct". Pl

Re: pack/unpack zero terminated string

2007-05-02 Thread Laurent Pointal
tmp123 a écrit : > Hello, > > Thanks for your time. > > After review the "struct" documentation, it seems there are no option > to pack/unpack zero terminated strings. > > By example, if the packed data contains: byte + zero terminated string > + zero terminated string + byte, it seems no possib

Re: While we're talking about annoyances

2007-05-02 Thread Michael Hoffman
Steven D'Aprano wrote: > On Wed, 02 May 2007 06:10:54 +, Tim Roberts wrote: >> I've tended to favor the "Schwarzian transform" (decorate-sort-undecorate) >> because of that. > > That's what the key= argument does. cmp= is slow because the comparison > function is called for EVERY comparison.

Re: pack/unpack zero terminated string

2007-05-02 Thread Laurent Pointal
tmp123 a écrit : > Hello, > > Thanks for your time. > > After review the "struct" documentation, it seems there are no option > to pack/unpack zero terminated strings. > > By example, if the packed data contains: byte + zero terminated string > + zero terminated string + byte, it seems no possib

open("output/mainwindow.h",'w') doesn't create a folder for me

2007-05-02 Thread noagbodjivictor
Hello I have done python for some time now. I'm forgetting things. This is the faulty line : outfile = open("output/mainwindow.h",'w') I thought it would have created the folder ouput and the file mainwindow.h for me but it's throwing an error -- http://mail.python.org/mailman/listinfo/python-l

Re: open("output/mainwindow.h",'w') doesn't create a folder for me

2007-05-02 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Hello > I have done python for some time now. I'm forgetting things. > > This is the faulty line : outfile = open("output/mainwindow.h",'w') > > I thought it would have created the folder ouput and the file > mainwindow.h for me but it's throwing an error No, you have

Re: open("output/mainwindow.h",'w') doesn't create a folder for me

2007-05-02 Thread noagbodjivictor
On May 2, 10:06 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello > > I have done python for some time now. I'm forgetting things. > > > This is the faulty line : outfile = open("output/mainwindow.h",'w') > > > I thought it would have created the folder ouput and t

Writing a nice formatted csv file

2007-05-02 Thread redcic
Hi all, I use the csv module of Python to write a file. My code is of the form : cw = csv.writer(open("out.txt", "wb")) cw.writerow([1,2,3]) cw.writerow([10,20,30]) And i get an out.txt file looking like: 1,2,3 10,20,30 Whereas what I'd like to get is: 1,2,3, 10, 20, 30 which is mor

Re: Python un-plugging the Interpreter

2007-05-02 Thread Jorgen Grahn
On Wed, 25 Apr 2007 08:05:01 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Jorgen Grahn" <[EMAIL PROTECTED]> wrote: ... >> I doubt it. (But I admit that I am a bit negative towards thread >> programming in general, and I have whined about this before.) >> > > I find this last statement

Is it possible to determine what a function needs for parameters -

2007-05-02 Thread rh0dium
Hi all, Below is a basic threading program. The basic I idea is that I have a function which needs to be run using a queue of data. Early on I specified my function needed to only accept basic parameters ( no postional *args or *kwargs ) but now I am re-writing it and I want to accept these. Is

Refreshing imported modules

2007-05-02 Thread noagbodjivictor
I have the python interperter opened while editing a module. The problem is that when I make changes, the module is not refreshed whenever I import it again. I have to re-launch the interpreter, is there a way to shortcut this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing a nice formatted csv file

2007-05-02 Thread Sebastian Bassi
On 2 May 2007 07:14:04 -0700, redcic <[EMAIL PROTECTED]> wrote: > And i get an out.txt file looking like: > 1,2,3 > 10,20,30 > Whereas what I'd like to get is: > 1,2,3, > 10, 20, 30 > which is more readable. The idea behind csv module is to produce and read csv files that are "machine r

Re: Writing a nice formatted csv file

2007-05-02 Thread 7stud
On May 2, 8:14 am, redcic <[EMAIL PROTECTED]> wrote: > Hi all, > > I use the csv module of Python to write a file. My code is of the > form : > > cw = csv.writer(open("out.txt", "wb")) > cw.writerow([1,2,3]) > cw.writerow([10,20,30]) > > And i get an out.txt file looking like: > 1,2,3 > 10,20,30 >

Re: Writing a nice formatted csv file

2007-05-02 Thread redcic
Well then how can I format a file ? Thanks for your help, Cédric On 2 mai, 16:26, 7stud <[EMAIL PROTECTED]> wrote: > On May 2, 8:14 am, redcic <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > I use the csv module of Python to write a file. My code is of the > > form : > > > cw = csv.writer(ope

Re: Writing a nice formatted csv file

2007-05-02 Thread dustin
On Wed, May 02, 2007 at 07:28:32AM -0700, redcic wrote: > Well then how can I format a file ? for row in rows: print "".join([ "%-6s" % ("%d," % cell) for cell in row ]) The "%-6s" formats each column to be no less than six characters long; the "%d," formats the number with a comma after it.

Re: Problem with inspect.getfile

2007-05-02 Thread elventear
On May 2, 1:12 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 02 May 2007 02:53:55 -0300, elventear <[EMAIL PROTECTED]> > escribió: > > > Found the offending code. I was importing between files that were at > > the same level of the hierarchy without using absolute references. > > C

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Bruno Desthuilliers
rh0dium a écrit : > Hi all, > > Below is a basic threading program. The basic I idea is that I have a > function which needs to be run using a queue of data. Early on I > specified my function needed to only accept basic parameters ( no > postional *args or *kwargs ) but now I am re-writing it an

Re: While we're talking about annoyances

2007-05-02 Thread Alex Martelli
Michael Hoffman <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > On Wed, 02 May 2007 06:10:54 +, Tim Roberts wrote: > > >> I've tended to favor the "Schwarzian transform" (decorate-sort-undecorate) > >> because of that. > > > > That's what the key= argument does. cmp= is slow because

Re: Why are functions atomic?

2007-05-02 Thread Alex Martelli
Michael <[EMAIL PROTECTED]> wrote: > Is there a reason for using the closure here? Using function defaults > seems to give better performance: What measurements show you that...? brain:~ alex$ cat powi.py def powerfactory1(exponent): def inner(x): return x**exponent return inner de

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Chris Mellon
On 2 May 2007 07:22:07 -0700, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > Below is a basic threading program. The basic I idea is that I have a > function which needs to be run using a queue of data. Early on I > specified my function needed to only accept basic parameters ( no > postional *a

I need help speeding up an app that reads football scores and generates rankings

2007-05-02 Thread jocknerd
About 10 years ago, I wrote a C app that would read scores from football games and calculate rankings based on the outcome of the games. In fact, I still use this app. You can view my rankings at http://members.cox.net/jocknerd/football. A couple of years ago, I got interested in Python and deci

Re: Python un-plugging the Interpreter

2007-05-02 Thread Jorgen Grahn
On Tue, 24 Apr 2007 07:49:46 -0700, Alex Martelli <[EMAIL PROTECTED]> wrote: > Jorgen Grahn <[EMAIL PROTECTED]> wrote: >... >> > Perhaps the current wave of dual-core and quad-core CPUs in cheap >> > consumer products would change people's perceptions -- I wonder... >> >> Maybe it would change

Re: Writing a nice formatted csv file

2007-05-02 Thread Jon Clements
On 2 May, 15:14, redcic <[EMAIL PROTECTED]> wrote: > Hi all, > > I use the csv module of Python to write a file. My code is of the > form : > > cw = csv.writer(open("out.txt", "wb")) > cw.writerow([1,2,3]) > cw.writerow([10,20,30]) > > And i get an out.txt file looking like: > 1,2,3 > 10,20,30 > >

Re: Writing a nice formatted csv file

2007-05-02 Thread Dave Borne
> Whereas what I'd like to get is: > 1,2,3, > 10, 20, 30 (without trying this myself first...) You might try setting up a csv dialect with a delimiter of ',\t' then using a reader that can set tab stops for display. -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread rh0dium
> This is far more work than you need. Push an (args, kwargs) tuple into > your arguments queue and call self.function(*args, **kwargs). No see I tried that and that won't work. I'm assuming what you are referring to is this (effectively) Q.put(((),{a:"foo", b:"bar})) input = Q.get() self.funct

Re: What do people use for code analysis.

2007-05-02 Thread Mike Brenner
On the one hand, I would like better graphical code analysis tools. On the other hand, I would like to mention a different kind of code analysis. A "Return on Investment" (ROI) philosophy would analyze the code by how much it costs to change the code. To do this, you can add up all the costs. Th

Re: regexp match string with word1 and not word2

2007-05-02 Thread Ant
On May 2, 9:17 am, Flyzone <[EMAIL PROTECTED]> wrote: > On 30 Apr, 20:00, Steven Bethard <[EMAIL PROTECTED]> wrote: ... > Maybe a right approach will be another if after the first one? Like: >for y in range(0, len(skip_lst) ): > if (re.search(skip_lst[y], line)): >

Re: I need help speeding up an app that reads football scores and generates rankings

2007-05-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jocknerd wrote: > The biggest difference in my two apps is the C app uses linked lists. > I feel my Python app is doing too many lookups which is causing the > bottleneck. Then replace those linear searches you wrote in Python with a dictionary. Ciao, Marc 'Black

Active Directory: how to delete a user from a group?

2007-05-02 Thread Dirk Hagemann
Hi! Does anyone has experience with manipulating MS Active Directory objects? I'd like to delete some users from a group, but so far I couldn't find anything about this. There is some good stuff about retrieving data out of the AD (thanks to Tim Golden!), but how can I manipulate or change AD obje

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Gary Herron
rh0dium wrote: >> This is far more work than you need. Push an (args, kwargs) tuple into >> your arguments queue and call self.function(*args, **kwargs). >> > > No see I tried that and that won't work. > Won't work? How does it fail? > I'm assuming what you are referring to is this (effect

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Chris Mellon
On 2 May 2007 08:13:12 -0700, rh0dium <[EMAIL PROTECTED]> wrote: > > This is far more work than you need. Push an (args, kwargs) tuple into > > your arguments queue and call self.function(*args, **kwargs). > > No see I tried that and that won't work. > > I'm assuming what you are referring to is th

ignorance and intolerance in computing communties

2007-05-02 Thread Xah Lee
Today, a motherfucker Christophe Rhodes (aka Xof in irc://chat.freenode.net/lisp ) kicked banned me. Here's the few relevant excerpt. (full, unedited excerpt will be published if there is a public interest) Begin excerpt: [5:31am] k, here is a simple problem but rather tedious to do it correctly

Re: Active Directory: how to delete a user from a group?

2007-05-02 Thread Tim Golden
Dirk Hagemann wrote: > Hi! > > Does anyone has experience with manipulating MS Active Directory > objects? I'd like to delete some users from a group, but so far I > couldn't find anything about this. > There is some good stuff about retrieving data out of the AD (thanks > to Tim Golden!), but how

Re: Any way to refactor this?

2007-05-02 Thread John Salerno
Bruno Desthuilliers wrote: > From a purely efficiency POV, there are some obviously possible > improvements. The first one is to alias visual.cylinder, so you save on > lookup time. The other one is to avoid useless recomputation of > -hatch_length and hatch_length*2. > > def _create_3D_xhatc

Re: Active Directory: how to delete a user from a group?

2007-05-02 Thread Tim Golden
Tim Golden wrote: > Dirk Hagemann wrote: >> Hi! >> >> Does anyone has experience with manipulating MS Active Directory >> objects? I'd like to delete some users from a group, but so far I >> couldn't find anything about this. >> There is some good stuff about retrieving data out of the AD (thanks >

ascii to unicode line endings

2007-05-02 Thread fidtz
The code: import codecs udlASCII = file("c:\\temp\\CSVDB.udl",'r') udlUNI = codecs.open("c:\\temp\\CSVDB2.udl",'w',"utf_16") udlUNI.write(udlASCII.read()) udlUNI.close() udlASCII.close() This doesn't seem to generate the correct line endings. Instead of converting 0x0D/0x0A to 0x0D/0x00/0x0A/0

Re: ascii to unicode line endings

2007-05-02 Thread Jean-Paul Calderone
On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] wrote: >The code: > >import codecs > >udlASCII = file("c:\\temp\\CSVDB.udl",'r') >udlUNI = codecs.open("c:\\temp\\CSVDB2.udl",'w',"utf_16") > >udlUNI.write(udlASCII.read()) > >udlUNI.close() >udlASCII.close() > >This doesn't seem to generate the corre

Re: DiffLib Question

2007-05-02 Thread Gabriel Genellina
En Wed, 02 May 2007 06:26:13 -0300, whitewave <[EMAIL PROTECTED]> escribió: > Thank you for your reply. But I don't fully understand what the > charjunk and linejunk is all about. I'm a bit newbie in python using > the DiffLib. I'm I using the right code here? I will I implement the > linejunk

Re: I need help speeding up an app that reads football scores andgenerates rankings

2007-05-02 Thread Terry Reedy
"jocknerd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | About 10 years ago, I wrote a C app that would read scores from | football games and calculate rankings based on the outcome of the | games. In fact, I still use this app. You can view my rankings at | http://members.cox.n

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread rh0dium
On May 2, 7:49 am, Bruno Desthuilliers wrote: > Yes - using inspect.getargspec. I don't have example code at hand yet, > but it's not really complicated. Viola!! Hey this works!! Now I have modified my code to do this - way cool (still kind of a mess though) args, varargs, varkw, d

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread rh0dium
On May 2, 8:25 am, Gary Herron <[EMAIL PROTECTED]> wrote: > rh0dium wrote: > >> This is far more work than you need. Push an (args, kwargs) tuple into > >> your arguments queue and call self.function(*args, **kwargs). > > > No see I tried that and that won't work. > > Won't work? How does it fail?

Re: Need Help in Preparing for Study of Python by Forrester Research

2007-05-02 Thread Jim
What does it pay? -- http://mail.python.org/mailman/listinfo/python-list

Re: I need help speeding up an app that reads football scores and generates rankings

2007-05-02 Thread Arnaud Delobelle
On May 2, 4:00 pm, jocknerd <[EMAIL PROTECTED]> wrote: > About 10 years ago, I wrote a C app that would read scores from > football games and calculate rankings based on the outcome of the > games. In fact, I still use this app. You can view my rankings > athttp://members.cox.net/jocknerd/footba

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Chris Mellon
On 2 May 2007 09:41:56 -0700, rh0dium <[EMAIL PROTECTED]> wrote: > On May 2, 8:25 am, Gary Herron <[EMAIL PROTECTED]> wrote: > > rh0dium wrote: > > >> This is far more work than you need. Push an (args, kwargs) tuple into > > >> your arguments queue and call self.function(*args, **kwargs). > > > >

Logic for Chat client

2007-05-02 Thread Viewer T.
Could anyone kindly give me a comprehensive logic guide to creating a peer-to-peer chat program with Python. I would really appreciat a comprehensive guide and links to any modules I would need that are not in the standard library. -- http://mail.python.org/mailman/listinfo/python-list

Time functions

2007-05-02 Thread HMS Surprise
I wish to generate a datetime string that has the following format. '05/02/2007 12:46'. The leading zeros are required. I found '14.2 time' in the library reference and have pulled in localtime. Are there any formatting functions available or do I need to make my own? Perhaps there is something s

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Steven D'Aprano
On Wed, 02 May 2007 07:22:07 -0700, rh0dium wrote: > Hi all, > > Below is a basic threading program. The basic I idea is that I have a > function which needs to be run using a queue of data. Early on I > specified my function needed to only accept basic parameters ( no > postional *args or *kwar

Re: Time functions

2007-05-02 Thread HMS Surprise
On May 2, 12:00 pm, HMS Surprise <[EMAIL PROTECTED]> wrote: > I wish to generate a datetime string that has the following format. > '05/02/2007 12:46'. The leading zeros are required. > > I found '14.2 time' in the library reference and have pulled in > localtime. Are there any formatting functions

Re: Time functions

2007-05-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, HMS Surprise wrote: > I wish to generate a datetime string that has the following format. > '05/02/2007 12:46'. The leading zeros are required. > > I found '14.2 time' in the library reference and have pulled in > localtime. Are there any formatting functions available or

Re: I need help speeding up an app that reads football scores and generates rankings

2007-05-02 Thread Gabriel Genellina
En Wed, 02 May 2007 12:16:56 -0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> escribió: > In <[EMAIL PROTECTED]>, jocknerd > wrote: > >> The biggest difference in my two apps is the C app uses linked lists. >> I feel my Python app is doing too many lookups which is causing the >> bottlenec

Re: Leaving Python List

2007-05-02 Thread Gabriel Genellina
En Wed, 02 May 2007 08:27:43 -0300, Gurpreet Singh <[EMAIL PROTECTED]> escribió: > This mail is to confirm that i want to leave the > python list. Goodbye! -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: ScrolledText?

2007-05-02 Thread nik
Great thank you for the help, we got it working. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way to refactor this?

2007-05-02 Thread Steven D'Aprano
On Wed, 02 May 2007 11:37:14 -0400, John Salerno wrote: > Bruno Desthuilliers wrote: > >> From a purely efficiency POV, there are some obviously possible >> improvements. The first one is to alias visual.cylinder, so you save on >> lookup time. The other one is to avoid useless recomputation o

Re: Time functions

2007-05-02 Thread HMS Surprise
On May 2, 12:03 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, HMS Surprise > wrote: > > > I wish to generate a datetime string that has the following format. > > '05/02/2007 12:46'. The leading zeros are required. > > > I found '14.2 time' in the library referenc

gpp (conditional compilation)

2007-05-02 Thread [EMAIL PROTECTED]
I'm trying to use the gpp utility (Gnu points to http://en.nothingisreal.com/wiki/GPP) to do conditional compilation in Python, and I'm running into a problem: the same '#' character introduces Python comments and is used by default to introduce #ifdef etc. lines. Here's an example of what I'm tr

Re: how to use Dispatch to open an application in win32com.client

2007-05-02 Thread Peter Fischer
Hello, I also use the COM API via python to dispatch an application. My problem now is that I want to dispatch a second instance of this application (Google Earth by the way). But when I invoke dispatch the second time, nothing happens although using another variable to store the returned value:

Re: gpp (conditional compilation)

2007-05-02 Thread dustin
On Wed, May 02, 2007 at 10:37:40AM -0700, [EMAIL PROTECTED] wrote: > I'm trying to use the gpp utility (Gnu points to > http://en.nothingisreal.com/wiki/GPP) > to do conditional compilation in Python, and I'm running into a > problem: the same '#' character introduces Python comments and is used >

Re: gpp (conditional compilation)

2007-05-02 Thread Duncan Booth
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to use the gpp utility (Gnu points to > http://en.nothingisreal.com/wiki/GPP) to do conditional compilation in > Python, and I'm running into a problem: the same '#' character > introduces Python comments and is used by default to introdu

Re: gpp (conditional compilation)

2007-05-02 Thread John Nagle
[EMAIL PROTECTED] wrote: > I'm trying to use the gpp utility (Gnu points to > http://en.nothingisreal.com/wiki/GPP) > to do conditional compilation in Python, and I'm running into a > problem: the same '#' character introduces Python comments and is used > by default to introduce #ifdef etc. lines

Re: Python un-plugging the Interpreter

2007-05-02 Thread John Nagle
Jorgen Grahn wrote: > On Wed, 25 Apr 2007 08:05:01 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> > wrote: > >>"Jorgen Grahn" <[EMAIL PROTECTED]> wrote: > Eric Raymond's "The Art of Unix Programming" sums up the threading > criticism, I think: > > http://catb.org/~esr/writings/taoup/html/multipr

Re: Time functions

2007-05-02 Thread Matimus
On May 2, 10:21 am, HMS Surprise <[EMAIL PROTECTED]> wrote: > On May 2, 12:03 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > In <[EMAIL PROTECTED]>, HMS Surprise > > wrote: > > > > I wish to generate a datetime string that has the following format. > > > '05/02/2007 12:46'. The leadi

Re: Is it possible to determine what a function needs for parameters -

2007-05-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Chris Mellon <[EMAIL PROTECTED]> wrote: >On 2 May 2007 09:41:56 -0700, rh0dium <[EMAIL PROTECTED]> wrote: >> On May 2, 8:25 am, Gary Herron <[EMAIL PROTECTED]> wrote: >> > rh0dium wrote: . . . >T

Re: Time functions

2007-05-02 Thread Grant Edwards
On 2007-05-02, Matimus <[EMAIL PROTECTED]> wrote: >> I think I have an import misconception. >> >> I use >> import from time localtime, strftime >> t = strftime('%m/%d/%Y %H:%M', localtime()) >> >> This works. How would one use it with the module name pre-pended? > > I would think that wha

Re: Need Help in Preparing for Study of Python by Forrester Research

2007-05-02 Thread Duncan Booth
Jeff Rush <[EMAIL PROTECTED]> wrote: > Initially, they'd like feedback (not yet the answers themselves) from > us regarding their proposed evaluation criteria - questions to add or > that give no value, rewording to make them more clear. I've posted > their draft criteria, which came as a spreads

Re: gpp (conditional compilation)

2007-05-02 Thread [EMAIL PROTECTED]
(replying to myself because I got four good replies) Wow! That was fast! OK, I'll try out these ideas, and many thanks! Mike Maxwell -- http://mail.python.org/mailman/listinfo/python-list

hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-02 Thread bhochstetler
I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get my python executable created and run it, I get the error: "import site failed" OverflowError: signed integer is greater than the maximum. This is happening in the convertsimple() routine when it tries to return a signed int:

Re: [ANN] Update to Python Quick Reference Card (for Python 2.4) (v0.67)

2007-05-02 Thread Casey Hawthorne
PC-cillin flagged this as a dangerous web site. Laurent Pointal <[EMAIL PROTECTED]> wrote: >PQRC (Python Quick Reference Card) is a condensed documentation for >Python and its main libraries, targetting production of printed quick >http://www.limsi.fr/Individu/pointal/python/pqrc/ > -- Regards

Re: how to use Dispatch to open an application in win32com.client

2007-05-02 Thread Tim Golden
Peter Fischer wrote: > Hello, > > I also use the COM API via python to dispatch an application. My > problem now is that I want to dispatch a second instance of this > application (Google Earth by the way). But when I invoke dispatch > the second time, nothing happens although using another variab

  1   2   3   >