ANN: speech.py, a clean speech recognition module

2008-08-04 Thread Michael Gundlach
I'm moderately pleased to announce the arrival of a speech recognition and synthesis module for Windows, speech.py. The 'speech' module provides a clean and simple interface to the Microsoft Speech Kit. It's very easy to use within a program that needs to listen for specific phrases or general

Are makepy-generated COM wrapper classes distributable?

2008-08-04 Thread gundlach
Hi! I've just written a Python speech-recognition module (http:// pyspeech.googlecode.com). It provides a clean and simple interface to the Microsoft Speech SDK using COM wrapper classes generated by PythonWin's MakePY utility. Once this is a mature module, I'd like to make it as useful as

Re: A bug in difflib module? (find_longest_match)

2008-08-04 Thread Calvin Spealman
This came up again and I was taking a look at it. There seems to still be no resolution. I have a patch that can add a kwarg to skip this behavior if you know you need otherwise. Right now its a simple boolean flag, but is this enough? Are there any use cases anyone has to define how this case is

Parser for Wordpress export files?

2008-08-04 Thread The Green Tea Leaf
Has anyone written a parser for the export files that wordpress generates (WordPress Extended RSS)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Teething troubles with Python on a Mac

2008-08-04 Thread Avinash Vora
(Greg: You only sent the email to me: you probably wanted to add the mailing list to the recipients.) On Aug 4, 2008, at 8:37 AM, greg wrote: Avi wrote: On that: how would I go about updating the system Python, then? The usual advice is not to try to do that at all. Generally it's best

xlrd

2008-08-04 Thread Yeats
Hi, Years ago i use xlrd to read data from excel and now I need again, but i get strange result. The code is: from xlrd import * Planilha = open_workbook('C:\\Resultados.xls') Resultados = Planilha.sheet_by_name('Resultados') c = (Resultados.cell_value(2,2)) print c and the result is: 0, but

Re: Trying to fix Invalid CSV File

2008-08-04 Thread Ryan Rosario
On Aug 3, 10:38 pm, Emile van Sebille [EMAIL PROTECTED] wrote: Ryan Rosario wrote: I have a very large CSV file that contains double quoted fields (since they contain commas). Unfortunately, some of these fields also contain other double quotes and I made the painful mistake of forgetting

Re: Trying to fix Invalid CSV File

2008-08-04 Thread John Machin
On Aug 4, 5:49 pm, Ryan Rosario [EMAIL PROTECTED] wrote: Thanks Emile! Works almost perfectly, but is there some way I can adapt this to quote fields that contain a comma in them? You originally said I have a very large CSV file that contains double quoted fields (since they contain commas).

Re: Trying to fix Invalid CSV File

2008-08-04 Thread Ryan Rosario
On Aug 4, 1:01 am, John Machin [EMAIL PROTECTED] wrote: On Aug 4, 5:49 pm, Ryan Rosario [EMAIL PROTECTED] wrote: Thanks Emile! Works almost perfectly, but is there some way I can adapt this to quote fields that contain a comma in them? You originally said I have a very large CSV file

Re: xlrd

2008-08-04 Thread Gary Herron
Yeats wrote: Hi, Years ago i use xlrd to read data from excel and now I need again, but i get strange result. The code is: from xlrd import * Planilha = open_workbook('C:\\Resultados.xls') Resultados = Planilha.sheet_by_name('Resultados') c = (Resultados.cell_value(2,2)) print c and

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-04 Thread Erik Max Francis
Antoon Pardon wrote: Maybe I'm going to be pedantic here, but I fear that your code won't work with matrices. The problem is that multiplication is not commutative with matrices. This means that matrices have two divisions a right and a left division. A far as I know the / operator usaly

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-04 Thread Antoon Pardon
On 2008-08-01, Terry Reedy [EMAIL PROTECTED] wrote: Nevertheless, I think this is probably the best example of the enhanced polymorphism of if x yet. I'm kind of surprised no one came up with it.) I think of Python code as 'generic' rather than 'polymorphic'. I am not sure if that is a

Re: Peer-to-Peer Chat Program

2008-08-04 Thread Avinash Vora
On Aug 4, 2008, at 10:44 AM, Trevor Slocum wrote: Python seemed like the right choice for writing a peer-to-peer application, as the support for sockets is adequate and the cross- platform ability is nominal. That's why I searched around for P2P frameworks in Python, and didn't have much

Re: My Python error...

2008-08-04 Thread SaMTHG
On Aug 3, 9:39 pm, Erik Max Francis [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Basically I have Mac OS X 10.4.11 and I've got python 2.5. When I go to TextEdit and type in something like #!/usr/bin/env python print 2+2 and save it as simplescript.py. Then I go to terminal and

Re: Trying to fix Invalid CSV File

2008-08-04 Thread John Machin
On Aug 4, 6:15 pm, Ryan Rosario [EMAIL PROTECTED] wrote: On Aug 4, 1:01 am, John Machin [EMAIL PROTECTED] wrote: On Aug 4, 5:49 pm, Ryan Rosario [EMAIL PROTECTED] wrote: Thanks Emile! Works almost perfectly, but is there some way I can adapt this to quote fields that contain a comma in

Nlp, Python and period

2008-08-04 Thread Fred Mangusta
Hi, are you aware of any nlp packages or algorithms in Python to spot whether a '.' represents an end of sentence or rather something else (eg Mr., [EMAIL PROTECTED], etc)? Thanks F. -- http://mail.python.org/mailman/listinfo/python-list

Limits of Metaprogramming

2008-08-04 Thread Wilson
Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why I'm asking on this group): I'd like to write a program that

Re: Nlp, Python and period

2008-08-04 Thread Paul Boddie
On 4 Aug, 11:59, Fred Mangusta [EMAIL PROTECTED] wrote: Hi, are you aware of any nlp packages or algorithms in Python to spot whether a '.' represents an end of sentence or rather something else (eg Mr., [EMAIL PROTECTED], etc)? I wouldn't mind finding out about such packages, either. I see

Re: xlrd

2008-08-04 Thread John Machin
Yeats w.b.yeats at uol.com.br writes: Hi, Years ago i use xlrd to read data from excel and now I need again, but i get strange result. The code is: from xlrd import * Planilha = open_workbook('C:\\Resultados.xls')Resultados = Planilha.sheet_by_name('Resultados')c =

Fwd: Unit testing type comparison

2008-08-04 Thread Alexei Zankevich
Hello Mike, The reason of the problem is that the class Test was not pushed into the sys.modules. Use one more separate module for that stuff: *one.py* class Test(object): '''just define''' *three.py* from one import Test #push one.pyc to sys.modules if __name__ == '__main__': import

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-04 Thread Ken Starks
CNiall wrote: I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root

Re: Nlp, Python and period

2008-08-04 Thread Fred Mangusta
Hi Paul, thanks for replying. I'm interested in knowing more about your regex approach, but as you point out in your comment, seems like access to the sourceforge mail archive is restricted. Is there any way I can read about it? Would you be so kind to cut and paste it here for instance?

Re: Nlp, Python and period

2008-08-04 Thread John Machin
On Aug 4, 7:59 pm, Fred Mangusta [EMAIL PROTECTED] wrote: Hi, are you aware of any nlp packages or algorithms in Python to spot whether a '.' represents an end of sentence or rather something else (eg Mr., [EMAIL PROTECTED], etc)? google(python nltk) ... it may do what you want. --

Wrapping C with Python

2008-08-04 Thread Anish Chapagain
Hi!! I tried wrapping a simple C code suing SWIG to Python, but am having problem, my .c file is, Step 1: example.c -- double val=3.0; int fact(int n) { if(n=1) return 1; else return n*fact(n-1); } int mod(int x, int y) { return (x%y); } Step 2: I then created interface file as.

Re: Interconvert a ctypes.Structure to/from a binary string?

2008-08-04 Thread Nick Craig-Wood
Andrew P. Lentvorski, Jr. [EMAIL PROTECTED] wrote: On Aug 1, 11:35 pm, Andrew Lentvorski [EMAIL PROTECTED] wrote: Basically, I'd like to use the ctypes module as a much more descriptive struct module. Is there a way to take a ctypes.Structure-based class and convert it to/from a binary

Re: Wrapping C with Python

2008-08-04 Thread RPM1
Anish Chapagain wrote: Hi!! I tried wrapping a simple C code suing SWIG to Python, but am having problem, I am not too familiar with SWIG, (I have looked at it), but you may want to try ctypes in the standard module library. It's very easy to use. I use it on Windows with gcc but I believe

Re: Limits of Metaprogramming

2008-08-04 Thread Jeff
You could write a class composed of states and then use the pickle module to serialize it to disk. -- http://mail.python.org/mailman/listinfo/python-list

Check if module is installed

2008-08-04 Thread Kless
How to check is a library/module is installed on the system? I use the next code but it's possivle that there is a best way. --- try: import foo foo_loaded = True except ImportError: foo_loaded = False --- Thanks in advance! --

Re: Using two pythons in an application

2008-08-04 Thread Larry Bates
Allen wrote: Larry Bates wrote: Allen wrote: I'm in the process of developing an application that will use Python for a scripting support. In light of the upcoming changes to Python, I was wondering if it is possible to link to and use two different versions of Python so that in the

sip.so: undefined symbol: PyUnicodeUCS4_AsWideChar

2008-08-04 Thread Andreas Hinzmann
Hello! I am trying to install PyQt3 and I have the following problem: from qt import * gives the the following error: /.../python2.5/site-packages/sip.so: undefined symbol: PyUnicodeUCS4_AsWideChar I have installed the following software: qt-x11-free-3.3.6 Python2.5 sip-4.7.6

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On 4 Aug, 12:55, Jeff [EMAIL PROTECTED] wrote: You could write a class composed of states and then use the pickle module to serialize it to disk. Thanks Jeff. I guess this is my intermediary format! -- http://mail.python.org/mailman/listinfo/python-list

Re: Check if module is installed

2008-08-04 Thread Chris Ortner
On Aug 4, 2:25 pm, Kless [EMAIL PROTECTED] wrote: try:     import foo     foo_loaded = True except ImportError:     foo_loaded = False Many projects use this as the standard procedure to check a module's presence. I assume, this is the best way. Chris --

Wrapping C API

2008-08-04 Thread Anish Chapagain
Hi!! I'm new to python and have a task for Wrapping up an old program written in C(20.c files), to provide GUI and chart,graph feature in Python. I've tried using SWIG but am not getting well in windows system, wish to receive guidelines for initiating the task... --

Re: xlrd

2008-08-04 Thread Edwin . Madari
here is working code that will read display contents of all rows columns in all the sheets, you need xlrd 0.6.1 import xlrd, os, sys book = xlrd.open_workbook(sys.argv[1]) print The number of worksheets is, book.nsheets for shx in range(book.nsheets): sh = book.sheet_by_index(shx)

Re: Wrapping C with Python

2008-08-04 Thread brad
RPM1 wrote: ... Basically you just compile your C code as a regular C code dll. ctypes then allows you to access the functions in the dll very easily. Does that work with C++ code too or just C? -- http://mail.python.org/mailman/listinfo/python-list

Re: __new__

2008-08-04 Thread Ethan Furman
Calvin Spealman wrote: [snip] ask if you really feel the need to know. I am. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping C API

2008-08-04 Thread Ulrich Eckhardt
Anish Chapagain wrote: I'm new to python and have a task for Wrapping up an old program written in C(20.c files), to provide GUI and chart,graph feature in Python. I've tried using SWIG but am not getting well in windows system, wish to receive guidelines for initiating the task... Two ways

Re: Wrapping C with Python

2008-08-04 Thread Anish Chapagain
On 4 Aug, 14:14, brad [EMAIL PROTECTED] wrote: RPM1 wrote: ... Basically you just compile your C code as a regular C code dll.  ctypes then allows you to access the functions in the dll very easily. Does that work with C++ code too or just C? Hi.. I havenot tried..before with dll, is

Re: Wrapping C API

2008-08-04 Thread Anish Chapagain
On 4 Aug, 14:20, Ulrich Eckhardt [EMAIL PROTECTED] wrote: Anish Chapagain wrote: I'm new to python and have a task for Wrapping up an old program written in C(20.c files), to provide GUI and chart,graph feature in Python. I've tried using SWIG but am not getting well in windows system,

Re: Nlp, Python and period

2008-08-04 Thread Paul Boddie
On 4 Aug, 12:34, Fred Mangusta [EMAIL PROTECTED] wrote: thanks for replying. I'm interested in knowing more about your regex approach, but as you point out in your comment, seems like access to the sourceforge mail archive is restricted. Is there any way I can read about it? Would you be so

Locking around

2008-08-04 Thread Nikolaus Rath
Hello, I need to synchronize the access to a couple of hundred-thousand files[1]. It seems to me that creating one lock object for each of the files is a waste of resources, but I cannot use a global lock for all of them either (since the locked operations go over the network, this would make the

Re: very large dictionary

2008-08-04 Thread Simon Strobl
On 4 Aug., 00:51, Avinash Vora [EMAIL PROTECTED] wrote: On Aug 4, 2008, at 4:12 AM, Jörgen Grahn wrote: (You might want to post this to comp.lang.python rather than to me -- I am just another c.l.p reader. If you already have done to, please disregard this.) Yeah, I hit reply by mistake

Re: Strong/weak typing

2008-08-04 Thread Mel
Jorgen Grahn wrote: I reuse names though, mostly because I don't want to invent additional names which would feel overburdened. I like this example better: months = range(1, 13) # do something with the months-as-numbers list, # and then: months = [ monthname(x) for x in

Re: sip.so: undefined symbol: PyUnicodeUCS4_AsWideChar

2008-08-04 Thread Alan Franzoni
Andreas Hinzmann was kind enough to say: I have also tried to configure python with --enable-unicode=ucs4, but it didn't help. But it should. try printing sys.maxunicode from your interpreter; if it's 2^16, then the interpreter is ucs2. If it's something more than 10 ^ 6, it's ucs4. -- Alan

Re: Limits of Metaprogramming

2008-08-04 Thread Tomasz Rola
On Mon, 4 Aug 2008, Wilson wrote: Hi all, Howdy, I am not sure if my remarks will be of any use for you, but here it goes. I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm

Re: __new__

2008-08-04 Thread Mel
Ethan Furman wrote: Emile van Sebille wrote: Ethan Furman wrote: -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse is the burden of the abuser... Is bytecodehacks still around? That was serious abuse :) Good

import * and py2exe

2008-08-04 Thread Paul Sijben
I am trying to turn my application into a WinXP exe. Py2exe has packaged all my files up into one humongous executable. When trying to run the app, it complains that it can not find modules I just saw it include. These invariably are modules that have been imported using from modulename

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On 4 Aug, 14:47, Tomasz Rola [EMAIL PROTECTED] wrote: On Mon, 4 Aug 2008, Wilson wrote: Hi all, Howdy, I am not sure if my remarks will be of any use for you, but here it goes. I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far

Re: Trying to fix Invalid CSV File

2008-08-04 Thread Emile van Sebille
John Machin wrote: On Aug 4, 6:15 pm, Ryan Rosario [EMAIL PROTECTED] wrote: On Aug 4, 1:01 am, John Machin [EMAIL PROTECTED] wrote: On Aug 4, 5:49 pm, Ryan Rosario [EMAIL PROTECTED] wrote: Thanks Emile! Works almost perfectly, but is there some way I can adapt this to quote fields that

Re: Limits of Metaprogramming

2008-08-04 Thread John Nagle
Wilson wrote: Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why I'm asking on this group): I'd like to write a program that

Re: PIL (etc etc etc) on OS X

2008-08-04 Thread David C. Ullrich
Thanks for the hand-holding. DU. In article [EMAIL PROTECTED], Kevin Walzer [EMAIL PROTECTED] wrote: [more about installing libjpeg...] -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Agnostic fetching

2008-08-04 Thread Ivan Ven Osdel
- Original Message - From: Diez B. Roggisch [EMAIL PROTECTED] To: python-list@python.org Sent: Saturday, August 2, 2008 11:05:07 AM GMT -06:00 US/Canada Central Subject: Re: Agnostic fetching Bruce Frederiksen schrieb: On Fri, 01 Aug 2008 17:05:00 -0700, jorpheus wrote: OK, that

Re: Agnostic fetching

2008-08-04 Thread Diez B. Roggisch
Ivan Ven Osdel wrote: - Original Message - From: Diez B. Roggisch [EMAIL PROTECTED] To: python-list@python.org Sent: Saturday, August 2, 2008 11:05:07 AM GMT -06:00 US/Canada Central Subject: Re: Agnostic fetching Bruce Frederiksen schrieb: On Fri, 01 Aug 2008 17:05:00 -0700, jorpheus

Re: Trying to fix Invalid CSV File

2008-08-04 Thread Ryan Rosario
On Aug 4, 8:30 am, Emile van Sebille [EMAIL PROTECTED] wrote: John Machin wrote: On Aug 4, 6:15 pm, Ryan Rosario [EMAIL PROTECTED] wrote: On Aug 4, 1:01 am, John Machin [EMAIL PROTECTED] wrote: On Aug 4, 5:49 pm, Ryan Rosario [EMAIL PROTECTED] wrote: Thanks Emile! Works almost perfectly,

Re: [unittest] Run setUp only once

2008-08-04 Thread Timothy Grant
On Sun, Aug 3, 2008 at 1:56 PM, Jorgen Grahn [EMAIL PROTECTED] wrote: On Tue, 29 Jul 2008 20:12:14 +0200, Nikolaus Rath [EMAIL PROTECTED] wrote: Jean-Paul Calderone [EMAIL PROTECTED] writes: On Tue, 29 Jul 2008 19:26:09 +0200, Nikolaus Rath [EMAIL PROTECTED] wrote: Jean-Paul Calderone [EMAIL

Re: Limits of Metaprogramming

2008-08-04 Thread Tomasz Rola
On Mon, 4 Aug 2008, Wilson wrote: Every sufficiently large application has a poor/incomplete implementation of LISP embedded within it . Yep, this is either exact or very close copy of what I have read. I've looked at LISP before and do appreciate its elegance, but Python has a beauty of

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On 4 Aug, 16:50, John Nagle [EMAIL PROTECTED] wrote: Wilson wrote: Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why

Re: Bidirectional Generators

2008-08-04 Thread william tanksley
Paddy [EMAIL PROTECTED] wrote: What's one of them then? I'm sorry, I don't know what you mean. Meanwhile, more pertinently: I did get my generator working, and then I replaced it with a class that did the same thing in less than a quarter of the number of lines. So... I'm not going to worry

Re: Bidirectional Generators

2008-08-04 Thread Jeff
On Aug 4, 12:39 pm, william tanksley [EMAIL PROTECTED] wrote: Paddy [EMAIL PROTECTED] wrote: What's one of them then? I'm sorry, I don't know what you mean. Meanwhile, more pertinently: I did get my generator working, and then I replaced it with a class that did the same thing in less than

Garbage collection of recursive inner function

2008-08-04 Thread from . future . import
Hi, I encountered garbage collection behaviour that I didn't expect when using a recursive function inside another function: the definition of the inner function seems to contain a circular reference, which means it is only collected by the mark-and-sweep collector, not by reference counting.

Re: Function editing with Vim throws IndentError

2008-08-04 Thread Ethan Furman
Matimus wrote: On Jul 24, 9:32 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Matimus wrote: On Jul 24, 2:54 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Matimus wrote:

Re: Function editing with Vim throws IndentError

2008-08-04 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Matimus wrote: On Jul 24, 9:32 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Matimus wrote: On Jul 24, 2:54 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand

Re: Limits of Metaprogramming

2008-08-04 Thread castironpi
On Aug 4, 4:48 am, Wilson [EMAIL PROTECTED] wrote: Hi all, My problem is that I don't know if it's possible to edit these states and then write them back to .py. Firstly, if my editing tool was to create a new state, I would want to create the class (using type) and attach it to the imported

Re: Object Manipulation and Frames

2008-08-04 Thread Mike Driscoll
snip Thanks alot Mr.Driscoll, that snippet of code helped me alot..but i was of the idea that the application should be cyclic in nature, that it hould not exit even on failure to authenticate the user.My idea is that once logged in i should be able to bring back the ligin screen on full

Re: Wrapping C with Python

2008-08-04 Thread Stefan Behnel
Anish Chapagain wrote: I tried wrapping a simple C code suing SWIG to Python, but am having problem, Try Cython. It's a Python-like language between Python and C that compiles to C code. It makes it very easy to call into C functions and to hide them behind a nice Python module.

Re: Garbage collection of recursive inner function

2008-08-04 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Hi, I encountered garbage collection behaviour that I didn't expect when using a recursive function inside another function: the definition of the inner function seems to contain a circular reference, which means it is only collected by the mark-and-sweep collector,

looking for IDE advice or workflow tips

2008-08-04 Thread [EMAIL PROTECTED]
I'm a novice developer at best and often work with the R statistical programming language. I use an editor called TINN-R which allows me to write a script, then highlight a few lines and send them to the interpreter. I am using pythonwin and it lacks this funtionality (that I can tell) and when I

Re: looking for IDE advice or workflow tips

2008-08-04 Thread Jeff
On Aug 4, 2:08 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm a novice developer at best and often work with the R statistical programming language. I use an editor called TINN-R which allows me to write a script, then highlight a few lines and send them to the interpreter. I am using

Re: looking for IDE advice or workflow tips

2008-08-04 Thread Olexandr Melnyk
If you split your code into functions (what you should really do), you can use a simple unit-testing like setup: make a caller script for every function, so you can test them separately. On 8/4/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm a novice developer at best and often work with the

Re: Bidirectional Generators

2008-08-04 Thread william tanksley
Jeff [EMAIL PROTECTED] wrote: william tanksley [EMAIL PROTECTED] wrote: I'm still curious, though, whether anyone's written any code that actually uses yield _and_ send() to do anything that isn't in the original PEP. I have.  An iterator that could backtrack itself without the user

UnicodeDecodeError, how to elegantly deal with this?

2008-08-04 Thread Jorgen Bodde
Hi All, I am relatively new to python unicode pains and I would like to have some advice. I have this snippet of code: def playFile(cmd, args): argstr = list() for arg in appcfg.options[appcfg.CFG_PLAYER_ARGS].split(): thefile = args[file] filemask = u%file%

Re: __new__

2008-08-04 Thread Ethan Furman
Mel wrote: Ethan Furman wrote: Emile van Sebille wrote: Ethan Furman wrote: -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse is the burden of the abuser... Is bytecodehacks still around? That was serious abuse

Re: UnicodeDecodeError, how to elegantly deal with this?

2008-08-04 Thread Edwin . Madari
if you can print out values of 'filemask', and 'thefile' variables, when it crashes, I can help. thx. Edwin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jorgen Bodde Sent: Monday, August 04, 2008 2:24 PM To: python-list@python.org Subject:

Re: import * and py2exe

2008-08-04 Thread Larry Bates
Paul Sijben wrote: I am trying to turn my application into a WinXP exe. Py2exe has packaged all my files up into one humongous executable. When trying to run the app, it complains that it can not find modules I just saw it include. These invariably are modules that have been imported using

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On Aug 4, 6:49 pm, castironpi [EMAIL PROTECTED] wrote: On Aug 4, 4:48 am, Wilson [EMAIL PROTECTED] wrote: Hi all, My problem is that I don't know if it's possible to edit these states and then write them back to .py. Firstly, if my editing tool was to create a new state, I would want to

What Python looks like

2008-08-04 Thread iu2
Hi, This is a little bit strange post, but I'm curious... I learned Python from its tutorial step by step, and practicing writing small scripts. I haven't seen a Python program before knowing Python. I'm curious, what did Python code look like to those of you who have seen a bunch of Python

custom allocation and custom type

2008-08-04 Thread castironpi
Hi all, I am trying to create a custom tuple type. I want it to live in a custom memory region, which will be a memory-mapped file. Its contents cannot be PyObject*. They have to be offsets into mapped memory. GetItem( i ) would return: (PyObject *)( t-ob_item[ i ]+ mmap_base_addr ); In

Re: What Python looks like

2008-08-04 Thread Larry Bates
iu2 wrote: Hi, This is a little bit strange post, but I'm curious... I learned Python from its tutorial step by step, and practicing writing small scripts. I haven't seen a Python program before knowing Python. I'm curious, what did Python code look like to those of you who have seen a bunch

Re: What Python looks like

2008-08-04 Thread Gary Herron
iu2 wrote: Hi, This is a little bit strange post, but I'm curious... I learned Python from its tutorial step by step, and practicing writing small scripts. I haven't seen a Python program before knowing Python. I'm curious, what did Python code look like to those of you who have seen a bunch

Re: Keg - A python web framework

2008-08-04 Thread Daniel Fetchinson
I've been working on a python web framework which I think might be of interest to you. Details may be found at http://code.google.com/p/keg/wiki/Concept. All suggestions or comments will be greatly appreciated. I fail to see what the advantages of your framework are over django or

Re: What Python looks like

2008-08-04 Thread Mensanator
On Aug 4, 2:06 pm, iu2 [EMAIL PROTECTED] wrote: Hi, This is a little bit strange post, but I'm curious... I learned Python from its tutorial step by step, and practicing writing small scripts. I haven't seen a Python program before knowing Python. I'm curious, what did Python code look

Re: Limits of Metaprogramming

2008-08-04 Thread castironpi
On Aug 4, 1:57 pm, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 6:49 pm, castironpi [EMAIL PROTECTED] wrote: Two, if all your methods will have uniform signatures and closures, you can store class methods as only their co_code objects: C.g.im_func.func_code.co_code 'd\x00\x00S' And

Re: Newbie Python questions

2008-08-04 Thread LessPaul
On Aug 2, 3:07 pm, Tim Roberts [EMAIL PROTECTED] wrote: binaryjesus [EMAIL PROTECTED] wrote: One great open source GUI package that you left out is GTK ie. pygtk. i cant compare it with wx as i have never used it but isay its much better than QT. Anyway for ur q if u want to compair qt n

Re: PIL (etc etc etc) on OS X

2008-08-04 Thread David C. Ullrich
Just as well that the message sent earlier today seems to have been lost... Ok. Read your instructions on libjpeg. Read some of the install.doc. ./configure, fine. make, fine. make test, fine. So I said sudo make install and this happened: 0-1d-4f-fc-28-d:jpeg-6b dullric$ sudo make install

Re: PIL (etc etc etc) on OS X

2008-08-04 Thread Kevin Walzer
David C. Ullrich wrote: Just as well that the message sent earlier today seems to have been lost... Ok. Read your instructions on libjpeg. Read some of the install.doc. ./configure, fine. make, fine. make test, fine. So I said sudo make install and this happened: 0-1d-4f-fc-28-d:jpeg-6b

Re: Trying to fix Invalid CSV File

2008-08-04 Thread Larry Bates
Ryan Rosario wrote: On Aug 4, 8:30 am, Emile van Sebille [EMAIL PROTECTED] wrote: John Machin wrote: On Aug 4, 6:15 pm, Ryan Rosario [EMAIL PROTECTED] wrote: On Aug 4, 1:01 am, John Machin [EMAIL PROTECTED] wrote: On Aug 4, 5:49 pm, Ryan Rosario [EMAIL PROTECTED] wrote: Thanks Emile! Works

Re: Using two pythons in an application

2008-08-04 Thread Rhamphoryncus
On Aug 3, 5:43 pm, Allen [EMAIL PROTECTED] wrote: Larry Bates wrote: Allen wrote: I'm in the process of developing an application that will use Python for a scripting support.  In light of the upcoming changes to Python, I was wondering if it is possible to link to and use two different

Re: __new__

2008-08-04 Thread Rhamphoryncus
On Aug 4, 11:46 am, Ethan Furman [EMAIL PROTECTED] wrote: Mel wrote: Ethan Furman wrote: Emile van Sebille wrote: Ethan Furman wrote:    -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse is the burden of the

Re: Newbie Python questions

2008-08-04 Thread Timothy Grant
On Mon, Aug 4, 2008 at 1:27 PM, LessPaul [EMAIL PROTECTED] wrote: On Aug 2, 3:07 pm, Tim Roberts [EMAIL PROTECTED] wrote: binaryjesus [EMAIL PROTECTED] wrote: One great open source GUI package that you left out is GTK ie. pygtk. i cant compare it with wx as i have never used it but isay its

Re: Check if module is installed

2008-08-04 Thread Wojtek Walczak
Dnia Mon, 4 Aug 2008 05:25:08 -0700 (PDT), Kless napisa�(a): How to check is a library/module is installed on the system? I use the next code but it's possivle that there is a best way. You may also be interested in techniques to keep your software compatible with older versions of python. Take

os.path.normpath() for URLs?

2008-08-04 Thread Robert Dailey
Hi, I'm currently trying to parse relative URLs, but I want to make them absolute. In other words, I want to normalize the URLs. However, I don't want to have to write this logic myself if it is already provided. I was thinking of somehow tricking os.path.normpath() as a last resort. This is for

Re: Keg - A python web framework

2008-08-04 Thread bukzor
On Aug 4, 1:13 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: I've been working on a python web framework which I think might be of interest to you. Details may be found athttp://code.google.com/p/keg/wiki/Concept. All suggestions or comments will be greatly appreciated. I fail to see

Re: What Python looks like

2008-08-04 Thread Ben Finney
iu2 [EMAIL PROTECTED] writes: I'm curious, what did Python code look like to those of you who have seen a bunch of Python code for the first time before knowing Python? To me it looked like the pseudo-code used for describing algorithms, allowing clear understanding and redesign of the

Why doesn't import work?

2008-08-04 Thread ssecorp
I have in Lib/site-packages a module named pdfminer. when I do import pdfminer it complains: import pdfminer Traceback (most recent call last): File pyshell#3, line 1, in module import pdfminer ImportError: No module named pdfminer I created a file pdfminer.py and put it in

Re: Wrapping C with Python

2008-08-04 Thread RPM1
brad wrote: RPM1 wrote: ... Basically you just compile your C code as a regular C code dll. ctypes then allows you to access the functions in the dll very easily. Does that work with C++ code too or just C? I believe it does work with C++ although I have not done that. Here's a simple

Re: Why doesn't import work?

2008-08-04 Thread Sean DiZazzo
On Aug 4, 3:34 pm, ssecorp [EMAIL PROTECTED] wrote: I have in Lib/site-packages a module named pdfminer. when I do import pdfminer it complains: import pdfminer Traceback (most recent call last):   File pyshell#3, line 1, in module     import pdfminer ImportError: No module named

Re: Why doesn't import work?

2008-08-04 Thread Timothy Grant
On Mon, Aug 4, 2008 at 3:34 PM, ssecorp [EMAIL PROTECTED] wrote: I have in Lib/site-packages a module named pdfminer. when I do import pdfminer it complains: import pdfminer Traceback (most recent call last): File pyshell#3, line 1, in module import pdfminer ImportError: No module

Re: Wrapping C with Python

2008-08-04 Thread RPM1
Anish Chapagain wrote: On 4 Aug, 14:14, brad [EMAIL PROTECTED] wrote: RPM1 wrote: ... Basically you just compile your C code as a regular C code dll. ctypes then allows you to access the functions in the dll very easily. Does that work with C++ code too or just C? Hi.. I havenot

Re: xlrd

2008-08-04 Thread John Machin
On Aug 4, 11:08 pm, [EMAIL PROTECTED] wrote: here is working code that will read display contents of all rows columns in all the sheets, you need xlrd 0.6.1 import xlrd, os, sys book = xlrd.open_workbook(sys.argv[1]) print The number of worksheets is, book.nsheets for shx in

Re: very large dictionary

2008-08-04 Thread Steven D'Aprano
On Mon, 04 Aug 2008 07:02:16 -0700, Simon Strobl wrote: I created a python file that contained the dictionary. The size of this file was 6.8GB. Ah, that's what I thought you had done. That's not a dictionary. That's a text file containing the Python code to create a dictionary. My guess is

  1   2   >