argparse 1.0 - Command-line parsing library

2009-07-27 Thread Steven Bethard
=== Announcing argparse 1.0 === The argparse module provides an easy, declarative interface for creating command line tools, which knows how to: * parse the arguments and flags from sys.argv * convert arg strings into objects for your program * format and

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Terry Reedy
Steven D'Aprano wrote: On Sun, 26 Jul 2009 20:10:00 -0400, Terry Reedy wrote: Michal Kwiatkowski wrote: The thing is I don't need the next item. I need to know if the generator has stopped without invoking it. Write a one-ahead iterator class, which I have posted before, that sets

Re: missing 'xor' Boolean operator

2009-07-27 Thread Terry Reedy
greg wrote: Terry Reedy wrote: In Math and Python, abc means ab and bc, not (ab)c or a(bc). != is a comparison operator like , Although Python extends the chaining principle to !=, this is somewhat questionable, because a b and b c implies a c, but a != b and b != c does not imply a != c.

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Steven D'Aprano
On Mon, 27 Jul 2009 02:02:19 -0400, Terry Reedy wrote: Steven D'Aprano wrote: On Sun, 26 Jul 2009 20:10:00 -0400, Terry Reedy wrote: Michal Kwiatkowski wrote: The thing is I don't need the next item. I need to know if the generator has stopped without invoking it. Write a one-ahead

Re: python function for retrieving key and encryption

2009-07-27 Thread jayshree
On Jul 23, 5:48 pm, Piet van Oostrum p...@cs.uu.nl wrote: jayshree jayshree06c...@gmail.com (j) wrote: j On Jul 21, 8:59 pm, Piet van Oostrum p...@cs.uu.nl wrote: The recipient_public_key.pem file is the public key of the recipient which means the person that is going to receive the

Re: Help understanding the decisions *behind* python? - immutable objects

2009-07-27 Thread John Nagle
Steven D'Aprano wrote: On Sun, 26 Jul 2009 11:24:48 -0700, John Nagle wrote: An interesting issue is Python objects, which are always mutable. A dict of Python objects is allowed, but doesn't consider the contents of the objects, just their identity (address). Only built-in types are

Problem in PyArg_ParseTuple on python 2.5.2 with AIX

2009-07-27 Thread abhi
Hi, I am facing a problem using PyArg_ParseTuple() in my C-API extension. Here is a small repro of the function: static PyObject *parsetuple_test(PyObject *self, PyObject *args) { SQLUSMALLINT param_no = 0; PyObject *py_obj = NULL; if (!PyArg_ParseTuple(args, Oi,

open a file in python

2009-07-27 Thread jayshree
pk = open('/home/jayshree/my_key.public.pem' , 'rb').read() Please tell me how to open a file placed in any directory or in same directory. After opening this file i want to use the contain (public key ) for encryption thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: web page retrieve problems

2009-07-27 Thread Alex
On Jul 26, 8:57 am, golu bhardwajjaye...@gmail.com wrote: the following function retrieves pages from the web and saves them in a specified dir. i want to extract the respective filenames from the urls e.g the page code.google.com shud be saved as code-google.htm  or something similar. can u

Re: open a file in python

2009-07-27 Thread Kushal Kumaran
On Mon, Jul 27, 2009 at 12:58 PM, jayshreejayshree06c...@gmail.com wrote: pk = open('/home/jayshree/my_key.public.pem' , 'rb').read() Please tell me how to open a file placed in any directory or in same directory. After opening this file i want to use the contain (public key ) for

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Piet van Oostrum
Dotan Cohen dotanco...@gmail.com (DC) wrote: DC Referring to this article: DC http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/ DC The author, who is specifically looking for math-related functions, writes: DC DC The dream algorithm RD tool

[no subject]

2009-07-27 Thread 9372966370
(Re: urllib2.URLError: urlopen error unknown url type: 'http error using twill with python) how can i change url/http://... - Sent by a Cricket mobile device - --

[no subject]

2009-07-27 Thread 9372966370
(Re: urllib2.URLError: urlopen error unknown url type: 'http error using twill with python) - Sent by a Cricket mobile device - -- http://mail.python.org/mailman/listinfo/python-list

SEC doc parsing

2009-07-27 Thread Michael Boldin
I am looking for any parsing routines (written in python), for Security Exchange Commision (SEC) documents. These documents are on the SEC's EDGAR system (at ftp://ftp.sec.gov ) and I am especially interested in insider trading files known as Forms 3,4 and 5.

Re: invoke method on many instances

2009-07-27 Thread Aahz
In article mailman.3747.1248642434.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Ok, if you insist... NLMPI = Ni La Más Puta Idea. IHNFI = I Have No Fucking Idea. Thanks! -- Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/ Many customs

Re: how can a child thread notify a parent thread its status?

2009-07-27 Thread davidj411
could i see an example of this maybe? -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-27 Thread greg
Bearophile wrote: Was this link, shown by William, not enough? http://hg.flibuste.net/libre/games/cheval/file/46797c3a5136/chevalx.pyx#l1 Yes, sorry, I posted too soon. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Computation/E-mail Expert opinions?

2009-07-27 Thread Diez B. Roggisch
scribio_vide schrieb: MAIL From: tomm...@centrum.sk From: tommy02 tomm...@centrum.sk To: MeAmI me...@vzw.blackberry.net Subject: I AM LOOKING FORWARD TO YOUR ANSWER ON THIS ISSUE Date: Fri, 24 Jul 09 11:52:27 Pacific Daylight Time MIME-Version: 1.0 Content-Type: multipart/mixed;boundary=

Re: How can I get the line number ?

2009-07-27 Thread kk
Maxim, Thank you so much. I will try right now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding method from one class to another class or to instance of another class

2009-07-27 Thread marekw2143
Thanks for your responses. im_func is all I need. I considered subclassing, wchih is more easy to extend, but I needed some quick way to add a method to another class. Regards, Marek -- http://mail.python.org/mailman/listinfo/python-list

Re: Itext for Python

2009-07-27 Thread S.Selvam
On Sun, Jul 26, 2009 at 11:52 PM, Santhosh Kumar santhosh.vku...@gmail.comwrote: Hi all, One of my cousin suggested me to do a IText PDF converter for python. Actually I heard that there is no separate IText converter either we have to go for jython or GCJ with wrapper. Instead of

Re: How do I generate dia diagrams from python source code?

2009-07-27 Thread Vesa Köppä
Qauzzix wrote: Greetings. Since I have been using dia to make my UML diagrams. I also found an util named dia2code that generates python code from dia diagram. Now that I have that option I really want to find a way to generate dia diagram from existing code and/or maintain my diagrams. I have

Re: Globalize all variables in function without knowing names.

2009-07-27 Thread Tom
Dictionaries are fundamental to Python and very useful. Not learning about them before starting to write code is like not learning about the accelerator pedal before starting to drive a car. Heh, I just looked at the actual tutorial for Dictionaries and I have to say they are very useful.

Re: If Scheme is so good why MIT drops it?

2009-07-27 Thread Hendrik van Rooyen
On Sunday 26 July 2009 21:26:46 David Robinow wrote: I'm a mediocre programmer. Does this mean I should switch to PHP? I have searched, but I can find nothing about this mediocre language. Could you tell us more? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: missing 'xor' Boolean operator

2009-07-27 Thread Mark Dickinson
On Jul 27, 1:53 am, Delaney, Timothy (Tim) tdela...@avaya.com wrote: Mark Dickinson wrote: Since the 'and' and 'or' already return objects (and objects evaluate to true or false), then 'xor' should behave likewise, IMO. I expect that would be the case if it were ever added to the

Re: Problem in PyArg_ParseTuple on python 2.5.2 with AIX

2009-07-27 Thread John Machin
On Jul 27, 5:11 pm, abhi abhigyan_agra...@in.ibm.com wrote: Hi,     I am facing a problem using PyArg_ParseTuple() in my C-API extension. Here is a small repro of the function: static PyObject *parsetuple_test(PyObject *self, PyObject *args) {         SQLUSMALLINT param_no = 0; Sorry, my

Re: open a file in python

2009-07-27 Thread jayshree
On Jul 27, 1:09 pm, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: On Mon, Jul 27, 2009 at 12:58 PM, jayshreejayshree06c...@gmail.com wrote: pk = open('/home/jayshree/my_key.public.pem' , 'rb').read() Please tell me how to open a file placed in any directory or in same directory.

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Mohammad Tayseer
You can generate binaries using py2exe, and you can create UI using Tkinter (which is very easy) or wxPython (which have GUI builders) Mohammad Tayseer http://spellcoder.com/blogs/tayseer From: Piet van Oostrum p...@cs.uu.nl To: python-list@python.org Sent:

Re: open a file in python

2009-07-27 Thread Diez B. Roggisch
jayshree wrote: On Jul 27, 1:09 pm, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: On Mon, Jul 27, 2009 at 12:58 PM, jayshreejayshree06c...@gmail.com wrote: pk = open('/home/jayshree/my_key.public.pem' , 'rb').read() Please tell me how to open a file placed in any directory or in

Call function from another class

2009-07-27 Thread Lars
Hi I'm trying to make an simple image viewer in wxPython and rotate an image with a slider. The code at Pastebin is striped down at bit. The class Frame(wx.Frame) is the main window, the function def CreateMenuBar (l. 39) creates a menu, where the function def onRotate (self,event): (l. 43) is

_msi.Record object has no attribute 'GetString'

2009-07-27 Thread ++imanshu
The documentation (http://docs.python.org/library/msilib.html#record- objects) for msilib mentions the GetString() method on Record objects. However, the following snippet :- db = msilib.OpenDatabase(os.path.join(root, file), msilib.MSIDBOPEN_READONLY) view = db.OpenView('SELECT * FROM Property')

Re: Call function from another class

2009-07-27 Thread Diez B. Roggisch
Lars wrote: Hi I'm trying to make an simple image viewer in wxPython and rotate an image with a slider. The code at Pastebin is striped down at bit. The class Frame(wx.Frame) is the main window, the function def CreateMenuBar (l. 39) creates a menu, where the function def onRotate

Re: Problem in PyArg_ParseTuple on python 2.5.2 with AIX

2009-07-27 Thread abhi
On Jul 27, 2:25 pm, John Machin sjmac...@lexicon.net wrote: On Jul 27, 5:11 pm, abhi abhigyan_agra...@in.ibm.com wrote: Hi,     I am facing a problem using PyArg_ParseTuple() in my C-API extension. Here is a small repro of the function: static PyObject *parsetuple_test(PyObject *self,

Re: RSA cryptography between Python and Java

2009-07-27 Thread Piet van Oostrum
Paul Rubin http://phr...@nospam.invalid (PR) wrote: PR Rob Knop rk...@pobox.com writes: Are there any python libraries that will take a public key in this format and do RSA encoding on it? PR Try www.trevp.com/tlslite I have looked into tlslite and found no easy way to do this. Maybe I

Free hosting for open source Python projects

2009-07-27 Thread Sean Kemplay
Hi All, If anyone is looking for somewhere to host their Python project / modules etc. for free, please get in touch with me. There of course are some restraints on disk space and bandwidth but they should be sufficient for most projects. Your project must be open source. You will have access

Re: Call function from another class

2009-07-27 Thread Lars
If I'm not mistaken, in doRotate you should be able to refer to the to-be-closed dialog via self.frameRotate Now if you change the sliderUpdate-code to store that angle instead of just letting it fall out of scope, you could access that value through frameRotate: def sliderUpdate(self,

Re: open a file in python

2009-07-27 Thread Piet van Oostrum
jayshree jayshree06c...@gmail.com (j) wrote: j pk = open('/home/jayshree/my_key.public.pem' , 'rb').read() By the way, a PEM file is a text file, no reason to open it in binary mode. Just replace the 'rb' with 'r' or leave it out. -- Piet van Oostrum p...@cs.uu.nl URL:

Re: ANN: psyco V2

2009-07-27 Thread Eduardo Lenz
Em Qui 16 Jul 2009, às 19:48:18, Christian Tismer escreveu: Announcing Psyco V2 source release -- This is the long awaited announcement of Psyco V2. Psyco V2 is a continuation of the well-known psyco project, which was called finished and was dis-continued by

Re: If Scheme is so good why MIT drops it?

2009-07-27 Thread David Robinow
On 7/26/09, MRAB pyt...@mrabarnett.plus.com wrote: David Robinow wrote: This doesn't mean they're on the same level - in fact, if you read carefully you'll see my original post said as much: python attracted average programmers; php attracted mediocre programmers and even some

ANN: python-ldap-2.3.9

2009-07-27 Thread Michael Ströder
Find a new release of python-ldap: http://www.python-ldap.org/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g.

Re: RSA cryptography between Python and Java

2009-07-27 Thread Piet van Oostrum
Michael Ströder mich...@stroeder.com (MS) wrote: MS Piet van Oostrum wrote: Please note that the text to be encrypted must be smaller than the key size (at least 11 bytes smaller). You shouldn't encrypt large data with RSA anyway: it is too slow. Normally you would encrypt a session key with

wave.setparams((2, 2, 44100, 44100 * 2 * 10, NONE, not compressed)) became more than 30secs

2009-07-27 Thread '2+
thanx to rob .. who gave me an example of how to use the WAVE lib now am on my way to use it as simple as i can i wrote an oil.py the instance of which will behave like an oscillator which constantly generates 7 different wave forms (non fixed) i thought this code might produce 10secs of wave

Re: quickly looping over a 2D array?

2009-07-27 Thread Martin
On Jul 27, 12:42 pm, Peter Otten __pete...@web.de wrote: Martin wrote: I am new to python and I was wondering if there was a way to speed up the way I index 2D arrays when I need to check two arrays simultaneously? My current implementations is (using numpy) something like the

Convert raw binary file to ascii

2009-07-27 Thread r2
I have a memory dump from a machine I am trying to analyze. I can view the file in a hex editor to see text strings in the binary code. I don't see a way to save these ascii representations of the binary, so I went digging into Python to see if there were any modules to help. I found one I think

Re: Help understanding the decisions *behind* python? - immutable objects

2009-07-27 Thread Benjamin Kaplan
On Sun, Jul 26, 2009 at 2:24 PM, John Naglena...@animats.com wrote: Beni Cherniavsky wrote: On Jul 22, 9:36 am, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Tuesday 21 July 2009 15:49:59 Inky 788 wrote: My guess is that it was probably for optimization reasons long ago. I've never

Particle research opens door for new technology

2009-07-27 Thread Rashid Ali Soomro
Big uses for small particles will be explored at the annual Particle Technology Research Centre Conference at The University of Western Ontario July 9 and 10.more http://0nanotechnology0.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: quickly looping over a 2D array?

2009-07-27 Thread Peter Otten
Martin wrote: On Jul 27, 12:42 pm, Peter Otten __pete...@web.de wrote: Martin wrote: I am new to python and I was wondering if there was a way to speed up the way I index 2D arrays when I need to check two arrays simultaneously? My current implementations is (using numpy) something like

Re: quickly looping over a 2D array?

2009-07-27 Thread Martin
On Jul 27, 1:46 pm, Peter Otten __pete...@web.de wrote: Martin wrote: On Jul 27, 12:42 pm, Peter Otten __pete...@web.de wrote: Martin wrote: I am new to python and I was wondering if there was a way to speed up the way I index 2D arrays when I need to check two arrays simultaneously?

Re: Convert raw binary file to ascii

2009-07-27 Thread Peter Otten
r2 wrote: I have a memory dump from a machine I am trying to analyze. I can view the file in a hex editor to see text strings in the binary code. I don't see a way to save these ascii representations of the binary, so I went digging into Python to see if there were any modules to help. I

Testoob: How do you use testoob.collector_from_globals / collector_from_modules?

2009-07-27 Thread Harry Ebbers
Hi, For a project I'm creating unittests using testoob. When all tests are in a single file there is no problem if __name__ == '__main__': testoob.main() does the trick as usual. But for a number of python-applications they have asked me to group unittests in different files, based on

Re: quickly looping over a 2D array?

2009-07-27 Thread Peter Otten
Martin wrote: On Jul 27, 1:46 pm, Peter Otten __pete...@web.de wrote: Martin wrote: On Jul 27, 12:42 pm, Peter Otten __pete...@web.de wrote: Martin wrote: I am new to python and I was wondering if there was a way to speed up the way I index 2D arrays when I need to check two arrays

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Michal Kwiatkowski
On Jul 27, 1:56 am, a...@pythoncraft.com (Aahz) wrote: Upon a cursory look, after a generator 'gen' is exhausted (meaning gen.next() has raised StopIteration), it seems that gen.gi_frame will be None. Only in Python 2.5 or higher though. I need to support Python 2.3 and 2.4 as well, sorry

Re: Problem in PyArg_ParseTuple on python 2.5.2 with AIX

2009-07-27 Thread John Machin
On Jul 27, 8:49 pm, abhi abhigyan_agra...@in.ibm.com wrote: On Jul 27, 2:25 pm, John Machin sjmac...@lexicon.net wrote: On Jul 27, 5:11 pm, abhi abhigyan_agra...@in.ibm.com wrote: Hi,     I am facing a problem using PyArg_ParseTuple() in my C-API extension. Here is a small repro of

Re: quickly looping over a 2D array?

2009-07-27 Thread Martin
On Jul 27, 2:17 pm, Peter Otten __pete...@web.de wrote: Martin wrote: On Jul 27, 1:46 pm, Peter Otten __pete...@web.de wrote: Martin wrote: On Jul 27, 12:42 pm, Peter Otten __pete...@web.de wrote: Martin wrote: I am new to python and I was wondering if there was a way to speed

iText for Python

2009-07-27 Thread santhoshvkumar
Hi all, One of my cousin suggested me to do a IText PDF converter for python. Actually I heard that there is no separate IText converter either we have to go for jython or GCJ with wrapper. Instead of wrapping, my plan is to create a separate module with Python and I am thinking of

Re: Override a method but inherit the docstring

2009-07-27 Thread Jean-Michel Pichavant
Ben Finney wrote: Howdy all, The following is a common idiom:: class FooGonk(object): def frobnicate(self): Frobnicate this gonk. basic_implementation(self.wobble) class BarGonk(FooGonk): def frobnicate(self):

Re: Convert raw binary file to ascii

2009-07-27 Thread Grant Edwards
On 2009-07-27, r2 rlichligh...@gmail.com wrote: I have a memory dump from a machine I am trying to analyze. I can view the file in a hex editor to see text strings in the binary code. I don't see a way to save these ascii representations of the binary, $ strings memdump.binary memdump.strings

Re: How to comment constant values?

2009-07-27 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Mon, 27 Jul 2009 00:47:08 +0200, Diez B. Roggisch wrote: Only modules, classes, and functions/methods can have docstrings associated with them. For anything else, you have to use comments; or you can mention them in the docstrings of related things. While

Re: python function for retrieving key and encryption

2009-07-27 Thread Piet van Oostrum
jayshree jayshree06c...@gmail.com (j) wrote: j import M2Crypto j from M2Crypto import RSA,SSL j def encrypt(): j pk = open('my_key.public.pem', 'rb').read() j rsa = M2Crypto.RSA.load_pub_key(pk) #return a M2Crypto.RSA.RSA_pub j object. j plaintext = 4545479545655576767767686688782344

Wrapping prstat on Solaris

2009-07-27 Thread skip
At work we currently use top to monitor ongoing system utilization on our Solaris systems. As time has moved on though, use of top has become problematic. Our admins want us to switch to prstat, Sun's top-like command. It works fine however doesn't emit a timestamp at each display interval, so

Re: iText for Python

2009-07-27 Thread Simon Brunning
2009/7/27 santhoshvkumar santhosh.vku...@gmail.com:           One of my cousin  suggested me to do a IText PDF converter for python. Actually I heard that there is no separate IText converter either we have to go for jython or GCJ with wrapper. Instead of wrapping, my plan is to create a

Re: Form/Template Fill-in the blanks

2009-07-27 Thread Aahz
In article 4b77a992-370d-4879-88a0-fdd6a23f7...@p10g2000prm.googlegroups.com, allan kawe...@gmail.com wrote: My initial thought was to use: 1. .ini files to declare the EDI configuration INI file configuration: * A root INI file indicates other INI files that define each segment of the EDI

Re: Script runs manually, but cron fails

2009-07-27 Thread Bryan
On Jul 24, 2:11 pm, Bryan bryanv...@gmail.com wrote: I have a backup script that runs fine when I run it manually from the command line.  When I run it with cron, the script stops running at random points in the source code. The script calls rsync with the subprocess module, which in turn

Re: Itext for Python

2009-07-27 Thread Kushal Kumaran
On Mon, Jul 27, 2009 at 2:23 PM, S.Selvams.selvams...@gmail.com wrote: On Sun, Jul 26, 2009 at 11:52 PM, Santhosh Kumar santhosh.vku...@gmail.com wrote: Hi all,            One of my cousin  suggested me to do a IText PDF converter for python. Actually I heard that there is no separate 

Re: Script runs manually, but cron fails

2009-07-27 Thread J Kenneth King
Bryan bryanv...@gmail.com writes: I have a backup script that runs fine when I run it manually from the command line. When I run it with cron, the script stops running at random points in the source code. The script calls rsync with the subprocess module, which in turn uses ssh to backup

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Aahz
In article 1c8ae01e-2e9c-497c-9f8d-408f56f9c...@g31g2000yqc.googlegroups.com, Michal Kwiatkowski constant.b...@gmail.com wrote: On Jul 27, 1:56 am, a...@pythoncraft.com (Aahz) wrote: Upon a cursory look, after a generator 'gen' is exhausted (meaning gen.next() has raised StopIteration), it

Re: pyc files not automatically compiled on import

2009-07-27 Thread Aahz
In article mailman.3739.1248625343.8015.python-l...@python.org, Baz Walter baz...@ftml.net wrote: i thought that python automatically compiled pyc files after a module is successfully imported. what could prevent this happening? Looks like you got your problem fixed, but for the record, not

Re: If Scheme is so good why MIT drops it?

2009-07-27 Thread Aahz
In article mailman.3765.1248685391.8015.python-l...@python.org, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Sunday 26 July 2009 21:26:46 David Robinow wrote: I'm a mediocre programmer. Does this mean I should switch to PHP? I have searched, but I can find nothing about this mediocre

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Ethan Furman
[corrected top posting] Mohammad Tayseer wrote: *From:* Piet van Oostrum p...@cs.uu.nl *To:* python-list@python.org *Sent:* Monday, July 27, 2009 11:18:20 AM *Subject:* Re: Looking for a dream language: sounds like Python to me. Dotan Cohen dotanco...@gmail.com mailto:dotanco...@gmail.com

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Dotan Cohen
Creating binaries is not the same as creating /fast, efficient/ binaries.  Py2Exe bundles it all together, but does not make it any faster. How inefficient is py2exe. I was under the impression that it's really not that bad. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il --

Re: quickly looping over a 2D array?

2009-07-27 Thread Peter Otten
Martin wrote: The statement works now, but it doesn't give the same results as my original logic, strangely!? in my logic: data = np.zeros((numrows, numcols), dtype = np.uint8, order ='C') for i in range(numrows): for j in range(numcols): if band3[i,j] == 255 or

Re: If Scheme is so good why MIT drops it?

2009-07-27 Thread David Smith
Aahz wrote: In article mailman.3765.1248685391.8015.python-l...@python.org, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Sunday 26 July 2009 21:26:46 David Robinow wrote: I'm a mediocre programmer. Does this mean I should switch to PHP? I have searched, but I can find nothing about

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Jean-Paul Calderone
On Mon, 27 Jul 2009 18:12:09 +0300, Dotan Cohen dotanco...@gmail.com wrote: Creating binaries is not the same as creating /fast, efficient/ binaries.  Py2Exe bundles it all together, but does not make it any faster. How inefficient is py2exe. I was under the impression that it's really not

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread David Cournapeau
On Tue, Jul 28, 2009 at 12:12 AM, Dotan Cohendotanco...@gmail.com wrote: Creating binaries is not the same as creating /fast, efficient/ binaries.  Py2Exe bundles it all together, but does not make it any faster. How inefficient is py2exe. It is neither efficient or inefficient: it is just a

CRLF Newlines and libc

2009-07-27 Thread Eric
I am working on the subprocess.Popen module for Google Summer of Code. Right now, I am having difficulty trying to work out how to deal with my '\n' newlines being converted to '\r\n' newlines when reading from a pipe on windows; see this blog post (http://subdev.blogspot.com/ 2009/07/stdout.html)

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Grant Edwards
On 2009-07-27, Dotan Cohen dotanco...@gmail.com wrote: Creating binaries is not the same as creating /fast, efficient/ binaries. ??Py2Exe bundles it all together, but does not make it any faster. How inefficient is py2exe. [Assuming that was a question.] py2exe just bundles up the files

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Dotan Cohen
It is neither efficient or inefficient: it is just a distribution tool, to deploy python software in a form familiar to most windows users. It does not make it any faster than running the software under a python prompt. As much as I like python for scientific programming, I would say python

Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread David Cournapeau
On Tue, Jul 28, 2009 at 12:28 AM, Dotan Cohendotanco...@gmail.com wrote: It is neither efficient or inefficient: it is just a distribution tool, to deploy python software in a form familiar to most windows users. It does not make it any faster than running the software under a python prompt.

Re: exceptions.TypeError an integer is required

2009-07-27 Thread jakecjacobson
On Jul 24, 3:11 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 24 Jul 2009 11:24:58 -0700, jakecjacobson wrote: I am trying to do a post to a REST API over HTTPS and requires the script to pass a cert to the server.  I am getting exceptions.TypeError an integer is

bad certificate error

2009-07-27 Thread jakecjacobson
Hi, I am getting the following error when doing a post to REST API, Enter PEM pass phrase: Traceback (most recent call last): File ./ices_catalog_feeder.py, line 193, in ? main(sys.argv[1]) File ./ices_catalog_feeder.py, line 60, in main post2Catalog(catalog_host, catalog_port,

Re: quickly looping over a 2D array?

2009-07-27 Thread Martin
On Jul 27, 4:12 pm, Peter Otten __pete...@web.de wrote: Martin wrote: The statement works now, but it doesn't give the same results as my original logic, strangely!? in my logic: data = np.zeros((numrows, numcols), dtype = np.uint8, order ='C') for i in range(numrows): for j in

Re: [python-win32] subprocess and stdout

2009-07-27 Thread Dave Angel
(This message was top-posted, and sent off-list. So I'm copying it back to the list, with my response at the end) Chris Chapman wrote: Thanks Dave. You know after trying your suggestion on the command prompt it doesn't as a matter of fact. Not sure why I didn't just try that in windows to

Re: quickly looping over a 2D array?

2009-07-27 Thread Robert Kern
On 2009-07-27 06:24, Martin wrote: Hi, I am new to python and I was wondering if there was a way to speed up the way I index 2D arrays when I need to check two arrays simultaneously? My current implementations is (using numpy) something like the following... for i in range(numrows): for j

New implementation of re module

2009-07-27 Thread MRAB
Hi all, I've been working on a new implementation of the re module. The details are at http://bugs.python.org/issue2636, specifically from http://bugs.python.org/issue2636#msg90954. I've included a .pyd file for Python 2.6 on Windows if you want to try it out. I'm interested in how fast it is

Using easy_install, reduncant?

2009-07-27 Thread ray
I am working on a Trac installation. I am new to Python. To install packages, it is suggested to use setuptools. I have not understood the directions. I execute ez_install.py. Then I attempt to execute easy_install.py setuptools-0.6c9-py2.6.egg. There response that setuptools is already the

Re: Using easy_install, reduncant?

2009-07-27 Thread John Nagle
ray wrote: I am working on a Trac installation. I am new to Python. To install packages, it is suggested to use setuptools. I have not understood the directions. I execute ez_install.py. Then I attempt to execute easy_install.py setuptools-0.6c9-py2.6.egg. There response that setuptools is

Re: Using easy_install, reduncant?

2009-07-27 Thread Diez B. Roggisch
John Nagle wrote: ray wrote: I am working on a Trac installation. I am new to Python. To install packages, it is suggested to use setuptools. I have not understood the directions. I execute ez_install.py. Then I attempt to execute easy_install.py setuptools-0.6c9-py2.6.egg. There

M2Crypto hangs on this URL

2009-07-27 Thread John Nagle
There's something strange about this URL: https://sagar310.pontins.com/sraep/; It hangs Firefox 2; there's no short timeout, the web page just gets stuck in initial load for about ten minutes. Then The connection to sagar310.pontins.com was interrupted while the page was loading. It hangs

ioctl on socket

2009-07-27 Thread jacopo mondi
Is there a reason why there is no ioctl interface for socket either then for windows platform? It's technical issues or what else?? thank in advance jacopo -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert raw binary file to ascii

2009-07-27 Thread r2
On Jul 27, 9:06 am, Peter Otten __pete...@web.de wrote: r2 wrote: I have a memory dump from a machine I am trying to analyze. I can view the file in a hex editor to see text strings in the binary code. I don't see a way to save these ascii representations of the binary, so I went digging

Re: Convert raw binary file to ascii

2009-07-27 Thread r2
On Jul 27, 10:11 am, Grant Edwards inva...@invalid wrote: On 2009-07-27, r2 rlichligh...@gmail.com wrote: I have a memory dump from a machine I am trying to analyze. I can view the file in a hex editor to see text strings in the binary code. I don't see a way to save these ascii

initializing with empty list as default causes freaky problems

2009-07-27 Thread Reckoner
Hi, Observe the following: In [202]: class Foo(): .: def __init__(self,h=[]): .: self.h=h .: .: In [203]: f=Foo() In [204]: g=Foo() In [205]: g.h Out[205]: [] In [206]: f.h Out[206]: [] In [207]: f.h.append(10) In [208]: f.h Out[208]: [10] In [209]:

Re: initializing with empty list as default causes freaky problems

2009-07-27 Thread MRAB
Reckoner wrote: Hi, X-Antispam: NO; Spamcatcher 5.2.1. Score 50 Observe the following: In [202]: class Foo(): .: def __init__(self,h=[]): .: self.h=h .: .: In [203]: f=Foo() In [204]: g=Foo() In [205]: g.h Out[205]: [] In [206]: f.h Out[206]: [] In

Re: Convert raw binary file to ascii

2009-07-27 Thread Peter Otten
r2 wrote: On Jul 27, 9:06 am, Peter Otten __pete...@web.de wrote: r2 wrote: I have a memory dump from a machine I am trying to analyze. I can view the file in a hex editor to see text strings in the binary code. I don't see a way to save these ascii representations of the binary, so I

Re: M2Crypto hangs on this URL

2009-07-27 Thread John Nagle
John Nagle wrote: There's something strange about this URL: https://sagar310.pontins.com/sraep/; It hangs Firefox 2; there's no short timeout, the web page just gets stuck in initial load for about ten minutes. Then The connection to sagar310.pontins.com was interrupted while the page was

Re: CRLF Newlines and libc

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 12:21:29 -0300, Eric gmwee...@gmail.com escribió: I am working on the subprocess.Popen module for Google Summer of Code. Right now, I am having difficulty trying to work out how to deal with my '\n' newlines being converted to '\r\n' newlines when reading from a pipe on

Re: bad certificate error

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson jakecjacob...@gmail.com escribió: I was wondering if this is due to the server having a invalid server cert? If I go to this server in my browser, I get a This server tried to identify itself with invalid information. Is there a way to

where do I put resources (images, audio files) when I wrote Python program?

2009-07-27 Thread Piotrek
Hello, I write a Python program. It will contain some images (in .png format), some audio files (as .ogg) etc. Now I think where should my installer put these files and how should I access them. What is the normal Python way of doing that? I think about puting these files in /usr/share/myprogram

Re: bad certificate error

2009-07-27 Thread jakecjacobson
On Jul 27, 2:23 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson   jakecjacob...@gmail.com escribió: I was wondering if this is due to the server having a invalid server cert?  If I go to this server in my browser, I get a This server

Re: where do I put resources (images, audio files) when I wrote Python program?

2009-07-27 Thread mhearne808
On Jul 27, 12:43 pm, Piotrek niedzi...@gazeta.pl wrote: Hello, I write a Python program. It will contain some images (in .png format), some audio files (as .ogg) etc. Now I think where should my installer put these files and how should I access them. What is the normal Python way of doing

  1   2   >