Re: High performance binary data

2007-08-09 Thread Marc 'BlackJack' Rintsch
On Fri, 10 Aug 2007 00:26:54 +, Steve wrote: > I want to ready binary data from a udp socket effeciently as possible > in python. I know of the struct package but do people have any tips > when dealing with binary data in python? Is there a library or api > that is faster when dealing with b

Re: Does PyModule_GetDict return information about class method variables?

2007-08-09 Thread Marc 'BlackJack' Rintsch
On Thu, 09 Aug 2007 19:34:37 -0700, MD wrote: >I have a variable which is defined inside a class method. When I > call PyModule_GetDict on the module containing this class, the > dictionary doesn't contain any information about this variable. Is > this expected behavior? If so, what options do

Re: beginner whitespace question

2007-08-09 Thread James Stroud
Dan Bishop wrote: >> Tabs are for tables, hence the name. "Use spaces for space and use tabs >> for tables" can be a little mnemonic to help you remember the rules. We >> can make a little song together if you can think of some things that >> rhyme with "don't" and "use" and "tabs". > > "won't" >

Re: Deleting objects on the fly

2007-08-09 Thread Michele Simionato
On Aug 10, 2:25 am, Godzilla <[EMAIL PROTECTED]> wrote: > Hello, > > I wish to know whether I should delete objects created on the fly via > the "del obj" statement. I noticed the RAM usage increased whenever > the application is being run for a long time. I am creating lots of > objects (messages)

Re: wxPython before MainLoop

2007-08-09 Thread Heikki Toivonen
[david] wrote: > I'd like to refresh the display before I start the main loop. We have this kind of situation in Chandler, where we display and update the splash screen before we enter MainLoop. 1. Create app object http://lxr.osafoundation.org/source/chandler/Chandler.py#080 2. During app ob

Re: Puzzled by "is"

2007-08-09 Thread Paul Rudin
John K Masters <[EMAIL PROTECTED]> writes: > > OK fiddling around with this and reading the docs I tried:- > a = 'qq' #10 q's > b = 'qq' #10 q's > a is b > true > c = 'q' * 10 > c > 'qq' #10 q's > d = 'q' * 10 > d > 'qq' #10 q's > c is d > false > > So from what I'v

Re: Threaded Design Question

2007-08-09 Thread Mark T
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as

Re: accessing static attributes

2007-08-09 Thread Carsten Haese
On Fri, 10 Aug 2007 02:51:44 -, james_027 wrote > hi, > > for example an request object ... is request.user the same as > request.__class__.user? Not in general: >>> class Request(object): ...user = "somebody" ... >>> request = Request() >>> request.user == request.__class__.user True >>

Re: Puzzled by "is"

2007-08-09 Thread Erik Max Francis
Ben Finney wrote: > It's important to also realise that the language is *deliberately* > non-committal on whether any given value will have this behaviour; > that is, it's entirely left to the language implementation which > optimisation trade-offs to make, and the language user (that's you and >

Re: beginner whitespace question

2007-08-09 Thread Dan Bishop
On Aug 9, 8:28 pm, James Stroud <[EMAIL PROTECTED]> wrote: > eggie5 wrote: > > But this still isn't valid: > > > from django.db import models > > > class Poll(models.Model): > >question = models.CharField(max_length=200) > >pub_date = models.DateTimeField('date published') > > > def __u

accessing static attributes

2007-08-09 Thread james_027
hi, for example an request object ... is request.user the same as request.__class__.user? THanks james -- http://mail.python.org/mailman/listinfo/python-list

Re: mmm-mode, python-mode and doctest-mode?

2007-08-09 Thread Edward Loper
Edward Loper wrote: >> Anyone testing on xemacs? I tried it, and C-c C-c sent xemacs into an >> infinite loop (apparantly). I may have tracked down the cause of this problem. Please download the most recent version, and try again. And when you do, let me know whether that fixed it. :) -Edwar

Does PyModule_GetDict return information about class method variables?

2007-08-09 Thread MD
Hi, I have a variable which is defined inside a class method. When I call PyModule_GetDict on the module containing this class, the dictionary doesn't contain any information about this variable. Is this expected behavior? If so, what options do I have to access this variable from my Python C e

Re: beginner whitespace question

2007-08-09 Thread eggie5
On Aug 9, 6:31 pm, James Stroud <[EMAIL PROTECTED]> wrote: > James Stroud wrote: > > def __unicode__(self): That's so goofy. > > return self.choice > > Laughing to hard at the tab & spaces thing to notice the lack of > indentation here. > > James > > -- > James Stroud > UCLA-DOE Inst

Re: wxPython before MainLoop

2007-08-09 Thread Stephen Hansen
On 8/9/07, [david] <[EMAIL PROTECTED]> wrote: > > I'm disappointed that I didn't get a wxPython solution. > > If the only way to get wxPython to correctly handle > this simple task is to code around it, I don't think > wxPython is really ready for Windows. A thread *is* basically the right answer

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 5:39 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if anyone can point me in the r

Re: Threaded Design Question

2007-08-09 Thread Justin T.
> approach. That sounds the easiest, although I'm still interested in > any idioms or other proven approaches for this sort of thing. > > ~Sean Idioms certainly have their place, but in the end you want clear, correct code. In the case of multi-threaded programming, synchronization adds complexi

Re: wxPython before MainLoop

2007-08-09 Thread [david]
I'm disappointed that I didn't get a wxPython solution. If the only way to get wxPython to correctly handle this simple task is to code around it, I don't think wxPython is really ready for Windows. Is there a better place to ask? Regarding the suggestions: Bjoern, you're wrong. The GUI needs t

wxPython - drawing without paint event

2007-08-09 Thread Matt Bitten
I've got a wxPython program that needs to do some drawing on a DC on a regular basis, whether or not a paint event happens. I know how to make a ClientDC to do the drawing in, and I know what drawing calls to make. But how do I make it all happen? After I call MainLoop, none of my code gets called

Re: Threaded Design Question

2007-08-09 Thread half . italian
On Aug 9, 12:09 pm, "Justin T." <[EMAIL PROTECTED]> wrote: > On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > > Here's how I have it designed so far. The main thread starts a > > Watch(threading.Thread) class that loops and searches a directory for > > files. It has been passed a Queue.Queue() ob

Re: beginner whitespace question

2007-08-09 Thread James Stroud
James Stroud wrote: > def __unicode__(self): > return self.choice Laughing to hard at the tab & spaces thing to notice the lack of indentation here. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- ht

Re: beginner whitespace question

2007-08-09 Thread James Stroud
eggie5 wrote: > But this still isn't valid: > > from django.db import models > > class Poll(models.Model): > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > > def __unicode__(self): > return self.question > > > >

Emacs PDB Windows

2007-08-09 Thread [EMAIL PROTECTED]
I'm trying to get PDB working on Emacs 2.1.3, Python 2.3, Windows XP. Whenever I try to run a Python file from the Emacs buffer using the PDB command I get the following error "spawning child process: invalid process" I've tried the exact same command from the command prompt and the debugger works

Re: Puzzled by "is"

2007-08-09 Thread Ben Finney
Grzegorz Słodkowicz <[EMAIL PROTECTED]> writes: > That's just theorisation but I'd rather expect the interpreter > simply not to create a second tuple while there already is an > identical one. Others have already said that it's an implementation optimisation, which seems to partly answer your qu

Re: beginner whitespace question

2007-08-09 Thread eggie5
But this still isn't valid: from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.question class Choice(models.Model): poll

Re: beginner whitespace question

2007-08-09 Thread Dan Bishop
On Aug 9, 7:02 pm, eggie5 <[EMAIL PROTECTED]> wrote: > On Aug 9, 4:52 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > > > On Aug 9, 6:47 pm, eggie5 <[EMAIL PROTECTED]> wrote: > > > > I keep getting an error for line 7, what's wrong with this? > > > > from django.db import models > > > > class Poll(mode

Re: Gotcha I never ran into before

2007-08-09 Thread James Stroud
Brian Cole wrote: > I've been programming in Python for about 6 years now. One of the > features I adore the most is the very useful error messages and stack > traces that make it easy to debug. However, today I ran into a > difficult to trace bug because the stack trace was reporting the > problem

Re: Threaded Design Question

2007-08-09 Thread MRAB
On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as a daemon and watch

Re: Misleading wikipedia article on Python 3?

2007-08-09 Thread Ricardo Aráoz
Evan Klitzke wrote: > On 8/8/07, greg <[EMAIL PROTECTED]> wrote: >> Istvan Albert wrote: >>> A solution would be writing the code with a logging function to begin >>> with, alas many times that is out of one's hand. >> If the code has been written with calls to a builtin >> print function, the situ

Importing to

2007-08-09 Thread James Stroud
Many thanks to the numerous helpful comments by Paul Rubin, Carsten Haese and others in the thread "How to pass a reference to the current module". After digesting these comments, I came up with this way to circumvent the problem of attempting to reference modules that import other modules i

High performance binary data

2007-08-09 Thread Steve
I want to ready binary data from a udp socket effeciently as possible in python. I know of the struct package but do people have any tips when dealing with binary data in python? Is there a library or api that is faster when dealing with binary data. I am looking for a any one with experience or

Deleting objects on the fly

2007-08-09 Thread Godzilla
Hello, I wish to know whether I should delete objects created on the fly via the "del obj" statement. I noticed the RAM usage increased whenever the application is being run for a long time. I am creating lots of objects (messages) on the fly for communication between threads. Rather than having

Re: beginner whitespace question

2007-08-09 Thread eggie5
On Aug 9, 4:52 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Aug 9, 6:47 pm, eggie5 <[EMAIL PROTECTED]> wrote: > > > I keep getting an error for line 7, what's wrong with this? > > > from django.db import models > > > class Poll(models.Model): > > question = models.CharField(max_length=200) >

Smoother Lines in Turtle Graphics

2007-08-09 Thread tomy
Hi All I am a newbie to turtle graphics in python, so sorry if you find this question too easy. How can I get smoother lines in turtle graphics? I am using python on windows. Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner whitespace question

2007-08-09 Thread Dan Bishop
On Aug 9, 6:47 pm, eggie5 <[EMAIL PROTECTED]> wrote: > I keep getting an error for line 7, what's wrong with this? > > from django.db import models > > class Poll(models.Model): > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > > def

beginner whitespace question

2007-08-09 Thread eggie5
I keep getting an error for line 7, what's wrong with this? from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.question de

Re: programmatically define a new variable on the fly

2007-08-09 Thread Roberto Bonvallet
On Aug 9, 6:11 pm, Lee Sander <[EMAIL PROTECTED]> wrote: > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. Use a dictionary. -- http://mail.python.org/

Re: Threaded Design Question

2007-08-09 Thread Jun-geun Park
[EMAIL PROTECTED] wrote: > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as a daemon and watch a given directory

Re: programmatically define a new variable on the fly

2007-08-09 Thread Ian Clark
Lee Sander wrote: > Hi, > > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. So, for example, if I the file > I'm reading has > g 99 > on the first line,

Re: programmatically define a new variable on the fly

2007-08-09 Thread Dustan
On Aug 9, 5:30 pm, Dustan <[EMAIL PROTECTED]> wrote: > given the > variables data (the dictionary), name (in your example, 'g') and > *size* (in your example, 99), you can add it data as shown: erm... make that: given the variables data (the dictionary), name (in your example, 'g') and size (in

Re: programmatically define a new variable on the fly

2007-08-09 Thread Dustan
On Aug 9, 5:11 pm, Lee Sander <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. So, for example, if I the file > I'm re

Re: Querying Graphics Card Name

2007-08-09 Thread Benjamin Goldenberg
On Aug 9, 4:06 pm, Richard Jones <[EMAIL PROTECTED]> wrote: > Benjamin Goldenberg wrote: > > I would like to find out the name of the graphics card of the machine > > my program is running on. I have looked into the pyopengl module, and > > using them to query the card, but it seems like there ough

programmatically define a new variable on the fly

2007-08-09 Thread Lee Sander
Hi, I would like to define a new variable which is not predefined by me. For example, I want to create an array called "X%s" where "%s" is to be determined based on the data I am processing. So, for example, if I the file I'm reading has g 99 on the first line, I want to create a new variable cal

Re: Puzzled by "is"

2007-08-09 Thread Hrvoje Niksic
Grzegorz Słodkowicz <[EMAIL PROTECTED]> writes: >> Seriously, it's just an optimization by the implementers. There is >> no need for more than one empty tuple, since tuples can never be >> modified once created. >> >> But they decided not to create (1, ) in advance. They probably knew >> that hard

Re: Puzzled by "is"

2007-08-09 Thread Steve Holden
Grzegorz Słodkowicz wrote: >> Why? Because. >> >> Seriously, it's just an optimization by the implementers. There is no >> need for more than one empty tuple, since tuples can never be modified >> once created. >> >> But they decided not to create (1, ) in advance. They probably knew that >> har

Re: Querying Graphics Card Name

2007-08-09 Thread Richard Jones
Benjamin Goldenberg wrote: > I would like to find out the name of the graphics card of the machine > my program is running on. I have looked into the pyopengl module, and > using them to query the card, but it seems like there ought to be a > simpler way to find this out without setting up a glcont

Re: Querying Graphics Card Name

2007-08-09 Thread Benjamin Goldenberg
On Aug 9, 3:26 pm, Bjoern Schliessmann wrote: > Benjamin Goldenberg wrote: > > I would like to find out the name of the graphics card of the > > machine my program is running on. I have looked into the pyopengl > > module, and using them to query the card, but it seems like there > > ought to be a

Re: Screenscraping, in python, a web page that requires javascript?

2007-08-09 Thread John J. Lee
Dan Stromberg - Datallegro <[EMAIL PROTECTED]> writes: > Is there a method, with python, of screenscraping a web page, if that web > page uses javascript? Not pure CPython, no. > I know about BeautifulSoup, but AFAIK at this time, BeautifulSoup is for > HTML that doesn't have embedded javascrip

Re: Stackless Integration

2007-08-09 Thread Aahz
In article <[EMAIL PROTECTED]>, Neil Cerutti <[EMAIL PROTECTED]> wrote: >On 2007-08-09, Justin T. <[EMAIL PROTECTED]> wrote: >>JP Calderone: >>> >>> It's not Pythonic. >> >> Ha! I wish there was a way to indicate sarcasm on the net. You >> almost got people all riled up! > >Sorry. There's NO WAY t

Screenscraping, in python, a web page that requires javascript?

2007-08-09 Thread Dan Stromberg - Datallegro
Is there a method, with python, of screenscraping a web page, if that web page uses javascript? I know about BeautifulSoup, but AFAIK at this time, BeautifulSoup is for HTML that doesn't have embedded javascript. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Querying Graphics Card Name

2007-08-09 Thread Bjoern Schliessmann
Benjamin Goldenberg wrote: > I would like to find out the name of the graphics card of the > machine my program is running on. I have looked into the pyopengl > module, and using them to query the card, but it seems like there > ought to be a simpler way to find this out without setting up a > glco

Re: Puzzled by "is"

2007-08-09 Thread Erik Max Francis
Grzegorz Słodkowicz wrote: > That's just theorisation but I'd rather expect the interpreter simply > not to create a second tuple while there already is an identical one. > This could save some memory if the tuple was large (Although by the same > token comparison of large tuples can be expensi

Re: Puzzled by "is"

2007-08-09 Thread Erik Max Francis
John K Masters wrote: > OK fiddling around with this and reading the docs I tried:- > a = 'qq' #10 q's > b = 'qq' #10 q's > a is b > true > c = 'q' * 10 > c > 'qq' #10 q's > d = 'q' * 10 > d > 'qq' #10 q's > c is d > false > > So from what I've read "==" tests for

Gotcha I never ran into before

2007-08-09 Thread Brian Cole
I've been programming in Python for about 6 years now. One of the features I adore the most is the very useful error messages and stack traces that make it easy to debug. However, today I ran into a difficult to trace bug because the stack trace was reporting the problem in the wrong place. class

Re: Puzzled by "is"

2007-08-09 Thread Grzegorz Słodkowicz
> > Why? Because. > > Seriously, it's just an optimization by the implementers. There is no > need for more than one empty tuple, since tuples can never be modified > once created. > > But they decided not to create (1, ) in advance. They probably knew that > hardly anybody would want to create

Re: Puzzled by "is"

2007-08-09 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] > > Steve, > > I thought you'd probably weigh in on this esoteric matter. Very > illuminating, as usual. > Thank you! regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb

Re: how to get command output using python

2007-08-09 Thread Arnau Sanchez
[EMAIL PROTECTED] escribió: >> Any non cross-platform module should be avoided unless absolutely necessary. >> >> Subprocess is the right module to use. >> >> arnau > > You forgot to mention that subprocess replaces commands, so in effect, > commands is deprecated anyway. It was implicit :-) An

Re: Puzzled by "is"

2007-08-09 Thread Neil Cerutti
On 2007-08-09, John K Masters <[EMAIL PROTECTED]> wrote: > On 15:53 Thu 09 Aug , Steve Holden wrote: >> Dick Moores wrote: >> > At 10:46 AM 8/9/2007, Bill Scherer wrote: >> >> Dick Moores wrote: >> [...] >> >> There is only one empty tuple. >> >> Does that clear it up for you? >> > >> > But is

Re: Puzzled by "is"

2007-08-09 Thread kyosohma
On Aug 9, 2:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Dick Moores wrote: > > At 10:46 AM 8/9/2007, Bill Scherer wrote: > >> Dick Moores wrote: > [...] > >> There is only one empty tuple. > >> Does that clear it up for you? > > > But isn't that the same as saying, "That's just the reality of

Re: Puzzled by "is"

2007-08-09 Thread John K Masters
On 15:53 Thu 09 Aug , Steve Holden wrote: > Dick Moores wrote: > > At 10:46 AM 8/9/2007, Bill Scherer wrote: > >> Dick Moores wrote: > [...] > >> There is only one empty tuple. > >> Does that clear it up for you? > > > > But isn't that the same as saying, "That's just the reality of > > Pytho

Re: tempfile behavior

2007-08-09 Thread Marc 'BlackJack' Rintsch
On Thu, 09 Aug 2007 12:47:10 -0700, billiejoex wrote: fd, filename = tempfile.mkstemp() type(fd) > > > I would expect a file descriptor, not and integer. > How do I have to use it? File descriptors are integers. It's a low level C thing. Either use the low level functions in `os` or

Re: Puzzled by "is"

2007-08-09 Thread Steve Holden
Dick Moores wrote: > At 10:46 AM 8/9/2007, Bill Scherer wrote: >> Dick Moores wrote: [...] >> There is only one empty tuple. >> Does that clear it up for you? > > But isn't that the same as saying, "That's just the reality of > Python; it is what it is."? I want to know why there is only one > e

Re: tempfile behavior

2007-08-09 Thread billiejoex
On 9 Ago, 20:31, [EMAIL PROTECTED] wrote: > On Aug 9, 11:21 am, billiejoex <[EMAIL PROTECTED]> wrote: > > > Hi all, > > I would like to use tempfile module to generate files having unique > > names excepting that I don't want them to be removed after closing. > > Does it is possible? > > Looks like

Re: Puzzled by "is"

2007-08-09 Thread Dick Moores
At 10:46 AM 8/9/2007, Bill Scherer wrote: >Dick Moores wrote: > > >>> () is () > > True > > >>> (1,) is (1,) > > False > > > > Why? > > > > >>> a = () > >>> b = () > >>> c = (1,) > >>> d = (1,) > >>> a is b >True > >>> c is d >False > >>> id(a) >3086553132 > >>> id(b) >3086553132 > >>> id(c) >308

Re: check if regeular expression has results

2007-08-09 Thread Bruno Desthuilliers
Neil Cerutti a écrit : > On 2007-08-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>Hi, >>I'm looking for the best way to check if regular expression return >>true (it's mean - there is a match). for example, i want "if" that >>check if this regular expression: .*born.*to.* has a match. >> >>

Querying Graphics Card Name

2007-08-09 Thread Benjamin Goldenberg
Hello, I would like to find out the name of the graphics card of the machine my program is running on. I have looked into the pyopengl module, and using them to query the card, but it seems like there ought to be a simpler way to find this out without setting up a glcontext. Does anyone have any id

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > Here's how I have it designed so far. The main thread starts a > Watch(threading.Thread) class that loops and searches a directory for > files. It has been passed a Queue.Queue() object (watch_queue), and > as it finds new files in the watch folder

Re: how to get output.

2007-08-09 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I corrected a typ below. > > On Aug 9, 12:50 pm, [EMAIL PROTECTED] wrote: >> Hey, >> >> I did write the following: >> but it does not work. >> >> import subprocess as sp >> try: >> p = sp.Popen("DIR . /AD /B", stdout=sp.PIPE) >> result = p.communicate()[0] >>

Re: tempfile behavior

2007-08-09 Thread half . italian
On Aug 9, 11:21 am, billiejoex <[EMAIL PROTECTED]> wrote: > Hi all, > I would like to use tempfile module to generate files having unique > names excepting that I don't want them to be removed after closing. > Does it is possible? Looks like tempfile.mkstemp() will do what you want. '''Unlike Tem

Threaded Design Question

2007-08-09 Thread half . italian
Hi all! I'm implementing one of my first multithreaded apps, and have gotten to a point where I think I'm going off track from a standard idiom. Wondering if anyone can point me in the right direction. The script will run as a daemon and watch a given directory for new files. Once it determines

how to call file from Jython?

2007-08-09 Thread Naveen kumar
Hi I want to excute a .cmd file on windows through jython.. How can i do that? I am using following code import os os.system("C:/testfile/anotherfolder/Startserver.cmd") can any body let me know how can excute Startserver.cmd from jython?? thanks, Naveen ---

tempfile behavior

2007-08-09 Thread billiejoex
Hi all, I would like to use tempfile module to generate files having unique names excepting that I don't want them to be removed after closing. Does it is possible? -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by "is"

2007-08-09 Thread Jay Loden
Jay Loden wrote: > Dick Moores wrote: >> >>> () is () >> True >> >>> (1,) is (1,) >> False >> >> Why? >> >> Thanks, >> >> Dick Moores > >From the docs for 'is': The operators is and is not test for object identity: x is y is true if and only if x and y are the same object. x is not y yi

Re: how to get command output using python

2007-08-09 Thread kyosohma
On Aug 9, 12:01 pm, Arnau Sanchez <[EMAIL PROTECTED]> wrote: > Steven Harms escribió: > > > In python it is quite easy: > > > import commands > > status, output = commands.getstatusoutput("my command") > > Uhm, this module has a big issue: > > (http://docs.python.org/lib/module-commands.html) > ---

Re: Puzzled by "is"

2007-08-09 Thread Neil Cerutti
On 2007-08-09, Dick Moores <[EMAIL PROTECTED]> wrote: > >>> () is () > True > >>> (1,) is (1,) > False > > Why? >From _Python Reference Manual_: 5.2.4 List displays: An empty pair of parentheses yields an empty tuple object. Since tuples are immutable, the rules for literals apply (i.e., tw

Re: Puzzled by "is"

2007-08-09 Thread Bill Scherer
Dick Moores wrote: > >>> () is () > True > >>> (1,) is (1,) > False > > Why? > >>> a = () >>> b = () >>> c = (1,) >>> d = (1,) >>> a is b True >>> c is d False >>> id(a) 3086553132 >>> id(b) 3086553132 >>> id(c) 3086411340 >>> id(d) 3086390892 There is only one empty tuple. Does that clear

Re: Puzzled by "is"

2007-08-09 Thread Jay Loden
Dick Moores wrote: > >>> () is () > True > >>> (1,) is (1,) > False > > Why? > > Thanks, > > Dick Moores >From the docs for 'is': -- http://mail.python.org/mailman/listinfo/python-list

Puzzled by "is"

2007-08-09 Thread Dick Moores
>>> () is () True >>> (1,) is (1,) False Why? Thanks, Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

Re: Stackless Integration

2007-08-09 Thread Neil Cerutti
On 2007-08-09, Justin T. <[EMAIL PROTECTED]> wrote: > >> It's not Pythonic. >> >> Jean-Paul > > Ha! I wish there was a way to indicate sarcasm on the net. You > almost got people all riled up! Sorry. There's NO WAY to show sarcasm on the net. ;) -- Neil Cerutti -- http://mail.python.org/mailman

Re: how to get command output using python

2007-08-09 Thread Arnau Sanchez
Steven Harms escribió: > In python it is quite easy: > > import commands > status, output = commands.getstatusoutput("my command") Uhm, this module has a big issue: (http://docs.python.org/lib/module-commands.html) 8.17 commands -- Utilities for running commands Availability: Unix.

Re: Stackless Integration

2007-08-09 Thread Justin T.
> It's not Pythonic. > > Jean-Paul Ha! I wish there was a way to indicate sarcasm on the net. You almost got people all riled up! -- http://mail.python.org/mailman/listinfo/python-list

Re: Stackless Integration

2007-08-09 Thread Justin T.
On Aug 9, 8:57 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > First, which 'stackless'? The original continuation-stackless (of about 7 > years ago)? Or the more current tasklet-stackless (which I think is much > younger than that)? > The current iteration. I can certianly understand Guido's dist

Re: Stackless Integration

2007-08-09 Thread Steve Holden
Steve Holden wrote: > Bruno Desthuilliers wrote: >> Jean-Paul Calderone a écrit : >>> On Thu, 09 Aug 2007 09:00:27 -, "Justin T." <[EMAIL PROTECTED]> >>> wrote: Hi, I've been looking at stackless python a little bit, and it's awesome. My question is, why hasn't it been inte

Re: tests

2007-08-09 Thread Jay Loden
Steve Holden wrote: > This discussion seems to assume that Excel spreadsheets are stored in > some canonical form so that two spreads with the same functionality are > always identical on disk to the last bit. I very much doubt this is true > (consider as an example the file properties that can

Re: Issues of state

2007-08-09 Thread Jay Loden
Steve Holden wrote: > As far as I'm concerned the major issue with trying to have "desktop web > apps" compete with true windowed applications is the difficulty of > maintaining sensible interactions with the interface. AJAX designs have > increased the interaction level at the expense of greate

Extending logging module

2007-08-09 Thread jay
Hello, I've been using the python logging module a lot lately, and I've come across an instance where I need some new levels. Specifically, python does not include ALERT and NOTICE in the default set of logging levels. I am wondering how trivial it would be to extend the logging module to includ

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
special_dragonfly a écrit : > "Ben Finney" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "special_dragonfly" <[EMAIL PROTECTED]> writes: >> >>> I've managed to solve the problem, I really was just being a >>> dunce. >> Doubtful; but at this stage we can't tell, because we still

Re: wxPython before MainLoop

2007-08-09 Thread 7stud
On Aug 8, 11:25 pm, "[david]" <[EMAIL PROTECTED]> wrote: > I'd like to refresh the display before I start the main loop. > > I have code like this: > > app = App() > app.Show() > app.long_slow_init() > app.MainLoop() > > The main frame partly loads at Show, but because the mainloop has not > starte

Re: tests

2007-08-09 Thread Steve Holden
Jason wrote: > On Aug 9, 8:46 am, "special_dragonfly" <[EMAIL PROTECTED]> > wrote: >> <[EMAIL PROTECTED]> wrote in message >>> http://docs.python.org/lib/module-filecmp.html >> My understanding of reading that is that it only looks at the file names >> themselves and not their contents. So whether

Re: Stackless Integration

2007-08-09 Thread Terry Reedy
"Justin T." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I've been looking at stackless python a little bit, and it's awesome. | My question is, why hasn't it been integrated into the upstream python | tree? Does it cause problems with the current C-extensions? It seems | like if

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Sion Arrowsmith
special_dragonfly <[EMAIL PROTECTED]> wrote: >if key in FieldsDictionary: >FieldsDictionary[key].append(FieldClass(*line.split(","))) >else: >FieldsDictionary[key]=[FieldClass(*line.split(","))] These four lines can be replaced by: FieldsDictionary.setdefau

Re: Something in the function tutorial confused me.

2007-08-09 Thread Neil Cerutti
On 2007-08-09, Magnus Lycka <[EMAIL PROTECTED]> wrote: > It's all a matter of understanding that all the juicy bits in > the Python data model is in the actual values or objects. > That's the stuff with type safety, a location in memory, > qualities such as mutability etc. A "variable" is basically

Re: Stackless Integration

2007-08-09 Thread Steve Holden
Bruno Desthuilliers wrote: > Jean-Paul Calderone a écrit : >> On Thu, 09 Aug 2007 09:00:27 -, "Justin T." <[EMAIL PROTECTED]> >> wrote: >>> Hi, >>> >>> I've been looking at stackless python a little bit, and it's awesome. >>> My question is, why hasn't it been integrated into the upstream pyth

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
Neil Cerutti a écrit : > On 2007-08-09, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> Neil Cerutti a écrit : >>> On 2007-08-09, special_dragonfly <[EMAIL PROTECTED]> wrote: Is there anyway for python to consider the values within a string when entering the data into a dictionary. I kn

Re: Something in the function tutorial confused me.

2007-08-09 Thread Magnus Lycka
Lee Fleming wrote: > Hello, > I have a simple question. Say you have the following function: > > def f(x, y = []): ... > But this, the code that "fixes" the list accumulation confounds me: > def f(x, y=None): > if y is None: y = [] ... > In other words, what's going on here? How is it that

Re: tests

2007-08-09 Thread Jason
On Aug 9, 8:46 am, "special_dragonfly" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > >http://docs.python.org/lib/module-filecmp.html > > My understanding of reading that is that it only looks at the file names > themselves and not their contents. So whether filename1=filename2

py2exe, command line parameter problem

2007-08-09 Thread Karsten W.
Hello, my small program is a Tkinter-App which supports some command line options. When the app is started within the python environment, everything works fine. When the py2exe-frozen app is started, everything works until I pass command line parameters. Then the gui window is not displayed. It's

Re: Issues of state

2007-08-09 Thread Steve Holden
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Paul Rubin wrote: >> [EMAIL PROTECTED] (Cameron Laird) writes: >>> Others have answered this at other levels. In elementary terms, >>> there truly is a difference, Paul, and one that's widely reified: >>> a "deskt

Re: tests

2007-08-09 Thread special_dragonfly
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 9, 4:04 pm, brad <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > You should be able to read chunks of each file in binary mode and do a >> > compare to check for equality. Some kind of loop should do the trick. >> >>

Re: tests

2007-08-09 Thread dijkstra . arjen
On Aug 9, 4:04 pm, brad <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > You should be able to read chunks of each file in binary mode and do a > > compare to check for equality. Some kind of loop should do the trick. > > Why not a simple md5 or sha with the hash library? Or even: http:/

  1   2   >