Re: storing pickles in sql data base

2007-07-11 Thread Marc 'BlackJack' Rintsch
On Wed, 11 Jul 2007 17:14:43 -0500, Chris Mellon wrote: > [pickle] > > Protocol 0 (the default) is a text protocol, it's safe to store in a > text field or write to a text file. It's not really a text protocol it's more a binary protocol that uses just the ASCII range of byte values. You have to

Re: path backslash escaping trouble

2007-07-11 Thread placid
On Jul 11, 10:37 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 09 Jul 2007 22:40:04 -0300, placid <[EMAIL PROTECTED]> escribió: > > > > > I have these files; which are Merge Request (ClearCase) files that are > > created by a Perl CGI script (being re-written in Python, as the HTML/

ANN: PyDSTool 0.85 released

2007-07-11 Thread Rob Clewley
We have released an update to the PyDSTool dynamical systems and modeling package at http://sourceforge.net/projects/pydstool. There are lots of minor improvements and fixes in this version, but a powerful new feature is the support for user-defined functions for continuation using PyCont. We hav

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-11 Thread Alex Martelli
Donn Cave <[EMAIL PROTECTED]> wrote: > I've wondered if programmers might differ a lot in how much they > dread errors, or how they react to different kinds of errors. That's quite possible. I'm reminded of a by-now commonplace theory, well summarized at

Re: Portable general timestamp format, not 2038-limited

2007-07-11 Thread Ilya Zakharevich
[A complimentary Cc of this posting was sent to Martin Gregorie <[EMAIL PROTECTED]>], who wrote in article <[EMAIL PROTECTED]>: > Ilya Zakharevich wrote: > > My point is that attributing something to SH due to it appearing in > > ABHoT is like attributing it to you since it was mentioned in your >

Re: bash-style pipes in python?

2007-07-11 Thread faulkner
On Jul 11, 8:56 pm, Dan Stromberg - Datallegro <[EMAIL PROTECTED]> wrote: > I'm constantly flipping back and forth between bash and python. > > Sometimes, I'll start a program in one, and end up recoding in the > other, or including a bunch of python inside my bash scripts, or snippets > of bash in

Re: bool behavior in Python 3000?

2007-07-11 Thread Paul Rubin
tah <[EMAIL PROTECTED]> writes: > This doesn't leave you with anything equivalent to 'not' however. Or > nothing consistent. Currently '~a' will complement a boolean array,: > > >>> ~a > array([False, True, True], dtype=bool) Can you use operator.not_(a) ? -- http://mail.python.org/mailman/lis

Re: Where does str class represent its data?

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 8:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 11, 4:21 pm, [EMAIL PROTECTED] wrote: > > > > > I'd like to implement a subclass of string that works like this: > > > >>>m = MyString('mail') > > >>>m == 'fail' > > True > > >>>m == 'mail' > > False > > >>>m in ['fail', ha

Re: Where does str class represent its data?

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 4:21 pm, [EMAIL PROTECTED] wrote: > I'd like to implement a subclass of string that works like this: > > >>>m = MyString('mail') > >>>m == 'fail' > True > >>>m == 'mail' > False > >>>m in ['fail', hail'] > > True > > My best attempt for something like this is: > > class MyString(str): >

Re: bool behavior in Python 3000?

2007-07-11 Thread tah
On Jul 11, 1:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Alan Isaac <[EMAIL PROTECTED]> wrote: > > Miles wrote: > > > What boolean operation does '-' represent? > > > Complementation. > > And as usual, a-b is to be interpreted as a+(-b). > > In which case the desired behavior is > > F

Re: Where does str class represent its data?

2007-07-11 Thread James Stroud
[EMAIL PROTECTED] wrote: > I'd like to implement a subclass of string that works like this: > > m = MyString('mail') m == 'fail' > > True > m == 'mail' > > False > m in ['fail', hail'] > > True > > My best attempt for something like this is: > > class MyString(str): > def

Re: lists and dictionaries

2007-07-11 Thread anethema
> li = [ {'index': 0, 'transport': 'udp', 'service_domain': > 'dp0.example.com'}, > {'index': 1, 'transport': 'udp', 'service_domain': > 'dp1.example.com'}, > {'index': 0, 'transport': 'tcp', 'service_domain': > 'dp0.example.com'}, > {'index': 1, 'transport': 'tcp', 'servi

Re: bool behavior in Python 3000?

2007-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2007 07:14:53 -0600, Steven Bethard wrote: > Steven D'Aprano wrote: >> On Tue, 10 Jul 2007 17:47:47 -0600, Steven Bethard wrote: >>> But I think all you're really saying is that newbies don't expect things >>> like +, -, *, etc. to work with bools at all. Which I agree is probably >

Re: Screen Scraping Question

2007-07-11 Thread Dan Stromberg - Datallegro
On Wed, 11 Jul 2007 12:45:21 +, jeffbg123 wrote: > Hey, > > I am trying to make a bot for a flash game using python. However I am > having some trouble with a screen scraping strategy. Is there an > accepted way to compare a full screenshot with the image that I want > to locate? It is a math

Re: bool behavior in Python 3000?

2007-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2007 00:37:38 -0700, Rob Wolfe wrote: > > Steven D'Aprano wrote: > >> From a purely functional perspective, bools are unnecessary in Python. I >> think of True and False as syntactic sugar. But they shouldn't be >> syntactic sugar for 1 and 0 any more than they should be syntactic

Re: asyncore and OOB data

2007-07-11 Thread billiejoex
Douglas Wells wrote: > Second, when I look at the FTP specification, I don't find the > concept of OOB anywhere. So, it's not clear what OOB data would > mean in terms of the defined FTP commands in any case. Steve Holde wrote: > You are correct, however, in stating that the FTP > protocol does

Re: asyncore and OOB data

2007-07-11 Thread Steve Holden
Douglas Wells wrote: > In article <[EMAIL PROTECTED]>, > billiejoex <[EMAIL PROTECTED]> writes: >> In an asyncore based FTP server I wrote I should be able to receive >> OOB data from clients. >> A client sending such kind of data should act like this: >> > import socket > s = socket.socke

Re: bool behavior in Python 3000?

2007-07-11 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > | I think that the assignability to the names 'True' and 'False' is > > | incorrect, or at the very least subject to all sorts of odd results. > > It is necessary for 2.x to not break older code. I believe they > > will somehow be reserved, like None, i

Re: bool behavior in Python 3000?

2007-07-11 Thread Terry Reedy
In reply to various current discussants: there was a long discussion here (clp) of similar points of view when bool was introduced. In Guido's opinion (and mine, but his counts 100x), the positive benefits of the current implementation are greater than the net positive benefits of a 'pure' typ

Re: bool behavior in Python 3000?

2007-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2007 08:04:33 +0200, Stargaming wrote: > No, I think Bjoern just wanted to point out that all those binary > boolean operators already work *perfectly*. You just have to emphasize > that you're doing boolean algebra there, using `bool()`. > "Explicit is better than implicit." S

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Terry Reedy
"Evan Klitzke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On 7/11/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: | > Just for curiosity: This helps to find the answer to the problem "Which is | > the largest number that can be written with only 3 digits?" | > Some people sto

Re: bool behavior in Python 3000?

2007-07-11 Thread Steve Holden
Terry Reedy wrote: > "Ed Leafe" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | I think that the assignability to the names 'True' and 'False' is > | incorrect, or at the very least subject to all sorts of odd results. > > It is necessary for 2.x to not break older code. I beli

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-11 Thread Steve Holden
Donn Cave wrote: > In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: > >> Paul Rubin wrote: >>> Steven D'Aprano <[EMAIL PROTECTED]> writes: As far as I can see, the only difference is that the list comp variable isn't explicitly created with a statement of the fo

RE: S2K DTS and Python

2007-07-11 Thread Phil Runciman
-Original Message- From: stefaan [mailto:[EMAIL PROTECTED] Sent: Wednesday, 11 July 2007 6:47 a.m. To: python-list@python.org Subject: Re: S2K DTS and Python > > However, I now want to update some tables in MSAccess, and it occurred >

Re: socket programming related.

2007-07-11 Thread Simon Percivall
On Jul 12, 2:35 am, [EMAIL PROTECTED] wrote: > On Jul 11, 7:32 pm, [EMAIL PROTECTED] wrote: > > > I have just started working in network programming using python. > > written code for socket connection between client and server. Client > > sent data to server for server processing (also server echo

Re: Best architecture for proxy?

2007-07-11 Thread Steve Holden
Andrew Warkentin wrote: > On Jul 10, 8:19 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> Bjoern Schliessmann wrote: >>> Andrew Warkentin wrote: I am going to write a general-purpose modular proxy in Python. It will consist of a simple core and several modules for things like filterin

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
Nick Craig-Wood wrote: > The problem you are having is you are letting Popen do half the job > and doing the other half yourself. Except that I never wanted Popen to do any thread management for me to begin with. Popen class has advertised itself as a replacement for os.popen, popen2, popen4, an

bash-style pipes in python?

2007-07-11 Thread Dan Stromberg - Datallegro
I'm constantly flipping back and forth between bash and python. Sometimes, I'll start a program in one, and end up recoding in the other, or including a bunch of python inside my bash scripts, or snippets of bash in my python. But what if python had more of the power of bash-style pipes? I migh

socket programming related.

2007-07-11 Thread hari . siri74
I have just started working in network programming using python. written code for socket connection between client and server. Client sent data to server for server processing (also server echoing back rcvd data to client). When there is ("if no data": break ) no data from client then the while loo

Re: socket programming related.

2007-07-11 Thread hari . siri74
On Jul 11, 7:32 pm, [EMAIL PROTECTED] wrote: > I have just started working in network programming using python. > written code for socket connection between client and server. Client > sent data to server for server processing (also server echoing back > rcvd data to client). When there is ("if no

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Evan Klitzke
On 7/11/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 11 Jul 2007 16:39:17 -0300, Paul McGuire <[EMAIL PROTECTED]> > escribió: > > > As was > > pointed out earlier, left-associativity with exponentiation is of > > little value, since (2**3)**2 is the same as 2**(3*2) or 2**6=64. > > Ju

Re: binascii.unhexlify ... not clear about usage, and output

2007-07-11 Thread Gabriel Genellina
En Wed, 11 Jul 2007 17:34:04 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > If only there was a built-in base 2 conversion. No builtin, but you can find uncountable versions if you search this group, or the Python cookbook, or the entire web... -- Gabriel Genellina -- http://mai

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Gabriel Genellina
En Wed, 11 Jul 2007 16:39:17 -0300, Paul McGuire <[EMAIL PROTECTED]> escribió: > As was > pointed out earlier, left-associativity with exponentiation is of > little value, since (2**3)**2 is the same as 2**(3*2) or 2**6=64. Just for curiosity: This helps to find the answer to the problem "Which

Re: Portable general timestamp format, not 2038-limited

2007-07-11 Thread Martin Gregorie
Ilya Zakharevich wrote: > My point is that attributing something to SH due to it appearing in > ABHoT is like attributing it to you since it was mentioned in your > post... > OK, so who should it be attributed to? -- martin@ | Martin Gregorie gregorie. | Essex, UK org | -- http://mail.p

Re: Portable general timestamp format, not 2038-limited

2007-07-11 Thread Michael Angelo Ravera
On Jun 22, 1:33 pm, James Harris <[EMAIL PROTECTED]> wrote: > I have a requirement to store timestamps in a database. Simple enough > you might think but finding a suitably general format is not easy. The > specifics are > > 1) subsecond resolution - milliseconds or, preferably, more detailed > 2)

testing scapy installation

2007-07-11 Thread bparkis
I have an installation of scapy on OS X (via macports) and I am trying to determine if it was successful or not. Nothing I do on the network seems to work completely, but on the other hand the installation didn't seem to have run into any trouble so I want to be sure. What test can I do to determ

Re: Where does str class represent its data?

2007-07-11 Thread Miles
On Jul 11, 7:21 pm, [EMAIL PROTECTED] wrote: > I'd like to implement a subclass of string that works like this: > > >>>m = MyString('mail') > >>>m == 'fail' > True > >>>m == 'mail' > False > >>>m in ['fail', hail'] > > True > > My best attempt for something like this is: > > class MyString(str): >

interactive graphical script builder

2007-07-11 Thread nik
Hi, I am looking for an interactive graphical script builder for python. Basically, something like the os X automator. I have made a group of methods that some non-programmers need to combine into a script. I don't need a python IDE necessarially, but more of a sequence builder. I am imagining a t

Re: atexit, sys.exit, sys.exitfunc, reaching end of source code

2007-07-11 Thread Wojciech Muła
[EMAIL PROTECTED] wrote: > I am playing with the atexit module but I don't find a way to see the > difference > between a script calling sys.exit() and the interpreting > arriving at the end > of the source code file. This has a semantic difference for my > applications. > Is there a way to determi

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-11 Thread John Nagle
Donn Cave wrote: > I've wondered if programmers might differ a lot in how much they > dread errors, or how they react to different kinds of errors. > For example, do you feel a pang of remorse when your program > dies with a traceback - I mean, what a horrible way to die? > Do you resent the compil

Where does str class represent its data?

2007-07-11 Thread ChrisEdgemon
I'd like to implement a subclass of string that works like this: >>>m = MyString('mail') >>>m == 'fail' True >>>m == 'mail' False >>>m in ['fail', hail'] True My best attempt for something like this is: class MyString(str): def __init__(self, seq): if self == self.clean(seq): pass else

www.OutpatientSurgicare.com/video/

2007-07-11 Thread dvd_km
www.OutpatientSurgicare.com/video/ Outpatient Doctors Surgery Center is committed to offering the healthcare the community needs. We offer patients a meaningful alternative to traditional surgery. This state-of-the-art outpatient surgery center, located in the heart of Orange County, at 10900 Warne

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-11 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> As far as I can see, the only difference is that the list comp variable > >> isn't explicitly created with a statement of the form "name = value". Why >

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-11 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > I don't think it's the syntax that keeps people from checking for > errors. It's more a difference of error handling philosophy - in > Python, if you can't do something sensible with an error you just > pretend it can't

Re: highly einteractive editor for python

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 9, 5:14 pm, "Atul Bhingarde" <[EMAIL PROTECTED]> wrote: > Does anybody know an editor that facilitates, interactive python > development. Where GUI etc developed will be possible to see in real time > mode. > > Thanks > > Atul Have a look at UliPad: http://wiki.woodpecker.org.cn/moin/UliPad

Accessing OpenLink ODBC driver

2007-07-11 Thread Mariano Mara
Hi everyone. I have a Windows 2000 server with an OpenLink ODBC client installed which we use to connect to an Informix database. I'm not allowed to access to informix directly so I would like to write an script to retrieve some info using the mentioned driver. As far as I can tell, there's an o

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Paul McGuire
On Jul 11, 3:53 pm, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 7/11/07, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > On Jul 11, 12:04 pm, David Jones <[EMAIL PROTECTED]> wrote: > > > > In fact, if I put (2**2)**2**2**2 > > > > it comes up with the correct answer, 4294967296 > > > > Actually, t

Re: Phoenix-iTorrent: iTunes Bit Torrent client v 0.3 release

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 10, 1:50 pm, "Danyelle Gragsone" <[EMAIL PROTECTED]> wrote: > How is this related to python? Hi Danyelle, Phoenix-iTorrent, as well as its Bit Torrent underpinnings, is written completely in python. Both projects use py2exe and py2app to create native binaries for the Windows and Mac OS X

Re: Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-11 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: [...] > Are the docs themselves in subversion? I suppose I should also update > the doc at http://docs.python.org/lib/module-urllib2.html Yep: http://svn.python.org/projects/python/trunk/Doc/lib/liburllib2.tex John -- http://mail.python.org/mail

atexit, sys.exit, sys.exitfunc, reaching end of source code

2007-07-11 Thread [EMAIL PROTECTED]
Hi, I am playing with the atexit module but I don't find a way to see the difference between a script calling sys.exit() and the interpreting arriving at the end of the source code file. This has a semantic difference for my applications. Is there a way to determine in an exithandler (that is regi

Re: Problem with Python's "robots.txt" file parser in module robotparser

2007-07-11 Thread John Nagle
Nikita the Spider wrote: > > Hi John, > Are you sure you're not confusing your sites? The robots.txt file at > www.ibm.com contains the double slashed path. The robots.txt file at > ibm.com is different and contains this which would explain why you > think all URLs are denied: > User-agent: *

Re: stripping the first byte from a binary file

2007-07-11 Thread Alex Popescu
On Jul 11, 7:45 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Alex Popescu wrote: > > On Jul 11, 4:15 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> > Forgive my newbie ignorance, but I am wondering why the other method > >> > would not work? I mean it may not be very safe, > >> > but

Re: storing pickles in sql data base

2007-07-11 Thread Chris Mellon
On 7/11/07, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > David Bear <[EMAIL PROTECTED]> wrote: > > I need to store pickled objects in postgresql. I reading through the pickle > > docs it says to always open a file in binary mode because you can't be sure > > if the pickled data is binary or text

RE: Time A Script

2007-07-11 Thread Adam Pletcher
Try: --- import time start_time = time.time() run_time = time.time() - start_time print 'Run time: %f seconds' % run_time --- Also have a look at the timeit module for more timing functionality. - Adam From: [EMAIL PROTECTED] [mailto:[EMAIL PROT

Re: Portable general timestamp format, not 2038-limited

2007-07-11 Thread Ilya Zakharevich
[A complimentary Cc of this posting was sent to Martin Gregorie <[EMAIL PROTECTED]>], who wrote in article <[EMAIL PROTECTED]>: > >> Its in "A Short History of Time". Sorry I can't quote chapter or page, > >> but a friend borrowed my copy and lent me Dawkins "Climbing Mount > >> Improbable" befo

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Paul Rubin
"Evan Klitzke" <[EMAIL PROTECTED]> writes: > Python happens to choose right > associativity for exponentiation because it is more useful for that > operator, but that doesn't make the language itself right associative. I would say Python uses right associativity for exponentiation because that's s

Re: win32com ppt embedded object - SOLVED

2007-07-11 Thread Lance Hoffmeyer
Basically, if I ran (after discovering what the object name I was trying to modify in the ppt slide was): if WB.Slides(29).Shapes("Object 2").Type==7: PWB = WB.Slides(29).Shapes("Object 2") #Select the Graph Object oGraph = PWB.OLEFormat.Object

Direct Client - Sr.Soft Engineer-Python and Linux

2007-07-11 Thread Kan
Hello, We have requirement for Sr.Software Engineer in San Jose CA with very strong experinece in PYTHON AND LINUX . If your skills and experience matches with the same, send me your resume asap with contact # and rate. Locals only pls apply The details of the openings are:- Strong in Python an

Direct Client - Sr.Soft Engineer-Python and Linux

2007-07-11 Thread Kan
Hello, We have requirement for Sr.Software Engineer in San Jose CA with very strong experinece in PYTHON AND LINUX . If your skills and experience matches with the same, send me your resume asap with contact # and rate. Locals only pls apply The details of the openings are:- Strong in Python an

Re: pattern match !

2007-07-11 Thread Jay Loden
Helmut Jarausch wrote: > [EMAIL PROTECTED] wrote: >> Extract the application name with version from an RPM string like >> hpsmh-1.1.1.2-0-RHEL3-Linux.RPM, i require to extract hpsmh-1.1.1.2-0 >> from above string. Sometimes the RPM string may be hpsmh-1.1.1.2-RHEL3- >> Linux.RPM. >> > > Have a tr

Re: Encode Bytes

2007-07-11 Thread John Machin
On Jul 12, 4:40 am, "albert_k_arhin" <[EMAIL PROTECTED]> wrote: > Hi All, > I am new to python and I am using a strip down version of > python that does not support struc,pack,etc. > > I have a binary protocol that is define as follows: > > PARTOffSet Lenght > ==

Re: asyncore and OOB data

2007-07-11 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, billiejoex <[EMAIL PROTECTED]> writes: > In an asyncore based FTP server I wrote I should be able to receive > OOB data from clients. > A client sending such kind of data should act like this: > > >>> import socket > >>> s = socket.socket(socket.AF_INET, socket.SOC

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Evan Klitzke
On 7/11/07, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 11, 12:04 pm, David Jones <[EMAIL PROTECTED]> wrote: > > > In fact, if I put (2**2)**2**2**2 > > > it comes up with the correct answer, 4294967296 > > > > Actually, the "correct" answer (even by your own demonstration) is > > 65536. > > I

Re: bool behavior in Python 3000?

2007-07-11 Thread Terry Reedy
"Ed Leafe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I think that the assignability to the names 'True' and 'False' is | incorrect, or at the very least subject to all sorts of odd results. It is necessary for 2.x to not break older code. I believe they will somehow be rese

RE: S2K DTS and Python

2007-07-11 Thread Phil Runciman
-Original Message- From: stefaan [mailto:[EMAIL PROTECTED] Sent: Wednesday, 11 July 2007 6:47 a.m. To: python-list@python.org Subject: Re: S2K DTS and Python > > However, I now want to update some tables in MSAccess, and it occurred

RE: S2K DTS and Python

2007-07-11 Thread Phil Runciman
-Original Message- From: Tim Golden [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 July 2007 7:58 p.m. Cc: python-list@python.org Subject: Re: S2K DTS and Python Phil Runciman wrote: > I am a Python newbie so please be gentle on me. Tim G

C Python Network Performance

2007-07-11 Thread GM M
Hello, I am writing an application bulk of which is sending and receving UDP data. I was evaluating which language will be a better fit for the job. I wrote following small pieces of code in Python and C respectively: from socket import * import sys if __name__ == '__main__': s = socket(AF

Re: Problem with Python's "robots.txt" file parser in module robotparser

2007-07-11 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: >Python's "robots.txt" file parser may be misinterpreting a > special case. Given a robots.txt file like this: > > User-agent: * > Disallow: // > Disallow: /account/registration > Disallow: /accoun

Re: binascii.unhexlify ... not clear about usage, and output

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 1:38 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 11 Jul 2007 10:46:23 -0700, [EMAIL PROTECTED] wrote: > > You can with gmpy: > > import gmpy > x = 0x0164 > s = gmpy.digits(x,2) # convert to base 2 > y = '0'*(16-len(s)) + s # pad to 16 bits

Re: storing pickles in sql data base

2007-07-11 Thread Nick Craig-Wood
David Bear <[EMAIL PROTECTED]> wrote: > I need to store pickled objects in postgresql. I reading through the pickle > docs it says to always open a file in binary mode because you can't be sure > if the pickled data is binary or text. So I have 2 question. Can I set the > pickle to be text -- a

Re: bool behavior in Python 3000?

2007-07-11 Thread Nick Craig-Wood
Alan Isaac <[EMAIL PROTECTED]> wrote: > Miles wrote: > > What boolean operation does '-' represent? > > Complementation. > And as usual, a-b is to be interpreted as a+(-b). > In which case the desired behavior is > False-True = False+(-True)=False+False = False If you want to do algebra wit

Re: os.wait() losing child?

2007-07-11 Thread Nick Craig-Wood
Jason Zheng <[EMAIL PROTECTED]> wrote: > greg wrote: > > Jason Zheng wrote: > >> Hate to reply to my own thread, but this is the working program that > >> can demonstrate what I posted earlier: > > > > I've figured out what's going on. The Popen class has a > > __del__ method which does a non-bl

Re: ImportError: MemoryLoadLibrary failed loading

2007-07-11 Thread kyosohma
On Jul 9, 12:47 pm, [EMAIL PROTECTED] wrote: > Hi, > > Recently I began my journey into creating executables. I am using > Andrea > Gavana's cool GUI2EXE program which works very well and that is a GUI > for > py2ece. I am also using Inno Setup to create a script/executable. > Anyway, > today I am

Re: lists and dictionaries

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 12:08 pm, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I have a list of dictionaries. > e.g. > [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'}, > {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'}, > {'index': 0, 'transport': 'tcp', 'service

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread Paul McGuire
On Jul 11, 12:04 pm, David Jones <[EMAIL PROTECTED]> wrote: > > In fact, if I put (2**2)**2**2**2 > > it comes up with the correct answer, 4294967296 > > Actually, the "correct" answer (even by your own demonstration) is > 65536. It might be easier to demonstrate if we chose a less homogeneous pro

lists and dictionaries

2007-07-11 Thread Ladislav Andel
Hi, I have a list of dictionaries. e.g. [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'}, {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'}, {'index': 0, 'transport': 'tcp', 'service_domain': 'dp0.example.com'}, {'index': 1, 'transport': 'tcp', 'service_dom

Re: Tuple vs List: Whats the difference?

2007-07-11 Thread Shafik
On Jul 11, 12:05 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > Shafik <[EMAIL PROTECTED]> writes: > > Hello folks, > > > I am an experienced programmer, but very new to python (2 days). I > > wanted to ask: what exactly is the difference between a tuple and a > > list? I'm sure there are some

Re: Tuple vs List: Whats the difference?

2007-07-11 Thread Alexander Schmolck
Shafik <[EMAIL PROTECTED]> writes: > Hello folks, > > I am an experienced programmer, but very new to python (2 days). I > wanted to ask: what exactly is the difference between a tuple and a > list? I'm sure there are some, but I can't seem to find a situation > where I can use one but not the oth

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
Matthew Woodcraft wrote: > greg <[EMAIL PROTECTED]> wrote: >> I've figured out what's going on. The Popen class has a >> __del__ method which does a non-blocking wait of its own. >> So you need to keep the Popen instance for each subprocess >> alive until your wait call has cleaned it up. > > I d

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
greg wrote: > Jason Zheng wrote: >> Hate to reply to my own thread, but this is the working program that >> can demonstrate what I posted earlier: > > I've figured out what's going on. The Popen class has a > __del__ method which does a non-blocking wait of its own. > So you need to keep the Pope

Encode Bytes

2007-07-11 Thread albert_k_arhin
Hi All, I am new to python and I am using a strip down version of python that does not support struc,pack,etc. I have a binary protocol that is define as follows: PARTOffSet Lenght ID 02 VER 21 CMD 3

Re: binascii.unhexlify ... not clear about usage, and output

2007-07-11 Thread Marc 'BlackJack' Rintsch
On Wed, 11 Jul 2007 10:46:23 -0700, [EMAIL PROTECTED] wrote: > You can with gmpy: > import gmpy x = 0x0164 s = gmpy.digits(x,2) # convert to base 2 y = '0'*(16-len(s)) + s # pad to 16 bits y > '000101100100' For the padding I'd use the `zfill()` method. In [1

Re: os.wait() losing child?

2007-07-11 Thread Matthew Woodcraft
greg <[EMAIL PROTECTED]> wrote: > I've figured out what's going on. The Popen class has a > __del__ method which does a non-blocking wait of its own. > So you need to keep the Popen instance for each subprocess > alive until your wait call has cleaned it up. I don't think this will be enough for

Re: Tuple vs List: Whats the difference?

2007-07-11 Thread Joe Riopel
On 7/11/07, Shafik <[EMAIL PROTECTED]> wrote: > I am an experienced programmer, but very new to python (2 days). I > wanted to ask: what exactly is the difference between a tuple and a > list? I'm sure there are some, but I can't seem to find a situation > where I can use one but not the other. Th

Tuple vs List: Whats the difference?

2007-07-11 Thread Shafik
Hello folks, I am an experienced programmer, but very new to python (2 days). I wanted to ask: what exactly is the difference between a tuple and a list? I'm sure there are some, but I can't seem to find a situation where I can use one but not the other. Thanks in advance, --Shafik -- http://ma

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
Greg, That explains it! Thanks a lot for your help. I guess this is something they do to prevent zombie threads? ~Jason greg wrote: > Jason Zheng wrote: >> Hate to reply to my own thread, but this is the working program that >> can demonstrate what I posted earlier: > > I've figured out what'

Re: bool behavior in Python 3000?

2007-07-11 Thread Ed Leafe
On Jul 11, 2007, at 2:04 AM, Stargaming wrote: > No, I think Bjoern just wanted to point out that all those binary > boolean operators already work *perfectly*. You just have to emphasize > that you're doing boolean algebra there, using `bool()`. > "Explicit is better than implicit." I th

Re: asyncore and OOB data

2007-07-11 Thread billiejoex
If it could be useful I attach the complete server application I used for doing tests: < code > import asyncore, asynchat, socket, os class Handler(asynchat.async_chat): def __init__(self, sock_obj): asynchat.async_chat.__init__(self, conn=sock_obj) self.remote_ip, self.remo

Re: binascii.unhexlify ... not clear about usage, and output

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 3:21 am, Vishal <[EMAIL PROTECTED]> wrote: > On May 30, 1:31 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > > > > Vishal wrote: > > > I have a file with a long list of hex characters, and I want to get a > > > file with corresponding binary characters > > > > here's what I did: > > >

Re: condor_compiled python interpreter

2007-07-11 Thread Will Maier
On Wed, Jul 11, 2007 at 10:28:52AM -0700, Thomas Nelson wrote: > Does anyone know where I could find help on condor_compiling a > python interpreter? My own attempts have failed, and I can't find > anything on google. This is probably more condor-related than Python-related, but are you building

condor_compiled python interpreter

2007-07-11 Thread Thomas Nelson
Does anyone know where I could find help on condor_compiling a python interpreter? My own attempts have failed, and I can't find anything on google. Here's the condor page: http://www.cs.wisc.edu/condor/ Thanks, Tom -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding Matplotlib in wxpython wx.Panel problem

2007-07-11 Thread kyosohma
On Jul 10, 2:09 pm, abakshi11 <[EMAIL PROTECTED]> wrote: > I was wondering if you ever got to create a small GUI program that did plots > using Matplotlib > I am gettin an error where its saying "WXagg's accelerator requires the > wxPython headers-the wxpython header files can not be located in any

Re: 2**2**2**2**2 wrong? Bug?

2007-07-11 Thread David Jones
On Jul 10, 12:47 am, "Jim Langston" <[EMAIL PROTECTED]> wrote: > "Paul Rubin" wrote in message > > news:[EMAIL PROTECTED] > > > "Jim Langston" <[EMAIL PROTECTED]> writes: > >> In Python 2.5 on intel, the statement > >> 2**2**2**2**2 > >> evaluates to > >> >>> 2**2**2**2**

Re: Simple search and Display system, no need for db?

2007-07-11 Thread Marc 'BlackJack' Rintsch
On Wed, 11 Jul 2007 16:52:32 +, flit wrote: > That seems to be a good idea, but I am afraid the web hosting does not > have the csv modules.. The `csv` module is part of the standard library. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

asyncore and OOB data

2007-07-11 Thread billiejoex
Hi there, In an asyncore based FTP server I wrote I should be able to receive OOB data from clients. A client sending such kind of data should act like this: >>> import socket >>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >>> s.connect(('127.0.0.1', 21)) >>> s.sendall('hello there\r\n'

Re: Simple search and Display system, no need for db?

2007-07-11 Thread flit
On Jul 11, 3:06 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > If the data is not too large, simple text files would do. Maybe in CSV > format. Either with building and department as columns in the files or > coded into the file name or path. That seems to be a good idea, but I am af

Problem with Python's "robots.txt" file parser in module robotparser

2007-07-11 Thread John Nagle
Python's "robots.txt" file parser may be misinterpreting a special case. Given a robots.txt file like this: User-agent: * Disallow: // Disallow: /account/registration Disallow: /account/mypro Disallow: /account/myint ... the python library "robo

Re: wxPython vs. Tkinter event loops

2007-07-11 Thread star . public
On Jul 11, 11:17 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > No again. wxPython provides a Process class for executing external > applications and providing events in response to input, app exit, and > similar. You can also implement it in a similar way to your Tkinter > implementation, but ba

Re: stripping the first byte from a binary file

2007-07-11 Thread Diez B. Roggisch
Alex Popescu wrote: > On Jul 11, 4:15 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> > Forgive my newbie ignorance, but I am wondering why the other method >> > would not work? I mean it may not be very safe, >> > but I guess it may perform a lot better, than having to read the whole >> > fi

Re: Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 10, 11:10 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > urllib2.build_opener happily accepts and ignores a FileCookieJar.I > > had a bug in my code which looked like > > > urllib2.build_opener(func_returning_cookie_jar()) > > > which sho

  1   2   >