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
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
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
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
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
[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
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
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...
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
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
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
[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
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
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
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
[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
>> *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
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
"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
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
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__
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
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()
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
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
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
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]
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
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
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
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 = [
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,
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
> 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
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
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
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
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)
>
>
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
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
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
> > 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
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
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,
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
"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
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[
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
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
"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
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))
> >
[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
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
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)
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
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
>> 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
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
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
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
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
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
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
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
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'
>> 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
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),
> >
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
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
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):
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
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
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
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.
>
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
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",
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
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
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>
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.
101 - 180 of 180 matches
Mail list logo