Re: Hexadecimal list conversion

2007-12-20 Thread Mark T
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > En Thu, 20 Dec 2007 09:30:14 -0300, Neil Webster <[EMAIL PROTECTED]> > escribi�: > >> I have a list which is a line from a file: >> ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00', >> '\x00

Re: Next float?

2007-11-21 Thread Mark T
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a simple, elegant way in Python to get the next float from a > given one? By "next float", I mean given a float x, I want the smallest > float larger than x. > > Bonus points if I can go in either direction (

Re: how to fill many data strings from socket.recvfrom()

2007-11-03 Thread Mark T
"lgwe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I want to receive 200 udp datagrams. Each into a new data string. > But I dont know how to do that, this is wrong: > > import socket > s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) > s.bind(("",port)) > i = 0 > while i<200:

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread Mark T
ere any way I can force these to a log or > print them to the screen? Thanks. > > Regards, > Ken > www.wireshark.org -Mark T. -- http://mail.python.org/mailman/listinfo/python-list

Re: slice with negative stride

2007-10-06 Thread Mark T
string, it returns the exact start,stop,step indices used: >>> mystr='my string' >>> s=slice(None,3,-1) >>> s.indices(len(mystr)) # start is the end of the string if step is >>> negative (8, 3, -1) >>> mystr[8],mystr[3] ('g

Re: elementtree question

2007-09-21 Thread Mark T
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > En Fri, 21 Sep 2007 11:49:53 -0300, Tim Arnold <[EMAIL PROTECTED]> > escribi�: > >> Hi, I'm using elementtree and elementtidy to work with some HTML files. >> For >> some of these files I need to enclose the body

Re: Python equivalent of Perl's $/

2007-08-20 Thread Mark T
Without wishing to start a flame war, is there a way to do this in Python? > > Regards, John > -- > War is God's way of teaching Americans geography > Ambrose Bierce (1842 - 1914) >>> 'test\ntest2.\ntest3\ntest4.\ntest5'.split('.\n') ['test\ntest2', 'test3\ntest4', 'test5'] -Mark T. -- http://mail.python.org/mailman/listinfo/python-list

Re: Threaded Design Question

2007-08-09 Thread Mark T
y. Any suggestions would be greatly appreciated. > > ~Sean > Just rename the file. We've used that technique in a similar application at my work for years where a service looks for files of a particular extension to appear in a directory. When the service sees a file, in renames it to a different extension and spins off a thread to process the contents. -Mark T. -- http://mail.python.org/mailman/listinfo/python-list

Re: passing arguments to tcpserver classes

2007-06-13 Thread Mark T
"Eric Spaulding" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there an easy way to pass arguments to a handler class that is used by > the standard TCPServer? > > normally --> srvr =SocketServer.TCPServer(('',port_num), TCPHandlerClass) > > I'd like to be able to: srvr =Socke

Re: Why can not catch the inner exception

2007-06-07 Thread Mark T
"人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Please see the follow code, I can not catch the exception " IOError" raised from shutil.copyfile() , why? try: if (DEST_TYPE & TYPE_FTP): fn = oname

Re: str() and repr() question

2007-04-26 Thread Mark T
"adima" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All! > Sorry, my English isnt good, but get a try to describe my problem. > > Today we wrote next script: > > import os, glob, time, string > files_to_test = ( "J:\\BWNEW\\!Unerase\\test.test", "L:\\Temp\Nick\ > \test.test",

Re: Python automatic testing: mocking an imported module?

2007-03-28 Thread Mark T
"Silfheed" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Heyas > > So we have the following situation: we have a testee.py that we want > to automatically test out and verifiy that it is worthy of being > deployed. We want our tester.py to test the code for testee.py > without ch

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-21 Thread Mark T
of y there. > > > Alex This is interesting: >>> class Test(object): ... def __getattribute__(self,n): ... print 'reading',n ... return object.__getattribute__(self,n) ... def __setattr__(self,n,v): ... print 'writing',n,v ... return object

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-21 Thread Mark T
e.next and placed in node, also losing the original value of node. -Mark T. > > as > node = node.next = nextnode > > only to discover that Python performs chained assignments > backwards compared to other languages, i.e. left-to-right > instead of right-to-left. From the user&#

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Mark T
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At Tuesday 9/1/2007 20:31, Carroll, Barry wrote: > >>I've spent about a day investigating our "too many open files" error. I >>found the following: >> >> 1. Windows XP allows a Python 2.5 script to open 509

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Mark T
"pythonchallenge" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > For the riddles' lovers among you, you are most invited to take part > in the Python Challenge, the first python programming riddle on the net. > > You are invited to take part in it at: > http://www.pythonchallenge.c

Re: getting text from WinXP console

2005-03-22 Thread Mark T.
"Chris Maloof" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > Does anyone know how I can read the ASCII text from a console window > (from another application) in WinXP? It doesn't sound like a major > operation, but although I can find the window via pywin32, I haven't