Re: exceptions.TypeError an integer is required

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 12:44:40 -0300, jakecjacobson escribió: You are quite correct in your statements. My goal was not to make great code but something that I could quickly test. My assumption was that the httplib.HTTPSConnection() would do the cast to int for me. As soon as I cast it to an i

Re: What is file.encoding convention?

2009-07-27 Thread Gabriel Genellina
En Thu, 23 Jul 2009 21:49:26 -0300, Naoki INADA escribió: The encoding that this file uses. When Unicode strings are written to a file, they will be converted to byte strings using this encoding. In addition, when the file is connected to a terminal, the attribute gives the encoding t

Determining __name__ from the code that called a function

2009-07-27 Thread Paul Johnston
Hi, In ToscaWidgets 2 experimental, when defining resources you often do something like this: CSSLink(modname=__name__, filename='static/mycss.css') Now, what I'd like to do is make the "modname=__name__" optional, to make code more concise. I figure there must be some way (using inspect or somet

Re: Download the "head" of a large file?

2009-07-27 Thread Ben Charrow
Dennis Lee Bieber wrote: On Mon, 27 Jul 2009 13:38:25 -0700 (PDT), erikcw declaimed the following in gmane.comp.python.general: Something like the Python equivalent of curl http://url.com/file.xml | head -c 2048 Presuming that | is a shell pipe operation, then doesn't that command lin

Re: Error in compiling Python on OS X

2009-07-27 Thread Kevin
On Jul 26, 3:46 pm, "Diez B. Roggisch" wrote: > Kevin schrieb: > > > I am trying to compile Python 2.6.2 on Mac OS X 10.5.7.  I have Xcode > > 3.1.3 installed. > > > The error I got is below. > > > $ ./configure --prefix=/Users/me/python > > Use a framework-build. > > > checking for --with-univers

new version of SSL module on PyPI

2009-07-27 Thread Bill Janssen
I've uploaded ssl-1.15.tgz, the backport of the 2.6/3.x SSL module to Python 2.3-2.5. It provides an option for not using SSLv2, and also fixes a bug with write retries. Bill -- http://mail.python.org/mailman/listinfo/python-list

Re: New implementation of re module

2009-07-27 Thread OKB (not okblacke)
MRAB wrote: > http://bugs.python.org/issue2636#msg90954 Variable-length lookbehind! My hero! -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/ma

Re: Gracefully exiting CLI application

2009-07-27 Thread Doron Tal
On Tue, Jul 28, 2009 at 12:52 AM, Jan Kaliszewski wrote: > As I wrote, you must use signals. Though sometimes it's a good idea > to combine these two techniques (i.e. signal handlers call sys.exit(), > then sys.exitfunc/or function registered with atexit does the actual > cleaning actions). Ano

Re: How to get the output struct parameter by extending C function?

2009-07-27 Thread Gabriel Genellina
En Tue, 28 Jul 2009 00:06:06 -0300, jammy escribió: I an just starting to use the ctypes module. Now I want to expentd C in python. In the function of C, I want to get the output struct parameter which is chaged in the function. You're mixing a C extension with a ctypes call - why is tha

Re: _msi.Record object has no attribute 'GetString'

2009-07-27 Thread ++imanshu
On Jul 27, 4:38 pm, "++imanshu" wrote: > 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_READ

Re: Extract images from PDF files

2009-07-27 Thread David Lyon
pdftohtml on sourceforge may help... On Mon, 27 Jul 2009 19:52:01 -0700 (PDT), writeson wrote: > Hi all, > > I've looked around with Google quite a bit, but haven't found anything > like what I'm looking for. Is there a Python library that will extract > images from PDF files? My ultimate goal

Re: [Baypiggies] Egnyte: hiring

2009-07-27 Thread mobiledreamers
Seems interesting http://fotoroll.com/searchvideo?q=vineet%20jain,%20ceo%20of%20egnyte&id=0&type=video On Mon, Jul 27, 2009 at 7:46 PM, Aahz wrote: > My new company (I just started today) closed a big venture

How to get the output struct parameter by extending C function?

2009-07-27 Thread jammy
Hello, I an just starting to use the ctypes module. Now I want to expentd C in python. In the function of C, I want to get the output struct parameter which is chaged in the function. following is my code: --- 1.Header file of C(information.h)--- typedef struct { char name[20

[ANN] pyxser-1.1r --- python xml serialization

2009-07-27 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello, I'm pleased to announce pyxser-1.1r, a Python-Object to XML serializer and deserializer. This package it's completly written in C and licensed under LGPLv3. The tested Python versions are 2.5.X and 2.7.X. * home page: http://coder.cl/soft

Re: New implementation of re module

2009-07-27 Thread Aahz
In article , MRAB wrote: > >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. How does it

Extract images from PDF files

2009-07-27 Thread writeson
Hi all, I've looked around with Google quite a bit, but haven't found anything like what I'm looking for. Is there a Python library that will extract images from PDF files? My ultimate goal is to pull the images out, use the PIL library to reduce the size of the images and rebuild another PDF file

Re: bad certificate error

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 20:00:27 -0300, Steven D'Aprano escribió: On Mon, 27 Jul 2009 15:23:41 -0300, Gabriel Genellina wrote: En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson escribió: I was wondering if this is due to the server having a invalid server cert? If I go to this server in my brow

Re: ioctl on socket

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 16:35:51 -0300, jacopo mondi escribió: Is there a reason why there is no ioctl interface for socket either then for windows platform? It's technical issues or what else?? I don't completely understand your question. On Windows, you can use socket.ioctl with sockets, and De

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

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 17:53:12 -0300, Dave Angel escribió: Piotrek wrote: 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

Re: Download the "head" of a large file?

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 19:40:25 -0300, John Yeung escribió: On Jul 27, 4:38 pm, erikcw wrote: I'm trying to figure out how to download just the first few lines of a large (50mb) text file form a server to save bandwidth.  Can Python do this? Something like the Python equivalent of curlhttp://ur

Re: bad certificate error

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 15:52:08 -0300, jakecjacobson escribió: On Jul 27, 2:23 pm, "Gabriel Genellina" wrote: En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson   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

Next meeting: Tuesday 11th August

2009-07-27 Thread Richard Jones
The next meeting of the Melbourne Python Users Group will be on Tuesday the 11th of August starting at 6:30pm. We'll be meeting at Horse Bazaar again but this time we'll have use of their projector. We'll have time for several short presentations or lightning talks. Meeting details, locatio

Re: Using easy_install, reduncant?

2009-07-27 Thread David Lyon
On Mon, 27 Jul 2009 09:42:06 -0700 (PDT), 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 setuptoo

Re: Discovery IP in connection

2009-07-27 Thread Piet van Oostrum
> Djames Suhanko (DS) wrote: >DS> Hello,all! >DS> I wrote a little programa that listening UDP packets. A can receive >DS> the messages, but I can't see the the origin IP. >DS> How can I to get the remote IP address in connection? What do you think the addr is for in data, addr = mySocke

Re: Discovery IP in connection

2009-07-27 Thread Roy Smith
In article , Djames Suhanko wrote: > Hello,all! > I wrote a little programa that listening UDP packets. A can receive > the messages, but I can't see the the origin IP. > How can I to get the remote IP address in connection? > > My source: > > #!/usr/bin/env python > import socket > mySocke

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

2009-07-27 Thread David Robinow
On Mon, Jul 27, 2009 at 9:49 AM, Aahz wrote: > In article , > Hendrik van Rooyen   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 language. >> >

Re: initializing with empty list as default causes freaky problems

2009-07-27 Thread Gary Herron
Reckoner wrote: 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]

Re: bad certificate error

2009-07-27 Thread Steven D'Aprano
On Mon, 27 Jul 2009 15:23:41 -0300, Gabriel Genellina wrote: > En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson > 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

Re: Download the "head" of a large file?

2009-07-27 Thread John Yeung
On Jul 27, 4:38 pm, erikcw wrote: > I'm trying to figure out how to download just the first few lines of a > large (50mb) text file form a server to save bandwidth.  Can Python do > this? > > Something like the Python equivalent of curlhttp://url.com/file.xml| > head -c 2048 urllib.urlopen gives

Re: Download the "head" of a large file?

2009-07-27 Thread Ben Charrow
erikcw wrote: > ...download just the first few lines of a large (50mb) text file form a > server to save bandwidth. Something like the Python equivalent of curl > http://url.com/file.xml | head -c 2048 If you're OK calling curl and head from within python: from subprocess import Popen, PIPE u

Re: Gracefully exiting CLI application

2009-07-27 Thread Jan Kaliszewski
27-07-2009 Ben Finney wrote: David <71da...@libero.it> writes: I am writing a command line application, and I need to perform some cleaning on exit even if the process is killed. How can I do that with python? Write an “exit handler” function, then use ‘atexit.register’ http://docs.python.o

Re: Gracefully exiting CLI application

2009-07-27 Thread Ben Finney
David <71da...@libero.it> writes: > I am writing a command line application, and I need to perform some > cleaning on exit even if the process is killed. How can I do that with > python? Write an “exit handler” function, then use ‘atexit.register’ http://docs.python.org/library/atexit> to registe

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Michal Kwiatkowski
On Jul 27, 10:47 pm, Terry Reedy wrote: > There are two possible definition of 'exhausted': 1) will raise > StopIteration on the next next() call; 2) has raised StopIteration at > least once. The wrapper converts 2) to 1), which is to say, it obeys > definition 1 once the underlying iteration has

Re: Gracefully exiting CLI application

2009-07-27 Thread Jan Kaliszewski
27-07-2009 o 22:35:01 David <71da...@libero.it> wrote: I am writing a command line application, and I need to perform some cleaning on exit even if the process is killed. How can I do that with python? See: http://docs.python.org/library/signal.html Cheers, *j -- Jan Kaliszewski (zuo) --

Re: Override a method but inherit the docstring

2009-07-27 Thread Shai
On Jul 27, 5:05 pm, Jean-Michel Pichavant wrote: > Ben Finney wrote: > > > > The docstring for ‘FooGonk.frobnicate’ is, intentionally, perfectly > > applicable to the ‘BarGonk.frobnicate’ method also. Yet in overriding > > the method, the original docstring is not associated with it. > > I've also

Re: M2Crypto hangs on this URL

2009-07-27 Thread Martin P. Hellwig
John Nagle wrote: John Nagle wrote: 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.co

Re: Convert raw binary file to ascii

2009-07-27 Thread Jan Kaliszewski
Hello Friends, It's my first post to python-list, so first let me introduce myself... * my name is Jan Kaliszewski, * country -- Poland, * occupation -- composer (studied in F. Chopin Academy of Music @Warsaw) and programmer (currently in Record System company,

Re: len() should always return something

2009-07-27 Thread Joel Koltner
"Dr. Phillip M. Feldman" wrote in message news:mailman.3699.1248490256.8015.python-l...@python.org... > Here's a simple-minded example: ... > This function works fine if xs is a list of floats, but not if it is single > float. It can be made to work as follows: Wow, you could substitute "Matlab

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

2009-07-27 Thread Dave Angel
Piotrek 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 that? I think about puting these files in /usr/

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Terry Reedy
Steven D'Aprano wrote: 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. W

Download the "head" of a large file?

2009-07-27 Thread erikcw
I'm trying to figure out how to download just the first few lines of a large (50mb) text file form a server to save bandwidth. Can Python do this? Something like the Python equivalent of curl http://url.com/file.xml | head -c 2048 Thanks! Erik -- http://mail.python.org/mailman/listinfo/python-l

Gracefully exiting CLI application

2009-07-27 Thread David
Greetings, I am writing a command line application, and I need to perform some cleaning on exit even if the process is killed. How can I do that with python? Thank you. David. -- http://mail.python.org/mailman/listinfo/python-list

Discovery IP in connection

2009-07-27 Thread Djames Suhanko
Hello,all! I wrote a little programa that listening UDP packets. A can receive the messages, but I can't see the the origin IP. How can I to get the remote IP address in connection? My source: #!/usr/bin/env python import socket mySocket = socket.socket ( socket.AF_INET, socket.SOCK_DGRAM ) my

Re: M2Crypto hangs on this URL

2009-07-27 Thread John Nagle
John Nagle wrote: 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 w

PyPDF and print restrictions

2009-07-27 Thread Chris Curvey
Has anyone out there been able to enforce print restrictions on a PDF document by using PyPDF? The documentation for "encrypt" states: # @param user_pwd The "user password", which allows for opening and reading # the PDF file with the restrictions provided. But there is no parameter for providi

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

2009-07-27 Thread Dave Angel
Benjamin Kaplan wrote: On Sun, Jul 26, 2009 at 2:24 PM, John Nagle wrote: Beni Cherniavsky wrote: On Jul 22, 9:36 am, Hendrik van Rooyen wrote: On Tuesday 21 July 2009 15:49:59 Inky 788 wrote: problem. An interesting issue is Python objects, which are always mutabl

Re: Convert raw binary file to ascii

2009-07-27 Thread Dave Angel
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: New implementation of re module

2009-07-27 Thread MRAB
William Dode wrote: On 27-07-2009, MRAB wrote: 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

Re: Convert raw binary file to ascii

2009-07-27 Thread r2
On Jul 27, 2:07 pm, Peter Otten <__pete...@web.de> wrote: > 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

Re: initializing with empty list as default causes freaky problems

2009-07-27 Thread Benjamin Kaplan
On Mon, Jul 27, 2009 at 1:40 PM, Reckoner wrote: > 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

Re: len() should always return something

2009-07-27 Thread Grant Edwards
On 2009-07-27, Joshua Kugler wrote: > Dr. Phillip M. Feldman wrote: > >> "As far as I know, there is no programming language which >> treats scalars like ints as if they were vectors of length 1" >> >> Actually, Matlab does: >> length(5) >> ans = >> 1 > > Oddly enough, so does Pe

Re: Wrapping prstat on Solaris

2009-07-27 Thread Diez B. Roggisch
s...@pobox.com schrieb: 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 e

Re: New implementation of re module

2009-07-27 Thread Wolfgang Rohdewald
On Monday 27 July 2009, MRAB wrote: > 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. h

Re: len() should always return something

2009-07-27 Thread Joshua Kugler
Dr. Phillip M. Feldman wrote: > > "As far as I know, there is no programming language which treats scalars > like ints as if they were > vectors of length 1" > > Actually, Matlab does: > >>> length(5) > ans = > 1 >>> Oddly enough, so does Perl: $ print length(44) 2 (that's in the Zoidb

Re: New implementation of re module

2009-07-27 Thread William Dode
On 27-07-2009, MRAB wrote: > 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.

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 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 > that? I think ab

Re: bad certificate error

2009-07-27 Thread jakecjacobson
On Jul 27, 2:23 pm, "Gabriel Genellina" wrote: > En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson   > 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 inval

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 a

Re: bad certificate error

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 12:57:40 -0300, jakecjacobson 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 ignore this issue with Pyth

Re: CRLF Newlines and libc

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 12:21:29 -0300, Eric 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 windows; see this blog

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: 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 bin

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 [

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: Convert raw binary file to ascii

2009-07-27 Thread r2
On Jul 27, 10:11 am, Grant Edwards wrote: > On 2009-07-27, 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, > > $ str

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 wen

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

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

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.

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 a

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 ac

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 ge

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

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 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):

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, ca

Re: exceptions.TypeError an integer is required

2009-07-27 Thread jakecjacobson
On Jul 24, 3:11 pm, Steven D'Aprano 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 required" error and can't find

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 Cohen 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. >> >> As much

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 >

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

2009-07-27 Thread Grant Edwards
On 2009-07-27, Dotan Cohen 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 needed to run the p

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 David Cournapeau
On Tue, Jul 28, 2009 at 12:12 AM, Dotan Cohen 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 distribution

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 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 that bad. py2exe doe

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

2009-07-27 Thread David Smith
Aahz wrote: > In article , > Hendrik van Rooyen 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 language. >> >> Could you tell us more? > > :-P >

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: 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: 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 *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 mailto:dotanco...@gmail.com>> (DC) wrote: >DC> Referring

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

2009-07-27 Thread Aahz
In article , Hendrik van Rooyen 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 language. > >Could you tell us more? :-P (For anyone who is confus

Re: pyc files not automatically compiled on import

2009-07-27 Thread Aahz
In article , Baz Walter 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 having write permission on a directory also causes this. It's eve

Re: Distinguishing active generators from exhausted ones

2009-07-27 Thread Aahz
In article <1c8ae01e-2e9c-497c-9f8d-408f56f9c...@g31g2000yqc.googlegroups.com>, Michal Kwiatkowski 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 seems that gen.gi

Re: Script runs manually, but cron fails

2009-07-27 Thread J Kenneth King
Bryan 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 files from a bo

Re: Itext for Python

2009-07-27 Thread Kushal Kumaran
On Mon, Jul 27, 2009 at 2:23 PM, S.Selvam wrote: > > > On Sun, Jul 26, 2009 at 11:52 PM, Santhosh Kumar > 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 IText converter either we >> have to go

Re: Script runs manually, but cron fails

2009-07-27 Thread Bryan
On Jul 24, 2:11 pm, Bryan 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 uses > ssh to back

Re: Form/Template Fill-in the blanks

2009-07-27 Thread Aahz
In article <4b77a992-370d-4879-88a0-fdd6a23f7...@p10g2000prm.googlegroups.com>, allan 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 document. >

Re: iText for Python

2009-07-27 Thread Simon Brunning
2009/7/27 santhoshvkumar : >           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

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 i

Re: python function for retrieving key and encryption

2009-07-27 Thread Piet van Oostrum
> jayshree (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 >j>

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 th

Re: Convert raw binary file to ascii

2009-07-27 Thread Grant Edwards
On 2009-07-27, 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, $ strings memdump.binary >memdump.strings $ hexdump -C memd

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): special_implemen

  1   2   >