Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-19 Thread Laszlo Nagy
This is what I did so far: #1. Install Python 2.6, Firebird 1.5 server (with libs and headers), egenix mx base and mingw C compiler #2. put "c:\MinGW\bin" on the PATH (or wherever it is) #3. extract kinterbasdb source to a temp folder #4. hack setup.cfg. Change the build section: [build] comp

Re: Can print() be reloaded for a user defined class?

2009-09-19 Thread Mark Tolonen
"r" wrote in message news:c87c1742-e185-4377-a3ae-b32b912bc...@33g2000vbe.googlegroups.com... On Sep 19, 9:53 pm, Peng Yu wrote: (snip) > I want to understand the exact meaning of the last line ('__repr__ = > __str__'). Would you please point me to the section of the python > manual that de

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread Robert Kern
John Nagle wrote: Daniel Fetchinson wrote: Barring the unimplemented libraries and bugs, yes. If you read the original post in this thread, you will see that on the roadmap is running the entire Python regression suite. No, it's getting close to running the entire Pyjamas regression suit

Re: How to get the minimum number that can be represented?

2009-09-19 Thread Daniel Fetchinson
> Suppose I want to define a function that return the minimum number > that can be represented. > > def f(x): > #body > > That it, if I call f(10), f will return the minimum integer that can > be represented in the machine; if I cal f(10.5), f will return the > minimum float that can be represent

Re: What are the naming convention for private member variable, and private and public member function?

2009-09-19 Thread Daniel Fetchinson
> It says in http://www.python.org/dev/peps/pep-0008/ > > "Method Names and Instance Variables > > Use the function naming rules: lowercase with words separated by > underscores as necessary to improve readability. > > Use one leading underscore only for non-public methods and

Re: detmining name during an assignment

2009-09-19 Thread Jerry Hill
On Fri, Sep 18, 2009 at 6:57 PM, Jamie Riotto wrote: > However, I'll have to keep looking for a more elegant solution. > Telling a user that typing: > cube1 = Cube(name = cube1) is a good thing because its pythonic is > somehow unsatisfying. That isn't pythonic. The usual pythonic way to map nam

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-19 Thread Skye sh...@#$
On Sep 19, 7:22 pm, Schif Schaf wrote: > The other day I needed to convert a date like "August 2009" into a > "seconds-since-epoch" value (this would be for the first day of that > month, at the first second of that day). You could use Time::Piece: [ss...@localhost ~]$ perl -lMTime::Piece -e'$t=

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-19 Thread John Yeung
On Sep 19, 10:57 pm, Carl Banks wrote: > On Sep 19, 7:22 pm, Schif Schaf wrote: > > > I *wanted* to just use time.mktime(), but it wouldn't > > work unless I could specify the *complete* time tuple > > value (who would have all that handy?!). > > Was it really that hard to add a few zeros to the

How to get the minimum number that can be represented?

2009-09-19 Thread Peng Yu
Hi, Suppose I want to define a function that return the minimum number that can be represented. def f(x): #body That it, if I call f(10), f will return the minimum integer that can be represented in the machine; if I cal f(10.5), f will return the minimum float that can be represented in the m

Re: Comparison of parsers in python?

2009-09-19 Thread TerryP
Peng Yu wrote: > This is more a less just a list of parsers. I would like some detailed > guidelines on which one to choose for various parsing problems. > > Regards, > Peng It depends on the parsing problem. Obviously your not going to use an INI parser to work with XML, or vice versa. Likewise

What are the naming convention for private member variable, and private and public member function?

2009-09-19 Thread Peng Yu
Hi, It says in http://www.python.org/dev/peps/pep-0008/ "Method Names and Instance Variables Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability. Use one leading underscore only for non-public methods and instanc

urllib2, https and gzipped files

2009-09-19 Thread Barry
I'm trying to use urllib2 to download some gzipped files from an https server, but I cannot correctly open the file. It happens to be an mbox file -- a mailing list archive to be exact. Upon calling open, the file starts to be unzipped. Content-Length is read as the length of the first post in the

Re: control CPU usage

2009-09-19 Thread Jiang Fung Wong
Dear All, Thank you for the information. I think I've some idea what the problem is about after seeing the replies. More information about my system and my script PIII 1Ghz, 512MB RAM, Windows XP SP3 The script monitors global input using PyHook, and calculates on the information collected from

Re: Can print() be reloaded for a user defined class?

2009-09-19 Thread r
On Sep 19, 9:53 pm, Peng Yu wrote: (snip) > I want to understand the exact meaning of the last line ('__repr__ = > __str__'). Would you please point me to the section of the python > manual that describes such usage. simple i assined any call to __repr__ to the __str__ methods. >>> class Test(

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-19 Thread Carl Banks
On Sep 19, 7:22 pm, Schif Schaf wrote: > The other day I needed to convert a date like "August 2009" into a > "seconds-since-epoch" value (this would be for the first day of that > month, at the first second of that day). > > In Python, I came up with this: > > > #!/usr/bin/env python > > imp

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread John Nagle
Daniel Fetchinson wrote: Barring the unimplemented libraries and bugs, yes. If you read the original post in this thread, you will see that on the roadmap is running the entire Python regression suite. No, it's getting close to running the entire Pyjamas regression suite, which is something

Re: Can print() be reloaded for a user defined class?

2009-09-19 Thread Peng Yu
On Sep 19, 9:34 pm, r wrote: > On Sep 19, 9:28 pm, Peng Yu wrote: > > > > > Hi, > > > I have the following code. The last line does not print the members > > ("x" and "y") of 'my_bin'. I am wondering if there is a way to reload > > the print function for bin, so that the last line print the membe

Re: Can print() be reloaded for a user defined class?

2009-09-19 Thread r
On Sep 19, 9:28 pm, Peng Yu wrote: > Hi, > > I have the following code. The last line does not print the members > ("x" and "y") of 'my_bin'. I am wondering if there is a way to reload > the print function for bin, so that the last line print the members of > 'my_bin'. > > Regards, > Peng > > clas

Can print() be reloaded for a user defined class?

2009-09-19 Thread Peng Yu
Hi, I have the following code. The last line does not print the members ("x" and "y") of 'my_bin'. I am wondering if there is a way to reload the print function for bin, so that the last line print the members of 'my_bin'. Regards, Peng class bin: def __init__(self, x, y) : self.x = x

Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-19 Thread Schif Schaf
The other day I needed to convert a date like "August 2009" into a "seconds-since-epoch" value (this would be for the first day of that month, at the first second of that day). In Python, I came up with this: #!/usr/bin/env python import datetime import time time_in_sse = time.mktime(

Re: How to change string or number passed as argument?

2009-09-19 Thread Tim Chase
I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class, which I feel a little bit tedious. I am wondering what is the comm

How to change string or number passed as argument?

2009-09-19 Thread Peng Yu
Hi, I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class, which I feel a little bit tedious. I am wondering what is the

Re: Granularity of OSError

2009-09-19 Thread Grant Edwards
On 2009-09-20, MRAB wrote: > kj wrote: >> In MRAB >> writes: >> >>> If, for example, you're going to copy a file, it's a good idea >>> to check beforehand that there's enough space available for >>> the copy. >> >> How do you do that? >> > There's os.statvfs(...), although that's Unix only.

Re: Comparison of parsers in python?

2009-09-19 Thread Peng Yu
On Sep 19, 6:05 pm, Robert Kern wrote: > Peng Yu wrote: > > Hi, > > > I did a google search and found various parser in python that can be > > used to parse different files in various situation. I don't see a page > > that summarizes and compares all the available parsers in python, from > > simpl

Re: Granularity of OSError

2009-09-19 Thread MRAB
kj wrote: In MRAB writes: If, for example, you're going to copy a file, it's a good idea to check beforehand that there's enough space available for the copy. How do you do that? There's os.statvfs(...), although that's Unix only. The point is that it's sometimes a good idea to do a che

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread Daniel Fetchinson
>> the pyjamas project is taking a slightly different approach to achieve >> this same goal: beat the stuffing out of the pyjamas compiler, rather >> than hand-write such large sections of code in pure javascript, and >> double-run regression tests (once as python, second time conve

Re: class initialization problem

2009-09-19 Thread Tim Roberts
rantingrick wrote: > >WHY did i need do this you may ask? >I am creating geometry with OpenGL. When you create a face you must >specify a winding order (clockwise or counter clockwise) this winding >order controls which side of the face will be visible (since only one >side of a face is rendered).

Re: An assessment of the Unicode standard

2009-09-19 Thread r
On Sep 19, 2:12 am, greg wrote: > Hendrik van Rooyen wrote: > > there would be no way for a language to change   > > and grow, if it were literally true that you cannot think of something  that > > you have no word for. > >  From my own experience, I know that it's possible for me to > think about

Re: OK to memoize re objects?

2009-09-19 Thread Robert Kern
kj wrote: My Python code is filled with assignments of regexp objects to globals variables at the top level; e.g.: _spam_re = re.compile('^(?:ham|eggs)$', re.I) Don't like it. My Perl-pickled brain wishes that re.compile was a memoizing method, so that I could use it anywhere, even inside tig

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread Robert Kern
exar...@twistedmatrix.com wrote: On 19 Sep, 11:04 pm, robert.k...@gmail.com wrote: Daniel Fetchinson wrote: the pyjamas project is taking a slightly different approach to achieve this same goal: beat the stuffing out of the pyjamas compiler, rather than hand-write such large sections of code in

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread exarkun
On 19 Sep, 11:04 pm, robert.k...@gmail.com wrote: Daniel Fetchinson wrote: the pyjamas project is taking a slightly different approach to achieve this same goal: beat the stuffing out of the pyjamas compiler, rather than hand-write such large sections of code in pure javascript, and double-run

Re: An assessment of the Unicode standard

2009-09-19 Thread Terry Reedy
greg wrote: So in my humble opinion, the strong form of the Sapir-Whorf hypothesis is bunk. :-) It also seems not to have been their hypothesis ;-). from http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis "Since neither Sapir nor Whorf had ever stated an actual hypothesis, Lenneberg formula

OK to memoize re objects?

2009-09-19 Thread kj
My Python code is filled with assignments of regexp objects to globals variables at the top level; e.g.: _spam_re = re.compile('^(?:ham|eggs)$', re.I) Don't like it. My Perl-pickled brain wishes that re.compile was a memoizing method, so that I could use it anywhere, even inside tight loops, w

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread Diez B. Roggisch
Daniel Fetchinson schrieb: the pyjamas project is taking a slightly different approach to achieve this same goal: beat the stuffing out of the pyjamas compiler, rather than hand-write such large sections of code in pure javascript, and double-run regression tests (once as python, second time conv

Re: Comparison of parsers in python?

2009-09-19 Thread Robert Kern
Peng Yu wrote: Hi, I did a google search and found various parser in python that can be used to parse different files in various situation. I don't see a page that summarizes and compares all the available parsers in python, from simple and easy-to-use ones to complex and powerful ones. Second

Re: Granularity of OSError

2009-09-19 Thread kj
In MRAB writes: >If, for example, you're >going to copy a file, it's a good idea to check beforehand that there's >enough space available for the copy. How do you do that? TIA, kynn -- http://mail.python.org/mailman/listinfo/python-list

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread Robert Kern
Daniel Fetchinson wrote: the pyjamas project is taking a slightly different approach to achieve this same goal: beat the stuffing out of the pyjamas compiler, rather than hand-write such large sections of code in pure javascript, and double-run regression tests (once as python, second time conver

Re: control CPU usage

2009-09-19 Thread Dave Angel
kakarukeys wrote: Hi, When I am running a loop for a long time, calculating heavily, the CPU usage is at 100%, making the comp not so responsive. Is there a way to control the CPU usage at say 80%? putting a time.sleep(0.x) doesn't seem to help although CPU usage level is reduced, but it's unsta

Re: Creating a local variable scope.

2009-09-19 Thread Ethan Furman
Dave Angel wrote: Johan Grönqvist wrote: DiZazzo skrev: I would do something like this: class Namespace(object): ... pass ... n = Namespace() n.f = 2 n.g = 4 print f Traceback (most recent call last): File "", line 1, in ? NameError: name 'f' is not defined print n.f 2 I l

Re: python profiling for a XML parser program

2009-09-19 Thread MacRules
Paul Boddie wrote: On 19 Sep, 21:19, MacRules wrote: Is there a python profiler just like for C program? And tell me which functions or modules take a long time. Can you show me URL or link on doing this task? Having already looked at combining Python profilers with KCachegrind (as suggested

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-19 Thread Daniel Fetchinson
>> the pyjamas project is taking a slightly different approach to achieve >> this same goal: beat the stuffing out of the pyjamas compiler, rather >> than hand-write such large sections of code in pure javascript, and >> double-run regression tests (once as python, second time converted to >> javas

Comparison of parsers in python?

2009-09-19 Thread Peng Yu
Hi, I did a google search and found various parser in python that can be used to parse different files in various situation. I don't see a page that summarizes and compares all the available parsers in python, from simple and easy-to-use ones to complex and powerful ones. I am wondering if somebo

Re: How to install pysqlite?

2009-09-19 Thread Daniel Fetchinson
> I am trying to install pysqlite (Python interface to the SQLite). I > downloaded the file with the package (pysqlite-2.5.5.tar.gz). And I > did the following: > > gunzip pysqlite-2.5.5.tar.gz > tar xvf pysqlite-2.5.5.tar > cd pysqlite-2.5.5 > python setup.py install > > At the last step I have a

on package import, have it conditionally import a subpackage

2009-09-19 Thread Gabriel Rossetti
Hello everyone, I'd like to ba able to import a package and have it's __init__ conditionally import a subpackage. Suppose that you have this structure : mybase/ mybase/__init__.py mybase/mypkg mybase/mypkg/__init__.py mybase/mypkg/module0.py mybase/mypkg/type1 mybase/mypkg/type1/__init__.py my

Re: python profiling for a XML parser program

2009-09-19 Thread Paul Boddie
On 19 Sep, 21:19, MacRules wrote: > > Is there a python profiler just like for C program? > And tell me which functions or modules take a long time. > > Can you show me URL or link on doing this task? Having already looked at combining Python profilers with KCachegrind (as suggested by Andrew Dal

Re: python profiling for a XML parser program

2009-09-19 Thread Diez B. Roggisch
MacRules schrieb: I have a python program doing XML data prasing and write the result to 2 data files; which will be loaded to MySQL. I ran this. $ python dealmaker.py ... read data loop through records ... XML parsing ... write to file1.dat ... write to file2.date done Is there a python prof

Re: Podcast catcher in Python

2009-09-19 Thread Chuck
Never mind, guys I finally got things working. Woo hoo -- http://mail.python.org/mailman/listinfo/python-list

Re: Podcast catcher in Python

2009-09-19 Thread Chuck
On Sep 19, 7:40 am, Dave Angel wrote: > Chuck wrote: > > On Sep 12, 3:37 pm, Chuck wrote: > > >> On Sep 11, 9:54 pm, Chris Rebert wrote: > > >>> On Fri, Sep 11, 2009 at 7:43 PM, Chuck wrote: > > Does anyone know how I should read/download the mp3 file, and how I > should write/save it

python profiling for a XML parser program

2009-09-19 Thread MacRules
I have a python program doing XML data prasing and write the result to 2 data files; which will be loaded to MySQL. I ran this. $ python dealmaker.py ... read data loop through records ... XML parsing ... write to file1.dat ... write to file2.date done Is there a python profiler just like for

Re: How to install pysqlite?

2009-09-19 Thread Diez B. Roggisch
Roman Gorbunov schrieb: Hi all, I am trying to install pysqlite (Python interface to the SQLite). I downloaded the file with the package (pysqlite-2.5.5.tar.gz). And I did the following: gunzip pysqlite-2.5.5.tar.gz tar xvf pysqlite-2.5.5.tar cd pysqlite-2.5.5 python setup.py install At the la

Re: control CPU usage

2009-09-19 Thread Sean DiZazzo
On Sep 19, 9:17 am, kakarukeys wrote: > Hi, > > When I am running a loop for a long time, calculating heavily, the CPU > usage > is at 100%, making the comp not so responsive. Is there a way to > control the > CPU usage at say 80%? putting a time.sleep(0.x) doesn't seem to help > although CPU usag

Re: Podcast catcher in Python

2009-09-19 Thread Chuck
On Sep 19, 7:40 am, Dave Angel wrote: > Chuck wrote: > > On Sep 12, 3:37 pm, Chuck wrote: > > >> On Sep 11, 9:54 pm, Chris Rebert wrote: > > >>> On Fri, Sep 11, 2009 at 7:43 PM, Chuck wrote: > > Does anyone know how I should read/download the mp3 file, and how I > should write/save it

Re: Podcast catcher in Python

2009-09-19 Thread Chuck
On Sep 19, 7:40 am, Dave Angel wrote: > Chuck wrote: > > On Sep 12, 3:37 pm, Chuck wrote: > > >> On Sep 11, 9:54 pm, Chris Rebert wrote: > > >>> On Fri, Sep 11, 2009 at 7:43 PM, Chuck wrote: > > Does anyone know how I should read/download the mp3 file, and how I > should write/save it

control CPU usage

2009-09-19 Thread kakarukeys
Hi, When I am running a loop for a long time, calculating heavily, the CPU usage is at 100%, making the comp not so responsive. Is there a way to control the CPU usage at say 80%? putting a time.sleep(0.x) doesn't seem to help although CPU usage level is reduced, but it's unstable. Regards, W.J.F

Finding application data after install - a solution?

2009-09-19 Thread Wolodja Wentland
Hi all, reliably finding distribution data from your program seems to be an unsolved issue for programs packaged with distutils. I have seen a lot of code that manipulates mod.__file__ to solve this problem, but this *will* break for some installation schemes and has the following problems: * i

Re: Tkinter - Text - bullets

2009-09-19 Thread Thomas Lehmann
> Something like this maybe? > > from Tkinter import * > > root = Tk() > txt = Text(root, wrap='word') > txt.pack() > > txt.tag_configure('text_body', font=('Times', 18), lmargin1=0, > lmargin2=0) > txt.tag_configure('bulleted_list', font=('Times', 18), lmargin1='10m', > lmargin2='15m', tabs=[

How to install pysqlite?

2009-09-19 Thread Roman Gorbunov
Hi all, I am trying to install pysqlite (Python interface to the SQLite). I downloaded the file with the package (pysqlite-2.5.5.tar.gz). And I did the following: gunzip pysqlite-2.5.5.tar.gz tar xvf pysqlite-2.5.5.tar cd pysqlite-2.5.5 python setup.py install At the last step I have a problem.

Re: Granularity of OSError

2009-09-19 Thread MRAB
Grant Edwards wrote: On 2009-09-19, Christian Heimes wrote: kj wrote: For example, LBYL would look like this: if os.path.isfile(some_file): os.unlink(some_file) In contrast, EAFP would look like this: try: os.unlink(some_file) except OSError: pass The two version aren't equal.

Re: Creating a local variable scope.

2009-09-19 Thread Dave Angel
Johan Grönqvist wrote: Sean DiZazzo skrev: I would do something like this: class Namespace(object): ... pass ... n = Namespace() n.f = 2 n.g = 4 print f Traceback (most recent call last): File "", line 1, in ? NameError: name 'f' is not defined print n.f 2 I like this solution. Th

Re: Podcast catcher in Python

2009-09-19 Thread Dave Angel
Chuck wrote: On Sep 12, 3:37 pm, Chuck wrote: On Sep 11, 9:54 pm, Chris Rebert wrote: On Fri, Sep 11, 2009 at 7:43 PM, Chuck wrote: Does anyone know how I should read/download the mp3 file, and how I should write/save it so that I can play it on a media player such as Windoz

Re: An assessment of the Unicode standard

2009-09-19 Thread Hendrik van Rooyen
On Saturday 19 September 2009 09:12:34 greg wrote: > From my own experience, I know that it's possible for me to > think about things that I don't have a word for. An example > occured once when I was developing a 3D game engine, and > I was trying to think of a name for the thing that exists > w

Sunday 20th Global Python Mtg via VOIP - BerkeleyTIP - for forwarding

2009-09-19 Thread john_re
Get a VOIP headset, Install VOIP client SW, & join the global Python meeting this Sunday Sept 20, 12N-3P Pacific Daylight Savings Time (UTC-8), 3P-6P Eastern, (7P-10P UTC?) http://sites.google.com/site/berkeleytip/remote-attendance Lots of great, exciting new things for Python users, as we start

Re: Creating a local variable scope.

2009-09-19 Thread Johan Grönqvist
Sean DiZazzo skrev: I would do something like this: class Namespace(object): ... pass ... n = Namespace() n.f = 2 n.g = 4 print f Traceback (most recent call last): File "", line 1, in ? NameError: name 'f' is not defined print n.f 2 I like this solution. This also minimizes the ex

Re: Creating a local variable scope.

2009-09-19 Thread Johan Grönqvist
Gabriel Genellina skrev: En Fri, 18 Sep 2009 10:55:47 -0300, Johan Grönqvist escribió: Summarizing the answers, it seems that I will try to follow three suggestions: 3) If I define a few values intended to be used very locally, delete those after use. Why bother? Unless they're big objec

Re: An assessment of the Unicode standard

2009-09-19 Thread greg
Hendrik van Rooyen wrote: there would be no way for a language to change and grow, if it were literally true that you cannot think of something that you have no word for. From my own experience, I know that it's possible for me to think about things that I don't have a word for. An example o

Proxysite open facebook ,myaspace,.....etc

2009-09-19 Thread mido mido
Proxysite open facebook ,myaspace,.etc http://proxypop.110mb.com/ -- http://mail.python.org/mailman/listinfo/python-list