Re: distutils and ctypes

2007-01-09 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I suspect that I'm doing something stupid, I would like some other > opinions though. > I'm getting started with ctypes and am trying to use distutils to help > build my module. At the moment I simply want distutils to build a > shared c library (not a python extension!

Re: distutils and ctypes

2007-01-09 Thread Robert Kern
Martin v. Löwis wrote: > Not sure it's stupid, but I wonder why you want to use ctypes. What's > wrong with extension modules? What's wrong with ctypes? They're both valid, useful approaches to connect to C libraries. -- Robert Kern "I have come to believe that the whole world is an enigma, a

Re: Summarizing data by week

2007-01-09 Thread Larry Bates
Mike Orr wrote: > What's the best way to summarize data by week? I have a set of > timestamped records, and I want a report with one row for each week in > the time period, including zero rows if there are weeks with no > activity. I was planning to use ISO weeks because datetime has a > convenie

Re: Internet Survey

2007-01-09 Thread CBFalconer
[EMAIL PROTECTED] wrote: > > I represent Octabox, an Internet Start-up developing a wide-scale > platform for Internet services. We are very interested to know > your thoughts on Internet productivity and how it might be > improved, and to that end we have set up a short survey at our > website -

A question about IDLE and environment variables

2007-01-09 Thread Tristan
Hello community: I post this because I could not find satisfactory answers in the posts generated by this nice group. I work on winXP. I have many little python applications in different folders, each application can share or not other objects located in the same or other folders. The way I work to

Python - C# interoperability

2007-01-09 Thread mc
Is there an easy way to compile a Python class (or set of classes) into a .DLL that a C# program can call? Or otherwise to use an existing library of Python classes from a C# program as seamlessly as possible? -- http://mail.python.org/mailman/listinfo/python-list

Re: Internet Survey

2007-01-09 Thread Elan Magavi
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello all, > > I represent Octabox, an Internet Start-up developing a wide-scale > platform for Internet services. We are very interested to know your > thoughts on Internet productivity and how it might be improved, and to > that end

What does the -O flag do?

2007-01-09 Thread Sard
http://rgruet.free.fr/PQR25/PQR2.5.html says "Optimize generated bytecode (also PYTHONOPTIMIZE=x). Asserts are suppressed." Is removing asserts all it does, where can I find more details? I'm guessing it's not very useful as I hardly ever see it mentioned. -- http://mail.python.org/mailman/lis

injecting functions into a python sandbox within a python program

2007-01-09 Thread Graham Menhennitt
I have a large Python 2.5 program that I want my users to be able to "extend" using a Python script. However, I want their script to run in a sandbox within the overall program so that they only have access to the rest of the program via a single simple interface. Note that this is not meant to

Re: distutils and ctypes

2007-01-09 Thread Martin v. Löwis
Robert Kern schrieb: >> Not sure it's stupid, but I wonder why you want to use ctypes. What's >> wrong with extension modules? > > What's wrong with ctypes? They're both valid, useful approaches to connect to > C > libraries. See the original posting. Distutils doesn't support building arbitrary

Re: Python - C# interoperability

2007-01-09 Thread Martin v. Löwis
mc schrieb: > Is there an easy way to compile a Python class (or set of classes) into > a .DLL that a C# program can call? Or otherwise to use an existing > library of Python classes from a C# program as seamlessly as possible? You should take a look at IronPython, which supports that kind of thi

Re: Python - C# interoperability

2007-01-09 Thread Bruno Desthuilliers
mc a écrit : > Is there an easy way to compile a Python class (or set of classes) into > a .DLL that a C# program can call? Or otherwise to use an existing > library of Python classes from a C# program as seamlessly as possible? > I can't tell if that'll do, but have you looked at IronPython ? --

find.find

2007-01-09 Thread Gigs_
import fnmatch, os def find(pattern, startdir=os.curdir): matches = [] os.path.walk(startdir, findvisitor, (matches, pattern)) matches.sort() return matches def findvisitor((matches, pattern), thisdir, nameshere): # for name in nameshere: if fnmatch.fnmatch(name

Re: injecting functions into a python sandbox within a python program

2007-01-09 Thread Bruno Desthuilliers
Graham Menhennitt a écrit : > I have a large Python 2.5 program that I want my users to be able to > "extend" using a Python script. However, I want their script to run in a > sandbox within the overall program so that they only have access to the > rest of the program via a single simple interf

Re: Non-blocking pipes during subprocess handling

2007-01-09 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Tom Plunket <[EMAIL PROTECTED]> wrote: > I'm using subprocess to launch, well, sub-processes, but now I'm > stumbling due to blocking I/O. > > Is there a way for me to know that there's data on a pipe, and possibly > how much data is there so I can get it? Curren

Re: What does the -O flag do?

2007-01-09 Thread Martin v. Löwis
Sard schrieb: > "Optimize generated bytecode (also PYTHONOPTIMIZE=x). Asserts are > suppressed." > > Is removing asserts all it does, where can I find more details? I'm > guessing it's not very useful as I hardly ever see it mentioned. It somewhat depends on the Python version. To find out preci

[ANN] win32 binaries for zope.interface 3.3.0

2007-01-09 Thread Petri Savolainen
Both eggs and installers (exe) are available for Python 2.4 & 2.5 from: http://www.zope.org/Members/saffe/zope_interface/folder_contents Compiled on winxp pro using mingw32 "current". Cheers, Petri -- http://mail.python.org/mailman/listinfo/python-list

The trouble with sockets.... (fixing inheritance, etc.)

2007-01-09 Thread rossabri
This topic has been addressed in limited detail in other threads: [1] "sockets don't play nice with new style classes :(" May 14 2005. http://groups.google.com/group/comp.lang.python/browse_thread/thread/76d27388b0d286fa/c9849013e37c995b [2] "Subclassing socket" Dec 20 2005 - Jan 14 2006. http://

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Carroll, Barry
John et al: I've spent about a day investigating our "too many open files" error. I found the following: 1. Windows XP allows a Python 2.5 script to open 509 concurrent files. 2. RedHat Fedora Core 1 allows a Python 2.3 script to open 1022 concurrent fi

Re: distutils and ctypes

2007-01-09 Thread Robert Kern
Martin v. Löwis wrote: > Robert Kern schrieb: >>> Not sure it's stupid, but I wonder why you want to use ctypes. What's >>> wrong with extension modules? >> What's wrong with ctypes? They're both valid, useful approaches to connect >> to C >> libraries. > > See the original posting. Distutils doe

maildir->mbox conversion script review

2007-01-09 Thread matej
Hi, I am writing a script to convert couple of thousand emails (in couple of hundred folders) and before I will get to the hard part -- maintaing structure folders and subfolders, and maintaing record of the status of the message, I would like to be sure that I have at least maildir->mbox conversi

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Gabriel Genellina
At Tuesday 9/1/2007 20:31, Carroll, Barry wrote: I've spent about a day investigating our "too many open files" error. I found the following: 1. Windows XP allows a Python 2.5 script to open 509 concurrent files. And do you actually need so many open files simultaneously?

Re: pyExcelerator big integer values

2007-01-09 Thread John Machin
On Jan 10, 12:30 am, "Gacha" <[EMAIL PROTECTED]> wrote: > I use pyExcelerator to import some data from xml file. One column > contains integer values like: > 4750456000708 > 4750456000715 > 4750456000333 I think you must mean "xls", not "xml". Those are integers only in the mathematical sens

Re: find.find

2007-01-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Gigs_ wrote: > import fnmatch, os > > def find(pattern, startdir=os.curdir): > matches = [] > os.path.walk(startdir, findvisitor, (matches, pattern)) > matches.sort() > return matches > > def findvisitor((matches, pattern), thisdir, nameshere): # >

dynamic library loading, missing symbols

2007-01-09 Thread [EMAIL PROTECTED]
While my question doesn't pertain specifically to python programming, it is a result of developing a python module, so I'm hoping someone here might have experience with this issue. So, first a little background to how the system works right now. I am developing a module for Python. The original c

tkinter Ignoring Certain Key Presses?

2007-01-09 Thread Tim Daneliuk
I am having trouble getting tkinter to recognize the following key presses- it seems to be ignoring them alltogether: Alt F1-F10: FreeBSD 4.x console running XFree86 and cygwin/X (current) connected to same machine. Works on cygwin/X local to Windows machine and native W

Question: Best Practice? (module 'shelve')

2007-01-09 Thread Thomas Ploch
Hello fellows, I just wanted to know, if there is any best practice concerning following code: import re, shelve class TextMatcher: def __init__(self, patterns, email=False, dbName='textmatch.db'): self._initPatterns(patterns) self.email = email self.dbName = dbName

Re: Question: Best Practice? (module 'shelve')

2007-01-09 Thread Thomas Ploch
Thomas Ploch schrieb: > Hello fellows, > > I just wanted to know, if there is any best practice concerning > following code: > > import re, shelve > > class TextMatcher: > def __init__(self, patterns, email=False, dbName='textmatch.db'): > self._initPatterns(patterns) > self.

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Carroll, Barry
Hi, Gabriel, > -Original Message- > From: Gabriel Genellina [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 09, 2007 4:06 PM > To: python-list@python.org > Subject: RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final > report) > > At Tuesday 9/1/2007 20:31, Carroll, Barry wrote:

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Gabriel Genellina
At Tuesday 9/1/2007 22:03, Carroll, Barry wrote: The first assumption was correct: the file object is destroyed. The second assumption is apparently incorrect: the file handle is not released when the associated object is destroyed. These 'orphaned' file handles build up and when the OS hand

Read CSV file into an array

2007-01-09 Thread oyekomova
I would like to know how to read a CSV file with a header ( n columns of float data) into an array without the header row. -- http://mail.python.org/mailman/listinfo/python-list

Re: Read CSV file into an array

2007-01-09 Thread Robert Kern
oyekomova wrote: > I would like to know how to read a CSV file with a header ( n columns > of float data) into an array without the header row. Did you read our responses from the last time you asked this question? -- Robert Kern "I have come to believe that the whole world is an enigma, a harm

"tkinter module not found" please help

2007-01-09 Thread notsonice51
I'm trying to install python2.5 on my computer(os Fedora 5). My problem is that I'm unable to get the tkinter module loaded into python. I've tried the solution here:"wiki.python.org/moin/TkInter" but am unsure as how to modify my setup.py script. I have installed the latest versions of tcl/tk (8.4

Re: Summarizing data by week

2007-01-09 Thread Dan Bishop
On Jan 9, 1:57 pm, "Mike Orr" <[EMAIL PROTECTED]> wrote: > What's the best way to summarize data by week? I have a set of > timestamped records, and I want a report with one row for each week in > the time period, including zero rows if there are weeks with no > activity. I was planning to use IS

Re: Python - C# interoperability

2007-01-09 Thread Luis M. González
mc wrote: > Is there an easy way to compile a Python class (or set of classes) into > a .DLL that a C# program can call? Or otherwise to use an existing > library of Python classes from a C# program as seamlessly as possible? I'm affraid this is not possible. Ironpython (the .NET python implemen

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Mark T
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At Tuesday 9/1/2007 20:31, Carroll, Barry wrote: > >>I've spent about a day investigating our "too many open files" error. I >>found the following: >> >> 1. Windows XP allows a Python 2.5 script to open 509

pgen2 use questions.

2007-01-09 Thread Brian L. Troutwine
I happened to stumble upon Guido's announcement of his python2 to python3 refactoring tool earlier today (http://mail.python.org/pipermail/python-3000/2006-December/005102.html), and, after playing with it a bit, I have some use questions as I don't quite understand how the pattern matching languag

Re: where is python on linux?

2007-01-09 Thread Kevin Yuan
Frank Potter wrote: >> ... where is the executable python file? ... >> > > does > > whereis python "whereis" is cool! -- http://mail.python.org/mailman/listinfo/python-list

Announcement -- ZestyParser

2007-01-09 Thread Adam Atlas
This has been on Cheese Shop for a few weeks now, being updated now and then, but I never really announced it. I just now put up a real web page for it, so I thought I'd take the opportunity to mention it here. ZestyParser is my attempt at a flexible toolkit for creating concise, precise, and Pyth

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Julio Biason
[Kinda stealing the thread] On Tue, Jan 09, 2007 at 09:05:30PM -0300, Gabriel Genellina wrote: > And do you actually need so many open files simultaneously? > Try to close them explicitely when you finish working on them - do > not rely on GC for closing files. This has *always* been the > recom

Re: "tkinter module not found" please help

2007-01-09 Thread Asper Faner
[EMAIL PROTECTED] wrote: > I'm trying to install python2.5 on my computer(os Fedora 5). My problem > is that I'm unable to get the tkinter module loaded into python. I've > tried the solution here:"wiki.python.org/moin/TkInter" but am unsure as > how to modify my setup.py script. I have installed

Wierd M2Crypto bug - phony "peer did not return certificate" error

2007-01-09 Thread John Nagle
Here's a wierd problem: I have a little test case for M2Crypto, which just opens up SSL connections to web servers and reads their certificates. This works fine. But if I execute socket.setdefaulttimeout(5.0) so that the sockets don't wait too long if there's no SSL server, I get a "peer

Re: distutils and ctypes

2007-01-09 Thread Martin v. Löwis
Robert Kern schrieb: > To which I say that doing the type-checking and error handling is much easier > in > Python than using the C API. Add to that the tediousness of the > edit-compile-run > cycle of C and the finickiness of refcounting. Sure: edit-compile-run is tedious, but in the given case

Re: How do I add users using Python scripts on a Linux machine

2007-01-09 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Piet van Oostrum wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> (LD) wrote: > In message <[EMAIL PROTECTED]>, Piet van Oostrum wrote: > >> The scenario is as follows: Suppose the script starts with the line: >> #!/usr/bin/python >> >> (using #!/usr/bin/env pytho

Re: dynamic library loading, missing symbols

2007-01-09 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > However, the linker fails at runtime here because it can't > find this symbol. The variable in question does exist in the C++ code > that in does dlopen. Did you verify, using nm -D, that the symbol is indeed present in the shared object, not just in the source code?

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Gabriel Genellina
At Wednesday 10/1/2007 02:36, Julio Biason wrote: [Kinda stealing the thread] (at least a related question!) If I use a file() in a for, how to I explicitely close the file? for line in file('contents'): print line Would this work like the new 'with' statement or it will only be close

Re: how to clean sys.path

2007-01-09 Thread siggi
Thank you Laszlo! Take care, siggi "Laszlo Nagy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > >> >> So far, I know only the command >>>sys.path.append(r'c:etc...'), but >> how to delete or insert at the beginning of the list, I know not. >> > You can delete a slice.

maximum number of threads

2007-01-09 Thread Paul Sijben
I have a server in Python 2.5 that generates a lot of threads. It is running on a linux server (Fedora Core 6). The server quickly runs out of threads. I am seeing the following error. File "/home/sijben/ORCA/src/libmercury_mt.py", line 565, in __init__ MercuryObject.__init__(self,mylink)

Re: Question: Best Practice? (module 'shelve')

2007-01-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Thomas Ploch wrote: >> I just wanted to know, if there is any best practice concerning >> following code: >> >> […] >> >> def match(self, src, url): >> self.matchDict = {} >> self.matchDict[url] = {} >> # The next 2 functions just add stuff to self

<    1   2