Seattle Python Interest Group (SeaPIG)

2006-09-15 Thread jamesthiele . usenet
Thursday, September 14th at 7:00 PM See www.seapig.org for more info. -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html

Re: Colorado Python seminar in November

2006-09-15 Thread wesley chun
in parallel to Mark's week-long Python seminar (Nov 6-10), we are offering an alternative session focusing only on advanced topics. it is 3-days long (Nov 8-10) and will be held in San Francisco. course description: http://roadkill.com/~wesc/cyberweb/pp2dsc.html general information:

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 14)

2006-09-15 Thread Jack Diederich
QOTW: Regexps are a brittle tool, best tolerated in small doses. - Tim Peters Simplicity is prerequisite for reliability - Edsger W. Dijkstra eval(repr(var)) sometimes works for serialization but don't count on it.

RELEASED: Mailman 2.1.9

2006-09-15 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the GNU Mailman development team, I'm please to announce Mailman 2.1.9. This is primarily a security and bug fix release and it is highly recommended that all sites upgrade to this version. Mailman 2.1.9 also contains support for

Re: Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-15 Thread John Machin
[EMAIL PROTECTED] wrote: The following program does not work if you uncomment #lis = [xmms2] + list(args) Evidently Python is opting for the nullary constructor list() as opposed to the other one which takes a sequence. But no newcomer would know this. Are you using the nullary

Re: [ANN] XPN 0.6.5 released

2006-09-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Nemesis wrote: Mentre io pensavo ad una intro simpatica Franz Steinhaeusler scriveva: There is no progress bar or other info, if I subscribe one list. There is a little in the lower left corner, but if a lot of headers and bodies are received, the program seems to

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

2006-09-15 Thread John Machin
Tempo wrote: Thanks for all of the help. It all has been very useful to an new python programmer. I agree that I should fix the error/bug instead of handeling it with a try/etc. However, I do not know why range(sh.nrows) never gets the right amount of rows right. For example, if the Excel

Re: Is there a way to find IP address?

2006-09-15 Thread Winfried Tilanus
On 09/15/2006 Lad wrote: How can be HTTP_X_FORWARDED_FOR easily spoofed? I thought that IP address is not possible change. Because it is a header that is added by the proxy. This header has (or should have) no role in the proces of relaying the request by the proxy. It is just politely added

Check if variable is an instance of a File object

2006-09-15 Thread sc_wizard29
Hi everyone, Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in file: ... What can I do to be sure that the input argument is

UDP packets to PC behind NAT

2006-09-15 Thread Janto Dreijer
This is probably more of a networking question than a Python one, but it would be nice to know if someone has done this with Python's socket module. And besides one usually gets more information from c.l.py than anywhere else :) I have a server with a static public IP and a client behind a NAT. I

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

2006-09-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], sc_wizard29 wrote: Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in file: ... What can I do to be

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

2006-09-15 Thread Calvin Spealman
On 15 Sep 2006 00:18:14 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in

Re: Looking for the Perfect Editor

2006-09-15 Thread Ramon Diaz-Uriarte
On 9/15/06, David J. Braden [EMAIL PROTECTED] wrote: Wildemar Wildenburger wrote: (...) jEdit is extensible though java, and with the jython plugin also through python. Thanks. That helps me get a sense of the landscape. As an emacs user, this is a clear plus for JEdit (and for vim, for

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

2006-09-15 Thread sc_wizard29
Marc 'BlackJack' Rintsch a ecrit : And what do you do if you check for `file` and it isn't such an instance? Raise an exception? A no, that's something you don't like. So what else? ;-) Well, I prefer the idea of raising my *own* exception to the idea of having an unknown behavior occur

Re: Outbound port on sockets

2006-09-15 Thread Diez B. Roggisch
Bryan Olson schrieb: Diez B. Roggisch wrote: bmearns schrieb: Is it possible to specify which port to use as the outbound port on a connection? [...] Specifically, I'm trying to write an FTP host, and I'm trying to implement the PORT command. AFAIK you neither can't do that nor need it.

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

2006-09-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: Marc 'BlackJack' Rintsch a ecrit : And what do you do if you check for `file` and it isn't such an instance? Raise an exception? A no, that's something you don't like. So what else? ;-) Well, I prefer the idea of raising my *own* exception to the idea of

add without carry

2006-09-15 Thread Hugh
I would like to perform an addition without carrying of two integers... I've got no idea how to do this in python, although I've been using it for web/cgi/db work for a few years now. Any help would be great. Hugh -- http://mail.python.org/mailman/listinfo/python-list

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

2006-09-15 Thread sc_wizard29
Thanks for your help peter ! -- http://mail.python.org/mailman/listinfo/python-list

Re: UDP packets to PC behind NAT

2006-09-15 Thread Christophe
Janto Dreijer a écrit : This is probably more of a networking question than a Python one, but it would be nice to know if someone has done this with Python's socket module. And besides one usually gets more information from c.l.py than anywhere else :) I have a server with a static public

Re: XPN 0.6.5 released

2006-09-15 Thread Nemesis
Marc 'BlackJack' Rintsch wrote: XPN is monothreaded, so when it is downloading the headers (it is a monolotic job) the progress bar can't be updated. Why? I guess there's a loop involved. Can't you update the GUI after each message? If you use the Donwload New Headers function XPN will

Re: RELEASED Python 2.5 (release candidate 2)

2006-09-15 Thread Ant
Georg Brandl wrote: Georg Brandl wrote: ... Please open a bug in the tracker at http://www.sf.net/projects/python. Wait, don't bother - just fixed it myself. Nice one, cheers! -- http://mail.python.org/mailman/listinfo/python-list

Re: add without carry

2006-09-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Hugh wrote: I would like to perform an addition without carrying of two integers... I've got no idea how to do this in python, although I've been using it for web/cgi/db work for a few years now. Your description is a bit vague. What is `without carrying`? Do you want

Re: add without carry

2006-09-15 Thread John Machin
Hugh wrote: I would like to perform an addition without carrying of two integers... I've got no idea how to do this in python, although I've been using it for web/cgi/db work for a few years now. In multiword addition in assembly language, one uses a normal ADD instruction on the

blt error using py2exe

2006-09-15 Thread Agathe Sørflaten
Title: Message Hello! I have problem ofusing a exe file (it did well to makethe exe filewith py2exe) with the bltto make gui programs with graphics with windows.It seems to work well on my computer, but when running the .exe file on another computer I got the message: Exception in Tkinter

Re: add without carry

2006-09-15 Thread Hugh
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 starting to work something out... I just wondered if there was a function in python math to do this automatically... Hugh --

Re: add without carry

2006-09-15 Thread MonkeeSage
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 def add(a, b, c=10): an = a + b if an = c: an -= c return an add(5, 7) # = 2 ? Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: add without carry

2006-09-15 Thread Bryan Olson
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 Are you looking for bitwise exclusive or? In Python it's the '^' operator. For example: print 5 ^ 7 -- --Bryan --

Re: add without carry

2006-09-15 Thread Hugh
Thankyou everyone this gives me something to work with. Hugh -- http://mail.python.org/mailman/listinfo/python-list

Re: add without carry

2006-09-15 Thread Hugh
Peter, That was what I was thinking along the lines of, It's been two years since I finished my CS degree and working in mechanical engineering means I've nearly forgotten it all! :( Thanks, I'll write a function in my app to handle this... Hugh (5 + 7) % 10 2 In this context '%' is

Re: [ANN] XPN 0.6.5 released

2006-09-15 Thread Franz Steinhaeusler
On Thu, 14 Sep 2006 19:36:01 GMT, Nemesis [EMAIL PROTECTED] wrote: Mentre io pensavo ad una intro simpatica Franz Steinhaeusler scriveva: XPN (X Python Newsreader) is a multi-platform newsreader with Unicode [...] Hello Nemesis, Hello Nemesis, that is a great program, thank you. Thanks.

Re: add without carry

2006-09-15 Thread Bruno Desthuilliers
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 starting to work something out... No need to think too long to come up with the most possibly QD solution: res

Re: Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-15 Thread metaperl
John Machin wrote: [EMAIL PROTECTED] wrote: The following program does not work if you uncomment #lis = [xmms2] + list(args) Evidently Python is opting for the nullary constructor list() as opposed to the other one which takes a sequence. But no newcomer would know this. Are

Python for science (was: Re: Looking for the Perfect Editor)

2006-09-15 Thread Wildemar Wildenburger
David J. Braden wrote: I've come to sense, in the last (many) threads and topics brought up that I have read in the last 3 weeks, that this NG attracts folks who are very much into the web-app interface potential and usefulness of Python, as you yourself seem to be (see following), and

Re: Looking for the Perfect Editor

2006-09-15 Thread Wildemar Wildenburger
Ramon Diaz-Uriarte wrote: - I was referring to executing arbitrary sections of a Python file in a Python interpreter in an integrated way. When I tried JEdit, I think that Jython was the way to go. (And I think this was also the case for a while, at least to judge from D. Metrz's review

Re: add without carry

2006-09-15 Thread Bryan Olson
Bruno Desthuilliers wrote: Bryan Olson 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 Are you looking for bitwise exclusive or? In Python it's the '^' operator. For example: print 5 ^ 7 10 ^ 21 31

Re: matplotlib

2006-09-15 Thread skip
diffuser This site and webpage in particular doesn't open. I tried that diffuser too before posting my question. Well, it is SourceForge. They are known for flakiness. Just keep trying. If you never fail to open the tutorial, drop me a note and I'll send you a copy. Skip --

Experienced UK based developer required

2006-09-15 Thread Dean Houghton
A software house based in Bristol, UK require an experienced developer to maintain and progress our Enterprise Management software suite. The suite is a group of applications used to monitor, manage and alert on all aspects of the enterprise infrastructure from the network to application

Re: add without carry

2006-09-15 Thread Jon Ribbens
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 starting to work something out... No need to think

Re: add without carry

2006-09-15 Thread Bruno Desthuilliers
Christophe wrote: Bruno Desthuilliers a écrit : Bryan Olson 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 Are you looking for bitwise exclusive or? In Python it's the '^' operator. For example: print 5 ^

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

2006-09-15 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: Hi everyone, Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in file: ... OT : this will shadow

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

2006-09-15 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: Marc 'BlackJack' Rintsch a ecrit : And what do you do if you check for `file` and it isn't such an instance? Raise an exception? A no, that's something you don't like. So what else? ;-) Well, I prefer the idea of raising my *own* exception to the idea of

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

2006-09-15 Thread Fuzzyman
[EMAIL PROTECTED] wrote: Hi everyone, Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in file: ... What can I do to be

Re: Tkinter on Python 2.4 on Mac OS X?

2006-09-15 Thread Bill Williams
In article [EMAIL PROTECTED], Ben Kovitz [EMAIL PROTECTED] wrote: Maybe this is a better question for me to ask: *How* did you get Python 2.4 running with Tkinter on OS X? Ben Kovitz Hi Ben I am by no means a Python expert, but finding my way slowly. There is a lot of documentation, but

Re: XPN 0.6.5 released

2006-09-15 Thread Nemesis
Franz Steinhaeusler wrote: A few other notes (or should I post into the feature requests on sourceforge?) To be honest I do not check sourceforge forums very often. If you want you can also send me an email (the email is written in the readme file). little point: I find it superfluos on the

Re: high level, fast XML package for Python?

2006-09-15 Thread Diez B. Roggisch
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 since I have to

Re: Looking for the Perfect Editor

2006-09-15 Thread Ramon Diaz-Uriarte
On 9/15/06, Wildemar Wildenburger [EMAIL PROTECTED] wrote: Ramon Diaz-Uriarte wrote: - I was referring to executing arbitrary sections of a Python file in a Python interpreter in an integrated way. When I tried JEdit, I think that Jython was the way to go. (And I think this was also the

Searching for patterns on the screen

2006-09-15 Thread Jerry Hill
Hello all, I have a piece of code I could use some help optimizing. What I'm attempting to do is periodically grab a screenshot, and search for 2D patterns of black pixels in it. I don't care about any color other than black. Here's some simple code that simulates my worst-case scenario,

Re: Threads and Progress Bar

2006-09-15 Thread Thomas Guettler
On Fri, 01 Sep 2006 21:43:46 +0530 Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: Hi, I have a small application, written in Python, that uses threads. The application uses function foo() to download files from the web. As it reads data from the web server, it runs a progress bar by calling

PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
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. Anyone figured this out? Thanks. --

Re: high level, fast XML package for Python?

2006-09-15 Thread Steven Bethard
Diez B. Roggisch wrote: 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

Re: UDP packets to PC behind NAT

2006-09-15 Thread Janto Dreijer
Awesome! I haven't tested it on the actual server but I think it works. Thanks! I prefer a TCP connection solution and will post one if it works. server.py from socket import * print listening UDPSock = socket(AF_INET, SOCK_DGRAM) UDPSock.bind((localhost, 1234)) # visibility to outside

Re: UDP packets to PC behind NAT

2006-09-15 Thread Grant Edwards
On 2006-09-15, Christophe [EMAIL PROTECTED] wrote: Initiate an UDP connection from the client to the server and have the server send back the UDP packets to the address you get in the recvfrom result. There's no such thing as a UDP connection, so I don't understand what you're suggesting. --

Re: UDP packets to PC behind NAT

2006-09-15 Thread Grant Edwards
On 2006-09-15, Janto Dreijer [EMAIL PROTECTED] wrote: I have a server with a static public IP and a client behind a NAT. I would like to send UDP packets from the server to the client. So what I need to do is open up a hole in the NAT and let the server know the target IP and port of the

Re: Outbound port on sockets

2006-09-15 Thread Grant Edwards
On 2006-09-15, Diez B. Roggisch [EMAIL PROTECTED] wrote: Is it possible to specify which port to use as the outbound port on a connection? [...] Specifically, I'm trying to write an FTP host, and I'm trying to implement the PORT command. AFAIK you neither can't do that nor need it.

Question about pipes/os.popen

2006-09-15 Thread Kevin Walzer
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. How does one read unbuffered output over a pipe

Re: urlopen() error

2006-09-15 Thread John Machin
Paul McNett wrote: Tempo wrote: Hello. I am getting an error and it has gotten me stuck. I think the best thing I can do is post my code and the error message and thank everybody in advanced for any help that you give this issue. Thank you. # Here's the code:

Re: UDP packets to PC behind NAT

2006-09-15 Thread Janto Dreijer
Oops. That second UDPSock = socket(...) in the server.py shouldn't be there. Janto Dreijer wrote: Awesome! I haven't tested it on the actual server but I think it works. Thanks! I prefer a TCP connection solution and will post one if it works. server.py from socket import * print

Re: add without carry

2006-09-15 Thread John Machin
Jason wrote: Jon Ribbens wrote: In article [EMAIL PROTECTED], Bruno Desthuilliers wrote: No need to think too long to come up with the most possibly QD solution: res = int(str(5 + 7)[-1]) Am I missing something subtle in the question or is there some reason that nobody has

Re: UDP packets to PC behind NAT

2006-09-15 Thread Janto Dreijer
Grant Edwards wrote: On 2006-09-15, Christophe [EMAIL PROTECTED] wrote: Initiate an UDP connection from the client to the server and have the server send back the UDP packets to the address you get in the recvfrom result. There's no such thing as a UDP connection, so I don't understand

Re: Searching for patterns on the screen

2006-09-15 Thread Paul McGuire
Jerry Hill [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I have a piece of code I could use some help optimizing. What I'm attempting to do is periodically grab a screenshot, and search for 2D patterns of black pixels in it. I don't care about any color other than

Re: UDP packets to PC behind NAT

2006-09-15 Thread Janto Dreijer
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 then send UDP to client over the same

Finding dynamic libraries

2006-09-15 Thread Bill Spotz
Hi, Is there a way to tell an executing python script where to look for dynamically-loaded libraries? My situation is that that I am developing python wrappers for a large software project. I create python wrappers with swig, and those extension modules link against dynamic libraries from

Re: Searching for patterns on the screen

2006-09-15 Thread John Machin
Paul McGuire wrote: Jerry Hill [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I have a piece of code I could use some help optimizing. What I'm attempting to do is periodically grab a screenshot, and search for 2D patterns of black pixels in it. I don't care

xmlrpc with Basic Auth

2006-09-15 Thread Milos Prudek
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 this possible in plain xmlrpclib, without

xmlrpc, extract data from http headers

2006-09-15 Thread Milos Prudek
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 HTTP headers from the HTTP

Re: high level, fast XML package for Python?

2006-09-15 Thread Gleb Rybkin
Okay, thanks! Steven Bethard wrote: Diez B. Roggisch wrote: 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

Re: Finding dynamic libraries

2006-09-15 Thread Robert Kern
Bill Spotz wrote: Hi, Is there a way to tell an executing python script where to look for dynamically-loaded libraries? My situation is that that I am developing python wrappers for a large software project. I create python wrappers with swig, and those extension modules link

Re: UDP packets to PC behind NAT

2006-09-15 Thread Jean-Paul Calderone
On 15 Sep 2006 00:32:49 -0700, Janto Dreijer [EMAIL PROTECTED] wrote: This is probably more of a networking question than a Python one, but it would be nice to know if someone has done this with Python's socket module. And besides one usually gets more information from c.l.py than anywhere else :)

fail to indent in inner loop

2006-09-15 Thread perltcl
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 lines are too much. (since it has history

Re: Outbound port on sockets

2006-09-15 Thread Sergei Organov
Grant Edwards [EMAIL PROTECTED] writes: On 2006-09-15, Diez B. Roggisch [EMAIL PROTECTED] wrote: Is it possible to specify which port to use as the outbound port on a connection? [...] Specifically, I'm trying to write an FTP host, and I'm trying to implement the PORT command. AFAIK

Re: fail to indent in inner loop

2006-09-15 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: 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 lines are too

Re: Searching for patterns on the screen

2006-09-15 Thread Jerry Hill
On 15 Sep 2006 08:16:41 -0700, John Machin [EMAIL PROTECTED] wrote: C:\junkpython -mtimeit -sBLACK=(0,0,0);rgb=(1,1,1) rgb==BLACK 100 loops, best of 3: 0.129 usec per loop C:\junkpython -mtimeit -srgb=(1,1,1) rgb==(0,0,0) 100 loops, best of 3: 0.127 usec per loop Surprisingly (to

Re: Searching for patterns on the screen

2006-09-15 Thread Claudio Grondi
Jerry Hill wrote: Hello all, I have a piece of code I could use some help optimizing. What I'm attempting to do is periodically grab a screenshot, and search for 2D patterns of black pixels in it. I don't care about any color other than black. Here's some simple code that simulates my

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Tim N. van der Leeuw
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.

Re: Searching for patterns on the screen

2006-09-15 Thread Filip Wasilewski
Jerry Hill wrote: Hello all, I have a piece of code I could use some help optimizing. What I'm attempting to do is periodically grab a screenshot, and search for 2D patterns of black pixels in it. I don't care about any color other than black. Here's some simple code that simulates my

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 it's something I

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 since I

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

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 (UDP

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: 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 code represents

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 say

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:

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

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 first

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

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 need to

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: 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 the network. This

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

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:

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 run across a situation

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: 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) Diez --

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' Rintsch --

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 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 = array.array('f', a) AFAIK d

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 then send UDP to

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: 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. How does one

  1   2   >