Re: Using a time duration to print out data where every 2 seconds is a pixel

2007-09-10 Thread cjt22
On Sep 10, 6:39 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 10 Sep 2007 07:57:58 -0700, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > >from time import * > > >startPoint = strptime(step.sTime, "%H:%S:%M") > > >finishPoint = strptime(step.fTime, "%H:%S:%M") >

Re: urllib2: handle an error (302)

2007-09-10 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Antoni Villalonga wrote: > There are any way to handle a 302 error? I assume the answer you seek is here . -- http://mail.python.org/mailman/listinfo/python-list

Re: printing list containing unicode string

2007-09-10 Thread Marc 'BlackJack' Rintsch
On Mon, 10 Sep 2007 19:26:20 -0700, Xah Lee wrote: > ・ Many Internet standards are defined in terms of textual data, and > can't handle content with embedded zero bytes. > > Not sure what he mean by "can't handle content with embedded zero > bytes". Overall i think this sentence is silly, and h

Re: Modul (%) in python not like in C?

2007-09-10 Thread Paul Rubin
Bryan Olson <[EMAIL PROTECTED]> writes: > > FIrst of all, how is the % symbol (as in 70%6=4) called in English? > > The operator is usually called "mod". (The symbol is usually > called "percent".) In Lisp, we'd say Python implements the mod function and C implements the rem (remainder) function.

Re: Need a KDE app, where to find a coder?

2007-09-10 Thread Diez B. Roggisch
Dotan Cohen schrieb: > I need an application, and I'd like it to be written in Python with QT > as I am a KDE user. I simply don't have the time to code it myself, as > I've been trying to find the time for half a year now. > > What are some reputable websites for finding Python coders? If anyone

Re: function to do dynamic import?

2007-09-10 Thread [EMAIL PROTECTED]
On Sep 10, 10:52 pm, "bambam" <[EMAIL PROTECTED]> wrote: > import works in the main section of the module, but does > not work as I hoped when run inside a function. > > That is, the modules import correctly, but are not visible to > the enclosing (global) scope. > > Questions: > (1) Where can I re

Re: [PyCON-Organizers] Next PyCon Organizers' Meeting Tuesday, 11 September

2007-09-10 Thread Laura Creighton
Does this mean that if you do not have a google account, and do not want one, there is no way to join the meeting? Laura In a message of Mon, 10 Sep 2007 22:34:01 EDT, "Douglas Napoleone" writes: >I have found that jabber accounts no longer work, but google accounts >do. I had a jabber account

function to do dynamic import?

2007-09-10 Thread bambam
import works in the main section of the module, but does not work as I hoped when run inside a function. That is, the modules import correctly, but are not visible to the enclosing (global) scope. Questions: (1) Where can I read an explanation of this? (2) Is there a work around? BTW, sys.module

Re: Mac OSX sqlite problem. Missing?

2007-09-10 Thread [EMAIL PROTECTED]
On Sep 10, 1:51 pm, [EMAIL PROTECTED] wrote: > Diez B. Roggisch wrote: > > > Are you by any chance using the python 2.3 when issuing that import > > statement? > > > Diez > > Unfortunately not :( > > ibook:~/project1$ python -V > Python 2.5 > ibook:~/project1$ python > Python 2.5 (r25:51918, Sep 19

Version numbering (was: Enum class with ToString functionality)

2007-09-10 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > On Sep 10, 7:55 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > Uh... The 1.0 version is vaporware? > > I think not. 42% of it is alive and kicking as we speak. That's odd. Do you think some similar matchematical relationship exists between Pyth

urllib2: handle an error (302)

2007-09-10 Thread Antoni Villalonga
Hi! First of all sorry for my English, it's not my language... When urllib2 libs visit a URL with 302 error follow the location automatically. I need to get the location in order to get the full URL (not relative URL) parsing html code. You can see an example here: http://friki.org/302.php rais

Re: Enum class with ToString functionality

2007-09-10 Thread Zara
On Mon, 10 Sep 2007 02:28:57 -0700, [EMAIL PROTECTED] wrote: >Hi, > >I have the following class - > >class TestOutcomes: >PASSED = 0 >FAILED = 1 >ABORTED = 2 > >plus the following code - > >testResult = TestOutcomes.PASSED > >testResultAsString >if testResult == TestOutcomes.PASSED: >

newbie: stani's python editor if-else

2007-09-10 Thread madzientist
hi, two quick questions: a) i am using SPE (latest version) and for some reason, when i type, say if 1==2: print "not equal" else: print "equal" the else is at the same indentation level as the preceding print statement, and i get a syntax error why doesn't spe automatically

Re: question on python syntax

2007-09-10 Thread Steve Holden
a.m. wrote: > If I type this in shell > > $ ./yourfile.py 12:34 PM & > > What does '$', '.', '/' and '& means in this succession? Note: 12:34 > PM is a argument to the yourfile.py. > "$" is the shell prompting you to let you know it's ready for you to type a command. "./" says "look in the cur

Re: Modul (%) in python not like in C?

2007-09-10 Thread Bryan Olson
Scott David Daniels wrote: > C, which was designed as a "high level assembly language," does not > tightly define the results of / and % for negative numbers. Instead > it defines the result for positive over positive, and constrains the > result for the others. Not true. Here it is again:

Re: noob: reloading modified python file within Python Shell

2007-09-10 Thread Robert Kern
johnny wrote: > from people.models import * > > Now I make changes to the models.py. How do I reload this module in > Python Shell? import people.models reload(people.models) from people.models import * -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigm

Re: PIL Error: "cannot read interlaced PNG files"

2007-09-10 Thread Steve Holden
T-u-N-i-X wrote: > Hey There, > > I'm developing an application that lets the user to upload JPG and PNG > files. I'm using PIL to check the images after the upload (like > checking it storage size, width and height). But PIL raises an error: > > "cannot read interlaced PNG files" > > It says th

Re: Checking if elements are empty

2007-09-10 Thread Steve Holden
Neil Cerutti wrote: > On 2007-09-10, Chris Mellon <[EMAIL PROTECTED]> wrote: >> On 9/10/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> Agreed; but I prefer 'if y[0] == ""', absent more context and >>> better names. >> Probably should use u"" if you're going to take that route, as >> this will fail

Re: Setting stdout encoding

2007-09-10 Thread Gabriel Genellina
En Mon, 10 Sep 2007 10:02:42 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> escribi�: >> Does someone know if there's a way to explicitly set the stdout/stderr/ >> stdin >> encoding that python should use? >> >> The encoding can be set using the C API for file objects - from Python >> code, use ctype

Re: Setting stdout encoding

2007-09-10 Thread Gabriel Genellina
En Sun, 09 Sep 2007 17:49:14 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> escribi�: > Does someone know if there's a way to explicitly set the > stdout/stderr/stdin > encoding that python should use? The encoding can be set using the C API for file objects - from Python code, use ctypes: py>

Re: os.sep and os.path.sep

2007-09-10 Thread Gabriel Genellina
En Sun, 09 Sep 2007 12:48:38 -0300, billiejoex <[EMAIL PROTECTED]> escribi�: import os hasattr(os, 'sep') > True hasattr(os.path, 'sep') > True > > By chance I noticed it. > Are there differences (I think not...)? > IMHO, if there are no differences os.path.sep should be removed sin

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-10 Thread Fernando Perez
Ferenczi Viktor wrote: > Properties are very useful, since ordinary attribute access can be > transparently replaced with properties if the developer needs to add code > when it's set or needs to calculate it's value whenever it is read. > > As an additional benefit this could allow developers t

Re: Modul (%) in python not like in C?

2007-09-10 Thread Terry Reedy
"Dotan Cohen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | FIrst of all, how is the % symbol (as in 70%6=4) called in English? | | Second, in Turbo C -111%10=-1 however in python -111%10=9. Is one or | the other in error? Is this a known gotcha? I tried to google the | subject ho

Re: concise code (beginner)

2007-09-10 Thread Gabriel Genellina
> "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> Why not just build a new list? E.g. >> >>newdevs = [] >>for dev in devs : >>... >>if not removing_dev : >>newdevs.append(dev) >>#end if >>#end for >>devs =

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 7:55 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > >> TheFlyingDutchman <[EMAIL PROTECTED]> writes: > http://cheeseshop.python.org/pypi/enum/> > >> (Please preserve attribution lines so

Re: Modul (%) in python not like in C?

2007-09-10 Thread Scott David Daniels
Bryan Olson wrote: > Dotan Cohen wrote: ... >> Second, in Turbo C -111%10=-1 however in python -111%10=9. Is one or >> the other in error? > > Turbo C is correct here with respect to the C standard. Python > is correct with respect to the Python Reference Manual. > > They also disagree about int

pipes

2007-09-10 Thread yagyala
Hi. I'm trying to communicate with a c++ executable via pipes. I prefer not to use forks because I want it to work on windows. In python the code looks roughly like: (r,w) = pipes() spawnl(P_WAIT, 'tool.exe', 'dummy', message, str(w)) close(w) print os.read(r, 1000) close r and in c++ int main (

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 8:02 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > > Looking at the documentation it looks excellent. But I don't > > >

pipes

2007-09-10 Thread yagyala
Hi. I'm rtying to use pipes to communicate between a python GUI and a spawned C++ program. I prefer not to use forking because the app may be run on windows, where forking isn't supported. Roughly what I'm doing is: (r,w) = os.pipe() spawnl(P_WAIT, 'tool.exe', ' ', message, str(w)) close(w) print

Re: Enum class with ToString functionality

2007-09-10 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > Looking at the documentation it looks excellent. But I don't > > > understand the 0.4.2 version number, > > > > Note the tag that says

Re: Enum class with ToString functionality

2007-09-10 Thread J. Cliff Dyer
TheFlyingDutchman wrote: > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: >> TheFlyingDutchman <[EMAIL PROTECTED]> writes: http://cheeseshop.python.org/pypi/enum/> >> (Please preserve attribution lines so it's clear who wrote what.) >> >> >>> Looking at the documentation it look

Python Database Apps

2007-09-10 Thread [EMAIL PROTECTED]
Kindof a poll, kindof curiosity... What is your favorite python - database combination? I'm looking to make an app that has a local DB and a server side DB. I'm looking at python and sqlite local side and sql server side. Any suggestions Darien -- http://mail.python.org/mailman/listinfo/

Re: printing list containing unicode string

2007-09-10 Thread J. Cliff Dyer
Xah Lee wrote: > This post is about some notes and corrections to a online article > regarding unicod and python. > > -- > > by happenstance i was reading: > > Unicode HOWTO > http://www.amk.ca/python/howto/unicode > > Here's some problems i see: > > ・ No conspicuous authorship. (howeve

anybody has py modules emulating symbian 60 on PC?

2007-09-10 Thread Ginger
like appuifw/graphics/sysinfo modules, i've get some primary modules of these, they do what they did on S60 platform. u can get them from http://pdis.hiit.fi/pdis/ but these modules i get are rather simple ones, and a full emulation is needed ..., so anyone who has it, plz send me a copy, with my

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > http://cheeseshop.python.org/pypi/enum/> > > (Please preserve attribution lines so it's clear who wrote what.) > > > Looking at the documentation it looks excellent. But I don't > > u

Re: [PyCON-Organizers] Next PyCon Organizers' Meeting Tuesday, 11 September

2007-09-10 Thread Douglas Napoleone
I have found that jabber accounts no longer work, but google accounts do. I had a jabber account, but could never get it working in GAIM. My google account works fine. -Doug On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > David> Connection details: > David> > http://wik

Re: printing list containing unicode string

2007-09-10 Thread Xah Lee
This post is about some notes and corrections to a online article regarding unicod and python. -- by happenstance i was reading: Unicode HOWTO http://www.amk.ca/python/howto/unicode Here's some problems i see: ・ No conspicuous authorship. (however, oddly, it has a conspicuous ackno

Re: [PyCON-Organizers] Next PyCon Organizers' Meeting Tuesday, 11 September

2007-09-10 Thread skip
David> Connection details: David> http://wiki.python.org/moin/PyCon2008/OrganizersMeetingsConnectionDetails Ah, now I remember. GAIM complained: 400: Malformed Jabber ID GAIM recorded my Jabber ID as "[EMAIL PROTECTED]" which seems pretty well-formed to me. Skip -- http://mail.p

Re: Enum class with ToString functionality

2007-09-10 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > http://cheeseshop.python.org/pypi/enum/> (Please preserve attribution lines so it's clear who wrote what.) > Looking at the documentation it looks excellent. But I don't > understand the 0.4.2 version number, Note the tag that says the "Deve

distutils question

2007-09-10 Thread billiejoex
Hi there, I'm having problems with creating an installer for a module of mine by using distutils. I'll try to explain my problem as clear as I can (sorry but English is not my first language). This is the structure of my module: setup.py mypackage/ __init__.py

Re: Enum class with ToString functionality

2007-09-10 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : > On Sep 8, 9:52 am, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >>TheFlyingDutchman a écrit : (snip) >>>class TestOutcomes: >>>PASSED = 0 >>>FAILED = 1 >>>ABORTED = 2 >> >>>def ToString(outcome): >>>if outcome == TestOutcomes.PASSED: >>>

Re: startswith( prefix[, start[, end]]) Query

2007-09-10 Thread Bruno Desthuilliers
Steve Holden a écrit : > Bruno Desthuilliers wrote: > >> Steve Holden a écrit : > > [...] > >>> >>> Probably not really necessary, though, and they do say that premature >>> optimization is the root of all evil ... >> >> >> I wouldn't call this one "premature" optimization, since it doesn't >>

Re: Python Problem

2007-09-10 Thread Wiseman
Carsten. I want to thank you for your help. I could not check this until this morning. Now that I checked your answer - THANK YOU. I do have 2 installations of Python on my machine. Once I called Python with a full path - my program orked as expected. Meir -- http://mail.python.org/mailman/l

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
> > I'd like to know if the Cheeseshop package 'enum' is useful to > you. Any constructive feedback would be appreciated. > > http://cheeseshop.python.org/pypi/enum/> Looking at the documentation it looks excellent. But I don't understand the 0.4.2 version number, particularly when you refer

Re: /dev/null as a file-like object, or logging to nothing

2007-09-10 Thread Asun Friere
On Sep 11, 10:22 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message <[EMAIL PROTECTED]>, Sion Arrowsmith wrote: > > > Torsten Bronger <[EMAIL PROTECTED]> wrote: > > > Windows has a NUL: device which behaves like /dev/null . > > It's not a device, it's a reserve

Re: zlib

2007-09-10 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Milos Prudek wrote: > Although I have Python 2.5 with zlib in my Linux disto, I need to install > my own Python (as most Zope developers do). Why? > Zope requires zlib. Python 2.4.4 does not contain zlib. So why does your own Python version have to be 2.4.4? --

Re: Question about PEP 8

2007-09-10 Thread Ben Finney
Laszlo Nagy <[EMAIL PROTECTED]> writes: > Here is my problem. There is ConfigParser, StringIO, Queue, > HTMLParser etc. They are all part of the standard library. Yes, many modules in the standard library don't conform to PEP 8; these are known bugs. > Most of these are modules with only a "mai

mailbox module, Maildir, and flags

2007-09-10 Thread jesse . k . rosenthal
Dear all, I'm trying to figure out if mailbox will let me get the flags of a Maildir message without running get_message on it, and reading the whole message. It seems like it should work by doing this: >>> import mailbox >>> mybox = mailbox.Maildir('~/Maildir/', mailbox.MaildirMessage) >>> myfol

Re: /dev/null as a file-like object, or logging to nothing

2007-09-10 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Sion Arrowsmith wrote: > Torsten Bronger <[EMAIL PROTECTED]> wrote: >>Marc 'BlackJack' Rintsch writes: > >>> `os.devnull`? > >>Yes, but I wasn't really sure how portable it is, in particular, on >>Windows. > > Windows has a NUL: device which behaves like /dev/null

Re: question on python syntax

2007-09-10 Thread J. Cliff Dyer
Andrew Robert wrote: > a.m. wrote: >> If I type this in shell >> >> $ ./yourfile.py 12:34 PM & >> >> What does '$', '.', '/' and '& means in this succession? Note: >> 12:34 PM is a argument to the yourfile.py. >> > > This not python syntax but Unix shell. > > $ = shell prompt ./

Re: Enum class with ToString functionality

2007-09-10 Thread Ben Finney
[EMAIL PROTECTED] writes: > But it would be much nicer if I had a function to covert to string > as part of the TestOutcomes class. How would I implement this? Others have given ad hoc implementations that may do what you want. I'd like to know if the Cheeseshop package 'enum' is useful to you.

Re: question on python syntax

2007-09-10 Thread Andrew Robert
a.m. wrote: > If I type this in shell > > $ ./yourfile.py 12:34 PM & > > What does '$', '.', '/' and '& means in this succession? Note: 12:34 > PM is a argument to the yourfile.py. > This not python syntax but Unix shell. $ = shell prompt ./= look for the program in my

question on python syntax

2007-09-10 Thread a.m.
If I type this in shell $ ./yourfile.py 12:34 PM & What does '$', '.', '/' and '& means in this succession? Note: 12:34 PM is a argument to the yourfile.py. -- http://mail.python.org/mailman/listinfo/python-list

[ANN] GtkImageView 1.5.0 and PyGtkImageView 1.0.0 -- Image viewer widget for GTK

2007-09-10 Thread BJörn Lindqvist
I'm pleased to finally announce GtkImageView 1.5.0. I'm even more pleased to ALSO announce PyGtkImageView 1.0.0: Description --- GtkImageView is a simple image viewer widget for GTK+. Similar to the image viewer panes in gThumb or Eye of Gnome. It makes writing image viewing and editing ap

Next PyCon Organizers' Meeting Tuesday, 11 September

2007-09-10 Thread David Goodger
Next meeting: Tuesday, September 11, at 18:00 UTC (2PM Eastern, 1PM Central, 12PM Mountain, 11AM Pacific). I'll post some agenda items, but feel free to add more: http://wiki.python.org/moin/PyCon2008/OrganizersMeetings Connection details: http://wiki.python.org/moin/PyCon2008/OrganizersMeetingsC

Re: getting the current function

2007-09-10 Thread Jonathan Gardner
On Sep 7, 9:19 am, Gary Robinson <[EMAIL PROTECTED]> wrote: > > This all seems a bit too complicated. Are you sure you want to do > > this? Maybe you need to step back and rethink your problem. > > In version 2.1 Python added the ability to add function attributes -- > seehttp://www.python.org/dev

Re: How do I read and write to the same CSV file

2007-09-10 Thread Steven D'Aprano
On Mon, 10 Sep 2007 15:01:32 +, Steven D'Aprano wrote: > But if you insist... you might be able to use cf_stream.seek() to move > to the current position in the file, then write the bytes you want. How > do you find the current position? Black magic or voodoo might help. Well, that'll learn

Re: encoding latin1 to utf-8

2007-09-10 Thread Xah Lee
On Sep 10, 5:25 am, Harshad Modi <[EMAIL PROTECTED]> wrote: > hello , > I make one function for encoding latin1 to utf-8. but i think it is > not work proper. > plz guide me. Hi, what you want is here, including complete code: Converting a File's "Character Set" / Encoding http://xahlee.org/perl

Re: Generating a unique identifier

2007-09-10 Thread stephen . lewitowski
On Sep 7, 1:03 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have an application that will be producing many instances, using them > for a while, then tossing them away, and I want each one to have a unique > identifier that won't be re-used for the lifetime of the Python se

Re: Silent SaveAs when using the Excel win32com module

2007-09-10 Thread MRAB
On Sep 10, 5:24 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > From: Chris > > > I'm trying to create an excel file which will act as a log, however I > > want to overwrite the file if it exists. > > > Looking at the SaveAs method I can't find anything that would allow > > it. I don't want

Re: printing list containing unicode string

2007-09-10 Thread Xah Lee
Google groups seems to be stripping my quotation markslately. Here's a retry to post my previous message. -- Xah Lee wrote: If i have a nested list, where the atoms are unicode strings, e.g. # -*- coding: utf-8 -*- ttt=[[u"→

Re: Python syntax wart

2007-09-10 Thread Carl Banks
On Sep 10, 8:07 am, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 9, 11:20 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > It may be that a language that doesn't have a statement terminator > > (which can be end-of-line) needs a statement continuation symbol. > > (Excluding languages

Re: printing list containing unicode string

2007-09-10 Thread Xah Lee
On Sep 10, 8:12 am, Carsten Haese <[EMAIL PROTECTED]> wrote: Xah Lee wrote: If i have a nested list, where the atoms are unicode strings, e.g. # -*- coding: utf-8 -*- ttt=[[u"→",u"↑"], [u"αβγ"],...] print ttt how can i print it without getting the u'\u1234' notation? i.e. i want it print just l

Message ("Your message dated Sun, 9 Sep 2007 23:15:08 -0400...")

2007-09-10 Thread LISTSERV
Your message dated Sun, 9 Sep 2007 23:15:08 -0400 with subject "Returned mail: Data format error" has been submitted to the moderator of the CSICOP-ANNOUNCE list: Barry Karr <[EMAIL PROTECTED]>. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why zlib not included in Python tarball?

2007-09-10 Thread Martin v. Löwis
> I need to install my own Python. I compiled Python 2.4.4 from sources. zlib > did not compile - it's not in the lib-dynload directory. > > I did not have this problem with any of my earlier Python compiles. I > routinely compile Python from source. > > What is the correct procedure for insta

Re: C API (embedded Python): How to get and set named variables

2007-09-10 Thread Martoon
Thank you! Just what I needed. I came across the PyObject_*AttrString() functions earlier when searching through the docs, and I thought I was in the right area, but I didn't know what object I was supposed to set the attribute for. Now I see that it's a module object. It all makes sense now. T

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 8, 9:52 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman a écrit : > > > > > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > > >>Hi, > > >>I have the following class - > > >>class TestOutcomes: > >>PASSED = 0 > >>FAILED = 1 > >>ABORTED = 2 > > >>plus the foll

Re: creating really big lists

2007-09-10 Thread Bruno Desthuilliers
Dr Mephesto a écrit : > Hi! > > I would like to create a pretty big list of lists; a list 3,000,000 > long, each entry containing 5 empty lists. My application will append > data each of the 5 sublists, so they will be of varying lengths (so no > arrays!). > > Does anyone know the most efficient

Re: How do I disable warnings?

2007-09-10 Thread Grant Edwards
On 2007-09-10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I'd like to disable this warning: >> >> Warning: 'with' will become a reserved keyword in Python 2.6 >> >> AFAICT, the following should work. But, it doesn't. >> >> import warnings >> warnings.filterwarnings('ignore',".*'with' wi

Re: Mac OSX sqlite problem. Missing?

2007-09-10 Thread ricardo . turpino
Diez B. Roggisch wrote: > > Are you by any chance using the python 2.3 when issuing that import > statement? > > Diez Unfortunately not :( ibook:~/project1$ python -V Python 2.5 ibook:~/project1$ python Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] o

Re: How do I disable warnings?

2007-09-10 Thread [EMAIL PROTECTED]
On Sep 10, 12:34 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > I've read the documentation for the warnings module, but I'm > still unable to figure out how to disable a warning. > > I'd like to disable this warning: > > Warning: 'with' will become a reserved keyword in Python 2.6 > > AFAICT, the

Need a KDE app, where to find a coder?

2007-09-10 Thread Dotan Cohen
I need an application, and I'd like it to be written in Python with QT as I am a KDE user. I simply don't have the time to code it myself, as I've been trying to find the time for half a year now. What are some reputable websites for finding Python coders? If anyone on the list wants the job, this

Re: Mac OSX sqlite problem. Missing?

2007-09-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi, > > I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a > Macbook 1.83GHz. I though that the python sqlite library was > installed by default as part of Mac Python 2.5, however, I still have > a problem. > > Sqlite does not appear to be my system: >

Re: memcpy

2007-09-10 Thread Marc 'BlackJack' Rintsch
On Mon, 10 Sep 2007 11:38:50 -0700, Tim wrote: > How do I memcpy from a pointer to an array of floats in python? > > I get errors: NameError: global name 'row' is not defined Well than the (global) name `row` is not defined. Quite clear message, isn't it? ;-) > I want to be able to get the ro

Python tickets summary

2007-09-10 Thread Facundo Batista
People: I modified my tool, whichs makes a summary of all the Python tickets (I moved the source where the info is taken from SF to our Roundup). In result, the summary is now, again, updated daily: http://www.taniquetil.com.ar/facundo/py_tickets.html Enjoy it. Regards, -- .Facundo B

ANNOUNCE: Exscript 0.9.8

2007-09-10 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Python developers can easily extend Exscript templates using

Why zlib not included in Python tarball?

2007-09-10 Thread Milos Prudek
I need to install my own Python. I compiled Python 2.4.4 from sources. zlib did not compile - it's not in the lib-dynload directory. I did not have this problem with any of my earlier Python compiles. I routinely compile Python from source. What is the correct procedure for installing zlib fro

Mac OSX sqlite problem. Missing?

2007-09-10 Thread ricardo . turpino
Hi, I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a Macbook 1.83GHz. I though that the python sqlite library was installed by default as part of Mac Python 2.5, however, I still have a problem. Sqlite does not appear to be my system: >>> import sqlite Traceback (most recent ca

Re: uninstall

2007-09-10 Thread Milos Prudek
> If you're installing from sources "manually", you might want to > consider checkinstall to give you the option of an uninstall for those > software distributions which don't support "make uninstall": I know about checkinstall and I often use it. If I remember correctly, Python failed to work wi

Re: creating really big lists

2007-09-10 Thread Bruno Desthuilliers
Delaney, Timothy (Tim) a écrit : > Hrvoje Niksic wrote: > > >>Dr Mephesto <[EMAIL PROTECTED]> writes: >> >> >>>I would like to create a pretty big list of lists; a list 3,000,000 >>>long, each entry containing 5 empty lists. (snip) > >>If you're building large data structures and don't need to r

Re: encoding latin1 to utf-8

2007-09-10 Thread Piet van Oostrum
> Harshad Modi <[EMAIL PROTECTED]> (HM) wrote: >HM> hello , >HM> I make one function for encoding latin1 to utf-8. but i think it is >HM> not work proper. >HM> plz guide me. >HM> it is not get proper result . such that i got "Belgi�" using this >HM> method, (Belgium) : >HM> import codecs

Re: Getting error zipimport.ZipImportError: can't decompress data; zlib not available

2007-09-10 Thread Diez B. Roggisch
shabda raaj schrieb: > I have a VPS server with fedora 7. > I wanted to install easy_install on this server, but I got an error > saying > unable to open /usr/lib/ > python2.5/config/Makefile (No such file or > directory). > So I installed the latest version of python from source. > Now when I am

Re: noob: reloading modified python file within Python Shell

2007-09-10 Thread Diez B. Roggisch
johnny schrieb: > from people.models import * > > Now I make changes to the models.py. How do I reload this module in > Python Shell? > reload(module) which works only with import people.models reload(people.models) Which is better anyway, as the from module import * syntax will create lo

How do I disable warnings?

2007-09-10 Thread Grant Edwards
I've read the documentation for the warnings module, but I'm still unable to figure out how to disable a warning. I'd like to disable this warning: Warning: 'with' will become a reserved keyword in Python 2.6 AFAICT, the following should work. But, it doesn't. import warnings warnings.fil

Re: Enum class with ToString functionality

2007-09-10 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > >>Hi, >> >>I have the following class - >> >>class TestOutcomes: >>PASSED = 0 >>FAILED = 1 >>ABORTED = 2 >> >>plus the following code - >> >>testResult = TestOutcomes.PASSED >> >>testResultAsString >>if testR

Getting error zipimport.ZipImportError: can't decompress data; zlib not available

2007-09-10 Thread shabda raaj
I have a VPS server with fedora 7. I wanted to install easy_install on this server, but I got an error saying unable to open /usr/lib/ > python2.5/config/Makefile (No such file or directory). So I installed the latest version of python from source. Now when I am trying to install libraries, I am g

Re: Changing data in an QAbstractListModel

2007-09-10 Thread Jonathan Gardner
On Sep 7, 1:24 am, "exhuma.twn" <[EMAIL PROTECTED]> wrote: > Still, nothing is happening when I call this method. Do I still need > to handle the "dataChanged" signal somehow? Or does the ListView take > care of this? You might have better luck asking these kinds of questions in the Qt or PyQt for

noob: reloading modified python file within Python Shell

2007-09-10 Thread johnny
from people.models import * Now I make changes to the models.py. How do I reload this module in Python Shell? -- http://mail.python.org/mailman/listinfo/python-list

Re: C API (embedded Python): How to get and set named variables

2007-09-10 Thread Farshid Lashkari
[EMAIL PROTECTED] wrote: >>From the C API (I'm using Python embedded), how can I get and set the > value of named variables? Right now, I'm using hacks like > PyRun_SimpleString("foobar = 12\n"), but I'd really like to access the > named objects directly. > You can use the following C functions

memcpy

2007-09-10 Thread Tim
How do I memcpy from a pointer to an array of floats in python? I get errors: NameError: global name 'row' is not defined I want to be able to get the row[i] array element. In C I would normally place the address of row as the first argument. cdll.msvcrt.memcpy( row, pData, 256 ) If I define r

PIL Error: "cannot read interlaced PNG files"

2007-09-10 Thread T-u-N-i-X
Hey There, I'm developing an application that lets the user to upload JPG and PNG files. I'm using PIL to check the images after the upload (like checking it storage size, width and height). But PIL raises an error: "cannot read interlaced PNG files" It says that interlaced PNG files are not sup

Re: Question about PEP 8

2007-09-10 Thread Matimus
> will Py3K change the standard library names in order to follow PEP 8?) Just continue down the list of PEPs and you will find the answer: http://www.python.org/dev/peps/pep-3108/#modules-to-rename This covers built-in modules. It doesn't cover 3rd party modules, like wx. Most likely you will st

C API (embedded Python): How to get and set named variables

2007-09-10 Thread mrabens
>From the C API (I'm using Python embedded), how can I get and set the value of named variables? Right now, I'm using hacks like PyRun_SimpleString("foobar = 12\n"), but I'd really like to access the named objects directly. -- http://mail.python.org/mailman/listinfo/python-list

Re: /dev/null as a file-like object, or logging to nothing

2007-09-10 Thread Gabriel Genellina
En Sat, 08 Sep 2007 14:42:14 -0300, Torsten Bronger <[EMAIL PROTECTED]> escribi�: >> `os.devnull`? > > Yes, but I wasn't really sure how portable it is, in particular, on > Windows. So does > > open(os.devnull, "w").write("Schallalla") > > work on Windows like on Unix? Yes. os.devnull=='nul' o

Re: Modul (%) in python not like in C?

2007-09-10 Thread [EMAIL PROTECTED]
On Sep 10, 1:38 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 09 Sep 2007 22:57:24 -0700, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > But, in general, doesn't (-11,-4) also satisfy > > x = y * a + b > > -70 = 6 * -11 + (-4)? >

Re: Checking if elements are empty

2007-09-10 Thread Neil Cerutti
On 2007-09-10, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 9/10/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> Agreed; but I prefer 'if y[0] == ""', absent more context and >> better names. > > Probably should use u"" if you're going to take that route, as > this will fail spuriously if y[0] conta

Question about PEP 8

2007-09-10 Thread Laszlo Nagy
Hi All, Here is what I read in PEP 8: > Package and Module Names > > Modules should have short, all-lowercase names. Underscores can be used > in the module name if it improves readability. Python packages should > also have short, all-lowercase names, although the use o

Re: shared memory pointer

2007-09-10 Thread Tim Golden
Tim wrote: > I reviewed the mmap function and I have a question. In the example > code below, what is the connection between the data in shared memory > and the mmap function. The fileno is zero. Why is it zero? The size > makes sense because there is 256 bytes in shared memory. The tag is > MyFile

RE: Silent SaveAs when using the Excel win32com module

2007-09-10 Thread Hamilton, William
> From: Chris > > I'm trying to create an excel file which will act as a log, however I > want to overwrite the file if it exists. > > Looking at the SaveAs method I can't find anything that would allow > it. I don't want the prompt to appear to ask whether to replace the > file or not. I just wa

Re: shared memory pointer

2007-09-10 Thread MC
Hi! I agree ; on windows mmap use Memory-Mapped-file, who use virtual memory. And shared memory use physical memory. The difference is OS an not Python -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >