How to write this regular expression?

2005-05-03 Thread could ildg
I need a regular expression to check if a string matches it. The string consists of one to there parts, each parts is a underline followed by a number, and the number of the first part should be 0~31, and numbers of other parts should be larger than 31. The requested re should match the following

Re: control precision for str(obj) output?

2005-05-03 Thread Dan Bishop
Andrew Dalke wrote: > Mike Meyer wrote: > > Someone want to tell me the procedure for submitting FAQ entries, so I > > can do that for this? > > You mean more than what already exists at > http://www.python.org/doc/faq/general.html#why-are-floating-point-calculations-so-inaccurate > > which has a l

file parsing/watching + qt

2005-05-03 Thread aljosa
this is a Qt app. app should watch for changes in /var/log/isdn.log and on file change (like new line was added to isdn.log) it should activate event in my app. i'm trying to fetch last line in file whenever isdnlog logs something so that i can parse that line for a number and store it somewhere e

Re: control precision for str(obj) output?

2005-05-03 Thread Andrew Dalke
Mike Meyer wrote: > Someone want to tell me the procedure for submitting FAQ entries, so I > can do that for this? You mean more than what already exists at http://www.python.org/doc/faq/general.html#why-are-floating-point-calculations-so-inaccurate which has a link to an even more detailed ch

Dr. Dobb's Python-URL! - weekly Python news and links (May 3)

2005-05-03 Thread Simon Brunning
QOTW: "The security 'droids have decided that since the MS Office Suite is a 'standard' application then software written in MS Office VBA must be 'safe.' Any other development environments (such as Java, Perl, Cygwin) are 'unsafe' and can't be installed." - Peter Olsen "There's nothing wrong with

Re: control precision for str(obj) output?

2005-05-03 Thread Bo Peng
> The unfortunate side effect of this is to make str(list of floats) > ugly, but... Yeah, Nothing is perfect. I can control the damage as long as I know what is going on. I guess this would fit in a faq list quite well. I would have to thank Mike and Dan for your quick and detailed reply. As a

Re: Mod_python

2005-05-03 Thread grahamd
Gensek wrote: > Python is obviously binary, but I compiled Apache and modpython. I > restarted apache before using the config. I'm inclined to believe that > I'm doing everything right, but the computer isn't. Try following through the directions/hints in: http://www.dscpl.com.au/projects/vamp

Re: empty lists vs empty generators

2005-05-03 Thread Michele Simionato
Andrea Griffini: > Are you sure this is going to do the right thing ? Argh! I missed these two lines from the documentation: """Note, once tee() has made a split, the original iterable should not be used anywhere else; otherwise, the iterable could get advanced without the tee objects being info

Re: Regular Expression tools?

2005-05-03 Thread Tim Henderson
I am not quite sure what you want. However if you are looking for Python's regular expression module it is the re module. Just go to interactive help and view the api for it. cheers Tim Henderson -- http://mail.python.org/mailman/listinfo/python-list

Re: control precision for str(obj) output?

2005-05-03 Thread Dan Bishop
Bo Peng wrote: > Dear list, > > I have enjoyed the convenience to output any object with str(obj) for a > while. However, I get long output for things like str([0.0002]) in my > output (which bothers my users more than me though). I also do not > understand why the following is happening: > > >>>

Re: control precision for str(obj) output?

2005-05-03 Thread Mike Meyer
Bo Peng <[EMAIL PROTECTED]> writes: > Dear list, > > I have enjoyed the convenience to output any object with str(obj) for > a while. However, I get long output for things like str([0.0002]) in > my output (which bothers my users more than me though). I also do not > understand why the following i

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Chris McAloney
On Tue, 3 May 2005, Tim Peters wrote: > Hmm. I've been staring at that one 18 hours a day since last Friday, I'm very relieved to hear that I'm not the only one, then. > > I've decoded the first message to get the hint for the next level. > > It's not nice to humilate your elders in public, Chr

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Chris McAloney
On Tue, 3 May 2005, Leif K-Brooks wrote: > Chris McAloney wrote: > > Okay, so I've been working on level seven for a LONG time now. I've > > decoded the first message to get the hint for the next level. Using the > > same tactics, then I decode the hint as well, but there are non-printable > > c

RE: Regular Expression tools?

2005-05-03 Thread Lee Cullens
Been here before, but can't remember what I used and anyway that was a PC platform. So, if you use a Regular Expression tool (PCRE standard) for Python programming and your development platform is Mac OS X, would you please help narrow down the search for me. All I seem to be finding are other

Mod_python

2005-05-03 Thread Gensek
I want to use mod_python, but I'm having trouble. Here's what I have in my config: LoadModule python_module /usr/local/apache2/modules/mod_python.so AddHandler mod_python .py PythonHandler mptest PythonDebug On /usr/local/apache2/htdocs/python/mptest.py: from mod_python import *

Re: xml.parsers.expat and utf-8

2005-05-03 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I have this code: > > import xml.parsers.expat > parser = xml.parsers.expat.ParserCreate(encoding="UTF-8") > text = unicode("þórður",'UTF-8') I think you want text = u"þórður".encode('UTF-8') so text is a UTF-8 string. Kent -- http://mail.python.org/mailman/listinf

Re: xmlrpclib and decoding entity references

2005-05-03 Thread Kent Johnson
Chris Curvey wrote: > I'm writing an XMLRPC server, which is receiving a request (from a > non-Python client) that looks like this (formatted for legibility): > > > > echo > > > > Le Martyre de Saint André
avec inscription > 'Le Dominiquain.' et 'Le tableau fait par le dominicain, > d'ap

Re: OOP

2005-05-03 Thread Philippe C. Martin
Try this: http://pigseye.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/ [EMAIL PROTECTED] wrote: > Hey yall, > I'm new to Python and I love it. Now I can get most of the topics > covered with the Python tutorials I've read but the one thats just > stumping me is Object Orientation. I can't get

Re: Pydev Refactoring Feature in Eclipse

2005-05-03 Thread Philippe C. Martin
Hi, I am using Eclipse 3.0.2 with Pydev 0.9.3 under Mandrake 10.1 and it works OK. Is 3.1M3 stable?, I see their latest milestone/stable is 3.1M6 - might want to upgrade. Regards, Philippe querejeto wrote: > Folks: > > I cannot get a refactoring menu to show up on my Eclipse (3.1M3, > Wi

control precision for str(obj) output?

2005-05-03 Thread Bo Peng
Dear list, I have enjoyed the convenience to output any object with str(obj) for a while. However, I get long output for things like str([0.0002]) in my output (which bothers my users more than me though). I also do not understand why the following is happening: >>> str([0.0002]) '[0.0002

ANNOUNCE: KirbyBase 1.8.2

2005-05-03 Thread Jamey Cribbs
This is an *Emergency* bug-fix release. Fred Pacquier alertly pointed out a bug I introduced in the last version. It occurs when you select all records in a table; newline characters were not getting stripped off the end of every returned record. The bug has been fixed in this version. Thank

Re: Any decent IM protocol implementations (icq or aim)

2005-05-03 Thread Lucas Raab
Jaime Wyant wrote: > Can anyone recommend one? Google isn't giving me much. > > jw I believe there's one for AIM called pyTOC. Trying Googling that or something like "Python ABC". ABC being the messenger service. -- -- Lucas Raab lvraab"@"earthlink.net dotpyFE"@"gmail.

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Tim Peters
[Tim Peters, whines about level 7] [Dan Christensen, gives a huge hint] The first time I looked at it, I thought "hmm, I should use PIL for this". I kept thinking that too -- but for some reason wanted to see if there was a clear way to do it without something that "fancy". I eventually gave u

Re: xmlrpclib and decoding entity references

2005-05-03 Thread John Ridley
Chris Curvey wrote on Tue, 03 May 2005 08:10:50 -0700: > Can anyone give me a lead on how to convert the entity references > into something that will make it through to my method call? The xmllib module has a function for doing this: >>> import xmllib >>> xmllib.XMLParser().translate_references(

RE: problem in the compiler ?

2005-05-03 Thread Delaney, Timothy C (Timothy)
Glauco Silva wrote: > My code is like this: > > MyClass() > > class MyClass: > def __init__(self): > btn = RadioButton(command=self.Function) > def Function(self): > print "Enter in the function" > > When a do this, the function 'Function' is call. And i don´t want >

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Dan Christensen
Tim Peters <[EMAIL PROTECTED]> writes: > [Chris McAloney] >> Okay, so I've been working on level seven for a LONG time now. > > Hmm. I've been staring at that one 18 hours a day since last Friday, > and still don't have the foggiest idea. I've counted boxes, counted > pixels, broken it apart and

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Leif K-Brooks
Chris McAloney wrote: > Okay, so I've been working on level seven for a LONG time now. I've > decoded the first message to get the hint for the next level. Using the > same tactics, then I decode the hint as well, but there are non-printable > characters. Frira be srjre pbcvrf bs gur fnzr cvkry

Re: text strings to binary...

2005-05-03 Thread John Machin
On 3 May 2005 12:39:51 -0700, [EMAIL PROTECTED] wrote: >Hi, > >I've been working with Python for a bit now but I just came accross a >problem and I'm not sure how to approach it. I'd like to convert a text >string into binary data format. I though I'd use the struct module and >the pack function b

Re: Form and Database

2005-05-03 Thread Lee Harr
On 2005-05-03, v <[EMAIL PROTECTED]> wrote: > Please help. I'm new with Python. > Using Boa (or Pythoncard) and pysqlite, how can I read/write from/to > database, thanks > > Have you tried the pysqlite basic intro? http://initd.org/tracker/pysqlite/wiki/basicintro Doesn't mention boa or pyth

Re: How to read an integer value from a binary file?

2005-05-03 Thread John Machin
On Tue, 3 May 2005 19:46:17 +0200, Olivier Elbaz <[EMAIL PROTECTED]> wrote: >Hi, > >I read a bmp file (binary file) and I want to extract an integer value >from it (size value). >The whole binary file is read inside a list "all_bmp_file". >I can read the "size" value with the following code: >for

Re: [Plone] DTML instead of ZPT for PHPParse

2005-05-03 Thread Max M
JZ wrote: > Who knows how to add to Plone the following content using DTML instead of > ZPT template? > > http://www.w3.org/1999/xhtml"; xml:lang="en-US" > lang="en-US" i18n:domain="plone" > metal:use-macro="here/main_template/macros/master"> > > > > HERE IS MY DYNAMIC P

Re: xml.parsers.expat and utf-8

2005-05-03 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: > I think I've tried all variations possible but I always get errors. > Anyone know what I'm doing wrong? You are passing Unicode strings to Parse. Try byte strings instead. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

[Plone] DTML instead of ZPT for PHPParse

2005-05-03 Thread JZ
Who knows how to add to Plone the following content using DTML instead of ZPT template? http://www.w3.org/1999/xhtml"; xml:lang="en-US" lang="en-US" i18n:domain="plone" metal:use-macro="here/main_template/macros/master"> HERE IS MY DYNAMIC PHP: I need to us

Re: Best way to parse file into db-type layout?

2005-05-03 Thread John Machin
On Tue, 03 May 2005 19:12:07 GMT, Peter A. Schott <[EMAIL PROTECTED]> wrote: >Thanks for the comments. Quick notes: >1. Yes, ultimate goal is to output various fields into Excel, Peter, (again) I'd like to suggest that putting some or all of the data into storage of type X (whether X is a datab

Re: py2exe and library.zip

2005-05-03 Thread Timothy Smith
Peter Hansen wrote: >Timothy Smith wrote: > > >>is it possible instead of py2exe putting all library's in a zip file, to >>just put them in a sub dir? >> >> > >Anything's possible. Maybe you could explain what you're actually >trying to accomplish (or the reasons) so we can better underst

Re: text strings to binary...

2005-05-03 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Hi, > > I've been working with Python for a bit now but I just came accross a > problem and I'm not sure how to approach it. I'd like to convert a text > string into binary data format. I though I'd use the struct module and > the pack function but I can't get it to work

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Tiziano Bettio
Tim Peters wrote: >[Tiziano Bettio] > > >>PLEASE HELP... >> >>What the hell do i have to pronounce in puzzle 5 >> >>Some useful hints would be awesome >> >> > >That's a funny one: I didn't understand the "pronounce it" hint until >long after I solved that one. Then again, Guido & I imp

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Tim Peters
[Tiziano Bettio] > PLEASE HELP... > > What the hell do i have to pronounce in puzzle 5 > > Some useful hints would be awesome That's a funny one: I didn't understand the "pronounce it" hint until long after I solved that one. Then again, Guido & I implemented PEP 307, so I knew what to do th

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Tim Peters
[Chris McAloney] > Okay, so I've been working on level seven for a LONG time now. Hmm. I've been staring at that one 18 hours a day since last Friday, and still don't have the foggiest idea. I've counted boxes, counted pixels, broken it apart and rearranged it like a jigsaw puzzle, ran "strings"

Re: Read / Write image file

2005-05-03 Thread phil
> > By the way, what is 'rb' and 'wb' ? > Read Binary, Write Binary In Win32 the default is text mode which will screw up binary files > Also, when I create a client/server sockets I do something like... > > SERVER > --- > server.bind(('', 4321)) > (sock, addr) = server.accept() > x =

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Tiziano Bettio
PLEASE HELP... What the hell do i have to pronounce in puzzle 5 Some useful hints would be awesome thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequences in list

2005-05-03 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > Hi Michael, > > Thanks for a quick response, I appreciate it. I will have to get back > to you tomorrow, as I can't check what you've given me right now. I > presume the fact that you mention the word note in your code you have > realised that I'm trying to search for mu

Re: atexit not being executed

2005-05-03 Thread Skip Montanaro
Chris> The environment in which I am working is client/server and it is Chris> the server that processes all python code. I have tried creating Chris> a file (which in the case of what I have explained means that I Chris> can't issue a close command) and let the process run as I ha

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Roel Schroeven
Dan Christensen wrote: > Roel Schroeven <[EMAIL PROTECTED]> writes: > > >>Chris McAloney wrote: >> >> >>>Hi all, >>> >>>Okay, so I've been working on level seven for a LONG time now. I've >>>decoded the first message to get the hint for the next level. Using the >>>same tactics, then I decode

Re: PHPParser pod Zope

2005-05-03 Thread Bruno Desthuilliers
JZ a écrit : > Probuje zainstalowac modul php pod zope i tam napisali dziwna rzecz ze > potrzebuje "PHP CGI program" a nie PHP CLI. Kompilacja php 5.0.4 pod > linuksem daje mi w wyniku mod_php + 5 plikow binarnych: pear, php, > php-config, phpextdist, phpsize. Zas lektura skryptu do zope jest nizby

Re: text strings to binary...

2005-05-03 Thread Stefan Näwe
[EMAIL PROTECTED] wrote: > Hi, > > I've been working with Python for a bit now but I just came accross a > problem and I'm not sure how to approach it. I'd like to convert a text > string into binary data format. I though I'd use the struct module and > the pack function but I can't get it to wor

Re: sorting list and then return the index of the sorted item

2005-05-03 Thread Scott David Daniels
Duncan Booth wrote: > custard_pie wrote: > >>I need help sorting a list...I just can't figure out how to sort a list >>and then return a list with the index of the sorted items in the list >>for example if the list I want to sort is [2,3,1,4,5] >>I need [2,0,1,3,4] to be returned > > ... v =

text strings to binary...

2005-05-03 Thread oriana . falco
Hi, I've been working with Python for a bit now but I just came accross a problem and I'm not sure how to approach it. I'd like to convert a text string into binary data format. I though I'd use the struct module and the pack function but I can't get it to work. I'm using Python 2.3.3 in Windows X

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Dan Christensen
Roel Schroeven <[EMAIL PROTECTED]> writes: > Chris McAloney wrote: > >> Hi all, >> >> Okay, so I've been working on level seven for a LONG time now. I've >> decoded the first message to get the hint for the next level. Using the >> same tactics, then I decode the hint as well, but there are non

Re: problem in the compiler ?

2005-05-03 Thread Scott David Daniels
Glauco Silva wrote: > ... so, my code is this: > file : MyClass.py > import Pmw > class MyClass: > def __init__(self): > radio = Pmw.RadioSelect() > radio.bind('', self.Function) > #Pmw.RadioSelect(command = self.Function) > > def Funcito

Form and Database

2005-05-03 Thread v
Please help. I'm new with Python. Using Boa (or Pythoncard) and pysqlite, how can I read/write from/to database, thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Read / Write image file

2005-05-03 Thread codecraig
well on the server, if I have, x = sock.recv(1024) and the client sends more than 1024 bytes...the server won't receive it all right? So I am wondering, how do I setup the server to handle some unknown amount of data? Note, in previous post it should have been, x = sock.recv(1024) not x = se

Re: distributing scripts

2005-05-03 Thread Maciej Dziardziel
Anand S Bisen wrote: > Hello, > > What is a good way to distributing python scripts as a package. Since > lately i am facing lots of issues with my python scripts not being able > to run properly due to either (old python 2.2 at the client machine) or > missing module. Is there a way by which i c

Re: Read / Write image file

2005-05-03 Thread Maciej Dziardziel
codecraig wrote: > I have a image file on my pc, say a .jpg. Basically I want to setup a > client/server socket, and I want the client to read in the jpg and send > it to the server, where the server can write that data into a new file > on the server. > > I tried just doing something like.. >

Re: Best way to parse file into db-type layout?

2005-05-03 Thread Peter A.Schott
Thanks for the comments. Quick notes: 1. Yes, ultimate goal is to output various fields into Excel, but I need to enter the data into a DB as well to avoid having any strange problems. That may be handled by a completely different process. I should have been more exact in saying that my current

Re: Read / Write image file

2005-05-03 Thread codecraig
By the way, what is 'rb' and 'wb' ? Also, when I create a client/server sockets I do something like... SERVER --- server.bind(('', 4321)) (sock, addr) = server.accept() x = server.recv(1024) CLIENT client.connect(('localhost', 4321)) x = open("abc.txt", "rb") client.send(x)

Re: Sequences in list

2005-05-03 Thread temp
Hi Michael, Thanks for a quick response, I appreciate it. I will have to get back to you tomorrow, as I can't check what you've given me right now. I presume the fact that you mention the word note in your code you have realised that I'm trying to search for musical sequences. I tried to put my pr

Re: trouble with lists

2005-05-03 Thread Kristian Zoerhoff
On 5/3/05, Anand Kumar <[EMAIL PROTECTED]> wrote: > > I am actually trying to mimic a multi dimensional array in C. > I tried doing things like Python lists are not arrays in that sense. If you really want an array, you probably want Numeric or Numarray. Head over to http://numeric.scipy.org/ to

Re: Read / Write image file

2005-05-03 Thread codecraig
thanks Phil, the problem was that I was not using "rb" and "wb". thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Read / Write image file

2005-05-03 Thread Max M
codecraig wrote: > I have a image file on my pc, say a .jpg. Basically I want to setup a > client/server socket, and I want the client to read in the jpg and send > it to the server, where the server can write that data into a new file > on the server. > > I tried just doing something like.. > >

PHPParser pod Zope

2005-05-03 Thread JZ
Probuje zainstalowac modul php pod zope i tam napisali dziwna rzecz ze potrzebuje "PHP CGI program" a nie PHP CLI. Kompilacja php 5.0.4 pod linuksem daje mi w wyniku mod_php + 5 plikow binarnych: pear, php, php-config, phpextdist, phpsize. Zas lektura skryptu do zope jest nizbyt jasna. Napisali: #

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Roel Schroeven
Chris McAloney wrote: > Hi all, > > Okay, so I've been working on level seven for a LONG time now. I've > decoded the first message to get the hint for the next level. Using the > same tactics, then I decode the hint as well, but there are non-printable > characters. I've tried stripping out t

Read / Write image file

2005-05-03 Thread phil
> I have a image file on my pc, say a .jpg. Basically I want to setup a > client/server socket, and I want the client to read in the jpg and send > it to the server, where the server can write that data into a new file > on the server. > > I tried just doing something like.. > > x = open("abc.

Re: How to read an integer value from a binary file?

2005-05-03 Thread Olivier Elbaz
Hi Jeff, You was right, my problem was coming from the number of items that I gave to the "unpack" method. I was thinking,like an array in C, that slice [2:5] will give 4 items and not 3. Thanks a lot for your help. Olivier On 5/3/05, Jeff Epler <[EMAIL PROTECTED]> wrote: > As your 'for' loop s

Re: atexit not being executed

2005-05-03 Thread Chris Gorton
The environment in which I am working is client/server and it is the server that processes all python code. I have tried creating a file (which in the case of what I have explained means that I can't issue a close command) and let the process run as I have before. When the process has finished a

Re: empty lists vs empty generators

2005-05-03 Thread Andrea Griffini
On 2 May 2005 21:49:33 -0700, "Michele Simionato" <[EMAIL PROTECTED]> wrote: >Starting from Python 2.4 we have tee in the itertools >module, so you can define the following: > >from itertools import tee > >def is_empty(it): >it_copy = tee(it)[1] >try: >it_copy.next() >except St

Re: Setting the corner color in rotated PIL images

2005-05-03 Thread rzed
"Anthra Norell" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: [in response to: >> I'm using PIL to generate some images which may be rotated at >> the user's option. When they are rotated, the original image is >> cropped in the new image (which is fine), and the corners are >> black (whic

Read / Write image file

2005-05-03 Thread codecraig
I have a image file on my pc, say a .jpg. Basically I want to setup a client/server socket, and I want the client to read in the jpg and send it to the server, where the server can write that data into a new file on the server. I tried just doing something like.. x = open("abc.jpg") y = x.read()

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Chris McAloney
Hi all, Okay, so I've been working on level seven for a LONG time now. I've decoded the first message to get the hint for the next level. Using the same tactics, then I decode the hint as well, but there are non-printable characters. I've tried stripping out those characters, quoting them to in

Re: trouble with lists

2005-05-03 Thread Bill Mill
On 3 May 2005 10:42:43 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm new to python. I tried doing this > > >>> x = [[]] * 3 > >>> print x > [ [] [] [] ] > >>> x[0].append( 2 ) > [ [2] [2] [2] ] > > I confused with the last line output. I actually expected something > like > > [ [2] [

Re: trouble with lists

2005-05-03 Thread vincent wehren
<[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | I'm new to python. I tried doing this | | >>> x = [[]] * 3 | >>> print x | [ [] [] [] ] | >>> x[0].append( 2 ) | [ [2] [2] [2] ] | | I confused with the last line output. I actually expected something | like | | [ [2] [] [] ] | |

Re: trouble with lists

2005-05-03 Thread Kristian Zoerhoff
On 3 May 2005 10:42:43 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm new to python. I tried doing this > > >>> x = [[]] * 3 > >>> print x > [ [] [] [] ] > >>> x[0].append( 2 ) > [ [2] [2] [2] ] > > I confused with the last line output. I actually expected something > like > > [ [2] [

Re: How to read an integer value from a binary file?

2005-05-03 Thread Jeff Epler
As your 'for' loop shows, the number of items in the slice [2:5] is only 3, not 4. Maybe you want the slice [2:6] instead. >>> x = "xx\xb6/\0\0" >>> struct.unpack('i', x[2:6]) (12214,) Jeff pgprzSG2OzoK4.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

How to read an integer value from a binary file?

2005-05-03 Thread Olivier Elbaz
Hi, I read a bmp file (binary file) and I want to extract an integer value from it (size value). The whole binary file is read inside a list "all_bmp_file". I can read the "size" value with the following code: for r in all_bmp_file[2:5]: n = struct.unpack('B',r)#B for unsigned char print n R

trouble with lists

2005-05-03 Thread anandr86
I'm new to python. I tried doing this >>> x = [[]] * 3 >>> print x [ [] [] [] ] >>> x[0].append( 2 ) [ [2] [2] [2] ] I confused with the last line output. I actually expected something like [ [2] [] [] ] Can anyone give me an explanation. help!! -- http://mail.python.org/mailman/listinfo/pyth

Re: python+windows/linux -> write stdout text to always on top text?

2005-05-03 Thread Swaroop C H
On 3 May 2005 09:41:37 -0700, flamesrock <[EMAIL PROTECTED]> wrote: > I'm writing a multiplayer component to an existing closed source game, > and I'd like users to be able to see whats going on in the chat while > playing the game. > Is it possible? I do not have much knowledge in this area but y

Re: [Errno 9] Bad File Descriptor on Windows 2003 Server & Py 2.4.1

2005-05-03 Thread rbt
Dennis Lee Bieber wrote: > On Tue, 03 May 2005 08:59:14 -0400, rbt <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>The below script produces a '[Errno 9] Bad File Descriptor' when >>executed. If I remove the try: except: statements, the script stops when >>the error occ

twisted jabber and xmlstream

2005-05-03 Thread Operation Latte Thunder
I am playing around with Jabber with Twisted. I can receive messages just fine, and thats great, however, I am a bit confused about how to actually _send_ messages. From what I've seen, I need to call send() on the xmlstream I get when I am auth'd... and thats where I get stuck. Do I need to cre

Re: [Errno 9] Bad File Descriptor on Windows 2003 Server & Py 2.4.1

2005-05-03 Thread rbt
vincent wehren wrote: > "rbt" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] > | The below script produces a '[Errno 9] Bad File Descriptor' when > | executed. If I remove the try: except: statements, the script stops when > | the error occurs. > | > | The purpose of the scrip

Re: python+windows/linux -> write stdout text to always on top text?

2005-05-03 Thread flamesrock
I'm writing a multiplayer component to an existing closed source game, and I'd like users to be able to see whats going on in the chat while playing the game. Is it possible? -- http://mail.python.org/mailman/listinfo/python-list

Re: So many things that need to be decided....

2005-05-03 Thread Mike Meyer
"Heather Stovold" <[EMAIL PROTECTED]> writes: >> > I've decided on DrPython for the Editor >> >> An editor for each language? Is that the kind of tower you get when >> you start using IDEs? I just kept right on using the same text editor >> I'd been using for the last 20 (now 30) years. > I ha

Pydev Refactoring Feature in Eclipse

2005-05-03 Thread querejeto
Folks: I cannot get a refactoring menu to show up on my Eclipse (3.1M3, Windows XP). F3 works, I can run and debug scripts. Can't refactor, though. Any idea what I could be missing on my installation? Thanks: Querejeto -- http://mail.python.org/mailman/listinfo/python-list

distributing scripts

2005-05-03 Thread Anand S Bisen
Hello, What is a good way to distributing python scripts as a package. Since lately i am facing lots of issues with my python scripts not being able to run properly due to either (old python 2.2 at the client machine) or missing module. Is there a way by which i can solve these issues revolving ar

Re: Any decent IM protocol implementations (icq or aim)

2005-05-03 Thread Michael Soulier
On 5/3/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > Can anyone recommend one? Google isn't giving me much. http://jabberpy.sourceforge.net/ Mike -- Michael P. Soulier <[EMAIL PROTECTED]> http://www.digitaltorque.ca http://opag.ca python -c 'import this' -- http://mail.python.org/mailman/

Dr. Dobb's Python-URL! - weekly Python news and links (May 3)

2005-05-03 Thread Simon Brunning
QOTW: "The security 'droids have decided that since the MS Office Suite is a 'standard' application then software written in MS Office VBA must be 'safe.' Any other development environments (such as Java, Perl, Cygwin) are 'unsafe' and can't be installed." - Peter Olsen "There's nothing wrong with

Re: wxpython on cygwin for drPython - ImportError: No module named _core_

2005-05-03 Thread Guenter Dannoritzer
Stephane Roy wrote: > Hi, > > Did someone installed and used successfully drPython on Cygwin? The > installation requires > wxpython. I tried many different alternatives (source, binary, etc) but so > far the best I get is the following. This might not be a direct help either, but have you consid

Re: So many things that need to be decided....

2005-05-03 Thread Anand S Bisen
Hi I see everybody talking about Eclipse and PyDev i have not used it but just wanted to know how does it compares with Activestate Komodo? thanks Anand Maurice LING wrote: > Hi, > > It seems that you are just starting on Python, same as my situation a > year ago. After almost going down the

Re: WordPress Python Library 1.0

2005-05-03 Thread [EMAIL PROTECTED]
Caro Michele: Non parlo italiano, ma parlo espagnol. I can read your website, and your library looks interesting. Would you like me to provide an english translation of your webpage so that you can provide a version for english speakers? I am a WordPress user and a Python programmer so I will b

xml.parsers.expat and utf-8

2005-05-03 Thread dagurp
I have this code: import xml.parsers.expat parser = xml.parsers.expat.ParserCreate(encoding="UTF-8") text = unicode("þórður",'UTF-8') print parser.Parse(text,1) And this is what I get: UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-6: ordinal not in range(128) I think I

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Roel Schroeven
Roel Schroeven wrote: > John Hazen wrote: > > >>Hmmm. The title of the html page is "dealing evil". If you were >>playing war instead of solitaire, how would you change how you deal the >>cards? > > > Hm, I'm not familiar with playing war. You couldn't elaborate a bit on > that, could you?

Re: [Errno 9] Bad File Descriptor on Windows 2003 Server & Py 2.4.1

2005-05-03 Thread vincent wehren
"rbt" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | The below script produces a '[Errno 9] Bad File Descriptor' when | executed. If I remove the try: except: statements, the script stops when | the error occurs. | | The purpose of the script is to monitor the size of the thre

Re: So many things that need to be decided....

2005-05-03 Thread Mage
Heather Stovold wrote: > >I have programmed in the past with a plain text editor too did it for >years. - but I much prefer programming with tools that have syntax coloring, >code completion, and the ability to run from the editor. Debugging tools are >a bonus too. > > My opinion is that the GUI

Re: Locale and cookies

2005-05-03 Thread dagurp
Setting it to "C" worked fine. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting Python code.

2005-05-03 Thread Leif K-Brooks
Isaac Rodriguez wrote: > Are there any standarized ways of documenting Python code? When I check the > __doc__ attribute of the standard modules, the results are kind of plain. Is > everyone using this style? See . Epydoc has a simple language for documentation t

Re: Python & SQLite

2005-05-03 Thread Klaus Alexander Seistrup
dcrespo wrote: > Does PySQLite run on Linux? There are specific python modules for SQLite on Linux. -- Klaus Alexander Seistrup Magnetic Ink, Copenhagen, Denmark http://magnetic-ink.dk/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2Exe security

2005-05-03 Thread Ivan Voras
Grant Edwards wrote: > On 2005-05-03, mahasamatman <[EMAIL PROTECTED]> wrote: >>password = pasword.decode("base64") > > That will delay the attacker for a few minutes. True, but a script kiddie that only knows about the 'strings' program will be forever baffled :) Though deprecated, I think the

Re: wxpython on cygwin for drPython - ImportError: No module named _core_

2005-05-03 Thread Franz Steinhaeusler
On Tue, 3 May 2005 10:26:52 -0400, "Stephane Roy" <[EMAIL PROTECTED]> wrote: >Hi, > >Did someone installed and used successfully drPython on Cygwin? The >installation requires >wxpython. I tried many different alternatives (source, binary, etc) but so >far the best I get is the following. > >Trace

Re: Whats the best Python Book for me

2005-05-03 Thread Nick Vargish
I would recommend starting with the official tutorial to get a feel for the nuts-and-bolts syntax of Python. Once you've worked your way through that (probably not more than an afternoon), pick up a copy of the Python Cookbook. Since you're an experienced programmer, I think the Cookbook will help

Re: problem in the compiler ?

2005-05-03 Thread Glauco Silva
The call of MyClass isn´t in this order... i only want to explain that i´m calling the class 'MyClass' and when i do this the function "Function" is call when the compiler pass for the RadioButton. The same happened when i used Pmw.RadioSelect. I solve this problem now using this: radio = Pmw.Radio

Re: So many things that need to be decided....

2005-05-03 Thread Heather Stovold
> My personal suggestion would be to go with SQLite because it's a > standard database which can be used with large number of other tools and > languages. > > As for report generating features, I don't know of any free report > generators that are as easy to use like the one in Access (e.g. > point

  1   2   >