Re: tokenize module after installation

2007-08-09 Thread Martin v. Löwis
> After installation my program that uses tokenize module,when I run > myprogram.exe (vgsveki.exe): > > AttributeError: 'module' object has no attribute 'untokenize' Perhaps you use the 2.4 version of tokenize.py here, which did not have untokenize. Regards, Martin -- http://mail.python.org/mai

how to get command output using python

2007-08-09 Thread Indu Shreenath
Hey, I want to get the output of DIR /AD /B to a variable using python. How to do this? Thanks, Indu - Download prohibited? No problem. CHAT from any browser, without download.-- http://mail.python.org/mailman/listinfo/python-list

Re: how to get output.

2007-08-09 Thread Indu Shreenath
Hey, I did write the following, but it does not work. import subprocess as sp try: = sp.Popen("DIR . /AD /B", stdout=sp.PIPE) result = p.communicate()[0] print result except: print "error" This throws error. DIR . /AD /B will list out only dir

Re: how to get output.

2007-08-09 Thread Indu Shreenath
Hey, I did write the following: but it does not work. import subprocess as sp try: = sp.Popen("DIR . /AD /B", stdout=sp.PIPE) result = p.communicate()[0] print result except: print "error" This throws error. DIR . /AD /B will list out only

Expect Telnet

2007-08-09 Thread Vinay Sagar Prakash
Hi all, I am not sure how this works, but am composing my query here. I am trying to expect the below snippet using telnetlib. # bash# install blah blah blah do you want to continue [y/n]? y blah blah blah blah blah blah blah blah blah blah blah blah Installation complete bash#

Python mode

2007-08-09 Thread jay
I'm starting to learn how to use emacs (on Mac OS 10.4) and I found that you can load something called python-mode.el which looks like it can help when writing Python code in emacs. I'm hoping it can color python syntax as well as indent it correctly, etc. My problems are: 1. Where should

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: how to get output.

2007-08-09 Thread indu_shreenath
Hey, I did write the following: but it does not work. import subprocess as sp try: = sp.Popen("DIR . /AD /B", stdout=sp.PIPE) result = p.communicate()[0] print result except: print "error" This throws error. DIR . /AD /B will list out only directories in the current directory.

Re: how to get output.

2007-08-09 Thread Peter Otten
[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: how to get output.

2007-08-09 Thread indu_shreenath
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] > print result > except: > print "er

Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
Hello, I'm new to this group, I've read through the subject of a lot of the group but can't find anything relevant. Perhaps my question is too basic but I'm still stuck. Classes and Dictionaries. If I have a dictionary, how do I instantiate many instances of a class per dictionary key? Either at ru

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Peter Otten
special_dragonfly wrote: > I'm new to this group, I've read through the subject of a lot of the group > but can't find anything relevant. Perhaps my question is too basic but I'm > still stuck. > Classes and Dictionaries. > If I have a dictionary, how do I instantiate many instances of a class per

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"special_dragonfly" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > I'm new to this group, I've read through the subject of a lot of the group > but can't find anything relevant. Perhaps my question is too basic but I'm > still stuck. > Classes and Dictionaries. > If I have

Stackless Integration

2007-08-09 Thread Justin T.
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 python tree? Does it cause problems with the current C-extensions? It seems like if something is fully compatible and better, then it would be adopted. However,

pep 3116 behaviour on non-blocking reads

2007-08-09 Thread Antoon Pardon
In the RawIOBase class I read the following: .read(n: int) -> bytes Read up to n bytes from the object and return them. Fewer than n bytes may be returned if the operating system call returns fewer than n bytes. If 0 bytes are returned, this indicates end of file. If the object is

Re: wxPython before MainLoop

2007-08-09 Thread 7stud
I reorganized my Thread class a little bit: class MyThread(threading.Thread): def __init__(self, a_frame): threading.Thread.__init__(self) self.frame_obj = a_frame def run(self): result = self.long_slow_init() wx.CallAfter(self.frame_obj.recei

Launching App

2007-08-09 Thread Robert Rawlins - Think Blue
Hello Guys, I'm looking for the best method to launch my python app when my Linux system boots up. At the moment I just have an entry like this in my rc.local file: CD /myfolder/anotherfolder ./myapp.py Is this the best way to do this? Or is there a better way? I feel like a bit of a d

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bjoern Schliessmann
special_dragonfly wrote: > I've managed to solve the problem, I really was just being a > dunce. Here's how incase anyone is wondering: > > class MyClass: > def __init__(self): > name="" > dict={} > dict[0]=[] > dict[0].append(MyClass()) > dict[0][0].name="Hello" > print dict[0][0].na

Re: wxPython before MainLoop

2007-08-09 Thread Bjoern Schliessmann
[david] wrote: > I'd like to refresh the display before I start the main loop. > [...] > I'd like to just make app.Show() finish correctly before running > long_slow_init. IMHO, this will bring no gain. If you see an inresponsive user interface or not is quite meaningless. > Or is there a better

Re: Launching App

2007-08-09 Thread Michael Bentley
On Aug 9, 2007, at 3:01 AM, Robert Rawlins - Think Blue wrote: I’m looking for the best method to launch my python app when my Linux system boots up. At the moment I just have an entry like this in my rc.local file: CD /myfolder/anotherfolder ./myapp.py Is this the best way to do this?

Re: Launching App

2007-08-09 Thread Michael Bentley
On Aug 9, 2007, at 3:01 AM, Robert Rawlins - Think Blue wrote: I’m looking for the best method to launch my python app when my Linux system boots up. At the moment I just have an entry like this in my rc.local file: CD /myfolder/anotherfolder ./myapp.py Is this the best way to do this? O

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
special_dragonfly a écrit : (snip) > I've managed to solve the problem, I really was just being a dunce. Here's > how incase anyone is wondering: > > class MyClass: > def __init__(self): > name="" > dict={} > dict[0]=[] > dict[0].append(MyClass()) > dict[0][0].name="Hello" > print dic

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > special_dragonfly a écrit : > (snip) >> I've managed to solve the problem, I really was just being a dunce. >> Here's how incase anyone is wondering: >> >> class MyClass: >> def __init__(self): >> nam

Re: Stackless Integration

2007-08-09 Thread Jean-Paul Calderone
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 python >tree? Does it cause problems with the current C-extensions? It seems >lik

Re: Stackless Integration

2007-08-09 Thread Michael Bentley
On Aug 9, 2007, at 4:48 AM, Jean-Paul Calderone wrote: > 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 >> python

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

2007-08-09 Thread Neal Becker
Edward Loper wrote: >> Anyone testing on xemacs? I tried it, and C-c C-c sent xemacs into an >> infinite loop (apparantly). > > It works fine for me in XEmacs 21.4 (patch 17) (i386-debian-linux, > Mule). If you could answer a few questions, it might help me track down > the problem: > > - What

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"special_dragonfly" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Bruno Desthuilliers" <[EMAIL PROTECTED]> > wrote in message news:[EMAIL PROTECTED] >> special_dragonfly a écrit : >> (snip) >>> I've managed to solve the problem, I really was just being a dunce. >>> Here's how

Jython - variables are stored somehow

2007-08-09 Thread nmin
Hi, I'm using Jython in combination with java. I wrote a jython skript, which calls a function from another jython module called library.py. So, executing the function genData() in skript .py runs without problem but if I execute the same function again, the data from the first run is stored som

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Neil Cerutti
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 know that > isn't very clear so here's an example: > > class MyClass(object): > def __init__(self,name="",age=""): >

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Steve Holden
special_dragonfly wrote: > "special_dragonfly" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Bruno Desthuilliers" <[EMAIL PROTECTED]> >> wrote in message news:[EMAIL PROTECTED] >>> special_dragonfly a écrit : >>> (snip) I've managed to solve the problem, I really was just

Re: (Re)announcing APL 2007

2007-08-09 Thread Steve
On Aug 6, 7:20 am, Paul Mansour <[EMAIL PROTECTED]> wrote: > On Aug 5, 11:54 pm, Mike Kent <[EMAIL PROTECTED]> wrote: > > > APL 2007 conference on Array Programming > > > co-located with OOPSLA 2007 > > > Sponsor: ACM SIGAPL > > > Where:Montreal > > > When:

check if regeular expression has results

2007-08-09 Thread shahargs
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. What's the way to do that simply? Thanks a lot, Shahar. -- http://mail.python.org/mailman/listinf

Re: Jython - variables are stored somehow

2007-08-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi, > > I'm using Jython in combination with java. > > I wrote a jython skript, which calls a function from another jython > module called library.py. > > So, executing the function genData() in skript .py runs without > problem but if I execute the same function aga

Re: wxPython before MainLoop

2007-08-09 Thread kyosohma
On Aug 9, 12:25 am, "[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: check if regeular expression has results

2007-08-09 Thread Marc 'BlackJack' Rintsch
On Thu, 09 Aug 2007 05:58:22 -0700, shahargs wrote: > 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. > > What's the way to do that simply? Simply

Re: check if regeular expression has results

2007-08-09 Thread Patrick Doyle
On 8/9/07, [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. > > What's the way to do that simply?

Re: Jython - variables are stored somehow

2007-08-09 Thread Marc 'BlackJack' Rintsch
On Thu, 09 Aug 2007 05:30:00 -0700, nmin wrote: > So, executing the function genData() in skript .py runs without > problem but if I execute the same function again, the data from the > first run is stored somehow and is added to the new data. > > So, if you look at the result: > #1 in DatenTypen

Re: check if regeular expression has results

2007-08-09 Thread Neil Cerutti
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. > > What's the way to do that sim

Re: check if regeular expression has results

2007-08-09 Thread Steve Holden
[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. > > What's the way to do that simply? > A failed match returns No

tests

2007-08-09 Thread nikolay marinov
Hi, everyone.Does anybody have an idea how can i test two xls files for equality with Python -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Ben Finney
"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 don't know what it is you're actually trying to *do*. > Here's how incase anyone is wondering: > > class MyClass: >

Re: tests

2007-08-09 Thread kyosohma
On Aug 9, 8:21 am, nikolay marinov <[EMAIL PROTECTED]> wrote: > Hi, everyone.Does anybody have an idea how can i test two xls files for > equality with Python 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: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
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 know that >> isn't very clear so here's an example: >> >> class MyClass(object): >> def __init

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Neil Cerutti
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 know that >>> isn't very clear

Re: tests

2007-08-09 Thread André Martins
Generate a hash of two files and compare -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
special_dragonfly a écrit : > "Bruno Desthuilliers" <[EMAIL PROTECTED]> > wrote in message news:[EMAIL PROTECTED] >> special_dragonfly a écrit : >> (snip) (and resnip) > Hello > To answer first Bjoern: > I have a dictionary and a class. The dictionary needs to be filled with > multiple instances

Re: Stackless Integration

2007-08-09 Thread Bruno Desthuilliers
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 python >> tree? Does it cause problems

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"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 don't know > what it is you're act

Re: tests

2007-08-09 Thread brad
[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? -- http://mail.python.org/mailman/listinfo/python-list

Re: Issues of state (was: Tkinter or wxpython?)

2007-08-09 Thread Cameron Laird
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 "desktop client-server" application

Re: how to get command output using python

2007-08-09 Thread Steven Harms
In python it is quite easy: import commands status, output = commands.getstatusoutput("my command") status will be the return code of the command output will be what the command displayed -sjh -- http://mail.python.org/mailman/listinfo/python-list

Re: Stackless Integration

2007-08-09 Thread Jean-Paul Calderone
On Thu, 9 Aug 2007 05:05:31 -0700, Michael Bentley <[EMAIL PROTECTED]> wrote: > >On Aug 9, 2007, at 4:48 AM, Jean-Paul Calderone wrote: > >> 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 awe

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:/

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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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 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: 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 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

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: 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

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 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: 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 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

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

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 ---

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

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

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: 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

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: 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. >> >>

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: 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 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 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 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: 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 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: 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 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: 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

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 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

  1   2   >