python-blosc 1.0.3 released

2010-11-18 Thread Francesc Alted
Announcing python-blosc 1.0.3 A Python wrapper for the Blosc compression library What is it? === Blosc (http://blosc.pytables.org) is a high performance compressor optimized for

[ANN]: 'tren' Cross-Platform Batch Renaming Tool, Version 1.239 Released

2010-11-18 Thread Tim Daneliuk
'tren' Version 1.239 is now released and available for download at: http://www.tundraware.com/Software/tren The last public release was 1.217. - What's New In This Release? --- This release

ANN: GMPY 1.14 and GMPY2 alpha1 released

2010-11-18 Thread casevh
Everyone, I'm pleased to annouce the release of both a new production and experimental release of GMPY. GMPY is a wrapper for the MPIR or GMP multiple-precision arithmetic library. The experimental release (GMPY2) now includes support for the MPFR floating-point library. GMPY is available for

Re: Distribution of Python Scripts

2010-11-18 Thread Steve Holden
On 11/18/2010 11:48 AM, tazz_ben wrote: Hi Folks - I'm an experienced programmer, but this is my first app with python, so I apologize for any stupidity on my part. So I've written/still working on a command line tool written in Python. It talks to a web service, so there really isn't

Re: Is Unladen Swallow dead?

2010-11-18 Thread John Nagle
On 11/18/2010 5:35 PM, Mark Wooding wrote: John Naglena...@animats.com writes: Python is defined by what a naive interpreter with late binding and dynamic name lookups, like CPython, can easily implement. Simply emulating the semantics of CPython with generated code doesn't help all

Re: Python has a really hidden encapsulation?

2010-11-18 Thread Aahz
In article 87fwvw214g@gmail.com, Arnaud Delobelle arno...@gmail.com wrote: Are you referring to the fact that in Python, if an attribute is a property, the __dict__ lookup on the instance is not performed? As in: class A: ... @property ... def x(self): return 42 ... a = A()

Re: Program, Application, and Software

2010-11-18 Thread Steve Holden
On 11/18/2010 7:57 PM, Martin Gregorie wrote: [...] .pyc files are an optional extra: in a *nix environment they are not produced if you use a hash-bang line to execute the source file: they only appear if you run the source with a python file.py command. Close, but no cigar. They are only

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Steven D'Aprano
On Thu, 18 Nov 2010 20:08:00 +0100, Stefan Sonnenberg-Carstens wrote: If you need it really *precise*, cast your Fractions into type Decimal: It's actually the opposite. Decimal has many advantages, but being really precise is not one of them. It suffers the exact same issues re precision and

Re: Program, Application, and Software

2010-11-18 Thread Steven D'Aprano
On Fri, 19 Nov 2010 00:26:41 +, MRAB wrote: On 19/11/2010 00:07, Steven D'Aprano wrote: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can

Re: What was your strategy?

2010-11-18 Thread Tomasz Rola
On Sun, 14 Nov 2010, Paul Rubin wrote: Jorge Biquez jbiq...@icsmx.com writes: I was wondering if you can share what was the strategy you followed to master Python (Yes I know I have to work hard study and practice a lot). 1. Read the tutorial http://docs.python.org/tutorial/ 2. Start

dpkt

2010-11-18 Thread Verde Denim
Hi I'm looking to find some help working with dpkt. As you probably know, there really isn't any documentation, and not being astute at Python as of yet leaves me with a lot of gaps. Is there anyone here that can point me in a direction toward writing some test code for parsing gre packets?

Re: dpkt

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 19.11.2010 06:39, schrieb Verde Denim: Hi I'm looking to find some help working with dpkt. As you probably know, there really isn't any documentation, and not being astute at Python as of yet leaves me with a lot of gaps. Is there anyone here that can point me in a direction toward writing

Re: Changing the EAX register with Python

2010-11-18 Thread Tim Roberts
dutche dut...@gmail.com wrote: Hi folks, I have a unusual question here. How can I change the value of EAX register under python under Linux?? As paimei does under Windows. My project is to have a python program that loads a C program and sets a breakpoint at some address, and then with this

Re: Sending changed parameters into nested generators

2010-11-18 Thread cbr...@cbrownsystems.com
On Nov 12, 10:52 pm, John O'Hagan resea...@johnohagan.com wrote: On Sat, 13 Nov 2010, Steven D'Aprano wrote: On Fri, 12 Nov 2010 09:47:26 +, John O'Hagan wrote: I have a generator function which takes as arguments another generator and a dictionary of other generators like this:

Re: Does Pygoogle allows for advanced search options?

2010-11-18 Thread Chris Rebert
On Wed, Nov 17, 2010 at 11:54 PM, neocortex pmi...@gmail.com wrote: Hello All, Can anyone help me with the Pygoogle: from pygoogle import pygoogle You're apparently talking about http://code.google.com/p/pygoogle/ rather than http://pygoogle.sourceforge.net/ ; the former appears to have

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Le 17/11/2010 18:52, geremy condra a écrit : On Wed, Nov 17, 2010 at 6:44 AM, Romaric DEFAUXr...@audaxis.com wrote: Le 16/11/2010 17:47, Romaric DEFAUX a écrit : Hi everybody ! First time I write to this mailing list :) I started writing in python last week, that's probably why I

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Michael Ricordeau
Hi, you can use json for passing list and dict . Pickle is dangerous . Instead of pickle.loads/pickle.dumps use json.loads and json.dumps (using stdlib json in python = 2.6 or simplejson in python 2.6) Regards Le Thu, 18 Nov 2010 09:29:00 +0100, Romaric DEFAUX r...@audaxis.com a écrit :

Re: How to read such file and sumarize the data?

2010-11-18 Thread huisky
thank you Martin. You are right. But the elapsed time is also okay for me. And i would like to assume that the total CPU time equals to the number of CPUs multiply the elapsed time. As to the number you mentioned, it is the 'process id', so it will be no problem to identify each job. Huiksy On

Re: How to read such file and sumarize the data?

2010-11-18 Thread huisky
the number before @ is the process id in the linux server and it is identical. So i do NOT think distinguish each job's starting and ending time is difficult in this case. Huisky On Nov 17, 11:38 pm, Tim Harig user...@ilthio.net wrote: On 2010-11-17, huisky hui...@gmail.com wrote: I want to

Re: How to read such file and sumarize the data?

2010-11-18 Thread huisky
Thank you very much for your reply. I think you just count the total number of NCPU used for each user. And it does NOT show how much time used for each user. Huisky On Nov 18, 12:10 am, Steve Holden st...@holdenweb.com wrote: On 11/17/2010 4:45 PM, huisky wrote: Say I have following log file,

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Thanks for the tip, I'll do that :) Le 18/11/2010 09:43, Michael Ricordeau a écrit : Hi, you can use json for passing list and dict . Pickle is dangerous . Instead of pickle.loads/pickle.dumps use json.loads and json.dumps (using stdlib json in python= 2.6 or simplejson in python 2.6)

I have a question about JavaFit

2010-11-18 Thread Bill Fishbaugher
Hello, I was searching online to find more info about JavaFit and I came across your information. Can you tell me, are you still involved with JavaFit? If you are, how are things going for you? Please let me know. Sincerely, Bill -- http://mail.python.org/mailman/listinfo/python-list

Re: String multi-replace

2010-11-18 Thread Peter Otten
Sorin Schwimmer wrote: I have to eliminate diacritics in a fairly large file. Inspired by http://code.activestate.com/recipes/81330/, I came up with the following code: Here's the unicode.translate()-based approach spelt out: http://effbot.org/zone/unicode-convert.htm Peter --

Re: Some syntactic sugar proposals

2010-11-18 Thread Mark Wooding
Steven D'Aprano steve-remove-t...@cybersource.com.au writes: On Wed, 17 Nov 2010 16:31:40 +, Mark Wooding wrote: But I don't think that's the big problem with this proposal. The real problem is that it completely changes the evaluation rule for the conditional expression. (The

Re: I have a question about JavaFit

2010-11-18 Thread Chris Rebert
We are a technical discussion maillinglist. About a computer programming language. Named Python. An unrelated computer programming language which happens to be named Java also exists, but is not this mailinglist's topic of discussion. Some computer programmers personally consume a lot of coffee,

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Hi again, I try simplejson, but I have a problem. (I just replace pickle everywhere by simplejson) Here's a test I did : # python Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type help, copyright, credits or license for more information.

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Michael Ricordeau
When loading from json datas with simplejson, strings are unicode . Le Thu, 18 Nov 2010 11:22:30 +0100, Romaric DEFAUX r...@audaxis.com a écrit : Hi again, I try simplejson, but I have a problem. (I just replace pickle everywhere by simplejson) Here's a test I did : # python Python

Re: strange subprocess behavior when calling ps

2010-11-18 Thread Jean-Michel Pichavant
Roger Davis wrote: Completely off topic but I think the try clause could be rewritten that way: ... Don't use bare except clause, you're masking syntax errors for instance, which will be flagged as 'unexpected error in generation In a more general manner, if something unexpected happens

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread Jean-Michel Pichavant
Tim Harig wrote: On 2010-11-18, noydb noyd...@gmail.com wrote: I have an executable that I want to run within python code. The exe requires an input text file, the user to click a 'compute' button, and then the exe calculates several output values, one of which I want to capture into a

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Sorry for this stupid question, but how can I convert unicode to string. I ask that because I hit an error (perhaps a bug) in mod_wsgi, and that crash the apache process : TypeError: sequence of string values expected, value of type unicode found RuntimeError: generator ignored GeneratorExit

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Hi answer to myself :) With str(unicode_string) ! Le 18/11/2010 12:23, Romaric DEFAUX a écrit : Sorry for this stupid question, but how can I convert unicode to string. I ask that because I hit an error (perhaps a bug) in mod_wsgi, and that crash the apache process : TypeError: sequence of

Re: Does Pygoogle allows for advanced search options?

2010-11-18 Thread neocortex
The library doesn't seem to have built-in support for filtering by language (and Google lacks a search query-string-based operator for that), but it looks like you could implement that feature by adding an lr parameter with an appropriate value to the query `args` dictionary. See the lr?

Re: String multi-replace

2010-11-18 Thread MRAB
On 18/11/2010 04:30, Benjamin Kaplan wrote: On Wed, Nov 17, 2010 at 11:21 PM, Sorin Schwimmersx...@yahoo.com wrote: Hi All, I have to eliminate diacritics in a fairly large file. Inspired by http://code.activestate.com/recipes/81330/, I came up with the following code: #! /usr/bin/env

with HTTPConnection as conn:

2010-11-18 Thread trylks
Hi! Would it be possible to use a with statement with an HTTPConnection object? I know it is not possible at this moment, it doesn't implement an __exit__ method, at least in version 3.1.1. I was wondering if the __exit__ method should do something more than conn.close(), something really hard

Re: with HTTPConnection as conn:

2010-11-18 Thread Chris Rebert
On Thu, Nov 18, 2010 at 3:46 AM, trylks try...@gmail.com wrote: Hi! Would it be possible to use a with statement with an HTTPConnection object? Yes, via http://docs.python.org/library/contextlib.html#contextlib.closing from httplib import HTTPConnection from contextlib import closing with

How to correctly pass “pointer-to-pointer” into DLL via ctypes?

2010-11-18 Thread Grigory Petrov
Hello. I have a DLL that allocates memory and returns it. Function in DLL is like this: void Foo( unsigned char** ppMem, int* pSize ) {   * pSize = 4;   * ppMem = malloc( * pSize );   for( int i = 0; i * pSize; i ++ ) (* pMem)[ i ] = i; } Also, i have a python code that access this function

Re: MATLAB to Python?

2010-11-18 Thread MATLABdude
On Nov 17, 10:04 am, MATLABdude matlab.d...@mbnet.fi wrote: Thanks guys! I still have some problems. I made the code somewhat simpler by dropping off some parts of it (xx, f). Now my Python code calculates 8 different values for lambda. The problem is that I don't know where the minus sign

Re: Is Unladen Swallow dead?

2010-11-18 Thread BartC
John Nagle na...@animats.com wrote in message news:4ce37e01$0$1666$742ec...@news.sonic.net... On 11/16/2010 10:24 PM, swapnil wrote: AFAIK, the merging plan was approved by Guido early this year. I guess Google is expecting the community to drive the project from here on. That was the whole

Re: argparse subparser problem

2010-11-18 Thread Sven
On 2010-11-16 14:35:01 -0500, Neal Becker said: I want to have subparsers, but I also want to be able to say: myprogram --version and get the version # Would it not be possible to print the version number and then exit the program before building the subparser?

Re: MATLAB to Python?

2010-11-18 Thread MRAB
On 18/11/2010 12:16, MATLABdude wrote: On Nov 17, 10:04 am, MATLABdudematlab.d...@mbnet.fi wrote: Thanks guys! I still have some problems. I made the code somewhat simpler by dropping off some parts of it (xx, f). Now my Python code calculates 8 different values for lambda. The problem is

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Adam Tauno Williams
On Thu, 2010-11-18 at 11:22 +0100, Romaric DEFAUX wrote: Hi again, I try simplejson, but I have a problem. (I just replace pickle everywhere by simplejson) Explanation : I dumps with json a list of dictionnaries into disk_list_json. When I loads it, I don't get my list of dictionnaries

Re: What was your strategy?

2010-11-18 Thread Lou Pecora
In article mailman.1048.1289936253.2218.python-l...@python.org, Steve Holden st...@holdenweb.com wrote: On 11/16/2010 2:22 PM, Lou Pecora wrote: I'll jump in and recommend the book Python in a Nutshell by Martelli. It may be a little dated now, but it covers many Python topics in good

Re: String multi-replace

2010-11-18 Thread Dave Angel
On 2:59 PM, Sorin Schwimmer wrote: Steven D'Aprano: the original file is 139MB (that's the typical size for it). Eliminating diacritics is just a little toping on the cake; the processing is something else. Thanks anyway for your suggestion, SxN PS Perhaps I should have mention that I'm on

Re: Program, Application, and Software

2010-11-18 Thread Martin Gregorie
On Thu, 18 Nov 2010 01:16:34 +, MRAB wrote: I'd probably say that a script is a program which is normally not interactive: you just set it up, start it, and let it do its work (a batch script, for example). It's also written in a language primarily designed for convenience rather than

Re: What was your strategy?

2010-11-18 Thread brf256
+2 I also agree. - Braden Faulkner -Original Message- From: Lou Pecora pec...@anvil.nrl.navy.mil Sender: python-list-bounces+brf256=gmail@python.org Date: Thu, 18 Nov 2010 09:05:59 To: python-list@python.org Subject: Re: What was your strategy? In article

Twisted on Windows

2010-11-18 Thread Bryan Richardson
Hello All, First off I must say that Twisted is a very nice event driven I/O package indeed. Thanks to all the developers who have contributed to it, as it's made my life much easier. Now for my question... I have a custom server application, and I have it structured as such: MyServerApp/ --

Re: with HTTPConnection as conn:

2010-11-18 Thread Antoine Pitrou
On Thu, 18 Nov 2010 12:46:07 +0100 trylks try...@gmail.com wrote: Hi! Would it be possible to use a with statement with an HTTPConnection object? I know it is not possible at this moment, it doesn't implement an __exit__ method, at least in version 3.1.1. I was wondering if the __exit__

Re: strange subprocess behavior when calling ps

2010-11-18 Thread Roger Davis
Hi JM, Thank you very much for your followup explanation! Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: Program, Application, and Software

2010-11-18 Thread Grant Edwards
On 2010-11-18, Martin Gregorie mar...@address-in-sig.invalid wrote: On Thu, 18 Nov 2010 01:16:34 +, MRAB wrote: I'd probably say that a script is a program which is normally not interactive: you just set it up, start it, and let it do its work (a batch script, for example). It's also

Re: with HTTPConnection as conn:

2010-11-18 Thread Hrvoje Niksic
Antoine Pitrou solip...@pitrou.net writes: On Thu, 18 Nov 2010 12:46:07 +0100 trylks try...@gmail.com wrote: Hi! Would it be possible to use a with statement with an HTTPConnection object? I know it is not possible at this moment, it doesn't implement an __exit__ method, at least in

Re: Program, Application, and Software

2010-11-18 Thread Martin Gregorie
On Thu, 18 Nov 2010 15:41:51 +, Grant Edwards wrote: On 2010-11-18, Martin Gregorie mar...@address-in-sig.invalid wrote: On Thu, 18 Nov 2010 01:16:34 +, MRAB wrote: I'd probably say that a script is a program which is normally not interactive: you just set it up, start it, and let it

what's the precision of fractions.Fraction?

2010-11-18 Thread Daniel Fetchinson
I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and denominator (as integers) reaches 80-100. And I'm wondering until what point I can trust the

Distribution of Python Scripts

2010-11-18 Thread tazz_ben
Hi Folks - I'm an experienced programmer, but this is my first app with python, so I apologize for any stupidity on my part. So I've written/still working on a command line tool written in Python. It talks to a web service, so there really isn't anything in it that is dependent on a particular

Re: Twisted on Windows

2010-11-18 Thread Jean-Paul Calderone
On Nov 18, 9:58 am, Bryan Richardson btri...@gmail.com wrote: Hello All, First off I must say that Twisted is a very nice event driven I/O package indeed. Thanks to all the developers who have contributed to it, as it's made my life much easier. Now for my question... I have a custom

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Ian Kelly
On Thu, Nov 18, 2010 at 9:27 AM, Daniel Fetchinson fetchin...@googlemail.com wrote: I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and

ANN: GMPY 1.14 and GMPY2 alpha1 released

2010-11-18 Thread casevh
Everyone, I'm pleased to annouce the release of both a new production and experimental release of GMPY. GMPY is a wrapper for the MPIR or GMP multiple-precision arithmetic library. The experimental release (GMPY2) now includes support for the MPFR floating-point library. GMPY is available for

Re: Is Unladen Swallow dead?

2010-11-18 Thread Dan Stromberg
On Thu, Nov 18, 2010 at 4:24 AM, BartC b...@freeuk.com wrote: John Nagle na...@animats.com wrote in message news:4ce37e01$0$1666$742ec...@news.sonic.net... On 11/16/2010 10:24 PM, swapnil wrote: AFAIK, the merging plan was approved by Guido early this year. I guess Google is expecting

Re: regenerating unicodedata for py2.7 using py3 makeunicodedata.py?

2010-11-18 Thread Martin v. Loewis
Thanks for the confirmation Martin! Do you think, it the mentioned omission of the character names of some CJK ranges in unicodedata intended, or should it be reported to the tracker? It's certainly a bug. So a bug report would be appreciated, but much more so a patch. Ideally, the patch

Re: Is Unladen Swallow dead?

2010-11-18 Thread brf256
I do hope that it isn't dead but it unfortunately seems that way? - Braden Faulkner -- http://mail.python.org/mailman/listinfo/python-list

Re: What was your strategy?

2010-11-18 Thread Paul Rubin
Lou Pecora pec...@anvil.nrl.navy.mil writes: I'll jump in and recommend the book Python in a Nutshell by Martelli. It's encyclopedic. Indeed. I hope Martelli updates it. I'd buy another copy right away. It's a great book but not a starting point for beginners. It's definitely worth

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Daniel Fetchinson
I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and denominator (as integers) reaches 80-100. And I'm wondering until what point I can trust the

Re: Is Unladen Swallow dead?

2010-11-18 Thread John Nagle
On 11/18/2010 4:24 AM, BartC wrote: John Nagle na...@animats.com wrote in message news:4ce37e01$0$1666$742ec...@news.sonic.net... On 11/16/2010 10:24 PM, swapnil wrote: AFAIK, the merging plan was approved by Guido early this year. I guess Google is expecting the community to drive the

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 18.11.2010 17:27, schrieb Daniel Fetchinson: I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and denominator (as integers) reaches 80-100. And

Re: Is Unladen Swallow dead?

2010-11-18 Thread Ben James
On 18/11/2010 17:50, brf...@gmail.com wrote: I do hope that it isn't dead but it unfortunately seems that way? - Braden Faulkner It looks like we'll have to get used to a laden one. Maybe if we had two, and a strand of creeper... -- http://mail.python.org/mailman/listinfo/python-list

Re: I have a question about JavaFit

2010-11-18 Thread Ben James
On 18/11/2010 10:05, Chris Rebert wrote: We are a technical discussion maillinglist. About a computer programming language. Named Python. An unrelated computer programming language which happens to be named Java also exists, but is not this mailinglist's topic of discussion. Some computer

Re: I have a question about JavaFit

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 18.11.2010 20:17, schrieb Ben James: On 18/11/2010 10:05, Chris Rebert wrote: We are a technical discussion maillinglist. About a computer programming language. Named Python. An unrelated computer programming language which happens to be named Java also exists, but is not this mailinglist's

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread noydb
I will use 2.5. I tried your suggestion, with this code import subprocess pig = subprocess.Popen([C:\Halls\hallbig2.exe], stdin=subprocess.PIPE, stdout=subprocess.PIPE) result = pig.communicate(input='C:\Halls\Input\Ea39j.txt')[-1] #I need to capture the, what I think is the, last output print

Changing the EAX register with Python

2010-11-18 Thread dutche
Hi folks, I have a unusual question here. How can I change the value of EAX register under python under Linux?? As paimei does under Windows. My project is to have a python program that loads a C program and sets a breakpoint at some address, and then with this breakpoint I change the EAX

Re: Twisted on Windows

2010-11-18 Thread Bryan Richardson
Thanks Jean-Paul, I added the following to my server.py file and things work perfectly on both Windows and Linux now. sys.path.insert(0, os.getcwd()) On Thu, Nov 18, 2010 at 9:52 AM, Jean-Paul Calderone calderone.jeanp...@gmail.com wrote: On Nov 18, 9:58 am, Bryan Richardson btri...@gmail.com

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Terry Reedy
On 11/18/2010 11:27 AM, Daniel Fetchinson wrote: I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and denominator (as integers) reaches 80-100. And

Re: String multi-replace

2010-11-18 Thread Frederic Rentsch
On Wed, 2010-11-17 at 21:12 -0800, Sorin Schwimmer wrote: Thanks for your answers. Benjamin Kaplan: of course dict is a type... silly me! I'll blame it on the time (it's midnight here). Chris Rebert: I'll have a look. Thank you both, SxN Forgive me if this is off the track. I

Re: Changing the EAX register with Python

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 18.11.2010 21:20, schrieb dutche: Hi folks, I have a unusual question here. How can I change the value of EAX register under python under Linux?? As paimei does under Windows. My project is to have a python program that loads a C program and sets a breakpoint at some address, and then with

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread Tim Harig
On 2010-11-18, noydb jenn.du...@gmail.com wrote: import subprocess pig = subprocess.Popen([C:\Halls\hallbig2.exe], stdin=subprocess.PIPE, stdout=subprocess.PIPE) result = pig.communicate(input='C:\Halls\Input\Ea39j.txt')[-1] #I need to capture the, what I think is the, last output From the

Why is pdb messing with STDIN? I can't step through my code, or enter any data accurately.

2010-11-18 Thread Bryan Wheelock
I'm baffled by the behavior of pdb as I attempt to debug a Twill test. I'm trying to step through socket.get_fqdn() and my key entries are garbled. I prefer to use ipdb, but the STDOUT gets messed up and printed at the end of the ipdb session. That defeats the purpose of a debugger. So I'm using

Re: Changing the EAX register with Python

2010-11-18 Thread Dan Stromberg
Here's -a- way to try - not necessarily the best way: 1) Write a little gcc .c with inline assembler, to make your EAX change 2) Call it from CPython using ctypes However, by the time you return from the code that makes your change and resume execution in the CPython interpreter, EAX may well

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread Tim Harig
On 2010-11-18, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Tim Harig wrote: If you are not already, I would highly suggest using Python3 with the subprocess module: Suggesting subprocess is a good idea, *highly*

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread noydb
On Nov 18, 5:22 pm, Tim Harig user...@ilthio.net wrote: On 2010-11-18, noydb jenn.du...@gmail.com wrote: import subprocess pig = subprocess.Popen([C:\Halls\hallbig2.exe], stdin=subprocess.PIPE, stdout=subprocess.PIPE) result = pig.communicate(input='C:\Halls\Input\Ea39j.txt')[-1] #I need

Re: Is Unladen Swallow dead?

2010-11-18 Thread Jean-Paul Calderone
On Nov 18, 1:31 pm, John Nagle na...@animats.com wrote: On 11/18/2010 4:24 AM, BartC wrote: John Nagle na...@animats.com wrote in message news:4ce37e01$0$1666$742ec...@news.sonic.net... On 11/16/2010 10:24 PM, swapnil wrote: AFAIK, the merging plan was approved by Guido early

Extension on Windows

2010-11-18 Thread Eric Frederich
Hello, I am trying to create an extension on Windows and I may be over my head but I have made it pretty far. I am trying to create bindings for some libraries which require me to use Visual Studio 2005. I set up the spammodule example and in VS set the output file to be a .pyd file. When I

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread Tim Harig
On 2010-11-18, noydb noyd...@gmail.com wrote: On Nov 18, 5:22 pm, Tim Harig user...@ilthio.net wrote: On 2010-11-18, noydb jenn.du...@gmail.com wrote: Okay, I see now. I did run it to start with 0 -- still same result no matter if 0 or -1. So, what is result (stdout, using [0]) in this case?

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread noydb
On Nov 18, 5:54 pm, noydb noyd...@gmail.com wrote: On Nov 18, 5:22 pm, Tim Harig user...@ilthio.net wrote: On 2010-11-18, noydb jenn.du...@gmail.com wrote: import subprocess pig = subprocess.Popen([C:\Halls\hallbig2.exe], stdin=subprocess.PIPE, stdout=subprocess.PIPE) result =

Re: How to run an EXE, with argument, capture output value

2010-11-18 Thread noydb
On Nov 18, 6:20 pm, noydb noyd...@gmail.com wrote: On Nov 18, 5:54 pm, noydb noyd...@gmail.com wrote: On Nov 18, 5:22 pm, Tim Harig user...@ilthio.net wrote: On 2010-11-18, noydb jenn.du...@gmail.com wrote: import subprocess pig = subprocess.Popen([C:\Halls\hallbig2.exe],

Re: Program, Application, and Software

2010-11-18 Thread Steven D'Aprano
On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW Python and Perl programs are scripts aloing with programs written as awk,

Re: Some syntactic sugar proposals

2010-11-18 Thread Steven D'Aprano
On Thu, 18 Nov 2010 09:32:23 +, Mark Wooding wrote: [...] You're wrong. Python evaluates these left-to-right, as I said. Parentheses override operator associativity; they don't affect evaluation order at all. Fair enough. I concede your point. [...] Not everything needs to be a one

Re: Program, Application, and Software

2010-11-18 Thread MRAB
On 19/11/2010 00:07, Steven D'Aprano wrote: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW Python and Perl programs are

Re: Program, Application, and Software

2010-11-18 Thread Alexander Kapps
On 19.11.2010 01:26, MRAB wrote: On 19/11/2010 00:07, Steven D'Aprano wrote: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW

Re: Program, Application, and Software

2010-11-18 Thread Martin Gregorie
On Fri, 19 Nov 2010 00:07:05 +, Steven D'Aprano wrote: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW Python and Perl

Advise for numerical programming content (New python user)

2010-11-18 Thread Sachin Kumar Sharma
Python Users, I am an average Fortran user. I am new to python and I am currently evaluating options and functionalities of numerical programming and related 2d and 3d graphic outputs with python. Kindly share your experience in scientific programming with python like how do you like it,

Bunch 2.0 - a dict with a default

2010-11-18 Thread Phlip
Pythonistas: If everyone likes this post, then the code is a snippet for community edification. Otherwise, it's a question: How to do this kind of thing better? I want a dict() variant that passes these test cases: map = Map() assert not(map.has_key('_default')) map =

Re: Is Unladen Swallow dead?

2010-11-18 Thread Mark Wooding
John Nagle na...@animats.com writes: Python is defined by what a naive interpreter with late binding and dynamic name lookups, like CPython, can easily implement. Simply emulating the semantics of CPython with generated code doesn't help all that much. Indeed. Because you can

Re: Bunch 2.0 - a dict with a default

2010-11-18 Thread Chris Kaynor
You may want to look at the collections.defaultdict class. It takes in a factory function for default values. You can also implement your class by overriding the __missing__ method of the dict class, rather than overriding the __getitem__. Both were added in Python 2.5 according to the

Re: Some syntactic sugar proposals

2010-11-18 Thread Mark Wooding
Steven D'Aprano st...@remove-this-cybersource.com.au writes: Not everything needs to be a one liner. If you need this, do it the old- fashioned way: t = foo() if not pred(t): t = default_value I already explained how to write it as a one-liner: t = (lambda y: y if

Re: Program, Application, and Software

2010-11-18 Thread Mark Wooding
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW Python and

Re: Is Unladen Swallow dead?

2010-11-18 Thread Carl Banks
On Nov 18, 2:59 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com wrote: On Nov 18, 1:31 pm, John Nagle na...@animats.com wrote: On 11/18/2010 4:24 AM, BartC wrote: John Nagle na...@animats.com wrote in message news:4ce37e01$0$1666$742ec...@news.sonic.net... On 11/16/2010 10:24

Re: Program, Application, and Software

2010-11-18 Thread Terry Reedy
On 11/18/2010 9:05 PM, Mark Wooding wrote: Maybe, once upon a time, there was a meaningful distinction to be made between purely interpreted languages and purely compiled languages. No, there never was; only between interpreting and compiling implementations. Right. I remember using a C

[issue10183] test_concurrent_futures failure on Windows

2010-11-18 Thread Brian Quinlan
Brian Quinlan br...@sweetapp.com added the comment: Would you include the entire output of the test run? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10183 ___

[issue4113] Add custom __repr__ to functools.partial

2010-11-18 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Looks like a reasonable proposal, but coding this in C is a chore. It's not that bad. Most C code is a bit of a chore compared to Python but it really doesn't take much to write a C equivalent of: functools.partial(%r,

[issue10183] test_concurrent_futures failure on Windows

2010-11-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Y:\py3k\__svn__\PCbuild\amd64\python_d.exe -m test.regrtest -v test_concurrent_futures == CPython 3.2a4+ (py3k, Nov 18 2010, 11:12:09) [MSC v.1500 64 bit (AMD64)] == Windows-7-6.1.7600 little-endian == Y:\py3k\__svn__\build\test_python_2016

[issue10351] Add autocompletion for keys in dictionaries

2010-11-18 Thread Valery Khamenya
Valery Khamenya khame...@gmail.com added the comment: Guys, do you expect anythig else from me in respect to this issue? Let me know it before my non-stopable garbage collector wipes all the details from my brain away :) -- ___ Python tracker

[issue10351] Add autocompletion for keys in dictionaries

2010-11-18 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +facundobatista, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10351 ___ ___

  1   2   >