Re: I want to use a C++ library from Python

2008-09-10 Thread Fredrik Lundh
Anders Eriksson wrote: I have looked (very briefly) at the three framework you mention but they all need the source code of the C++? No, they need header files and an import library to be able to compile the bindings and link them to your DLL. Do you know enough about C/C++ build issues to

Re: I want to use a C++ library from Python

2008-09-10 Thread Anders Eriksson
Hello all and thanks for replying, > Diez B. Roggisch wrote: >> Which actually isn't really helpful, as a DLL itself says nothing about what >> language was used to create it - and sending the OP to e.g. ctypes makes no >> sense at all in the face of C++. > > The library - or more precisely the

Re: universal unicode font for reportlab

2008-09-10 Thread Tim Roberts
Duncan Booth <[EMAIL PROTECTED]> wrote: > >Laszlo Nagy <[EMAIL PROTECTED]> wrote: > >> I need to use HTML anyway. I realized that universal unicode fonts are >> above 5MB in size. The report would be a 10KB PDF, but I need to embed >> the font before I can send it to anyone. Since some reports ne

Re: Gateway to python-list is generating bounce messages.

2008-09-10 Thread Ben Finney
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2008-09-10, Ben Finney <[EMAIL PROTECTED]> wrote: > > Grant Edwards <[EMAIL PROTECTED]> writes: > > > >> Could whoever is responsible for the gateway that is grabbing > >> my postings off of Usenet and e-mailing them out please fix the > >> headers in

Re: max(), sum(), next()

2008-09-10 Thread Terry Reedy
Mensanator wrote: On Sep 10, 5:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: Sum(s) replaces reduce(lambda x,y: x+y, s, 0), which was thought to be the most common use of reduce. Sum(s,start) replaces the much less common reduce(lambda x,y: x+y, s, start). Reduce(S, s), where S = sum funct

Re: Clearing a session and reload() problem (with repro error)

2008-09-10 Thread Rafe
On Sep 10, 2:28 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 10 Sep 2008 00:56:43 -0300,Rafe<[EMAIL PROTECTED]> escribió: > > > > > On Sep 9, 11:03 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Mon, 08 Sep 2008 05:37:24 -0300,Rafe<[EMAIL PROTECTED]> escribió: > >> .

Re: Alternatives to traditional RDBMS

2008-09-10 Thread James Mills
On Thu, Sep 11, 2008 at 12:06 PM, alex23 <[EMAIL PROTECTED]> wrote: > "James Mills" <[EMAIL PROTECTED]> wrote: >> This is an ORM. They are >> off-topic for this thread :) > > Tsk, such an unfounded bias... To be honest. I have since now tried both ZODB and Durus and both seem really nice. I still

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread Mike Driscoll
On Sep 10, 4:34 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Sep 10, 3:53 pm, James A. Donald <[EMAIL PROTECTED]> wrote: > > > > > James A. Donald > > > > > Horrible installs are a chronic problem of GUI programs driven by > > > > interpreted languages  Installing visual basic programs that wo

Re: Gateway to python-list is generating bounce messages.

2008-09-10 Thread Grant Edwards
On 2008-09-10, Ben Finney <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: > >> Could whoever is responsible for the gateway that is grabbing >> my postings off of Usenet and e-mailing them out please fix the >> headers in the mail messages so that I don't get the bounce >> me

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread James A. Donald
James A. Donald > > > > Horrible installs are a chronic problem of GUI programs driven by > > > > interpreted languages  Installing visual basic programs that worked on > > > > one Windows machine to work on a very slightly different windows > > > > machine was also a nightmare. > > > > > > > > I h

Re: Logix - gone?

2008-09-10 Thread Stephen Johnson
U try the download link; it worked for me. Oops. You just found my daily stupid. However, I still wish the Trac link worked, and I would prefer the participation of the original dev to forking it. -Steve Johnson -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternatives to traditional RDBMS

2008-09-10 Thread alex23
"James Mills" <[EMAIL PROTECTED]> wrote: > This is an ORM. They are > off-topic for this thread :) Tsk, such an unfounded bias... I've had a lot of success using sqlalchemy + Elixir together ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Logix - gone?

2008-09-10 Thread John Machin
On Sep 11, 10:34 am, Stephen Johnson <[EMAIL PROTECTED]> wrote: > I found Logix (http://livelogix.net/logix/) while looking for   > something else and thought it looked like a very interesting project.   > Unfortunately, the blog, mailing list, and Trac links are broken, and   > the contact email a

Re: SSH using PEXPECT

2008-09-10 Thread Sean DiZazzo
On Sep 10, 6:04 pm, [EMAIL PROTECTED] wrote: > Hey , I need to SSH into a server .. (10.8.42.38) using pexpect the > username is 'admin' and password is 'abc123' so far i have the > following code > > import pexpect > import sys > import time > import os > > foo = pexpect.spawn('ssh [EMAIL PROTECTE

Re: Simple UDP server

2008-09-10 Thread James Mills
On Thu, Sep 11, 2008 at 10:36 AM, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > For UDP I wouldn't thread or, fork, I'd use select and run > asynchronously. > > http://docs.python.org/lib/module-select.html > > Actually if I really had to do this I'd use twisted. Right tool for > the job! For any

SSH using PEXPECT

2008-09-10 Thread yellowblueyellow
Hey , I need to SSH into a server .. (10.8.42.38) using pexpect the username is 'admin' and password is 'abc123' so far i have the following code import pexpect import sys import time import os foo = pexpect.spawn('ssh [EMAIL PROTECTED]') ssh_newKey = 'Are you sure you want to continue connecti

Re: Working with environment variables.

2008-09-10 Thread Christian Heimes
aditya shukla wrote: now this dosen't change the value of the variable which was set earlier .Please help me in fixing this issue. Are you trying to modify or add an environment var so the change is visible from the calling shell? That's not possible. You can't change the env var of a parent

Re: Reading binary data

2008-09-10 Thread Terry Reedy
Aaron Scott wrote: Taking everything into consideration, my code is now: import struct file = open("test.gde", "rb") signature = file.read(3) version, attr_count = struct.unpack('II', file.read(8)) print signature, version, attr_count for idx in xrange(attr_count): attr_id, attr_val_le

Working with environment variables.

2008-09-10 Thread aditya shukla
Hello folks, i am working with Python-2.5.2, fedora 9 sulphur I wanna change the value of environment variable , so if i open bash and type envvariable=value;export variable then this sets the envvariable equal to the value.Now i am writing a python script to set the value of this environment v

Re: Simple UDP server

2008-09-10 Thread Nick Craig-Wood
Tzury Bar Yochay <[EMAIL PROTECTED]> wrote: > I am looking for the right way to write a small and simple UDP server. > > I am wondering between Forking, Threading (found at SocketServer.py) > and the one describes at the snippet below. > > Can you tell me the advantages and disadvantages of e

Logix - gone?

2008-09-10 Thread Stephen Johnson
I found Logix (http://livelogix.net/logix/) while looking for something else and thought it looked like a very interesting project. Unfortunately, the blog, mailing list, and Trac links are broken, and the contact email address bounces. I am interested in playing with it and working on it i

Re: PLEASE HELP ME WITH THIS ASSIGNMENT...PLEASE....

2008-09-10 Thread Sean DiZazzo
On Sep 10, 3:33 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > I know I'm to late to ask you for helpbut please help me out..I > > am really new to unix and dont know how to finish this assignment on > > time.proff. said he will be using MOSS to detect whether I > > downloaded t

Re: max(), sum(), next()

2008-09-10 Thread Mensanator
On Sep 10, 5:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > Are there situations where the sum of an empty > > list should NOT be 0? Of course there are. > > Python Philosopy (my version, for this discussion): >    Make normal things easy; make unusual or difficult things pos

Re: Web shopping carts

2008-09-10 Thread david . lyon
Quoting Luke Hamilton <[EMAIL PROTECTED]>: I am wondering if there are any OS shopping cart application written in python? Hi Luke, I'm sure there are a few. But recently I have been asked by two customers to provide a solution. So I'm thinking about the same thing. Actually, I've

Re: emulating read and readline methods

2008-09-10 Thread John Machin
On Sep 11, 8:01 am, MRAB <[EMAIL PROTECTED]> wrote: > On Sep 10, 6:59 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > > > I have a large file that I would like to transform and then feed to a > > function (psycopg2 copy_from) that expects a file-like object (needs > > read and readline methods). > > >

Re: Gateway to python-list is generating bounce messages.

2008-09-10 Thread Ben Finney
Grant Edwards <[EMAIL PROTECTED]> writes: > Could whoever is responsible for the gateway that is grabbing > my postings off of Usenet and e-mailing them out please fix the > headers in the mail messages so that I don't get the bounce > messages? The bounce messages are sent to you because you s

Re: Reading binary data

2008-09-10 Thread John Machin
On Sep 11, 4:16 am, Aaron Scott <[EMAIL PROTECTED]> wrote: > Taking everything into consideration, my code is now: > > import struct > file = open("test.gde", "rb") > signature = file.read(3) > version, attr_count = struct.unpack('II', file.read(8)) > print signature, version, attr_count > for idx

Re: dynamic allocation file buffer

2008-09-10 Thread Paul Boddie
On Sep 10, 5:03 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > So at best (i.e. if it actually makes any sense; I didn't read it), > this is an ANNouncement of a pre-alpha piece of code. ANN posts rarely > attract replies, even when they are about production/stable software. To be fair, at least

Re: Persuading ConfigParser to give me the section elements in the same order as the file

2008-09-10 Thread Matimus
On Sep 10, 1:52 pm, geoffbache <[EMAIL PROTECTED]> wrote: > Hi all, > > I recently needed to parse a file that was perfect for ConfigParser > apart from one thing: the elements in the sections, although > definitions, could in some cases clash with each other and therefore > it was important to be

Re: Generator functions and user interfaces

2008-09-10 Thread Terry Reedy
[EMAIL PROTECTED] wrote: I'm trying to implement an interactive graph visualisation tool using matplotlib. I want to use a spring layout, where nodes repulse each other and edges act as springs to pull connected nodes together. Usually, this algorithm runs through a number of iterations of att

Re: emulating read and readline methods

2008-09-10 Thread MRAB
On Sep 10, 10:52 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Sean Davis schrieb: > > > > > I have a large file that I would like to transform and then feed to a > > function (psycopg2 copy_from) that expects a file-like object (needs > > read and readline methods). > > > I have a class like

Re: dict slice in python (translating perl to python)

2008-09-10 Thread Terry Reedy
hofer wrote: Let's take following perl code snippet: %myhash=( one => 1, two => 2, three => 3 ); ($v1,$v2,$v3) = @myhash{qw(one two two)}; # <-- line of interest print "$v1\n$v2\n$v2\n"; How do I translate the second line in a similiar compact way to python? Below is what I tried.

Re: max(), sum(), next()

2008-09-10 Thread Terry Reedy
Mensanator wrote: Are there situations where the sum of an empty list should NOT be 0? Of course there are. Python Philosopy (my version, for this discussion): Make normal things easy; make unusual or difficult things possible. Application: Sum([]) == 0 is normal (90+% of cases). Make t

Re: Wx Python - Code Structure & Event Handling

2008-09-10 Thread lee . walczak
Thanks for the feedback. It is greatly appreciated. Let me check out your references and see where they take me. Will post back and let you know how useful this was. thanks! Lee -- http://mail.python.org/mailman/listinfo/python-list

Re: PLEASE HELP ME WITH THIS ASSIGNMENT...PLEASE....

2008-09-10 Thread Daniel Fetchinson
> I know I'm to late to ask you for helpbut please help me out..I > am really new to unix and dont know how to finish this assignment on > time.proff. said he will be using MOSS to detect whether I > downloaded the code..please help me.. > > email me : [EMAIL PROTECTED] > > Assignment 1

Re: Can anyone suggest a good crypto package?

2008-09-10 Thread Ricardo Aráoz
Fett wrote: > On Sep 4, 2:23 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: >> On Sep 4, 1:39 pm, Fett <[EMAIL PROTECTED]> wrote: >> >> >> >>> I need a crypto package that works on windows with python 2.5. Can >>> anyone suggest one for me? >>> I have been searching for a couple days for a good crypt

Re: emulating read and readline methods

2008-09-10 Thread MRAB
On Sep 10, 6:59 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > I have a large file that I would like to transform and then feed to a > function (psycopg2 copy_from) that expects a file-like object (needs > read and readline methods). > > I have a class like so: > > class GeneInfo(): >     def __init__

Re: Simple UDP server

2008-09-10 Thread James Mills
Tzury, You may consider using pymills to simplify writing your UDP server and just concentrating on the behavior of the system. You can get a copy of the latest development branch by cloning it with Mercurial: hg clone http://hg.shortcircuit.net.au/pymills/ There is an example UDP Server in exa

Re: List of modules available for import inside Python?

2008-09-10 Thread Anita Kean
On 2008-09-10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > (snip) ... > > So to refine the question: >how can I list all modules that might be importable on my system, >without actually importing them all ? > > (How about a "pydoc2" that's well thought out, doesn't crash ... > let me ask

PLEASE HELP ME WITH THIS ASSIGNMENT...PLEASE....

2008-09-10 Thread Vaidehi Pawar
I know I'm to late to ask you for helpbut please help me out..I am really new to unix and dont know how to finish this assignment on time.proff. said he will be using MOSS to detect whether I downloaded the code..please help me.. email me : [EMAIL PROTECTED] Assignment 1 Processes, In

Re: emulating read and readline methods

2008-09-10 Thread Diez B. Roggisch
Sean Davis schrieb: I have a large file that I would like to transform and then feed to a function (psycopg2 copy_from) that expects a file-like object (needs read and readline methods). I have a class like so: class GeneInfo(): def __init__(self): #urllib.urlretrieve('ftp://ftp.ncb

handling uncaught exceptions with pdb?

2008-09-10 Thread Paul Rubin
I think I've asked about this before, but is there a way to set up Python to handle uncaught exceptions with pdb? I know about setting sys.except_hook to something that calls pdb, but this is normally done at the outer level of a program, and by the time that hook gets called, the exception has al

Re: Alternatives to traditional RDBMS

2008-09-10 Thread James Mills
On Thu, Sep 11, 2008 at 3:40 AM, Daniel Fetchinson <[EMAIL PROTECTED]> wrote: > There is also dejavu: http://www.aminus.net/dejavu This is an ORM. They are off-topic for this thread :) cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternatives to traditional RDBMS

2008-09-10 Thread James Mills
On Thu, Sep 11, 2008 at 12:51 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Looks as you didn't mention ZODB yet. > As it is actively developed, it is maybe something > you could consider. Problem with ZODB is that I find that anything that comes out of Zope to be far too complicated in design

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread Mike Driscoll
On Sep 10, 3:53 pm, James A. Donald <[EMAIL PROTECTED]> wrote: > James A. Donald > > > > Horrible installs are a chronic problem of GUI programs driven by > > > interpreted languages  Installing visual basic programs that worked on > > > one Windows machine to work on a very slightly different wind

Re: formating a filesystem with python

2008-09-10 Thread Diez B. Roggisch
Ricardo Tiago schrieb: I understand that this is a very sensible unix question but i think fuse does this at least it mounts. I was wondering if there were other packages with similar functionality. I don't know what fuse is. And *mounting* can be allowed to be made by users. and possibly ther

Re: formating a filesystem with python

2008-09-10 Thread Sean DiZazzo
On Sep 10, 1:57 pm, "Ricardo Tiago" <[EMAIL PROTECTED]> wrote: > Hi all, > > is there a package in python that allows to mount/umount and format > (to ext3) a filesystem? I know that this is possible by just calling > the os commands 'mount/umount and mkfs' but this would imply to have > to change

Re: formating a filesystem with python

2008-09-10 Thread Ricardo Tiago
I understand that this is a very sensible unix question but i think fuse does this at least it mounts. I was wondering if there were other packages with similar functionality. On Wed, Sep 10, 2008 at 11:14 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Ricardo Tiago schrieb: >> >> Hi all, >> >>

Re: formating a filesystem with python

2008-09-10 Thread Diez B. Roggisch
Ricardo Tiago schrieb: Hi all, is there a package in python that allows to mount/umount and format (to ext3) a filesystem? I know that this is possible by just calling the os commands 'mount/umount and mkfs' but this would imply to have to change sudoers to run the script as non-root. well, th

Re: Reading binary data

2008-09-10 Thread nntpman68
What I would do first is to print the result byte by byte each as hexadecimal number. If you can I would additionally populate the C-structure with numbers, which are easier to follow. Example: signature = "ABC" // same as 0x41 0x42 0x43 version = 0x61626364 attr_count = 0x65667678 . . . a

Re: Python and Open Office

2008-09-10 Thread Colin J. Williams
Marco Bizzarri wrote: On Wed, Sep 10, 2008 at 10:04 PM, Greg Lindstrom <[EMAIL PROTECTED]> wrote: Hello, I would like to create and manipulate Open Office documents using Python. I have found then UNO Python page and odfpy modules which seem to be exactly what I need. The odfpy manual is, to

Re: XML-RPC "filter"

2008-09-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: On 9 Set, 17:55, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: I would go for a slightly different approach: make your server have a dispatch-method that delegates the calls to the underlying actual implementation. But *before* that happens, extract the information as

formating a filesystem with python

2008-09-10 Thread Ricardo Tiago
Hi all, is there a package in python that allows to mount/umount and format (to ext3) a filesystem? I know that this is possible by just calling the os commands 'mount/umount and mkfs' but this would imply to have to change sudoers to run the script as non-root. Thanks Ric -- http://mail.python.o

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread James A. Donald
James A. Donald > > Horrible installs are a chronic problem of GUI programs driven by > > interpreted languages  Installing visual basic programs that worked on > > one Windows machine to work on a very slightly different windows > > machine was also a nightmare. > > > > I have not attempted to cre

Persuading ConfigParser to give me the section elements in the same order as the file

2008-09-10 Thread geoffbache
Hi all, I recently needed to parse a file that was perfect for ConfigParser apart from one thing: the elements in the sections, although definitions, could in some cases clash with each other and therefore it was important to be able to retrieve them in the same order as they appeared in the file.

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread Terry Reedy
process wrote: qsort can handle bigger lists it seems, making less recursive calls before finishing(quicksort blows the stack when sorting range(100,-1000,-1). qsort does more work though right? is there a way to speed up that? If you are worried about speed, these 'neat' functional definitio

Re: Python and Open Office

2008-09-10 Thread Marco Bizzarri
On Wed, Sep 10, 2008 at 10:04 PM, Greg Lindstrom <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to create and manipulate Open Office documents using Python. I > have found then UNO Python page and odfpy modules which seem to be exactly > what I need. The odfpy manual is, to me, a confusing

Python and Open Office

2008-09-10 Thread Greg Lindstrom
Hello, I would like to create and manipulate Open Office documents using Python. I have found then UNO Python page and odfpy modules which seem to be exactly what I need. The odfpy manual is, to me, a confusing list of objects and methods (it's an impressive list!), but does not have much in the

Re: Is there a SOAP module that can do this...?

2008-09-10 Thread Waldemar Osuch
On Sep 10, 1:23 pm, thebjorn <[EMAIL PROTECTED]> wrote: > I've been trying to use SOAPpy and ZSI (with and without the use of > wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic > server(?) in front of some enterprise java bean) and not having much > luck.  I got them to send m

tempfile module

2008-09-10 Thread aditya shukla
Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues homedir = os.path.expanduser('~')

Re: Simple UDP server

2008-09-10 Thread Tzury Bar Yochay
> Transmitting large binary data over UDP? That makes only sense for few > applications like video and audio streaming. UDP does neither guarantee > that your data is received nor it's received in order. For example the > packages A, B, C, D might be received as A, D, B (no C). > > Can your protoco

Re: Reading binary data

2008-09-10 Thread Aaron "Castironpi" Brady
On Sep 10, 1:12 pm, Aaron Scott <[EMAIL PROTECTED]> wrote: > Sorry, I had posted the wrong error. The error I am getting is: > >      struct.error: unpack requires a string argument of length 12 > > which doesn't make sense to me, since I'm specifically asking for 11. > Just for kicks, if I change

Is there a SOAP module that can do this...?

2008-09-10 Thread thebjorn
I've been trying to use SOAPpy and ZSI (with and without the use of wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic server(?) in front of some enterprise java bean) and not having much luck. I got them to send me an example of what the bytes on the wire are supposed to look

Re: Simple UDP server

2008-09-10 Thread Christian Heimes
Tzury Bar Yochay wrote: So what if it is connectionless. It would make sense if you get a load of users who sends large sets of binary data to each other. Transmitting large binary data over UDP? That makes only sense for few applications like video and audio streaming. UDP does neither guaran

Re: Generator functions and user interfaces

2008-09-10 Thread Aaron "Castironpi" Brady
On Sep 10, 10:35 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > I'm trying to implement an interactive graph visualisation tool using > > matplotlib. > > > I want to use a spring layout, where nodes repulse each other and > > edges act as springs to pull conn

Re: Reading binary data

2008-09-10 Thread Jon Clements
On Sep 10, 7:16 pm, Aaron Scott <[EMAIL PROTECTED]> wrote: > Taking everything into consideration, my code is now: > > import struct > file = open("test.gde", "rb") > signature = file.read(3) > version, attr_count = struct.unpack('II', file.read(8)) > print signature, version, attr_count > for idx

Re: dynamic allocation file buffer

2008-09-10 Thread Aaron "Castironpi" Brady
On Sep 9, 10:03 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 9, 5:59 pm, castironpi <[EMAIL PROTECTED]> wrote: > > > I will try my idea again.  I want to talk to people about a > > module I want to write and I will take the time to explain it. > > I think it's a "cool idea" that a lot of p

Re: Reading binary data

2008-09-10 Thread Roel Schroeven
Aaron Scott schreef: Sorry, I had posted the wrong error. The error I am getting is: struct.error: unpack requires a string argument of length 12 which doesn't make sense to me, since I'm specifically asking for 11. That's because of padding. According to the docs, "By default, C numbers

Re: Simple UDP server

2008-09-10 Thread Tzury Bar Yochay
On Sep 10, 9:55 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Tzury Bar Yochay wrote: > > Would the one below will be capable of holding 30 concurrent > > connections? > > UDP is a connectionless datagram protocol, so that question doesn't > really make much sense. > So what if it is connectionle

Re: dynamic allocation file buffer

2008-09-10 Thread Aaron "Castironpi" Brady
On Sep 10, 5:24 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 10 Sep 2008 09:26:20 +0200, Fredrik Lundh wrote: > > Steven D'Aprano wrote: > > >> You've created a solution to a problem which (probably) only affects a > >> very small number of people, at least judging by your use-cases. Wh

Re: PHP's str_replace ?

2008-09-10 Thread Grzegorz Staniak
On 10.09.2008, David Thole <[EMAIL PROTECTED]> wroted: >> >> new_str = re.sub('[aeiou]', '-', str) >> > Wow - this is neat. Thanks >> >> But probably slower and definitely harder to understand. For simple >> problems the str methods are usually faster than a regular expression. > > It's true that

Re: Simple UDP server

2008-09-10 Thread Fredrik Lundh
Tzury Bar Yochay wrote: Would the one below will be capable of holding 30 concurrent connections? UDP is a connectionless datagram protocol, so that question doesn't really make much sense. -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP's str_replace ?

2008-09-10 Thread David Thole
On Sep 10, 12:20 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Anjanesh Lekshminarayanan wrote: > >> import re > >> new_str = re.sub('[aeiou]', '-', str) > > Wow - this is neat. Thanks > > But probably slower and definitely harder to understand. For simple > problems the str methods are usually

PYTHON FOR THE MSP430 or DSP ?

2008-09-10 Thread Blubaugh, David A.
To All, I was wondering if anyone has ever worked on developing a project for Python, where the Python and Numpy script code could then be generated into either C or assembly source for the Texas Instruments MSP430 or related DSP microcontrollers? Such as quickly generating from python algorithm

Simple UDP server

2008-09-10 Thread Tzury Bar Yochay
I am looking for the right way to write a small and simple UDP server. I am wondering between Forking, Threading (found at SocketServer.py) and the one describes at the snippet below. Can you tell me the advantages and disadvantages of each Would the one below will be capable of holding 30 concur

Re: PyGUI as a standard GUI API for Python?

2008-09-10 Thread Fred Pacquier
Todd Whiteman <[EMAIL PROTECTED]> said : > Personally, I believe XULRunner has a lot to offer for Python GUI > development, I'm currently finishing up some documentation steps to show > off how to use it specifically for Python (I'll post it to this list > when it's finished). That would be re

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread Stef Mientki
Mike Driscoll wrote: On Sep 10, 6:48 am, James A. Donald <[EMAIL PROTECTED]> wrote: On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <[EMAIL PROTECTED]> wrote: Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw That did it. one more question... how do I

RE: removing text string

2008-09-10 Thread Adam Pletcher
You just want to drop the last two characters? Slice it. >>> s = "080829-7_A"[:-2] >>> print s 080829-7 - Adam > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Ahmed, Shakir > Sent: Wednesday, September 10, 2008 10:22 AM > To: python-list@python.

Re: subprocess.Popen hangs at times?

2008-09-10 Thread Christian Heimes
Kenneth McDonald wrote: When making calls of the form Popen(cmd, shell=True, stdout=subprocess.PIPE), we've been getting occasional, predictable hangs. Will Popen accumulate a certain amount of stdout and then block until its read? We don't want to use threads, so just want to read the entire

Re: Reading binary data

2008-09-10 Thread Aaron Scott
Taking everything into consideration, my code is now: import struct file = open("test.gde", "rb") signature = file.read(3) version, attr_count = struct.unpack('II', file.read(8)) print signature, version, attr_count for idx in xrange(attr_count): attr_id, attr_val_len = struct.unpack('II',

Re: NumPy arrays that use memory allocated from other libraries or tools

2008-09-10 Thread sturlamolden
On Sep 10, 6:39 am, Travis Oliphant <[EMAIL PROTECTED]> wrote: > I wanted to point anybody interested to a blog post that describes a > useful pattern for having a NumPy array that points to the memory > created by a different memory manager than the standard one used by > NumPy. Here is somethi

Re: subprocess.Popen hangs at times?

2008-09-10 Thread Fredrik Lundh
Kenneth McDonald wrote: When making calls of the form Popen(cmd, shell=True, stdout=subprocess.PIPE), we've been getting occasional, predictable hangs. Will Popen accumulate a certain amount of stdout and then block until its read? the pipe provided by the operating system has a limited buff

Re: removing text string

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 11:22:16 -0400, Ahmed, Shakir wrote: > I need to remove text string from the list of the numbers mentioned > below: > > 080829-7_A > 070529-5_c > 080824-7_O > 070405_6_p > > The output will be : 080829-7 > 070529-5 >080824-7 >

Re: Reading binary data

2008-09-10 Thread Aaron Scott
Sorry, I had posted the wrong error. The error I am getting is: struct.error: unpack requires a string argument of length 12 which doesn't make sense to me, since I'm specifically asking for 11. Just for kicks, if I change the line to print struct.unpack('3sII', file.read(12)) I get t

Re: md5 differences

2008-09-10 Thread Python
On 10 sep 2008, at 19:48, Grant Edwards wrote: On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: On Wed, 10 Sep 2008 12:39:24 -0500, Grant Edwards wrote: The strange thing is that md5.new("/Volumes/data/Arno/test.txt").hexdigest() returns '8dd66a1592e2a8c3ab160822fb237f4d' on my mac

Re: Reading binary data

2008-09-10 Thread Jon Clements
On Sep 10, 6:45 pm, Aaron Scott <[EMAIL PROTECTED]> wrote: > > CORRECTION: '3cII' should be '3sII'. > > Even with the correction, I'm still getting the error. Me being silly... Quick fix: signature = file.read(3) then the rest can stay the same, struct.calcsize('3sII') expects a 12 byte string, w

emulating read and readline methods

2008-09-10 Thread Sean Davis
I have a large file that I would like to transform and then feed to a function (psycopg2 copy_from) that expects a file-like object (needs read and readline methods). I have a class like so: class GeneInfo(): def __init__(self): #urllib.urlretrieve('ftp://ftp.ncbi.nih.gov/gene/DATA/ g

Re: Reading binary data

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 10:43:31 -0700 (PDT), Aaron Scott wrote: >> signature, version, attr_count = struct.unpack('3cII', >> yourfile.read(11)) >> > > This line is giving me an error: > > Traceback (most recent call last): > File "test.py", line 19, in > signature, version, attr_count = struct.

Gateway to python-list is generating bounce messages.

2008-09-10 Thread Grant Edwards
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages? While you're at it, might as well fix it for everybody else too. ;) Its a bit rude to send out mass

Re: md5 differences

2008-09-10 Thread Python
On 10 sep 2008, at 19:39, Grant Edwards wrote: On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: On Wed, 10 Sep 2008 19:12:28 +0200, Python wrote: [EMAIL PROTECTED]:~% echo "test" > test.txt [EMAIL PROTECTED]:~% md5 test.txt MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249 import

subprocess.Popen hangs at times?

2008-09-10 Thread Kenneth McDonald
When making calls of the form Popen(cmd, shell=True, stdout=subprocess.PIPE), we've been getting occasional, predictable hangs. Will Popen accumulate a certain amount of stdout and then block until its read? We don't want to use threads, so just want to read the entire stdout after the subp

removing text string

2008-09-10 Thread Ahmed, Shakir
I need to remove text string from the list of the numbers mentioned below: 080829-7_A 070529-5_c 080824-7_O 070405_6_p The output will be : 080829-7 070529-5 080824-7 070405-6 Any idea is

Re: max(), sum(), next()

2008-09-10 Thread Mensanator
On Sep 7, 3:38 pm, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > Quoting Mensanator <[EMAIL PROTECTED]>: > > > Actualy, I already get the behaviour I want. sum([1,None]) > > throws an exception. I don't see why sum([]) doesn't throw > > an exception also > > If you take a "start value" and add to i

Re: md5 differences

2008-09-10 Thread Grant Edwards
On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Wed, 10 Sep 2008 12:39:24 -0500, Grant Edwards wrote: > >>> The strange thing is that >> md5.new("/Volumes/data/Arno/test.txt").hexdigest() >>> returns '8dd66a1592e2a8c3ab160822fb237f4d' on my machine. >> >> Same here. > > I guess i

Re: Reading binary data

2008-09-10 Thread Aaron Scott
> CORRECTION: '3cII' should be '3sII'. Even with the correction, I'm still getting the error. -- http://mail.python.org/mailman/listinfo/python-list

Re: md5 differences

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 12:39:24 -0500, Grant Edwards wrote: >> The strange thing is that > md5.new("/Volumes/data/Arno/test.txt").hexdigest() >> returns '8dd66a1592e2a8c3ab160822fb237f4d' on my machine. > > Same here. I guess it will be the same for vast majority of us ;-) The question is why i

Re: Reading binary data

2008-09-10 Thread Aaron Scott
> signature, version, attr_count = struct.unpack('3cII', > yourfile.read(11)) > This line is giving me an error: Traceback (most recent call last): File "test.py", line 19, in signature, version, attr_count = struct.unpack('3cII', file.read(12)) ValueError: too many values to unpack -- htt

Re: Reading binary data

2008-09-10 Thread Jon Clements
On 10 Sep, 18:33, Jon Clements <[EMAIL PROTECTED]> wrote: > On 10 Sep, 18:14, Aaron Scott <[EMAIL PROTECTED]> wrote: > > > > > I've been trying to tackle this all morning, and so far I've been > > completely unsuccessful. I have a binary file that I have the > > structure to, and I'd like to read i

Re: Alternatives to traditional RDBMS

2008-09-10 Thread Daniel Fetchinson
>> Are there any known alternatives >> to the traditional RDBMS (MySQL, >> PostgreSQL, SQLite, Oracle, etc0 / >> >> I know of 3 written in Python: >> * buzhug >> * kirbybase >> * PyDbLite > > ZODB. Without any problems usable without ZOPE, clusterable, ACID-conform > and so forth. There is als

Re: md5 differences

2008-09-10 Thread Grant Edwards
On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Wed, 10 Sep 2008 19:12:28 +0200, Python wrote: >> [EMAIL PROTECTED]:~% echo "test" > test.txt >> >> [EMAIL PROTECTED]:~% md5 test.txt >> MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249 > >> >>> import md5 >> >>> md5.new("/Volumes/data/

  1   2   >