Re: accessing parts of large files with File.seek()

2007-08-09 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Aug 8, 7:37 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Aug 8, 11:46 am, mhearne808[insert-at-sign-here]gmail[insert-dot- here]com [EMAIL PROTECTED] wrote: I'm having a problem with the File object's seek() method. Specifically, I cannot use it to seek to a location in a binary

Re: Destruction of generator objects

2007-08-09 Thread Stefan Bellon
On Thu, 09 Aug, Graham Dumpleton wrote: result = application(environ, start_response) try: for data in result: if data:# don't send headers until body appears write(data) if not headers_sent: write('') # send headers now

how to get output.

2007-08-09 Thread indu_shreenath
Hey, I want to get the output of DIR /AD /B command to a varriable using python. How can I do this? Thanks, Indu -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I programmatically find the name of a method from within that method?

2007-08-09 Thread Peter Otten
Tony wrote: On Aug 8, 9:28 pm, Peter Otten [EMAIL PROTECTED] wrote: No, just wrong. class A: ... def alpha(self): return dir(self)[-2] ... def gamma(self): return dir(self)[-1] ... a = A() a.alpha(), a.gamma() ('alpha', 'gamma') a.beta = 42 a.alpha(), a.gamma()

Re: how to get output.

2007-08-09 Thread Diez B. Roggisch
indu_shreenath schrieb: Hey, I want to get the output of DIR /AD /B command to a varriable using python. How can I do this? Using the subprocess-module. However, I'm not sure what DIR /AD /B does - but there are many functions in module os that might deliver what you want without invoking

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

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

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 started yet, the

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] print result

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

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

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 a

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.

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

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

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].name I'm

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

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: 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 dict[0][0].name

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): name= dict={}

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

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 tree? Does it

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 version

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 incase anyone is

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

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 being a dunce.

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

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

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 again, the

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 started yet, the

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 use

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

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

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

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 None. A

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

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

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 so here's an

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

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

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 actually trying to

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 http://[EMAIL PROTECTED] 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 typically

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 awesome. My question

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:

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. Why not a

Re: Issues of state

2007-08-09 Thread Steve Holden
Cameron Laird wrote: In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] 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

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 and in the

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 y

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 know that isn't

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 python tree? Does it

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 just

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.setdefault(key,

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 started yet, the

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 don't know what it

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

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 greater

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 be

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 integrated into the upstream

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 distaste

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

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

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 it up for you? Thanks, Dick Moores

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., two occurrences

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) 8.17 commands

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 yields the inverse truth

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

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

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] print result except:

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

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

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. What's the way to

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) 3086411340 id(d) 3086390892 There is only one empty tuple.

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 empty tuple,

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) type 'int' 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 Python; it is what it

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 Python; it is

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 isn't that the same as

  1   2   >