Re: float questions

2006-09-15 Thread spiffy
On Sat, 16 Sep 2006 03:13:16 -0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >At Saturday 16/9/2006 02:56, spiffy wrote: > >>after some calculations i have this number as a result... >>-7.1054273576010019e-015 > >This means -7.1054... * 10**(-15) and it's a compact way of writing >-0.

Re: float questions

2006-09-15 Thread Ben Finney
spiffy <[EMAIL PROTECTED]> writes: > after some calculations i have this number as a result... > -7.1054273576010019e-015 > > what does the 'e' mean? is this an error? It indicates that this is a number represented with scientific notation. http://en.wikipedia.org/wiki/Scientific_notation>

Re: Coding Nested Loops

2006-09-15 Thread Peter Otten
Rich Shepard wrote: > On Fri, 15 Sep 2006, Peter Otten wrote: > >> It's not clear to me why you would use dictionaries, especially as they >> are unordered; I used lists instead: > >... > >> Now that is a nice occasion to get acquainted with the itertools >> module... > > Peter, > >I

Looking for a python IDE

2006-09-15 Thread [EMAIL PROTECTED]
Hello I am looking for a good IDE for Python. Commercial or Open Software. If possible with visual GUI designer. For the moment I am considering Komodo. Any suggestions? Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: min() & max() vs sorted()

2006-09-15 Thread Paddy
MRAB wrote: > Tim Peters wrote: > > [MRAB] > > > Some time after reading about Python 2.5 and how the built-in functions > > > 'min' and 'max' will be getting a new 'key' argument, I wondered how > > > they would treat those cases where the keys were the same, for example: > > > > > > L = ["four",

Re: float questions

2006-09-15 Thread Gabriel Genellina
At Saturday 16/9/2006 02:56, spiffy wrote: after some calculations i have this number as a result... -7.1054273576010019e-015 This means -7.1054... * 10**(-15) and it's a compact way of writing -0.0071054... what does the 'e' mean? is this an error? It is not an error, just a

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Frank Millman
Dale Strickland-Clark wrote: > Now that OIDs have been deprecated in PostgreSQL, how do you find the key of > a newly inserted record? > > I've tried three Python client libraries, including psycopg2, and where they > support cursor attribute 'lastrowid' (Python DB API 2.0), it is always > zero. >

float questions

2006-09-15 Thread spiffy
after some calculations i have this number as a result... -7.1054273576010019e-015 what does the 'e' mean? is this an error? i want to be able to round this number to 3 places, but round() does not work please excuse my ignorance any help would be appreciated -- http://mail.python.org/mailma

Re: How to change font direction?

2006-09-15 Thread theju
Well here are some self explanatory functions that I've written for displaying the text vertically and from right to left. As for rotation gimme some more time and i'll come back to you. Also I don't guarantee that this is the best method(cos I myself am a newbie), but I can guarantee you that it w

Re: Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread James Stroud
Dustan wrote: > Jay wrote: > >>Thanks for the tip, but that breaks things later for what I'm doing. >> >>[EMAIL PROTECTED] wrote: >> >>>In that case you don't need a lambda: >>> >>>import Tkinter as tk >>> >>>class Test: >>>def __init__(self, parent): >>>buttons = [tk.Button(parent, te

Re: generators/iterators: filtered random choice

2006-09-15 Thread Calvin Spealman
On 15 Sep 2006 19:17:25 -0700, gry@ll.mit.edu wrote: > I want a function (or callable something) that returns a random > word meeting a criterion. I can do it like: > > def random_richer_word(word): > '''find a word having a superset of the letters of "word"''' > if len(set(word) == 26):

Re: mp3 libs and programs

2006-09-15 Thread [EMAIL PROTECTED]
PyMedia has Windows binaries available for download. http://prdownloads.sourceforge.net/pymedia/pymedia-1.3.7.2.win32-py2.4.exe?download Jay wrote: > Only if I have to. PyMedia is a pain and a half to build and why do > that if I can just pipe it out to some other program? > > > Tim Williams wrote

Re: xmlrpc with Basic Auth

2006-09-15 Thread Bryan
Milos Prudek wrote: > I need to use XML-RPC call with Basic Authorization in HTTP headers. I found > xmlrpclibBasicAuth.py, and it can be used as follows: > > from xmlrpclibBasicAuth import Server > s=Server("http://www.example.com/rpc.php","user","pwd";) > print s.system.listMethods() > > Is th

Re: Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread Dustan
Jay wrote: > Thanks for the tip, but that breaks things later for what I'm doing. > > [EMAIL PROTECTED] wrote: > > In that case you don't need a lambda: > > > > import Tkinter as tk > > > > class Test: > > def __init__(self, parent): > > buttons = [tk.Button(parent, text=str(x+1), > >

Re: Looking for the Perfect Editor

2006-09-15 Thread BartlebyScrivener
>> which allows soft word-wrap (no >> line breaks stored in the file) gvim 7.0 if you set wrap and linebreak :set wrap :set lbr The lines will softwrap only at whitespace and various punctuation marks. For the indentation issue, use autoindent. rd -- http://mail.python.org/mailman/listinfo

Re: mp3 libs and programs

2006-09-15 Thread Richard Jones
Jay wrote: > I'm writing a python script that involves playing mp3 files. I've previously successfully used the Python interface for MAD: http://www.underbit.com/products/mad/ which was trivial to use in combination with libao's python interface (and throw in ogg.vorbis from xiph.org and you'

generators/iterators: filtered random choice

2006-09-15 Thread gry
I want a function (or callable something) that returns a random word meeting a criterion. I can do it like: def random_richer_word(word): '''find a word having a superset of the letters of "word"''' if len(set(word) == 26): raise WordTooRichException, word while True: w = rand

Re: mp3 libs and programs

2006-09-15 Thread Jay
I checked it and I can most definitely do the seeking from the command line with mplayer. Can I use slave mode with python? Jay wrote: > That's definately a good choice, but what about mplayer in slave mode? > Can I use that with python? Would that be able to seek? > > > Harold Fellermann wrote

Re: mp3 libs and programs

2006-09-15 Thread Jay
That's definately a good choice, but what about mplayer in slave mode? Can I use that with python? Would that be able to seek? Harold Fellermann wrote: > hi, > > Jay wrote: > > I'm writing a python script that involves playing mp3 files. The first > > approach I had was sending commands to unix

Re: mp3 libs and programs

2006-09-15 Thread Harold Fellermann
hi, Jay wrote: > I'm writing a python script that involves playing mp3 files. The first > approach I had was sending commands to unix command-line programs in > order to play them. I tired mpg123 and moosic, but there was a key > feature to my program's success that's missing. SEEK! I need to

Re: mp3 libs and programs

2006-09-15 Thread Jay
Only if I have to. PyMedia is a pain and a half to build and why do that if I can just pipe it out to some other program? Tim Williams wrote: > On 15 Sep 2006 18:16:41 -0700, Jay <[EMAIL PROTECTED]> wrote: > > I'm writing a python script that involves playing mp3 files. The first > > approach I

Re: mp3 libs and programs

2006-09-15 Thread Tim Williams
On 15 Sep 2006 18:16:41 -0700, Jay <[EMAIL PROTECTED]> wrote: > I'm writing a python script that involves playing mp3 files. The first > approach I had was sending commands to unix command-line programs in > order to play them. I tired mpg123 and moosic, but there was a key > feature to my progra

mp3 libs and programs

2006-09-15 Thread Jay
I'm writing a python script that involves playing mp3 files. The first approach I had was sending commands to unix command-line programs in order to play them. I tired mpg123 and moosic, but there was a key feature to my program's success that's missing. SEEK! I need to be able to start playing

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Diez B. Roggisch
>> AFAIK d and f are synonym for arrays, as python doesn't distinguish >> between these two on a type-level. And double it is in the end. > > No `array.array` is really about "C compiler types". You get C doubles in > form of Python's `float` type if you read from the `array.array` but it's > st

Re: Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread Jay
Thanks for the tip, but that breaks things later for what I'm doing. [EMAIL PROTECTED] wrote: > In that case you don't need a lambda: > > import Tkinter as tk > > class Test: > def __init__(self, parent): > buttons = [tk.Button(parent, text=str(x+1), > command=self.highlight(x)) for x

Re: Finding dynamic libraries

2006-09-15 Thread MonkeeSage
Bill Spotz wrote: > Is there a way to tell an executing python script where to look for > dynamically-loaded libraries? If I understand, you want to tell an already running python process to import some extensions from arbitrary locations? If that is correct, you could use a file to hold the dynam

Re: Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread bearophileHUGS
In that case you don't need a lambda: import Tkinter as tk class Test: def __init__(self, parent): buttons = [tk.Button(parent, text=str(x+1), command=self.highlight(x)) for x in range(5)] for button in buttons: button.pack(side=tk.LEFT) def highlight(self, x)

Re: Looking for the Perfect Editor

2006-09-15 Thread Patrick Thomson
Personally, I use the non-free but absolutely phenomenal TextMate (http://macromates.com/), but I've enjoyed my work with jEdit (http://www.jedit.org/) and, of course, (X)Emacs. -- http://mail.python.org/mailman/listinfo/python-list

Re: min() & max() vs sorted()

2006-09-15 Thread Tim Peters
[MRAB] >>> Some time after reading about Python 2.5 and how the built-in functions >>> 'min' and 'max' will be getting a new 'key' argument, I wondered how >>> they would treat those cases where the keys were the same, for example: >>> >>> L = ["four", "five"] >>> print min(L, key = len), max(L, ke

Re: Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread Jay
Perfect. Thanks. Paul Rubin wrote: > "Jay" <[EMAIL PROTECTED]> writes: > > > I'm having a problem using lambda to use a command with an argument for > > a button in Tkinter. > > > > buttons = range(5) > > for x in xrange(5): > > > self.highlight(x)) > >

Re: Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread Paul Rubin
"Jay" <[EMAIL PROTECTED]> writes: > I'm having a problem using lambda to use a command with an argument for > a button in Tkinter. > > buttons = range(5) > for x in xrange(5): > self.highlight(x)) > buttons[x].pack(side=LEFT) > > The buttons a

Re: xmlrpc, extract data from http headers

2006-09-15 Thread Filip Wasilewski
Milos Prudek wrote: > I perform a XML-RPC call by calling xmlrpclibBasicAuth which in turn calls > xmlrpclib. This call of course sends a HTTP request with correct HTTP > headers. The response is correctly parsed by xmlrpclib, and I get my desired > values. > > However, I also need to get the raw H

Re: something for itertools

2006-09-15 Thread Tim Williams
On 15/09/06, Daniel Nogradi <[EMAIL PROTECTED]> wrote: > > or maybe a one liner :) > > > > >>> (a + 5*(None,))[:5] > > (1, 2, 3, None, None) > > > > Well, something like this is what I actually do. But for this first I > have to loop over all tuples and pick out the maximal length, so over > all

Tkinter.Button(... command) lambda and argument problem

2006-09-15 Thread Jay
I'm having a problem using lambda to use a command with an argument for a button in Tkinter. buttons = range(5) for x in xrange(5): buttons[x] = Button(frame, text=str(x+1), command=lambda: self.highlight(x)) buttons[

Re: Looking for a regexp generator based on a set of known string representative of a string set

2006-09-15 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Andy Dingley" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> [EMAIL PROTECTED] wrote: >> >>> I am looking for python code that takes as input a list of strings >>> [...] and outputs the python regu

Re: something for itertools

2006-09-15 Thread George Sakkis
Daniel Nogradi wrote: > In a recent thread, > http://mail.python.org/pipermail/python-list/2006-September/361512.html, > a couple of very useful and enlightening itertools examples were given > and was wondering if my problem also can be solved in an elegant way > by itertools. > > I have a bunch o

Re: min() & max() vs sorted()

2006-09-15 Thread MRAB
Tim Peters wrote: > [MRAB] > > Some time after reading about Python 2.5 and how the built-in functions > > 'min' and 'max' will be getting a new 'key' argument, I wondered how > > they would treat those cases where the keys were the same, for example: > > > > L = ["four", "five"] > > print min(L,

Re: Why not event-driven packages in other than the main thread?

2006-09-15 Thread Paul Rubin
Tor Erik <[EMAIL PROTECTED]> writes: > I've developed an application were I've used Tkinter for the GUI. > When I ran the GUI in another thread than the main, it kept locking > up. I experienced similar problems with Twisted. Tkinter is not thread-safe. You have to synchronize any cross-thread c

Re: something for itertools

2006-09-15 Thread Daniel Nogradi
> > In a recent thread, > > http://mail.python.org/pipermail/python-list/2006-September/361512.html, > > a couple of very useful and enlightening itertools examples were given > > and was wondering if my problem also can be solved in an elegant way > > by itertools. > > > > I have a bunch of tuples

Re: something for itertools

2006-09-15 Thread Tim Williams
On 15/09/06, Daniel Nogradi <[EMAIL PROTECTED]> wrote: > In a recent thread, > http://mail.python.org/pipermail/python-list/2006-September/361512.html, > a couple of very useful and enlightening itertools examples were given > and was wondering if my problem also can be solved in an elegant way > b

Re: add without carry

2006-09-15 Thread Bruno Desthuilliers
Jon Ribbens a écrit : > In article <[EMAIL PROTECTED]>, Bruno Desthuilliers wrote: > >>Hugh wrote: >> >>>Sorry, here's an example... >>> >>>5+7=12 >>> >>>added without carrying, 5+7=2 >>> >>>i.e the result is always less than 10 >> >>>I've been thinking some more about this and my brain is startin

How to change font direction?

2006-09-15 Thread Daniel Mark
Hello all: I am using PIL to draw some graphics and I need to draw some texts in vertical direction rather than the default left-to-right horizontal direction. Is there anyway I could do that? Thank you -Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: ancestor class' __init__ doesn't call other methods

2006-09-15 Thread Bruno Desthuilliers
Luis P. Mendes a écrit : > Hi, > > I have the following problem: > > I instantiate class Sistema from another class. The result is the same > if I import it to interactive shell. > > s = Sistema("par") > > class Sistema: > def __init__(self, par): > cruza_ema = CruzaEmas(par) > >

something for itertools

2006-09-15 Thread Daniel Nogradi
In a recent thread, http://mail.python.org/pipermail/python-list/2006-September/361512.html, a couple of very useful and enlightening itertools examples were given and was wondering if my problem also can be solved in an elegant way by itertools. I have a bunch of tuples with varying lengths and w

Re: Coding Nested Loops

2006-09-15 Thread Rich Shepard
On Fri, 15 Sep 2006, Peter Otten wrote: > It's not clear to me why you would use dictionaries, especially as they > are unordered; I used lists instead: ... > Now that is a nice occasion to get acquainted with the itertools module... Peter, I have to study the docs to understand what's g

Re: ancestor class' __init__ doesn't call other methods

2006-09-15 Thread Luis P. Mendes
Rob De Almeida escreveu: > Luis P. Mendes wrote: >> Method a() is not called. Why is this? What is the best option to >> solve this? Have Cotacoes returning values and not to be an ancestor >> class of CruzaEmas? > > It works for me, after rearranging your code a little bit: > Ok, thanks. I alr

Re: wxTimer problem

2006-09-15 Thread abcd
> Fix: Start the script from the main thread only. > > Regards, > > > Björn thanks for NO help.anyways, I got rid of the Timer b/c all i was using it for was to check the state of the "shift" key.but I am now binding to key up/down. thanks anyway -- http://mail.python.org/mailman/listi

Re: Question about pipes/os.popen

2006-09-15 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: [ someone's command that fails, run in popen ] > > cmd.read() > > > > This returns output of "". ... > > I'm not sure what I'm doing wrong here. > > > Probably expecting sudo to read the standard input for its password. Al

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread Tim Chase
shrikant COOLSOFT wrote: > Tim > > Stop acting like an [EMAIL PROTECTED]& > > > > > Tim Chase <[EMAIL PROTECTED]> wrote: > >> *Java, 2 year UNIX - HP / Solaris, 2 yrs OOA+D, Corba, Perl, >>> XML, UML. *Java dev experience, Swing, JPS, 2 years of >>> OOA+D. >> Clearly not spam,

Re: Coding Nested Loops

2006-09-15 Thread George Sakkis
Peter Otten wrote: > from itertools import count, izip, cycle, chain, repeat, starmap, imap > from random import choice > > first = ["X", "Y", "Z"] > second = ["A", "B", "C"] > second_count = [13, 14, 33] > third = [1.1, 2.2, 3.3, 4.4] > > random_floats = imap(choice, repeat(third)) > columns = [

Re: Question about pipes/os.popen

2006-09-15 Thread Kevin Walzer
Steve Holden wrote: >> > Probably expecting sudo to read the standard input for its password. > > First of all, sudo doesn't always ask for your password. Secondly, when > it does I'm pretty sure it will take care to try and do it on the > controlling tty, not by reading stdin. > sudo wasn't th

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread SpreadTooThin
Tim Peters wrote: > [Marc 'BlackJack' Rintsch] > >> What about: > >> > >> b = array.array('f', a) > > [Diez B. Roggisch] > > AFAIK d and f are synonym for arrays, as python doesn't distinguish > > between these two on a type-level. And double it is in the end. > > While Python has no type of its o

Re: Exposing Excel as a Webservice

2006-09-15 Thread Brandon
Thanks for the reply. Unfortunately I cannot use a different format for the data since I'm really using Excel as a calculation engine. I don't own the authoring of these spreadsheets or even the data inside of them so I cannot change the format. The spreadsheets also are complicated enough and c

Re: How do I converted a null (0) terminated string to a Python string?

2006-09-15 Thread Robert Kern
George Sakkis wrote: > Michael wrote: > >> Robert, >> >> Thanks to you and everyone else for the help. The "s.split('\x00', >> 1)[0] " solved the problem. > > And a probably faster version: s[:s.index('\x00')] Yup. About twice as fast for at least one dataset: In [182]: import timeit In [183]

Re: wxTimer problem

2006-09-15 Thread Bjoern Schliessmann
abcd wrote: > ...and I am getting this error: > > "timer can only be started from the main thread" > > how can I fix this?? > > FYI, my script is being started by a new thread each time Fix: Start the script from the main thread only. Regards, Björn -- BOFH excuse #53: Little hamster in

Re: How do I converted a null (0) terminated string to a Python string?

2006-09-15 Thread George Sakkis
Michael wrote: > Robert, > > Thanks to you and everyone else for the help. The "s.split('\x00', > 1)[0] " solved the problem. And a probably faster version: s[:s.index('\x00')] George -- http://mail.python.org/mailman/listinfo/python-list

Re: Outbound port on sockets

2006-09-15 Thread Grant Edwards
On 2006-09-15, Steve Holden <[EMAIL PROTECTED]> wrote: >> I don't know what "multi-homing problems are either". >> Apparently there must be some ftp clients that require the >> source port for the data connection to be port 20. >> >> The RFC is pretty vague. It does say the server and clinet but

wxTimer problem

2006-09-15 Thread abcd
I have a python script which creates a wx.App, which creates a wx.Frame (which has a wx.Timer). looks sorta like this: class MyProgram: def __init__(self): self.app = MyApp(0) self.app.MainLoop() class MyApp(wx.App): def OnInit(self): self.myframe= MyFrame()

Re: Limitate speed of a socket-based data transferring

2006-09-15 Thread Grant Edwards
On 2006-09-15, Steve Holden <[EMAIL PROTECTED]> wrote: >>>The sender will send at whatever rate they are capable of, so >>>packets may just become backlogged on your receiving socket >> >> >> When that happens, the sending end of the socket will throttle >> down to match the rate at which data i

Re: ancestor class' __init__ doesn't call other methods

2006-09-15 Thread Rob De Almeida
Luis P. Mendes wrote: > Method a() is not called. Why is this? What is the best option to > solve this? Have Cotacoes returning values and not to be an ancestor > class of CruzaEmas? It works for me, after rearranging your code a little bit: class Ema: pass class Sistema: def __init__

Re: Check if variable is an instance of a File object

2006-09-15 Thread George Sakkis
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > > #1 : should I start by checking that 'file' is indeed an instance of a > > File object ? > > Unless you have a *very* compelling reason to do so (and I can't imagine > one here), definitively, no. FWIW, it's pretty common in Python to pass

Re: Searching for patterns on the screen

2006-09-15 Thread Paul McGuire
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Paul McGuire wrote: >> "Jerry Hill" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > Hello all, >> As far as working just in Python, you could remove the tuple unpacking >> inside removeColor, and shor

Re: Coding Nested Loops

2006-09-15 Thread Rich Shepard
On Fri, 15 Sep 2006, Bjoern Schliessmann wrote: That doesn't answer the question. A list of 2-tuples would do the same (and was ordered and could be indexed). Björn, et al.: For the purpose of generating a data sample, the list of 2-tuples will work. Thanks all, Rich -- Richard B. Shepar

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread Tim Chase
>> *Java, 2 year UNIX - HP / Solaris, 2 yrs OOA+D, Corba, Perl, >> XML, UML. *Java dev experience, Swing, JPS, 2 years of >> OOA+D. > > Clearly not spam, since the guy is so in touch with the > readership of this group ... sigh ... is it just me, or is > this person an idiot? Perhaps this is an a

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Tim Peters
[Marc 'BlackJack' Rintsch] >> What about: >> >> b = array.array('f', a) [Diez B. Roggisch] > AFAIK d and f are synonym for arrays, as python doesn't distinguish > between these two on a type-level. And double it is in the end. While Python has no type of its own corresponding to the native C `flo

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > Marc 'BlackJack' Rintsch schrieb: >> In <[EMAIL PROTECTED]>, SpreadTooThin >> wrote: >> >>> I have some code... >>> >>> import array >>> >>> a = array.array('d') >>> f = open('file.raw') >>> a.fromfile(f, 10) >>> >>> now I need to convert them int

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread Kay Schluehr
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > [...] > > Skill: > > > > > > *Java, 2 year UNIX - HP / Solaris, 2 yrs OOA+D, Corba, Perl, XML, UML. > > *Java dev experience, Swing, JPS, 2 years of OOA+D. > > Clearly not spam, since the guy is so in touch with the readership of > this gro

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread skip
Carsten> Yes, he is an idiot. Good call on CC'ing your assessment to Carsten> him. :) Steve knows it's good to be subtle with these guys. ;-) Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: fail to indent in inner loop

2006-09-15 Thread Jakub Hegenbart
[EMAIL PROTECTED] wrote: > hi > > I've started learning python. I was typing from a tutorial, > and I fail to indent on an inner loop. > I got an error and all my previous typed lines are gone. > is there a way to prevent this. > i don't mind editing the last line, but to lose all the previous lin

ancestor class' __init__ doesn't call other methods

2006-09-15 Thread Luis P. Mendes
Hi, I have the following problem: I instantiate class Sistema from another class. The result is the same if I import it to interactive shell. s = Sistema("par") class Sistema: def __init__(self, par): cruza_ema = CruzaEmas(par) class CruzaEmas(Ema, Cotacoes): def __init__(self

Help on the deformer object

2006-09-15 Thread Dean Card
I am trying to use a MESH transform from the Python Imaging Library and am having trouble defining my deformer object. What I want to do is map one eight item tuple like (x0, y0, x1, y1, x2, y2, x3, y3) to another set of points like (x00, y00, x10, y10, x20, y20, x30, y30) where (xn, yn) is a p

Strange xml.parsers.expat import problem [corrected subject]

2006-09-15 Thread [EMAIL PROTECTED]
Sorry, that should have been "xml.parsers.expat" [EMAIL PROTECTED] wrote: > Hi, c.l.p.'ers- > > I am having a problem with the import of xml.parsers.expat that has > gotten me completely stumped. I have two programs, one a PyQt program > and one a command line (text) program that both eventually c

Strange xml.parsers.xml import problem

2006-09-15 Thread [EMAIL PROTECTED]
Hi, c.l.p.'ers- I am having a problem with the import of xml.parsers.expat that has gotten me completely stumped. I have two programs, one a PyQt program and one a command line (text) program that both eventually call the same code that imports xml.parsers.expat. Both give me different results...

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread Carsten Haese
On Fri, 2006-09-15 at 14:41, Steve Holden wrote: > [EMAIL PROTECTED] wrote: > [...] > > Skill: > > > > > > *Java, 2 year UNIX - HP / Solaris, 2 yrs OOA+D, Corba, Perl, XML, UML. > > *Java dev experience, Swing, JPS, 2 years of OOA+D. > > Clearly not spam, since the guy is so in touch wit

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] > Skill: > > > *Java, 2 year UNIX - HP / Solaris, 2 yrs OOA+D, Corba, Perl, XML, UML. > *Java dev experience, Swing, JPS, 2 years of OOA+D. Clearly not spam, since the guy is so in touch with the readership of this group ... sigh ... is it just me, or is t

Re: Question about pipes/os.popen

2006-09-15 Thread Steve Holden
Kevin Walzer wrote: > I'm trying to structure a Python script that streams output over a pipe. > > Here is my code: > > import os > > cmd = os.popen('echo foo | sudo -S /usr/sbin/tcpdump -en1') > cmd.read() > > This returns output of "". I'm expecting the standard output of "tcpdump > -en1". Ho

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
Tim N. van der Leeuw wrote: > > Hi, > > select lastval(); > Thanks, that was useful. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: UDP packets to PC behind NAT

2006-09-15 Thread Steve Holden
Janto Dreijer wrote: > Grant Edwards wrote: > >>On 2006-09-15, Janto Dreijer <[EMAIL PROTECTED]> wrote: > > > >>>Would it be a reasonable solution to initiate a TCP connection >>>from the client to the server and somehow (?) let the server >>>figure out how the client is connecting? And the

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Diez B. Roggisch
Marc 'BlackJack' Rintsch schrieb: > In <[EMAIL PROTECTED]>, SpreadTooThin > wrote: > >> I have some code... >> >> import array >> >> a = array.array('d') >> f = open('file.raw') >> a.fromfile(f, 10) >> >> now I need to convert them into floats (32 bit...) what do i do? > > What about: > > b = ar

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
Hi Harald Thanks for that, somewhat comprehensive, answer. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, SpreadTooThin wrote: > I have some code... > > import array > > a = array.array('d') > f = open('file.raw') > a.fromfile(f, 10) > > now I need to convert them into floats (32 bit...) what do i do? What about: b = array.array('f', a) Ciao, Marc 'BlackJack' Rint

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Diez B. Roggisch
SpreadTooThin schrieb: > I have some code... > > import array > > a = array.array('d') > f = open('file.raw') > a.fromfile(f, 10) > > now I need to convert them into floats (32 bit...) what do i do? I guess module struct is your friend. Something like this: struct.pack("f" * len(a), *a) Di

Re: Pre-defining an action to take when an expected error occurs

2006-09-15 Thread Steve Holden
John Machin wrote: [...] > > [1] There's a possibility that the package's author reads this > newsgroup, and I've heard tell that he's a cranky old so-and-so; you > wouldn't want him to take umbrage, would you? > Cranks doesn't even *begin* to describe it ... regards Steve -- Steve Holden

Re: Outbound port on sockets

2006-09-15 Thread Steve Holden
Grant Edwards wrote: > On 2006-09-15, Sergei Organov <[EMAIL PROTECTED]> wrote: > > >It's not the issue here, but to specify the outgoing port >call bind(('', portnum)) before connect(). > > >>>It's an interesting thing to know, but I've been doing TCP >>>stuff for many years and never

REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread shrikant
Hi Partners, Please check the following project details. If you are comfortable with the requirement. Please send me your resume with the following details asap. Name of the Consultant - Phone Number - Email - Rate / Salary - Availability - Location Location: Dallas

how do you convert and array of doubles into floats?

2006-09-15 Thread SpreadTooThin
I have some code... import array a = array.array('d') f = open('file.raw') a.fromfile(f, 10) now I need to convert them into floats (32 bit...) what do i do? -- http://mail.python.org/mailman/listinfo/python-list

Re: Limitate speed of a socket-based data transferring

2006-09-15 Thread Steve Holden
Grant Edwards wrote: > On 2006-09-15, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >>On 14 Sep 2006 04:54:48 -0700, "billie" <[EMAIL PROTECTED]> declaimed the >>following in comp.lang.python: >> >> >>>Hi all. I'm writing a TCP-based application that I will use to trasfer >>>binary files through

Re: Exposing Excel as a Webservice

2006-09-15 Thread utabintarbo
Disclaimer: I am not an expert in python, or even programming, for that matter In any case, option #2 sounds like the most theoretically sound. It sounds like you are using Excel as a database, and your worker thread as a transaction queue. Something to consider: do you really need to modify

Re: Coding Nested Loops

2006-09-15 Thread Bjoern Schliessmann
Rich Shepard wrote: > On Fri, 15 Sep 2006, Peter Otten wrote: >> It's not clear to me why you would use dictionaries, especially >> as they are unordered; I used lists instead: >Because the data comes via a serial port as sequences of two >bytes from an > OMR reader, and the byte pairs n

Re: Coding Nested Loops

2006-09-15 Thread Rich Shepard
On Fri, 15 Sep 2006, Peter Otten wrote: > It's not clear to me why you would use dictionaries, especially as they > are unordered; I used lists instead: Peter, Because the data comes via a serial port as sequences of two bytes from an OMR reader, and the byte pairs need to be converted into v

Re: Coding Nested Loops

2006-09-15 Thread Peter Otten
Rich Shepard wrote: >I want to code what would be nested "for" loops in C, but I don't know >the > most elegant way of doing the same thing in python. So I need to learn how > from you folks. Here's what I need to do: build a database table of 180 > rows. Each row contains 31 columns: the

Re: Pre-defining an action to take when an expected error occurs

2006-09-15 Thread Tempo
John Machin thanks for all of your help, and I take responsibility for the way I worded my sentences in my last reply to this topic. So in an effort to say sorry, I want to make it clear to everybody that it seems as though errors in my code and use of external programs (Excel in particular) are m

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread GHUM
Dale, > Now that OIDs have been deprecated in PostgreSQL, how do you find the key of > a newly inserted record? using OIDs as primary key was no good idea for some PostgreSQL versions allready ... i.e. they really make dump & restore much more challenging. So usually us have something along: CR

Re: How to build extensions on Windows?

2006-09-15 Thread michael . hatmaker
[EMAIL PROTECTED] wrote: > Kevin D. Smith wrote: > > I've written a simple Python extension for UNIX, but I need to get it > > working on Windows now. I'm having some difficulties figuring out how > > to do this. I've seen web pages that say that MS Visual Studio is > > required, and other that

Re: Limitate speed of a socket-based data transferring

2006-09-15 Thread Grant Edwards
On 2006-09-15, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 14 Sep 2006 04:54:48 -0700, "billie" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > >> Hi all. I'm writing a TCP-based application that I will use to trasfer >> binary files through the network. This piece of cod

IDLE Problem in Windows XP

2006-09-15 Thread ELATTAOUI Xavier
Hi,   I have encountered the same problem so you can try the following :   - Be sure your %PYTHONPATH% is set - open a DOS console and type : "python C:\Python23\Lib\idlelib\idle.py" -> this will launch the IDLE - then choose "configure IDLE" in Options menu - in the menu "Highlighting" on

Re: How do I converted a null (0) terminated string to a Python string?

2006-09-15 Thread Michael
Robert, Thanks to you and everyone else for the help. The "s.split('\x00', 1)[0] " solved the problem. Thanks again, MDM Robert Kern wrote: > Michael wrote: > > I guess, I still don't see how this will work. I'm receiving a C > > zero-terminated string in my Python program as a 1K byte block (UD

Coding Nested Loops

2006-09-15 Thread Rich Shepard
I want to code what would be nested "for" loops in C, but I don't know the most elegant way of doing the same thing in python. So I need to learn how from you folks. Here's what I need to do: build a database table of 180 rows. Each row contains 31 columns: the first is an automatically incremen

Re: high level, fast XML package for Python?

2006-09-15 Thread Tim N. van der Leeuw
Hi Gleb, Gleb Rybkin wrote: > I searched online, but couldn't really find a standard package for > working with Python and XML -- everybody seems to suggest different > ones. > > Is there a standard xml package for Python? Preferably high-level, fast > and that can parse in-file, not in-memory sin

Re: Outbound port on sockets

2006-09-15 Thread Grant Edwards
On 2006-09-15, Sergei Organov <[EMAIL PROTECTED]> wrote: It's not the issue here, but to specify the outgoing port call bind(('', portnum)) before connect(). >> It's an interesting thing to know, but I've been doing TCP >> stuff for many years and never run across a situation where >> i

  1   2   >