Re: Mysterious "Attribute Errors" when GUI Programming

2005-03-08 Thread Robert Kern
Coral Snake wrote: Thank you all. It appears that I was right in my original opinion of source code from the Python Developer's Handbook by Andre Lessa and the PyGTK Tutorial. That is where these source codes came from. The code in Question came from the Chapter Getting Started in the PyGTK Tutoria

Re: Mysterious "Attribute Errors" when GUI Programming

2005-03-08 Thread Coral Snake
klappnase wrote: > "Coral Snake" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > > -- > > Tkinter: > > > > from Tkinter import * > > root = Tk() > > This creates the application's main window. The Tk() command is not > som

Running doctests with unittest

2005-03-08 Thread Thomas Heller
I'm trying to integrate some doctest tests with unittest. The tests must be exposed as one or more subclasses of unittest.TestCase, so I'm collecting them with a call to doctest.DocTestSuite(), and then add them to a TestCase class I have created. The tests seem to run, but they always seem to suc

Re: Best way to make a list unique?

2005-03-08 Thread Michael Spencer
Delaney, Timothy C (Timothy) wrote: Michael Hoffman wrote: For those who don't know, these implement a hash set/map which iterates in the order that the keys were first added to the set/map. I would love to see such a thing. I've proposed this on python-dev, but the general feeling so far is agai

Re: Popen3 and capturestderr

2005-03-08 Thread Donn Cave
Quoth Kenneth Pronovici <[EMAIL PROTECTED]>: ... | If ignoreStderr=False, I use popen2.Popen4 so that stderr and stdout are | intermingled. If ignoreStderr=True, I use popen2.Popen3 with | capturestderr=True so stderr doesn't appear in the output. This | functionality exists so I have an equivale

window not responding

2005-03-08 Thread Raghul
hi I am working in making a jabber client.I made upto chatting with each other.Any number of people can be simultaneously chat.My problem is that If I am initiated to talk then the application works fine.Suppose if my friend initiate the session by sending message the window goes on not respondi

read() / readline() / readlines()

2005-03-08 Thread Dave Lajoie
Hello!     would someone know a method that allows     to read line delimited by "\n" instead of trapping "\0" like     readlines does?   I have to write my own while loop to do this.       while myThread.isAlive() == True:    myChar = p.stdout.read(1)    if myChar == '\0':

Re: Defining __getitem__() in a class that inherits from (dict)

2005-03-08 Thread Tobiah
My appreciation for your responses is not easily imparted through text. Thank You. Steven Bethard wrote: Michael Hoffman wrote: Tobiah wrote: If within the __getitem__ method I attempt to get an item from self, the __getitem__ method is called in an infinite recursion. You need to explicitly use

Re: Queued stdout, flush() doesn't seems to help...

2005-03-08 Thread Dave Lajoie
Here is the solution, as an fyi might not be the most elegant solution, but it works ;)   from subprocess import *import sys, threading, time   # if someone knows who to return value from thread function, # pls let me know, I hate to use global variable ;)   def ThreadProcess():    executab

Re: None in string formatting

2005-03-08 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Was doing some string formatting, noticed the following: x = None "%s" % x 'None' Is there a reason it maps to 'None'? I had expected ''. Because %s just calls str on the arguments, and str(None) == 'None'. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/

Re: Working on a log in script to my webpage

2005-03-08 Thread Steve Holden
Pete. wrote: The 2 scripts I made is actually working the way they where meant to. So im kindda happy :) The problem is, that I didnt think about the problem: as Steve wrote: "There are other matters of concern, however, the most pressing of which is: How am I going to stop user from naviga

Re: Working on a log in script to my webpage

2005-03-08 Thread Pete.....
The 2 scripts I made is actually working the way they where meant to. So im kindda happy :) The problem is, that I didnt think about the problem: as Steve wrote: "There are other matters of concern, however, the most pressing of which is: How am I going to stop user from navigating directly to

RE: Working on a log in script to my webpage

2005-03-08 Thread bruce
pete... simply use google and search for "php scripts login user authentication mysql session etc..." these terms will give you lots of examples... you could also look at some of the bulletin board/forum apps that are open source to se what they use. or, you could also look through the code for s

Weekly Python Patch/Bug Summary

2005-03-08 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 279 open (-24) / 2797 closed (+33) / 3076 total ( +9) Bugs: 851 open ( +2) / 4853 closed (+16) / 5704 total (+18) RFE : 173 open ( +4) / 150 closed ( +2) / 323 total ( +6) New / Reopened Patches __ Fix for w

RE: Best way to make a list unique?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Michael Hoffman wrote: >>> For those who don't know, these implement a hash set/map which >>> iterates in the order that the keys were first added to the set/map. > > I would love to see such a thing. I've proposed this on python-dev, but the general feeling so far is against it. So far the only

Python 2.4, asyncore and errors

2005-03-08 Thread Tony Meyer
Changes in asyncore from 2.3 to 2.4 mean that asyncore.poll() now passes all the sockets in the map to select.select() to be checked for errors, which is probably a good thing. If an error occurs, then handle_expt() is called, which by default logs the error. asyncore.dispatcher creates nonblocki

Re: function with a state

2005-03-08 Thread Peter Hansen
Xah Lee wrote: def myFun(var): return var+1 globe = 0 globe = myFun(globe) this is intriguing. How does it work? not a rhetorical question, but where in the python doc can i read about it? The tutorial, presumably, since there is nothing here that isn't covered by the most basic aspects of Python

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-03-08 Thread Alec Wysoker
It seems unlikely that is the problem, since I can connect from the client machine to server using JDBC, just not using mySQL client (any by extension) mysql-python. -- http://mail.python.org/mailman/listinfo/python-list

Re: function namespaces

2005-03-08 Thread Steve Holden
Darren Dale wrote: Generally, I avoid execfile within a function. What's your use case? There may be a better way to approach this problem... I am writing a simulation that loads some predefined constants, depending on the options called by the user. I originally had it set up to parse the file,

Re: How to make an extension class have a __getitem__ interface?

2005-03-08 Thread John Machin
Steve Juranich wrote: > I'm in the process of writing a few extension types, and there's one > that I'd sort of like to have getitem, setitem, getslice, setslice > functionality for. > > I've been looking through the docs and how things are done in > Objects/listobject.c, and it appears tha there

Re: function with a state

2005-03-08 Thread Xah Lee
>def myFun(var): > return var+1 >globe = 0 >globe = myFun(globe) this is intriguing. How does it work? not a rhetorical question, but where in the python doc can i read about it? thanks. Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listi

Re: Python docs [was: function with a state]

2005-03-08 Thread Steve Holden
Xah Lee wrote: thanks for the help... --- the python doc is stilted. It tried to organized the thing and with a style around some highbrow inane "computer science" outlook. [usual semi-literate expletive-deleted rant omitted] And your writing is so lucid and comprehensible, it's a pity you can

Re: Python docs [was: function with a state]

2005-03-08 Thread Sean Blakey
On 8 Mar 2005 17:07:31 -0800, Xah Lee <[EMAIL PROTECTED]> wrote: > thanks for the help... > > --- > the python doc is stilted. It tried to organized the thing and with a > style around some highbrow inane "computer science" outlook. > > i found the little section on global > (http://python.or

Re: File call error message (double backslash)

2005-03-08 Thread John Machin
Fred wrote: > Hi > I am writing on an application, that is supposed to read a file into a > single string: > My program though, when I run it, gives me an error, that the called > file is non existent > 'C:\ \Documents and Settings\ \Fred\ \My Documents\ \School\ \Bio' > Is it normal that python a

Re: running a C program with python script

2005-03-08 Thread James Stroud
module os the os.popen* commands. On Tuesday 08 March 2005 05:18 pm, M.N.A.Smadi wrote: > hi; > > how can i do the following: > 1- run a C program from a python script > 2- pass that C program an argument > 3- Read the out of the program into a buffer that is local to the script > > thanks > m.s

running a C program with python script

2005-03-08 Thread M.N.A.Smadi
hi; how can i do the following: 1- run a C program from a python script 2- pass that C program an argument 3- Read the out of the program into a buffer that is local to the script thanks m.smadi -- http://mail.python.org/mailman/listinfo/python-list

Python docs [was: function with a state]

2005-03-08 Thread Xah Lee
thanks for the help... --- the python doc is stilted. It tried to organized the thing and with a style around some highbrow inane "computer science" outlook. i found the little section on global (http://python.org/doc/2.4/ref/global.html) and can't make out what shit it is trying to say with

Re: Working on a log in script to my webpage

2005-03-08 Thread Pete.....
> How am I going to stop user from navigating directly to page1? > > Answering this question will involve learning about HTTP session state and > writing web applications. I could write a book on that subject :-) > > regards > Steve > Thanks Steve And yes I havnt thought about that, guess I

Re: function namespaces

2005-03-08 Thread Darren Dale
> Generally, I avoid execfile within a function. What's your use case? > There may be a better way to approach this problem... I am writing a simulation that loads some predefined constants, depending on the options called by the user. I originally had it set up to parse the file, and load the c

Re: Best way to make a list unique?

2005-03-08 Thread Michael Hoffman
Steven Bethard wrote: Delaney, Timothy C (Timothy) wrote: For those who don't know, these implement a hash set/map which iterates in the order that the keys were first added to the set/map. I would love to see such a thing. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

RE: Working on a log in script to my webpage

2005-03-08 Thread bruce
hi... regarding the issue of creating a login (user/passwd) script... there are numerous example scripts/apps written that use php/mysql... i suggest that you take a look at a few and then incoporate the features that you want into your script. from your questions, it seems like this approach wil

Re: function namespaces

2005-03-08 Thread Steven Bethard
Darren Dale wrote: Hi, I have a variable saved in a file like this #contents of myfile.py: testvar = [1,2,3,4] and I am trying to write a function that does something like this: def myfunction(filename): execfile(filename) print testvar The problem I am running into is that the glob

Re: function namespaces

2005-03-08 Thread M.E.Farmer
Hello Darren, I am not sure why you are using execfile(). Py> help(execfile) Help on built-in function execfile: execfile(...) execfile(filename[, globals[, locals]]) Read and execute a Python script from a file. The globals and locals are dictionaries, defaulting to the current g

Re: function namespaces

2005-03-08 Thread Max Erickson
Darren Dale wrote: > def myfunction(filename): > execfile(filename) > print testvar > > What am I doing wrong? I'm not familiar enough with execfile or the interactive interpreter to know what you are doing wrong, but something like: def myfunction(filename): ns=dict() execfi

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Brian Roberts
> > Am I so deperately fighting the language? No-one here on the list needs to > set hundreds > variables at once somewhere in their code? I still don't get why: > I once (and only once) needed hundreds of variables in a program. It was to simplify creation of unit tests, not for production us

Re: pyasm 0.2 - dynamic x86 assembler for python

2005-03-08 Thread olsongt
> > # > ## helloWorld.py > ## assembly hello world script > # DOH! The example file got truncated. Here it is. # ## helloWorld.py ## assembly hello world script # fro

Re: File call error message (double backslash)

2005-03-08 Thread M.E.Farmer
Hello Fred, Backslashes are used as an escape and not just in Python ( consider '\r\n' ) To use a backslash you must escape it with two of them like this: \\ 'c:\\windows\\dir' or you can use a raw string: r"c:\windows\dir" or you can use forward slashes. Yes that works ;) "c:/windows/dir" Windows

Re: Working on a log in script to my webpage

2005-03-08 Thread Steve Holden
Pete. wrote: Hi all I am working on a log in script for my webpage. I have the username and the password stored in a PostgreSQL database. The first I do is I make a html form, where the user can type in his username and code, when this is done I want to run the script(testifcodeisokay) that v

Re: Defining __getitem__() in a class that inherits from (dict)

2005-03-08 Thread Steven Bethard
Michael Hoffman wrote: Tobiah wrote: If within the __getitem__ method I attempt to get an item from self, the __getitem__ method is called in an infinite recursion. You need to explicitly use dict.__getitem__(self, key) instead of using self[key] directly. or super(bar, self).__getitem__(key) STeVe

Re: None in string formatting

2005-03-08 Thread Steve Holden
Jorge Godoy wrote: [EMAIL PROTECTED] writes: Was doing some string formatting, noticed the following: x = None "%s" % x 'None' Is there a reason it maps to 'None'? I had expected ''. How would know, then, if there was no value at all or if it was an empty string? Well, for that matter, how can

Re: Defining __getitem__() in a class that inherits from (dict)

2005-03-08 Thread Michael Hoffman
Tobiah wrote: If within the __getitem__ method I attempt to get an item from self, the __getitem__ method is called in an infinite recursion. You need to explicitly use dict.__getitem__(self, key) instead of using self[key] directly. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/pyt

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Steve Holden
Martin MOKREJŠ wrote: Steve Holden wrote: [...] I will be *very* surprised if you can't get a much better (i.e. easier and more efficient) solution by stepping back from the programming Hmm, I'm not convinced, but I'll put few more words here then. ;) details for a moment and explaining what it

Re: Best way to make a list unique?

2005-03-08 Thread BJörn Lindqvist
The Cookbook features another interesting way to do it: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/204297 -- mvh Björn -- http://mail.python.org/mailman/listinfo/python-list

File call error message (double backslash)

2005-03-08 Thread Fred
Hi I am writing on an application, that is supposed to read a file into a single string: My program though, when I run it, gives me an error, that the called file is non existent 'C:\ \Documents and Settings\ \Fred\ \My Documents\ \School\ \Bio' Is it normal that python adds the space and extra ba

Defining __getitem__() in a class that inherits from (dict)

2005-03-08 Thread Tobiah
#!/usr/bin/python # Hi, # # I noticed something interesting when trying to define # the __getitem__() method in a class that inherits from # (dict). If within the __getitem__ method I attempt # to get an item from self, the __getitem__ method is # called in an infinite recursion. I am very fond o

function namespaces

2005-03-08 Thread Darren Dale
Hi, I have a variable saved in a file like this #contents of myfile.py: testvar = [1,2,3,4] and I am trying to write a function that does something like this: def myfunction(filename): execfile(filename) print testvar The problem I am running into is that the global name testva

How to upgrade python on Redhat?

2005-03-08 Thread [EMAIL PROTECTED]
This question applies specifically to RHEL 3.0 (actually Whitebox), but also generally to Redhat and probably pretty much every distribution that uses python for distribution-related tasks (configuration managers, rpm package management, yum, etc). So I want to upgrade to python 2.4 on Whitebox 3.

[ANN] pyasm 0.2 - dynamic x86 assembler for python

2005-03-08 Thread Grant Olson
PyASM by Grant Olson = PyASM is a dynamic x86 assembler for python. By "dynamic", I mean that it can be used to generate inline assembly functions in python at runtime without requiring object file generation or linkage. New in version 0.2 ---

Re: Accessing files installed with distutils

2005-03-08 Thread Carl Banks
Frans Englich wrote: > This is silly. How do I access data files I've installed with distutils? In a > portable, generic way, I want to find out what is the following path on most > systems: > > /usr/local/lib/python2.4/lib/site-packages/foo/bar.txt > > How do I figure out the rest, if I know foo/

RE: Best way to make a list unique?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Steven Bethard wrote: > Sounds like a good candidate for the collections module. Of course > someone will need to implement it. ;) I'll suggest it to Raymond ... ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: parameter name conflict. How to solve?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Bo Peng wrote: >> Is this a style guide thing? >> >> Why not just: >> >> def func(output_param=''): >> output(output=output_param) >> > > This is exactly the problem. There are a bunch of other functions that > use output='' parameter. Changing parameter name for this single > function may

Re: Best way to make a list unique?

2005-03-08 Thread Steven Bethard
Delaney, Timothy C (Timothy) wrote: This is actually one thing that Java 1.5 has that I'd like to see in Python - the LinkedHashSet and LinkedHashMap. Very useful data structures. For those who don't know, these implement a hash set/map which iterates in the order that the keys were first added to

Re: parameter name conflict. How to solve?

2005-03-08 Thread Greg Ewing
Bo Peng wrote: def func(output=''): output(output=output) Another solution that hasn't been mentioned yet: def func(**kwds): output(output = kwds['output']) You might want to do some more checking on the contents of kwds to make sure it doesn't contain any other nonsense parameters. -- Greg

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Peter Hansen
Martin MOKREJŠ wrote: I need to test almost every for it's content. Some tests are just that the value is non-empty (few cases), but in most cases a lot more checks (only certain values allowed, or only int type allowed, or only \w is allowed ...). This sounds very much like an opportunity for some

Popen3 and capturestderr

2005-03-08 Thread Kenneth Pronovici
Hi, I have a problem with a popen2 pipe hanging partway through execution of a command. This happens in my function executeCommand() that is used for every "shell" command execution in my program. Source code for this function is below. My development environment is Debian unstable with Python

How to make an extension class have a __getitem__ interface?

2005-03-08 Thread Steve Juranich
I'm in the process of writing a few extension types, and there's one that I'd sort of like to have getitem, setitem, getslice, setslice functionality for. I've been looking through the docs and how things are done in Objects/listobject.c, and it appears tha there are a couple of ways to do it and

RE: Best way to make a list unique?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Diez B. Roggisch wrote: > No. But I doubt that that is what you actually want, as listA will > lose its order afterwards. Typically, something like that gets > written like this: This is actually one thing that Java 1.5 has that I'd like to see in Python - the LinkedHashSet and LinkedHashMap. Ve

Re: select random entry from dictionary

2005-03-08 Thread [EMAIL PROTECTED]
Peter, Agreed... which is why I said the 'random' module should be imported if more randomness is required. I only mentioned d.popitem() first in case Tores' application didn't need a psuedo-random item and instead he was looking to pull any value without randomness. -- http://mail.python.org/m

Re: firefox python plugin

2005-03-08 Thread Carl Banks
M.N.A.Smadi wrote: > i want to write a script to do the following: > when using firefox to download a textfile, instead of saving it to the > hard dist, i want to run a python script on it, and i want the python > script then to prompt me for the location where i want to store the > processed down

Working on a log in script to my webpage

2005-03-08 Thread Pete.....
Hi all I am working on a log in script for my webpage. I have the username and the password stored in a PostgreSQL database. The first I do is I make a html form, where the user can type in his username and code, when this is done I want to run the script(testifcodeisokay) that verifies that th

Re: pymem.h In function '__declspec'

2005-03-08 Thread Cathy Reddy
Thank you very much with your suggestion. I installed the python intepreter from SUSE CD but downloaded the sources of python from the python website. It seems like it created the mismatches here. After I installed the python source rpm from SUSE CD, I was able to pass where I had errors. Jeff Eple

Re: looking for way to include many times some .py code fromanotherpython code

2005-03-08 Thread Steven Bethard
Martin MOKREJŠ wrote: Basically, doing in a class method def(self, a, b, c): self.a = a self.b = b self.c = c sounds stupid. With next instance I'll loose a, b, c, so I have to save then to a variable, "self." prefix is generally proposed way. But it's not surprising a gets to self.a, righ

Re: looking for way to include many times some .py code fromanotherpython code

2005-03-08 Thread Martin MOKREJŠ
Scott David Daniels wrote: Martin MOKREJŠ wrote: If I put them into a module, it get's executed only once unless I > do reload. And I'd have to use: "from some import *", because mainly I'm interrested in assigning to self: self.x = "blah" self.y = "uhm" OK, somewhere in here I think I get

Re: capturing text from a GUI window

2005-03-08 Thread noah
Earl Eiland wrote: > Anyone know how to capture text from GUI output? I need to process > information returned via a GUI window. > > Earl Assuming Windows, then these guys have an interesting tool: http://www.skesoft.com/textcatch.htm It's not free, but you can try it before you buy it. You

Re: python open source charting solutions ?

2005-03-08 Thread Grant Edwards
On 2005-03-09, Caleb Hattingh <[EMAIL PROTECTED]> wrote: > On Tue, 8 Mar 2005 20:45:22 +0200, ionel <[EMAIL PROTECTED]> wrote: > >> i need some pointers. so far i've tryed matplotlib ... > > I have had good success with pygnuplot. I second the recommendation for pygnuplot -- especially if if you h

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies

Re: Accessing files installed with distutils

2005-03-08 Thread [EMAIL PROTECTED]
I ended up using the trick I found in the Disutils Cookbook. http://www.python.org/moin/DistutilsInstallDataScattered This works fine for me now, but I have another distutils question. My package requires Pmw and another home grown package that has a source dist and a Windows dist built with the

Re: None in string formatting

2005-03-08 Thread Scott David Daniels
Jorge Godoy wrote: [EMAIL PROTECTED] writes: Was doing some string formatting, noticed the following: x = None "%s" % x 'None' Is there a reason it maps to 'None'? I had expected ''. How would know, then, if there was no value at all or if it was an empty string? If you want the other effect, you

firefox python plugin

2005-03-08 Thread M.N.A.Smadi
hi; i want to write a script to do the following: when using firefox to download a textfile, instead of saving it to the hard dist, i want to run a python script on it, and i want the python script then to prompt me for the location where i want to store the processed downloaded file any help i

Re: Secondary list sorting comparison expression

2005-03-08 Thread David Pratt
Hi Raymond. I appreciate your reply. Yes, this is exactly what I was looking for. The syntax I had been trying to work out myself was not correct and not giving me the right thing. Many thanks for your help - this works just the way I wanted. David On Tuesday, March 8, 2005, at 03:46 PM, Raymo

Re: None in string formatting

2005-03-08 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Was doing some string formatting, noticed the following: > > >>> x = None > >>> "%s" % x > 'None' > > Is there a reason it maps to 'None'? I had expected ''. How would know, then, if there was no value at all or if it was an empty string? -- Godoy. <[EMAIL PR

Re: problem with "time"

2005-03-08 Thread Jeff Epler
Without your code, it's hard to tell. Here's a small program I wrote: import time t = time.time() print time.localtime(t - 86400) print time.localtime(t) on both lines, the tm_isdst flag is the same. If I choose two times that are on either side of the DST change in my timezone,

Re: None in string formatting

2005-03-08 Thread Steven Bethard
[EMAIL PROTECTED] wrote: Was doing some string formatting, noticed the following: x = None "%s" % x 'None' Is there a reason it maps to 'None'? I had expected ''. Can you explain why you expected that? A few other examples that make me not expect what you do: py> '%s' % False 'False' py> '%s' %

None in string formatting

2005-03-08 Thread rodney . maxwell
Was doing some string formatting, noticed the following: >>> x = None >>> "%s" % x 'None' Is there a reason it maps to 'None'? I had expected ''. -- http://mail.python.org/mailman/listinfo/python-list

Re: Secondary list sorting comparison expression

2005-03-08 Thread Raymond Hettinger
[David Pratt] > I am wanting to > extend this with a better comparison expression so that it would sort > on one key as primary, a second key as secondary sort , and maybe even > a third as tertiary. The simplest approach is to rely on Python's sort being stable. First sort on the tertiary key, t

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Steve Holden
Martin MOKREJŠ wrote: Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies wanting to access th

Re: python open source charting solutions ?

2005-03-08 Thread Caleb Hattingh
I have had good success with pygnuplot. On Tue, 8 Mar 2005 20:45:22 +0200, ionel <[EMAIL PROTECTED]> wrote: i need some pointers. so far i've tryed matplotlib ... -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 246 revision

2005-03-08 Thread Magnus Lie Hetland
In article <[EMAIL PROTECTED]>, S?bastien Boisg?rault wrote: [snip] > Agreed. Consistency matters. But precisely because Python looks in > the type of the object (and not the object itself), I don't need to > explicitely check the type myself: the code adapt = > getattr(protocol, '__adapt__') will

problem with "time"

2005-03-08 Thread a_geek
Hello, I'm writing a small program that needs to check Unix timestamps for falling into an interval (typical usage: ./program 2005-03, you get the idea). Now, I create two time stamps from the user's input to create the interval's borders using mktime(). Trying to check the sanity of my program, I

Secondary list sorting comparison expression

2005-03-08 Thread David Pratt
I have been using the following for sorting a list of dictionaries. This works but only provides sorting on a single key. I am wanting to extend this with a better comparison expression so that it would sort on one key as primary, a second key as secondary sort , and maybe even a third as ter

Re: Speeding up CGIHTTPServer (Tim Roberts)

2005-03-08 Thread Paul Boddie
"Johan Kohler" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > Fair enough. Pretend my question said "compared to apache, but also to > CGIHTTPServer on linux". The Windows box has modest specs Celeron 2.8GHz, > 256MB, but it takes 30-60s render pages. I was using it to

python open source charting solutions ?

2005-03-08 Thread ionel
i need some pointers. so far i've tryed matplotlib ... -- ionel. -- http://mail.python.org/mailman/listinfo/python-list

Re: i18n: looking for expertise

2005-03-08 Thread klappnase
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > That's apparently a bug in os.access, which doesn't support Unicode file > names. As a work around, do > > def access(name, mode, orig=os.access): > try: > return orig(name, mode) > except Unic

Re: Sorting dictionary by 'sub' value

2005-03-08 Thread Steven Bethard
Rory Campbell-Lange wrote: Thank you all very much for your help. I did the following and it works: imgs=v.keys() imgs.sort(lambda a,b: cmp( time.strptime(str(v[a][9]['date']), '%Y:%m:%d %H:%M:%S'), time.strptime(str(v[b][9]['date']), '%Y:%m:%d %H:%M:%S'))

MDaemon Warning - virus found: Returned mail: see transcript for details

2005-03-08 Thread image-sig-request
*** WARNING ** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. AttachmentVirus name Action taken ---

Python Presentation

2005-03-08 Thread Colin J. Williams
Rod, This is to confirm the telephone message I left yesterday. The Introduction to Python is scheduled for 8.0pm this evening at the Fulford Academy, 280 King Street East. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: Mysterious "Attribute Errors" when GUI Programming

2005-03-08 Thread klappnase
"Coral Snake" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > -- > Tkinter: > > from Tkinter import * > root = Tk() This creates the application's main window. The Tk() command is not some kind of initialization routine,

Re: How to script DOS app that doesn't use stdout

2005-03-08 Thread Timothy Grant
On Sun, 06 Mar 2005 13:41:57 GMT, Gregor <[EMAIL PROTECTED]> wrote: > There's a DOS console application I am trying to script (in Python), but it > doesn't seem to use stdout or stderr... For example, if I redirect output > to a file ("cmd > file.txt"), the output still appears on screen. > Similar

logging addLevelName

2005-03-08 Thread jjesso
I am trying to add a new logging level. logging.config.fileConfig("bengineLog.cfg") logging.CLIENT = logging.INFO + 1 logging.addLevelName( logging.CLIENT, 'CLIENT' ) logging.root.setLevel( [logging.INFO, logging.CLIENT, logging.WARNING, logging.ERROR, logging.CRITICAL] ) logger = logging.getLogge

Re: python -i (interactive environment)

2005-03-08 Thread Joe
Thanks I thought that was also true for globals() but I now see that it is not. "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Joe wrote: >> Thanks, I knew about that but my question is why is it not working >> consistently? > > At the module level, locals() is g

Re: python -i (interactive environment)

2005-03-08 Thread Steven Bethard
Joe wrote: Thanks, I knew about that but my question is why is it not working consistently? At the module level, locals() is globals(): py> locals() is globals() True And the globals() dict is modifiable. HTH, STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting dictionary by 'sub' value

2005-03-08 Thread Rory Campbell-Lange
Thank you all very much for your help. I did the following and it works: imgs=v.keys() imgs.sort(lambda a,b: cmp( time.strptime(str(v[a][9]['date']), '%Y:%m:%d %H:%M:%S'), time.strptime(str(v[b][9]['date']), '%Y:%m:%d %H:%M:%S')) ) for i in img

Re: Format strings that contain '%'

2005-03-08 Thread [EMAIL PROTECTED]
Thanks!! -- http://mail.python.org/mailman/listinfo/python-list

distutils: binary distribution?

2005-03-08 Thread Stefan Waizmann
Hello, I would like the distutils are creating a binary distribution only - means create the distribution file with *.pyc files WITHOUT the *.py files. Any ideas? Or are the distutils the wrong tool for that? "setup.py bdist" creates binary dist, but includes the sourcecode cheers Stefan -- "Wa

Re: Format strings that contain '%'

2005-03-08 Thread Diez B. Roggisch
> Will anything else work here? Use %% print "%%s %s" % "foo" -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: python -i (interactive environment)

2005-03-08 Thread Joe
Steve, Thanks, I knew about that but my question is why is it not working consistently? Joe "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Joe wrote: >> Isn't this a bug? >> >> Here's the test program: >> >> import code >> >> def test_func(): >> lv = 1 >>

Re: Format strings that contain '%'

2005-03-08 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: I'm trying to do something along the lines of print '%temp %d' % 1 Traceback (most recent call last): File "", line 1, in ? ValueError: unsupported format character 't' (0x74) at index 1 Use %%: >>> '%%temp %d' % 1 '%temp 1' -- Erik Max Francis && [EMAIL PROTECTED] && htt

Format strings that contain '%'

2005-03-08 Thread [EMAIL PROTECTED]
I'm trying to do something along the lines of >>> print '%temp %d' % 1 Traceback (most recent call last): File "", line 1, in ? ValueError: unsupported format character 't' (0x74) at index 1 although, obviously I can't do this, since python thinks that the '%t' is a format string. I've tried o

Re: python -i (interactive environment)

2005-03-08 Thread Steven Bethard
Joe wrote: Isn't this a bug? Here's the test program: import code def test_func(): lv = 1 print '\n\nBEFORE lv: %s\n' % (lv) code.interact(local=locals()) print '\n\nAFTER lv: %s\n' % (lv) return Check the documentation for locals() [1]: "Update and return a dictionary represen

Python 2.4 OSX Package

2005-03-08 Thread Daniel Alexandre
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I've just finished creating a package for Python 2.4 for users who don't want to install it from sources under Mac OS X Panther. The same has been tested and it's working perfectly for me. The package is available in the .pkg format and it'

  1   2   >