ANN: CherryPy 3.0.0

2006-12-26 Thread Christian Wyglendowski
Greetings! Just in time for the holidays and on behalf of the CherryPy team I am happy to announce the release of CherryPy 3.0.0. Here are some highlights of the new version: * As much as 3 times faster than CherryPy 2. * Much improved WSGI support. * Powerful enhanced configuration

ANN: Phebe 0.1

2006-12-26 Thread Thomas Lotze
Phebe 0.1 has been released and uploaded to the Python package index. From README.txt: = Phebe comprises a Python package and a number of executable scripts to operate a mobile phone connected to your computer. The

ANN: 4Suite XML 1.0.2

2006-12-26 Thread Uche Ogbuji
4Suite XML 1.0.2 is now available from Sourceforge and ftp.4suite.org. Thanks to all the testers, there are a number of important fixes and improvements since 1.0.1, and we recommend upgrade from all previous versions. Changes include: * Fixed TypeError when multiple interpreters are used (should

Re: Can Python help?

2006-12-26 Thread Gregor Horvath
Lad schrieb: On my website I allow users to upload files. I would like a user to see how much time is left before a file is uploaded. So, I would like to have a progress bar during a file uploading. Can Python help me with that?Or how can be a progress bar made? Thank you for ideas. La.

Re: How to depress the output of an external module ?

2006-12-26 Thread Steven D'Aprano
On Tue, 26 Dec 2006 15:49:10 +0800, [EMAIL PROTECTED] wrote: Hi, I'm writing a program which imports an external module writing in C and calls a function provided by the module to do my job. But the method produces a lot of output to the stdout, and this consumes most of the running time.

Re: How to depress the output of an external module ?

2006-12-26 Thread Luis Armendariz
On Tuesday, 26.12.06 at 21:28, Steven D'Aprano wrote: # WARNING: untested def run_without_stdout(*args, **kwargs): function = args[0] args = args[1:] savestdout = sys.stdout sys.stdout = cStringIO.StringIO() result = None try: result = function(*args,

Splitting lines from a database query

2006-12-26 Thread Peter Machell
I have an application where I need to take a query from an existing database and send it to a web api. Here's a cut down version of my existing code: for foo in mssql.fetch_array(); bar = foo[2] #trims the first result which we don't use for x in bar: for y in

Re: How to stop program when threads is sleeping

2006-12-26 Thread placid
many_years_after wrote: Carsten Haese wrote: On Sun, 2006-12-24 at 22:55 -0800, many_years_after wrote: Hi, pythoners: There is a problem I couldn't dispose. I start a thread in the my program. The thread will do something before executing time.sleep(). When the user give

Formatting a string to be a columned block of text

2006-12-26 Thread Leon
Hi, I'm creating a python script that can take a string and print it to the screen as a simple multi-columned block of mono-spaced, unhyphenated text based on a specified character width and line hight for a column. For example, if i fed the script an an essay, it would format the text like a

Re: BeautifulSoup vs. loose chars

2006-12-26 Thread placid
John Nagle wrote: I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like Design Advertising, that is, an instead of an amp;. Is there some way I can get BeautifulSoup to clean those up? There are various parsing options related to

Re: Splitting lines from a database query

2006-12-26 Thread ZeD
Peter Machell wrote: I have an application where I need to take a query from an existing database and send it to a web api. [...] There are always 5 values, but some are blank and some are 'None'. I'd like to split the lines so I get something resembling XML, like this: FNAMEFrank/FNAME

Re: How to depress the output of an external module ?

2006-12-26 Thread [EMAIL PROTECTED]
Steven D'Aprano wrote: Try something like this: # WARNING: untested def run_without_stdout(*args, **kwargs): function = args[0] args = args[1:] savestdout = sys.stdout sys.stdout = cStringIO.StringIO() result = None try: result = function(*args, **kwargs)

embedded python : can't get or set a variable

2006-12-26 Thread ycollet
Hello, I'm trying to write a program to send python statements to a python server via tcp and then get back results via a tcp connection. It nearly works ... but I'm totally lost with the embedded dictionary (I'm quite new to python). The first part of the server start the python interpreter via

Re: some OT: how to solve this kind of problem in our program?

2006-12-26 Thread bearophileHUGS
For people that will read the posts in the future, there is a little bug (it doesn't change the output of this program): items = alist[:] Has to be: alist = alist[:] Sorry, bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Formatting a string to be a columned block of text

2006-12-26 Thread placid
Leon wrote: Hi, I'm creating a python script that can take a string and print it to the screen as a simple multi-columned block of mono-spaced, unhyphenated text based on a specified character width and line hight for a column. For example, if i fed the script an an essay, it would format

Re: How to stop program when threads is sleeping

2006-12-26 Thread Carsten Haese
On 25 Dec 2006 21:50:15 -0800, many_years_after wrote While , there is something wrong in my expression. What I mean is the thread will wait some time after doing some tasks. I want to know is there any method to end the thread or make it out of execution of waiting. I use time.sleep() to let

Re: How to depress the output of an external module ?

2006-12-26 Thread André
[EMAIL PROTECTED] wrote: Steven D'Aprano wrote: Try something like this: # WARNING: untested def run_without_stdout(*args, **kwargs): function = args[0] args = args[1:] savestdout = sys.stdout sys.stdout = cStringIO.StringIO() result = None try:

Re: How to depress the output of an external module ?

2006-12-26 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: I have tried your method, but I found it didn't work as expected. The output produced by the external function couldn't be depressed, but the print statement i wrote in python is depressed. It seems make cStringIO.StringIO() as a temporary replacement of sys.stdout

keypressed() function

2006-12-26 Thread [EMAIL PROTECTED]
I need a function (blocking or non-blocking) that tells me if a key has been pressed (even before it has been released etc.). Also, I would of course like to know _which_ key has been pressed. I know that this probably does not exist in the Python library already as a platform-independant

Re: How to depress the output of an external module ?

2006-12-26 Thread Stefan Schwarzer
Hi Luis, Luis Armendariz wrote: There's no need for savestdout. There's a backup copy in sys.__stdout__ Depending on the code that ran before the call to the function run_without_stdout, sys.stdout may not be the same as sys.__stdout__ . Of course, you also have to be careful regarding threads

Re: How to depress the output of an external module ?

2006-12-26 Thread Sebastian 'lunar' Wiesner
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote [EMAIL PROTECTED] wrote: I have tried your method, but I found it didn't work as expected. The output produced by the external function couldn't be depressed, but the print statement i wrote in python is depressed. It seems make

Re: Formatting a string to be a columned block of text

2006-12-26 Thread Paul McGuire
Leon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'm creating a python script that can take a string and print it to the screen as a simple multi-columned block of mono-spaced, unhyphenated text based on a specified character width and line hight for a column. For example,

Re: Formatting a string to be a columned block of text

2006-12-26 Thread Dave Borne
On 26 Dec 2006 04:14:27 -0800, Leon [EMAIL PROTECTED] wrote: I'm creating a python script that can take a string and print it to the screen as a simple multi-columned block of mono-spaced, unhyphenated text based on a specified character width and line hight for a column. Hi, Leon, For

Re: Formatting a string to be a columned block of text

2006-12-26 Thread Dave Borne
Thanks, Paul. I didn't know about textwrap, that's neat. Leon, so in my example change data1= [testdata[x:x+colwidth] for x in range(0,len(testdata),colwidth)] to data1 = textwrap.wrap(testdata,colwidth) data1 = [x.ljust(colwidth) for x in data1] oh and I made a mistake that double spaces it.

Re: BeautifulSoup vs. loose chars

2006-12-26 Thread Felipe Almeida Lessa
On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote: So do you want to remove or replace them with amp; ? If you want to replace it try the following; I think he wants to replace them, but just the invalid ones. I.e., This this amp; that would become This amp; this amp; that

Re: Formatting a string to be a columned block of text

2006-12-26 Thread Paul McGuire
Paul McGuire [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] gettysburgAddress = Four score and seven years ago... snip By the way, this variable contains only 3 (very long) lines of text, one for each paragraph. (Not immediately obvious after Usenet wraps the text.) -- Paul --

PySchool Phase II

2006-12-26 Thread RobJ
PySchool Phase II I just wanted to thank everyone for filling out the survey a few months back for my PySchool graduate school project. I was able to capture a lot of good information from the community. For the people who mentioned to me that I should expand the What Linux Operating System do

Re: Formatting a string to be a columned block of text

2006-12-26 Thread Duncan Booth
Paul McGuire [EMAIL PROTECTED] wrote: By the way, this variable contains only 3 (very long) lines of text, one for each paragraph. (Not immediately obvious after Usenet wraps the text.) Usenet doesn't wrap text, all it has is a convention which suggests that people posting to usenet should

Re: Newbie: what is a usefull IDE for Python on Windows ?

2006-12-26 Thread Larry Bates
Osiris wrote: what is a usefull IDE for Python on Windows ? I saw Eric mentioned.. is that WinXP or Linux ? What does everybody use ? I was considering using old and very stable C-code in a new web application via Python/Plone/Zope. I like pyscripter, available here:

Type text global

2006-12-26 Thread Andreas Lysdal
Hey, I'm a noob at python so.. I just want to know, is there a function to type text global not in the program but in other programs(like you where typing it). For example in a textbox, in a program like cmd.exe or notebook.exe. I'm using windows xp. Thanks! :) /Scripter47 --

Re: BeautifulSoup vs. loose chars

2006-12-26 Thread Duncan Booth
Felipe Almeida Lessa [EMAIL PROTECTED] wrote: On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote: So do you want to remove or replace them with amp; ? If you want to replace it try the following; I think he wants to replace them, but just the invalid ones. I.e., This this

Re: Newbie: what is a usefull IDE for Python on Windows ?

2006-12-26 Thread tac-tics
On Dec 26, 8:53 am, Larry Bates [EMAIL PROTECTED] wrote: Osiris wrote: what is a usefull IDE for Python on Windows ? I am a happy user of jEDIT. -- http://mail.python.org/mailman/listinfo/python-list

Installing python.org distro over ActivePython?

2006-12-26 Thread Tom Plunket
Hey gang- I just ran into the fabled Secure Sockets not enabled in ActivePython, and the ActiveState FAQ says I should just grab _ssl.pyd from somewhere, offering up the python.org distribution as a possible source. I'm on 2.4 at this time, and python.org has what appears to be a considerably

Re: Formatting a string to be a columned block of text

2006-12-26 Thread rzed
Dave Borne [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Thanks, Paul. I didn't know about textwrap, that's neat. Leon, so in my example change data1= [testdata[x:x+colwidth] for x in range(0,len(testdata),colwidth)] to data1 = textwrap.wrap(testdata,colwidth) data1 =

Re: BeautifulSoup vs. loose chars

2006-12-26 Thread John Nagle
Felipe Almeida Lessa wrote: On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote: So do you want to remove or replace them with amp; ? If you want to replace it try the following; I think he wants to replace them, but just the invalid ones. I.e., This this amp; that

Fuzzy string comparison

2006-12-26 Thread Steve Bergman
I'm looking for a module to do fuzzy comparison of strings. I have 2 item master files which are supposed to be identical, but they have thousands of records where the item numbers don't match in various ways. One might include a '-' or have leading zeros, or have a single character missing, or

Re: SPAM-LOW: Re: BeautifulSoup vs. loose chars

2006-12-26 Thread Andreas Lysdal
Duncan Booth skrev: Felipe Almeida Lessa [EMAIL PROTECTED] wrote: On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote: So do you want to remove or replace them with amp; ? If you want to replace it try the following; I think he wants to replace them, but just

Re: Fuzzy string comparison

2006-12-26 Thread Wojciech Muła
Steve Bergman wrote: I'm looking for a module to do fuzzy comparison of strings. [...] Check module difflib, it returns difference between two sequences. -- http://mail.python.org/mailman/listinfo/python-list

Re: perl better than python for users with disabilities?

2006-12-26 Thread [EMAIL PROTECTED]
Dan Jacobson wrote: Can I feel even better about using perl vs. python, as apparently python's dependence of formatting, indentation, etc. vs. perl's (){}; etc. makes writing python programs perhaps very device dependent. Whereas perl can be written on a tiny tiny screen, and can withstand

Re: Why does Python never add itself to the Windows path?

2006-12-26 Thread robert
Ben Sizer wrote: I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH environment variable. Every time, I've had to go through and add this by hand, to

Re: SPAM-LOW: Re: BeautifulSoup vs. loose chars

2006-12-26 Thread Duncan Booth
Andreas Lysdal [EMAIL PROTECTED] wrote: P.S. apos is handled specially as it isn't technically a valid html entity (and Python doesn't include it in its entity list), but it is an xml entity and recognised by many browsers so some people might use it in html. Hey i fund this site:

Google Custom Search Engine

2006-12-26 Thread robert . hundt
Hi, I created a Google Custom Search Engine for searching on: Software / Compilers / Optimization This is basically a regular full Google search giving preference to technical sites such as IEEE, ACM, citeseer, the Universities, news-group (this one included), commercial sites such as Intel,

Re: keypressed() function

2006-12-26 Thread robert
[EMAIL PROTECTED] wrote: I need a function (blocking or non-blocking) that tells me if a key has been pressed (even before it has been released etc.). Also, I would of course like to know _which_ key has been pressed. I know that this probably does not exist in the Python library already as

Q: How to generate code object from bytecode?

2006-12-26 Thread kwatch
Hi, It is possible to get bytecode from code object. Reversely, is it possible to create code object from bytecode? ex. ## python code (not a module) pycode = '''\ print ul\n for item in items: print li%s/li\n % item print /ul\n ''' ## compile it and get bytecode code =

Mod_python

2006-12-26 Thread Lad
In my web application I use Apache and mod_python. I allow users to upload huge files( via HTTP FORM , using POST method) I would like to store the file directly on a hard disk and not to upload the WHOLE huge file into server's memory first. Can anyone suggest a solution? Thank you LB --

Re: Q: How to generate code object from bytecode?

2006-12-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: It is possible to get bytecode from code object. Reversely, is it possible to create code object from bytecode? ex. ## python code (not a module) pycode = '''\ print ul\n for item in items: print li%s/li\n % item print /ul\n ''' ##

Re: Q: How to generate code object from bytecode?

2006-12-26 Thread Carsten Haese
On Tue, 2006-12-26 at 11:15 -0800, [EMAIL PROTECTED] wrote: Hi, It is possible to get bytecode from code object. Reversely, is it possible to create code object from bytecode? ex. ## python code (not a module) pycode = '''\ print ul\n for item in items: print li%s/li\n %

Re: Q: How to generate code object from bytecode?

2006-12-26 Thread Carsten Haese
On Tue, 2006-12-26 at 14:48 -0500, Carsten Haese wrote: * Code objects come in two flavors: statements and expressions. * exec can execute a 'statement' flavored code object. * eval can evaluate an 'expression' flavored code object. * Your code snippet is a statement, actually, a suite of

Re: Splitting lines from a database query

2006-12-26 Thread Peter Machell
ZeD wrote: Peter Machell wrote: I have an application where I need to take a query from an existing database and send it to a web api. [...] There are always 5 values, but some are blank and some are 'None'. I'd like to split the lines so I get something resembling XML, like this:

Re: some OT: how to solve this kind of problem in our program?

2006-12-26 Thread Gabriel Genellina
At Monday 25/12/2006 21:24, Paul McGuire wrote: For example, for all the complexity in writing Sudoku solvers, there are fewer than 3.3 million possible permutations of 9 rows of the digits 1-9, and far fewer permutations that match the additional column and box constraints. Why not just

Re: Splitting lines from a database query

2006-12-26 Thread Scott David Daniels
Peter Machell wrote: ZeD wrote: An excellent response providing code Thanks very much ZeD. This will do what I need to. The next step is to do some regex on the phone number to ensure it's local and correct. How can I split these up so each value has a key? Well, you should try that,

Re: some OT: how to solve this kind of problem in our program?

2006-12-26 Thread Chris Mellon
On 12/26/06, Gabriel Genellina [EMAIL PROTECTED] wrote: At Monday 25/12/2006 21:24, Paul McGuire wrote: For example, for all the complexity in writing Sudoku solvers, there are fewer than 3.3 million possible permutations of 9 rows of the digits 1-9, and far fewer permutations that match the

Re: Q: How to generate code object from bytecode?

2006-12-26 Thread kwatch
Thanks Fredrik and Carsten, I'll try marshal module. * Your code snippet is a statement, actually, a suite of statements. You need to exec it, not eval it. * You seem to think that eval'ing or exec'ing a code object will magically capture its output stream. It won't. Oh, it's my mistake.

Re: some OT: how to solve this kind of problem in our program?

2006-12-26 Thread John Krukoff
On Tue, 2006-12-26 at 17:39 -0300, Gabriel Genellina wrote: At Monday 25/12/2006 21:24, Paul McGuire wrote: For example, for all the complexity in writing Sudoku solvers, there are fewer than 3.3 million possible permutations of 9 rows of the digits 1-9, and far fewer permutations that match

Re: Fuzzy string comparison

2006-12-26 Thread John Machin
Wojciech Mula wrote: Steve Bergman wrote: I'm looking for a module to do fuzzy comparison of strings. [...] Check module difflib, it returns difference between two sequences. and it's intended for comparing text files, and is relatively slow. Google python levenshtein. You'll probably find

BeautifulSoup bug when found in attribute value

2006-12-26 Thread John Nagle
This, which is from a real web site, went into BeautifulSoup: param name=movie value=/images/offersBanners/sw04.swf?binfot=We offer fantastic rates for selected weeks or days!!blinkt=Click here linkurl=/Europe/Spain/Madrid/Apartments/Offer/2408 / And this came out, via prettify: addresssnippet

Re: keypressed() function

2006-12-26 Thread Gabriel Genellina
At Tuesday 26/12/2006 10:25, [EMAIL PROTECTED] wrote: I need a function (blocking or non-blocking) that tells me if a key has been pressed (even before it has been released etc.). Also, I would of course like to know _which_ key has been pressed. On Windows you can listen to the messages

Re: Type text global

2006-12-26 Thread Gabriel Genellina
At Tuesday 26/12/2006 13:57, Andreas Lysdal wrote: I'm a noob at python so.. I just want to know, is there a function to type text global not in the program but in other programs(like you where typing it). For example in a textbox, in a program like cmd.exe or notebook.exe. I'm using windows

Re: Why does Python never add itself to the Windows path?

2006-12-26 Thread benc_nospam
Ross Ridge wrote: Ben Sizer wrote: I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH environment variable. Personally, I hate Windows

Re: Fuzzy string comparison

2006-12-26 Thread Carsten Haese
On Tue, 2006-12-26 at 13:08 -0800, John Machin wrote: Wojciech Mula wrote: Steve Bergman wrote: I'm looking for a module to do fuzzy comparison of strings. [...] Check module difflib, it returns difference between two sequences. and it's intended for comparing text files, and is

Re: Fuzzy string comparison

2006-12-26 Thread Gabriel Genellina
At Tuesday 26/12/2006 18:08, John Machin wrote: Wojciech Mula wrote: Steve Bergman wrote: I'm looking for a module to do fuzzy comparison of strings. [...] Check module difflib, it returns difference between two sequences. and it's intended for comparing text files, and is relatively

Re: Splitting lines from a database query

2006-12-26 Thread Peter Machell
Scott David Daniels wrote: Peter Machell wrote: ZeD wrote: An excellent response providing code Thanks very much ZeD. This will do what I need to. The next step is to do some regex on the phone number to ensure it's local and correct. How can I split these up so each value has a key?

Persistent variables in python

2006-12-26 Thread buffi
Found out a quite fun way to store persistent variables in functions in python. def doStuff(): try: #Will throw exception if not set doStuff.timesUsed ## #Insert stuff to do each time the function is called here ## doStuff.timesUsed+=1 print Function call! except

Re: Fuzzy string comparison

2006-12-26 Thread John Machin
Carsten Haese wrote: On Tue, 2006-12-26 at 13:08 -0800, John Machin wrote: Wojciech Mula wrote: Steve Bergman wrote: I'm looking for a module to do fuzzy comparison of strings. [...] Check module difflib, it returns difference between two sequences. and it's intended for

Re: some OT: how to solve this kind of problem in our program?

2006-12-26 Thread Paul McGuire
Gabriel Genellina [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At Monday 25/12/2006 21:24, Paul McGuire wrote: For example, for all the complexity in writing Sudoku solvers, there are fewer than 3.3 million possible permutations of 9 rows of the digits 1-9, and far fewer

Re: Splitting lines from a database query

2006-12-26 Thread Scott David Daniels
Peter Machell wrote: I can almost do it this way: for x in bar: fname = x[0] if fname == : fname == None sname = x[1] if sname == : sname == None print FNAME+fname+/FNAME+SNAME+sname+/SNAME

Re: Splitting lines from a database query

2006-12-26 Thread Gabriel Genellina
At Tuesday 26/12/2006 18:57, Peter Machell wrote: for x in bar: fname = x[0] if fname == : fname == None sname = x[1] if sname == : sname == None print FNAME+fname+/FNAME+SNAME+sname+/SNAME

Re: Persistent variables in python

2006-12-26 Thread Gabriel Genellina
At Tuesday 26/12/2006 19:13, buffi wrote: def doStuff(): try: #Will throw exception if not set doStuff.timesUsed Is this concidered bad coding practice since I guess persistent variables in functions are not meant to be? I don't think so, since Python proudly says that functions

Re: Splitting lines from a database query

2006-12-26 Thread John Machin
Peter Machell wrote: Scott David Daniels wrote: Peter Machell wrote: ZeD wrote: An excellent response providing code Thanks very much ZeD. This will do what I need to. The next step is to do some regex on the phone number to ensure it's local and correct. How can I split these up so

Re: Persistent variables in python

2006-12-26 Thread buffi
I don't think so, since Python proudly says that functions are first-class objects. CherryPy does a similar thing to mark a method as exposed. But perhaps I'd write the code this way to avoid an unneeded and risky recursive call: def doStuff(some, arguments, may, *be, **required):

Re: Persistent variables in python

2006-12-26 Thread Lee Harr
Found out a quite fun way to store persistent variables in functions in python. Is this concidered bad coding practice since I guess persistent variables in functions are not meant to be? I am using is in one of my recent projects. I was thinking of it sort of like static variables in C.

Re: BeautifulSoup vs. loose chars

2006-12-26 Thread Frederic Rentsch
John Nagle wrote: Felipe Almeida Lessa wrote: On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote: So do you want to remove or replace them with amp; ? If you want to replace it try the following; I think he wants to replace them, but just the invalid ones. I.e.,

Noobie: Open file - read characters multiply

2006-12-26 Thread gonzlobo
I've been using Python for a few days. It's such the perfect language for parsing data! I really like it so far, but I'm having a hard time reading a file, reading the first few hex characters converting them to an integer. Once the characters are converted to an integer, I'd like to write the

Re: How to depress the output of an external module ?

2006-12-26 Thread Steven D'Aprano
On Tue, 26 Dec 2006 03:21:57 -0800, Luis Armendariz wrote: On Tuesday, 26.12.06 at 21:28, Steven D'Aprano wrote: # WARNING: untested def run_without_stdout(*args, **kwargs): function = args[0] args = args[1:] savestdout = sys.stdout sys.stdout = cStringIO.StringIO()

Re: Persistent variables in python

2006-12-26 Thread Steven D'Aprano
On Tue, 26 Dec 2006 15:01:40 -0800, buffi wrote: def doStuff(some, arguments, may, *be, **required): try: doStuff.timesUsed += 1 except AttributeError: doStuff.timesUsed = 1 # ... special case for first call ... # ...common code... True, the

Re: Noobie: Open file - read characters multiply

2006-12-26 Thread Scott David Daniels
gonzlobo wrote: I've been using Python for a few days. It's such the perfect language for parsing data! I really like it so far, but I'm having a hard time reading a file, reading the first few hex characters converting them to an integer. Once the characters are converted to an integer,

Re: Noobie: Open file - read characters multiply

2006-12-26 Thread Steven D'Aprano
On Tue, 26 Dec 2006 16:50:06 -0700, gonzlobo wrote: I've been using Python for a few days. It's such the perfect language for parsing data! I really like it so far, but I'm having a hard time reading a file, reading the first few hex characters converting them to an integer. Once the

Re: How to depress the output of an external module ?

2006-12-26 Thread Carl Banks
[EMAIL PROTECTED] wrote: After some trials I found that put os.close(1) before calling the function will depress the output. In fact, os.close(1) closed standard output, but I don't know how to open it again after the function's execution. Try this: fd = os.dup(1) os.close(1) sys.stdout =

Re: How to suppress the output of an external module ?

2006-12-26 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: Hi, I'm writing a program which uses an external module written in C and calls a function provided by the module to do my job. The function produces a lot of output to the stdout. Is there a way to suppress the output produced by the function and hence make

Re: How to depress the output of an external module ?

2006-12-26 Thread Carl Banks
Carl Banks wrote: [EMAIL PROTECTED] wrote: After some trials I found that put os.close(1) before calling the function will depress the output. In fact, os.close(1) closed standard output, but I don't know how to open it again after the function's execution. Try this: fd = os.dup(1)

Re: Noobie: Open file - read characters multiply

2006-12-26 Thread WaterWalk
gonzlobo wrote: I've been using Python for a few days. It's such the perfect language for parsing data! I really like it so far, but I'm having a hard time reading a file, reading the first few hex characters converting them to an integer. Once the characters are converted to an integer,

Re: Noobie: Open file - read characters multiply

2006-12-26 Thread WaterWalk
WaterWalk wrote: gonzlobo wrote: I've been using Python for a few days. It's such the perfect language for parsing data! I really like it so far, but I'm having a hard time reading a file, reading the first few hex characters converting them to an integer. Once the characters are

Re: Noobie: Open file - read characters multiply

2006-12-26 Thread WaterWalk
WaterWalk wrote: WaterWalk wrote: gonzlobo wrote: I've been using Python for a few days. It's such the perfect language for parsing data! I really like it so far, but I'm having a hard time reading a file, reading the first few hex characters converting them to an integer.

Re: Newbie: what is a usefull IDE for Python on Windows ?

2006-12-26 Thread [EMAIL PROTECTED]
Osiris wrote: what is a usefull IDE for Python on Windows ? The Zeus IDE: http://www.zeusedit.com/python.html Jussi -- http://mail.python.org/mailman/listinfo/python-list

loose methods : Smalltalk asPython

2006-12-26 Thread Jan Theodore Galkowski
Hi. One of the things I'd like to do with Python is find a way to consistently implement Smalltalk's loose methods. This is a capability whereby additional methods can be added dynamically to existing classes. In some respects, it's possible with Python. While object cannot be touched, it's

module with a threading-like api that uses processes?

2006-12-26 Thread skip
I could have sworn someone was working on a module recently with a threading-like API that used subprocesses under the covers, but 10 minutes or so of googling didn't yield anything. Pointers appreciated. Thx, Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: module with a threading-like api that uses processes?

2006-12-26 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I could have sworn someone was working on a module recently with a threading-like API that used subprocesses under the covers, but 10 minutes or so of googling didn't yield anything. Pointers appreciated.

Re: module with a threading-like api that uses processes?

2006-12-26 Thread Gabriel Genellina
At Wednesday 27/12/2006 01:58, [EMAIL PROTECTED] wrote: I could have sworn someone was working on a module recently with a threading-like API that used subprocesses under the covers, but 10 minutes or so of googling didn't yield anything. Pointers appreciated. Perhaps this project? I just

Re: merits of Lisp vs Python

2006-12-26 Thread Lars Rune Nøstdal
On Sat, 23 Dec 2006 12:38:30 -0800, Fuzzyman wrote: Lars Rune Nøstdal wrote: On Fri, 08 Dec 2006 03:07:09 -0800, Mark Tarver wrote: How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes

[ python-Bugs-1621367 ] random import works?

2006-12-26 Thread SourceForge.net
Bugs item #1621367, was opened at 2006-12-23 11:04 Message generated for change (Comment added) made by mark-roberts You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1621367group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1619659 ] htonl, ntohl don't handle negative longs

2006-12-26 Thread SourceForge.net
Bugs item #1619659, was opened at 2006-12-20 12:42 Message generated for change (Comment added) made by mark-roberts You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1619659group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1622533 ] null bytes in docstrings

2006-12-26 Thread SourceForge.net
Bugs item #1622533, was opened at 2006-12-26 18:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1622533group_id=5470 Please note that this message will contain a full copy of

[ python-Bugs-1621367 ] random import works?

2006-12-26 Thread SourceForge.net
Bugs item #1621367, was opened at 2006-12-23 12:04 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1621367group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1545837 ] array.array borks on deepcopy

2006-12-26 Thread SourceForge.net
Bugs item #1545837, was opened at 2006-08-24 04:49 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1545837group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1622664 ] language reference index links are broken

2006-12-26 Thread SourceForge.net
Bugs item #1622664, was opened at 2006-12-26 16:15 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1622664group_id=5470 Please note that this message will contain a full copy of