Re: What is different with Python ?

2005-06-14 Thread Andrea Griffini
On Mon, 13 Jun 2005 21:33:50 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >But this same logic applies to why you want to teach abstract things >before concrete things. Since you like concrete examples, let's look >at a simple one: > > a = b + c > ... >In a very >few languages (BCPL being one),

Re: What is different with Python ?

2005-06-14 Thread Andrea Griffini
On Mon, 13 Jun 2005 22:19:19 -0500, D H <[EMAIL PROTECTED]> wrote: >The best race driver doesn't necessarily know the most about their car's >engine. The best baseball pitcher isn't the one who should be teaching >a class in physics and aerodynamics. Yes, both can improve their >abilities by

Re: regarding cgi

2005-06-14 Thread db
I think you should give another header: Content-type: text/html regards Arjen On Tue, 14 Jun 2005 07:00:09 +0100, praba kar wrote: > Dear All, > > I have doubt regarding headers in cgi > programming. If I gives "Content-Type:text/plain" > then I try to print html contents. Is righ

Re: "also" to balance "else" ?

2005-06-14 Thread Terry Hancock
On Tuesday 14 June 2005 12:07 am, Ron Adam wrote: > Terry Hancock wrote: > > On Monday 13 June 2005 11:09 pm, Ron Adam wrote: > >>My suggestion is to use, also as the keyword to mean "on normal exit" > >>'also' do this. > > Unfortunately, "also" is also a bad keyword to use for this, IMHO. > > I d

Re: What is different with Python ?

2005-06-14 Thread Andrea Griffini
On Tue, 14 Jun 2005 04:18:06 GMT, Andrew Dalke <[EMAIL PROTECTED]> wrote: >In programming you're often given a result ("an inventory >management system") and you're looking for a solution which >combines models of how people, computers, and the given domain work. Yes, at this higher level I agree

Re: "also" to balance "else" ?

2005-06-14 Thread Andrew Dalke
Ron Adam wrote: > True, but I think this is considerably less clear. The current for-else > is IMHO is reversed to how the else is used in an if statement. As someone else pointed out, that problem could be resolved in some Python variant by using a different name, like "at end". Too late for an

Re: Controlling assignation

2005-06-14 Thread =?ISO-8859-1?Q?Xavier_D=E9coret?=
Bruno Desthuilliers a écrit : > Xavier Décoret a écrit : > (snip) > >> What I wanted to do is something like this: >> >> def change(x,v): >> x = v >> >> class A(object): >> def __init__(self,v): >> self.x = v >> >> a = A(3) >> print a.x # displays 3 >> change(a.x,4) >> print a.x

Re: extending Python base class in C

2005-06-14 Thread Grigoris Tsolakidis
There was good article of how to do this on DDJ home page www.ddj.com "harold fellermann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi all, I once read that it is possible to use a python base class for a C extension class. To be precise, I want to achieve the following behavior

Re: How to get/set class attributes in Python

2005-06-14 Thread Kalle Anke
On Tue, 14 Jun 2005 06:40:51 +0200, Terry Hancock wrote (in article <[EMAIL PROTECTED]>): > I find the biggest problem coming to Python from a language > like C, C++, or Java is that you overthink things and try to > do them the hard way. A lot of times, you find out that the > "Python way" to do

windows directory

2005-06-14 Thread Austin
I would like to write a program which creates the folders in specific directory. For example, I want to create folder in Program Files. How do I know which is in C:\ or D:\ Is there any function to get the active path? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Regarding Content-type headers

2005-06-14 Thread praba kar
Dear All, I have doubt regarding headers in cgi programming. If I gives "Content-Type:text/plain" then I try to print html contents. Is right or wrong after giving content-type: text/plain? regards Prabahar __ H

Reg cgi header

2005-06-14 Thread praba kar
Dear All, I have doubt regarding headers in cgi programming. If I gives "Content-Type:text/plain" then I try to print html contents. Is right or wrong after giving content-type: text/plain? regards Prabahar __

Re: What is different with Python ?

2005-06-14 Thread Michele Simionato
Andrea Griffini wrote: >This is investigating. Programming is more similar to building >instead (with a very few exceptions). CS is not like physics or >chemistry or biology where you're given a result (the world) >and you're looking for the unknown laws. In programming *we* >are building the world

Re: wxpython wxlistctrl with combo

2005-06-14 Thread Franz Steinhaeusler
On Mon, 13 Jun 2005 21:05:09 GMT, "Fabio Pliger" <[EMAIL PROTECTED]> wrote: >Hi all, >i'm working on a very large project using wx 2.5... On one frame i have a >wx.lib.mixins.listctrl widget, wich is a listctrl extended with the >possibility to edit the columns text entrys Anyone know if it's

Re: "also" to balance "else" ?

2005-06-14 Thread Andrew Dalke
Terry Hancock wrote: > No, I know what it should be. It should be "finally". It's already > a keyword, and it has a similar meaning w.r.t. "try". Except that a finally block is executed with normal and exceptional exit, while in this case you would have 'finally' only called when the loop exite

Re: "also" to balance "else" ?

2005-06-14 Thread Fredrik Lundh
Ron Adam wrote: > True, but I think this is considerably less clear. The current for-else > is IMHO is reversed to how the else is used in an if statement. nope. else works in exactly the same way for all statements that support it: if the controlling expression is false, run the else suite and

Re: What is different with Python ?

2005-06-14 Thread Andreas Kostyrka
On Tue, Jun 14, 2005 at 12:02:29AM +, Andrea Griffini wrote: > However I do not think that going this low (that's is still > IMO just a bit below assembler and still quite higher than > HW design) is very common for programmers. Well, at least one University (Technical University Vienna) does i

Re: Regarding Content-type headers

2005-06-14 Thread Ola Natvig
praba kar wrote: > Dear All, > > I have doubt regarding headers in cgi > programming. If I gives "Content-Type:text/plain" then > I try to print html contents. Is right or wrong after > giving content-type: text/plain? > > regards > Prabahar It's not wrong, but you won't get the results

Re: "also" to balance "else" ?

2005-06-14 Thread Fredrik Lundh
Terry Hancock wrote: > Personally, though, "for-finally" would make a lot more sense > to me than "for-else" (and I don't have enough "for-else" code > to worry about it breaking). "finally" means "run this piece of code no matter what happens in the previous block". that's not how "else" works

RE: windows directory

2005-06-14 Thread Tim Golden
[Austin] | I would like to write a program which creates the folders in specific | directory. | For example, I want to create folder in Program Files. How do | I know which | is in C:\ or D:\ | Is there any function to get the active path? It's not quite clear what you mean. You seem to be asking

Re: windows directory

2005-06-14 Thread Richard Lewis
On Tue, 14 Jun 2005 15:32:02 +0800, "Austin" <[EMAIL PROTECTED]> said: > I would like to write a program which creates the folders in specific > directory. > For example, I want to create folder in Program Files. How do I know > which > is in C:\ or D:\ > Is there any function to get the active pat

Re: Access Database Using Python

2005-06-14 Thread Piet van Oostrum
> "Karthish" <[EMAIL PROTECTED]> (K) wrote: >K> I can't figure out how to authenticate and then load a page, since the >K> page requires cookies for authentication. http://www.voidspace.org.uk/python/articles/cookielib.shtml http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302930 -- P

gobal var inside class without notice???

2005-06-14 Thread [EMAIL PROTECTED]
I have code like this: class A: def __init__(self,j): self.j = j def something(self): print self.j print i # PROBLEM is here there is no var i in class A but it works ??? if __name__ == '__main__': i = 10 a = A(5) a.something() I don't define global i but it will take

Re: Which Python Wiki engine?

2005-06-14 Thread garabik-news-2005-05
Kenneth McDonald <[EMAIL PROTECTED]> wrote: > > Here are some of the features I'd greatly like to have that I haven't > seen provided by the (relatively few) wiki engines I've looked at. > Mind you, I don't claim to have looked at even these few > exhaustively. (No time!) MoinMoin is the one

Re: gobal var inside class without notice???

2005-06-14 Thread Michael Smith
[EMAIL PROTECTED] wrote: >I have code like this: > >class A: > def __init__(self,j): >self.j = j > > def something(self): >print self.j >print i # PROBLEM is here there is no var i in class A but it >works ??? > >if __name__ == '__main__': > i = 10 > a = A(5) > a.something()

Re: What is different with Python ?

2005-06-14 Thread Andrew Dalke
Andreas Kostyrka wrote: > On Tue, Jun 14, 2005 at 12:02:29AM +, Andrea Griffini wrote: >> Caching is indeed very important, and sometimes the difference >> is huge. ... > Easy Question: > You've got 2 programs that are running in parallel. > Without basic knowledge about caches, the naive answ

Re: gobal var inside class without notice???

2005-06-14 Thread [EMAIL PROTECTED]
Thanks a lot. pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending mail from 'current user' in Python

2005-06-14 Thread Leo Breebaart
Marcus Alanen <[EMAIL PROTECTED]> writes: > >>I've also tried opening a pipe to sendmail, and feeding the > >>message to that instead. This too works great [but] doesn't > >>seem like much of an improvement, portability-wise. > > No, but at least it can be expected to do the right thing > w.r.t. s

Resume after exception

2005-06-14 Thread Richard Lewis
Hi there, Is it possible to have an 'except' case which passes control back to the point after the exception occurred? e.g. # a function to open the file # raises FileLockedException is file contains 'locked' information def open_file(file_name): f = file(file_name, 'r') {read first line

Re: translating C++ exceptions to python

2005-06-14 Thread Denis S. Otkidach
On 13 Jun 2005 04:23:03 -0700 [EMAIL PROTECTED] wrote: > Hi all, > > I have a C++ library I call from python. The problem is I have c++ > exceptions that i want to be translated to python. I want to be able to > do stuff like: > try: > my_cpp_function() > except cpp_exception_1: > do_stuf

sudo open() ? (python newbee question)

2005-06-14 Thread slava
hello, i am writing a python script that will be run by a non root user the script needs to open a file in write mode that is owned by root file = open('/etc/apt/sources.list', 'r+') returns permission error how can i call sudo on open()? thanks alot slava -- http://mail.python.org/mailman/li

collect data using threads

2005-06-14 Thread Qiangning Hong
A class Collector, it spawns several threads to read from serial port. Collector.get_data() will get all the data they have read since last call. Who can tell me whether my implementation correct? class Collector(object): def __init__(self): self.data = [] spawn_work_bees(call

Where is Word?

2005-06-14 Thread Guy Lateur
Hi all, I need a way to get the path where MS Word/Office has been installed. I need to start Word from a script (see earlier post), but it doesn't work if I don't know its path. So "os.system("winword.exe %s" % fileName)" doesn't always work; I need to say "os.system("C:\Program Files\Microsof

RE: Where is Word?

2005-06-14 Thread Tim Golden
[Guy Lateur] | I need a way to get the path where MS Word/Office has been | installed. I need | to start Word from a script (see earlier post), but it | doesn't work if I | don't know its path. So "os.system("winword.exe %s" % | fileName)" doesn't | always work; I need to say "os.system("C:\P

Re: sudo open() ? (python newbee question)

2005-06-14 Thread Denis WERNERT
The script could be SUID Root, and you could use os.setuid immediately after having performed the task to switch to a non-priviledged user. May be a big security risk, if someone can alter the script, he gains root access to the system... [EMAIL PROTECTED] wrote: > hello, > > i am writing a pyth

Re: subprocess module and blocking

2005-06-14 Thread Robin Becker
Dieter Maurer wrote: . > > You just found out that this is not the case. thanks I suppose I was being a moron. > > The warning attached to "communicate"s docstring might have > you averted: "Note: the data read is buffered in memory... > do not use for large size". > > If subprocess would

Re: circular import Module

2005-06-14 Thread Magnus Lycka
Greg Ewing wrote: > Magnus Lycka wrote: > >> Due to the cycle, you can never use file1 without >> file2 or vice versa. Why do you then want it to be >> two different modules instead of one? > > Perhaps because it would then be too big and > unwieldy to maintain? > > Sometimes there are legitimat

ZCatalog for standalone Zodb?

2005-06-14 Thread Almad
Hello, is ZCatalog available for standalone zodb? As far as I read tutorial, the relation to zope is obvious. I knew there is IndexedCatalog, but its not developed any more...and without indexing, oodbms are unusable for cms, imo. Thank You, -- Lukas "Almad" Linhart [:: http://www.almad.net

Re: Where is Word?

2005-06-14 Thread Guy Lateur
Unfortunately, I need to open/edit a (temporary) text file with Word, and those are opened by default with UltraEdit (or Notepad or..). Thanks for the tip, though. Anything else? Do I need to read the registry? g While this doesn't answer the question you're asking, I believe it does solve

Re: Where is Word?

2005-06-14 Thread Tomasz Lisowski
> Unfortunately, I need to open/edit a (temporary) text file with Word, and > those are opened by default with UltraEdit (or Notepad or..). Thanks for the > tip, though. > > Anything else? Do I need to read the registry? > > g You may try to launch Word as a COM object and control it directly

RE: Where is Word?

2005-06-14 Thread Tim Golden
[Guy Lateur] | Unfortunately, I need to open/edit a (temporary) text file | with Word, and | those are opened by default with UltraEdit (or Notepad or..). | Thanks for the | tip, though. | | Anything else? Do I need to read the registry? | | g OK, you have a couple of options (at least). Eas

RE: Where is Word?

2005-06-14 Thread Tim Golden
[Guy Lateur] | Sent: 14 June 2005 11:02 | To: python-list@python.org | Subject: Re: Where is Word? | | | Unfortunately, I need to open/edit a (temporary) text file | with Word, and | those are opened by default with UltraEdit (or Notepad or..). | Thanks for the | tip, though. | | Anything el

Re: Where is Word?

2005-06-14 Thread Guy Lateur
Thanks, but could you pretty please post some code that does this? I'm new to Python, let alone COM.. TIA, g "Tomasz Lisowski" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > You may try to launch Word as a COM object and control it directly from > Python using the COM object

Re: Where is Word?

2005-06-14 Thread Guy Lateur
Thank you very much; I'll check that out shortly. g "Tim Golden" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] OK, a slightly more intelligent idea in place of my previous one. You can use win32api.ShellExecute (from the pywin32 extensions) which is like a beefed-up os.startfi

Re: implicit variable declaration and access

2005-06-14 Thread Tom Anderson
On Mon, 13 Jun 2005, Ali Razavi wrote: > Tom Anderson wrote: >> On Mon, 13 Jun 2005, Ali Razavi wrote: >> >>> Is there any reflective facility in python that I can use to define a >>> variable with a name stored in another variable ? >>> >>> like I have : >>> x = "myVarName" >>> >>> what can I

multi-CPU, GIL, threading on linux

2005-06-14 Thread gabor
hi, as i understand, on linux, python uses the operating systems threads (so python is not simulating threads by himself). that means that on a multi-CPU computer, the different threads may get executed on different CPUs. i am working with zope, and i was referenced to this page: http://www.zop

Re: What is different with Python ?

2005-06-14 Thread Peter Maas
Andrea Griffini schrieb: > On Mon, 13 Jun 2005 13:35:00 +0200, Peter Maas <[EMAIL PROTECTED]> > wrote: > > >>I think Peter is right. Proceeding top-down is the natural way of >>learning. > > > Depends if you wanna build or investigate. Learning is investigating. By top-down I mean high le

Re: ElementTree Namespace Prefixes

2005-06-14 Thread Oren Tirosh
> you forgot > >http://effbot.org/zone/element-infoset.htm > > which describes the 3-node XML infoset subset used by ElementTree. No, I did not forget your infoset subset. I was comparing it with other infoset subsets described in various XML specifications. I agree 100% that prefixes were no

Re: translating C++ exceptions to python

2005-06-14 Thread harold fellermann
On 13.06.2005, at 13:23, [EMAIL PROTECTED] wrote: > Hi all, > > I have a C++ library I call from python. The problem is I have c++ > exceptions that i want to be translated to python. I want to be able to > do stuff like: > try: > my_cpp_function() > except cpp_exception_1: > do_stuff > e

Re: python bytecode grammar

2005-06-14 Thread Magnus Lycka
M1st0 wrote: > Ops yes is BNF :P Bacus Normal Form if I am not wrong... Backus Naur Form. John Backus and Peter Naur first used it to describe ALGOL around 1960. See e.g. http://cui.unige.ch/db-research/Enseignement/analyseinfo/AboutBNF.html -- http://mail.python.org/mailman/listinfo/python-lis

Re: Generating HTML from python

2005-06-14 Thread Magnus Lycka
Philippe C. Martin wrote: > I now need to generate the HTML wxHtmlEasyPrinting can print: I need to have > a title followed by lines of text that do not look too ugly. If possible I > would like to use an existing module. How to do this really depends on what your data looks like, and how you get

Hopefully simple regular expression question

2005-06-14 Thread [EMAIL PROTECTED]
I want to match a word against a string such that 'peter' is found in "peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or "hey peterbe," because the word has to stand on its own. The following code works for a single word: def createStandaloneWordRegex(word): """ return a regu

Re: Get drives and partitions list (Linux)

2005-06-14 Thread cantabile
Thanks for the answer and help. Cheers :) Peter Hansen wrote: > cantabile wrote: > >> Hi, Peter >> Thanks for the reply. I'll check popen(). >> But you said I should not rely on fdisk... Why ? And should I prefer >> sfdisk ? Why ? > > > I was under the impression that fdisk was older and more

Re: collect data using threads

2005-06-14 Thread Jeremy Jones
Qiangning Hong wrote: >A class Collector, it spawns several threads to read from serial port. >Collector.get_data() will get all the data they have read since last >call. Who can tell me whether my implementation correct? > >class Collector(object): >def __init__(self): >self.data = [

Re: Learning more about "The Python Way"

2005-06-14 Thread Jim
Have you seen the Zen of Python http://www.python.org/peps/pep-0020.html ? Like a lot of humor, it has a lot of truth in it. Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: "also" to balance "else" ?

2005-06-14 Thread Sion Arrowsmith
Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Ron Adam wrote: >> True, but I think this is considerably less clear. The current for-else >> is IMHO is reversed to how the else is used in an if statement. >nope. else works in exactly the same way for all statements that >support it: if the controlling

Re: case/switch statement?

2005-06-14 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: >> With a case statement, on the other hand, you *know* that it must be >> just simple conditionals (a series of x == some_constant tests), so >> you don't need to look at all the cases, just the one that interests you. > > Since you and Steve Holden agree that a

Re: ANN: pyparsing-1.3.1 released

2005-06-14 Thread Peter Hansen
Christopher Subich wrote: > Is the pyparsing > tokenizer flexible enough to let me do this sort of thing easily? I can't say that for sure, but I can say that it is certainly easy enough to try it out (and well enough documented) that downloading it, installing it, and doing a quick proof-of-co

Re: Resume after exception

2005-06-14 Thread Dan Sommers
On Tue, 14 Jun 2005 10:09:30 +0100, "Richard Lewis" <[EMAIL PROTECTED]> wrote: > Hi there, > Is it possible to have an 'except' case which passes control back to the > point after the exception occurred? Not that I can think of. [ example of "interrupting" a file-reading function in order to ask

Re: Resume after exception

2005-06-14 Thread [EMAIL PROTECTED]
Why does the first function return True? Shouldn't it return the file content? That's at least what the function name implies. You call the second function open_command() which returns a boolean. Feels wrong. Where you have written "How?" I suggest that you replace that by: return open_file("foo.b

Re: windows directory

2005-06-14 Thread Peter Hansen
Richard Lewis wrote: > If you want to know where a particular directory is (on a Windows > 'drive') you could use: > > for drive_label in ["C", "D"]: > if "Program Files" in os.listdir(drive_label + ":/"): return > drive_label This would cause trouble in at least two cases that I've seen.

Re: Reg cgi header

2005-06-14 Thread Peter Hansen
praba kar wrote: > I have doubt regarding headers in cgi > programming. If I gives "Content-Type:text/plain" > then I try to print html contents. Is right or wrong > after giving content-type: text/plain? Since you didn't like the other two replies you've already received in response

Geometry library

2005-06-14 Thread Cyril BAZIN
Hello, I am looking for a geometry library for Python. I want to make some computations like:  -distance between vertex and polygon, vertex and polyline, vertex and segment, etc  -if a point is inside a polygon, if a polyline intersect a polygon, etc Thanks for your help, Cyril -- http://mail

Re: Resume after exception

2005-06-14 Thread Peter Hansen
Richard Lewis wrote: > Is it possible to have an 'except' case which passes control back to the > point after the exception occurred? Basically no, although I could imagine some gross hack with the frame info and some bytecode hacks that effect a "goto". Basically the stack frame gets unwound t

Re: sudo open() ? (python newbee question)

2005-06-14 Thread Dan Sommers
On Tue, 14 Jun 2005 11:52:13 +0200, Denis WERNERT <[EMAIL PROTECTED]> wrote: > The script could be SUID Root, and you could use os.setuid immediately > after having performed the task to switch to a non-priviledged > user. May be a big security risk, if someone can alter the script, he > gains roo

Re: Hopefully simple regular expression question

2005-06-14 Thread John Machin
[EMAIL PROTECTED] wrote: > I want to match a word against a string such that 'peter' is found in > "peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or > "hey peterbe," because the word has to stand on its own. The following > code works for a single word: > > def createStandaloneW

Re: Where is Word?

2005-06-14 Thread Tomasz Lisowski
> Thanks, but could you pretty please post some code that does this? I'm new > to Python, let alone COM.. > > TIA, > g import win32com.client wordCOMID = "Word.Application" word = win32com.client.Dispatch(wordCOMID) Then you can use the methods of the word object, provided by the COM object d

Re: collect data using threads

2005-06-14 Thread Peter Hansen
Qiangning Hong wrote: > A class Collector, it spawns several threads to read from serial port. > Collector.get_data() will get all the data they have read since last > call. Who can tell me whether my implementation correct? [snip sample with a list] > I am not very sure about the get_data() metho

Re: Where is Word?

2005-06-14 Thread Peter Hansen
Guy Lateur wrote: > I need a way to get the path where MS Word/Office has been installed. I need > to start Word from a script (see earlier post), (Asking us to refer to some earlier post that may or may not even be available on our news servers isn't the best way to get us the info. A senten

Re: Tiff Image Reader/writer

2005-06-14 Thread PyPK
I get a decoder error when i do a get pixel on the Image >>> im.getpixel((12,34)) Traceback (most recent call last): File "", line 1, in ? File "Image.py", line 858, in getpixel self.load() File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line 180, in load d = Image._

Re: recursive import list

2005-06-14 Thread Philippe C. Martin
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >>> I have a fairly large project going on and would like to figure out >>> automatically from the source which files are being imported. >> If you use your own import function, like below, you could create a >> list of all import

Re: Resume after exception

2005-06-14 Thread Skip Montanaro
>> Is it possible to have an 'except' case which passes control back to >> the point after the exception occurred? Peter> Basically no, although I could imagine some gross hack with the Peter> frame info and some bytecode hacks that effect a "goto". Someone (I forget who) posted

Re: Hopefully simple regular expression question

2005-06-14 Thread Kalle Anke
On Tue, 14 Jun 2005 13:01:58 +0200, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > How do I modify my regular expression to match on expressions as well > as just single words?? import re def createStandaloneWordRegex(word): """ return a regular expression that can find 'peter'

Re: What is different with Python ?

2005-06-14 Thread Roy Smith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > High and low tides aren't caused by the moon. They're not??? -- http://mail.python.org/mailman/listinfo/python-list

Re: Hopefully simple regular expression question

2005-06-14 Thread TZOTZIOY
On 14 Jun 2005 04:01:58 -0700, rumours say that "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> might have written: >I want to match a word against a string such that 'peter' is found in >"peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or >"hey peterbe," because the word has to stand on

Re: "also" to balance "else" ?

2005-06-14 Thread John Roth
"Andrew Dalke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ron Adam wrote: >> True, but I think this is considerably less clear. The current for-else >> is IMHO is reversed to how the else is used in an if statement. > > As someone else pointed out, that problem could be resolv

Re: Going crazy...

2005-06-14 Thread Jan Danielsson
Gary Herron wrote: [---] >> I just tried typing the above in Python, and it - obviously - doesn't >> work, so it must be some other syntax. >> >> > Not with tuples, lists or dictionaries. However a more recent addition > to the language is Sets, and they support set differences: > from s

ANN: Urwid 0.8.8 with web_display

2005-06-14 Thread Ian Ward
Announcing Urwid 0.8.8 -- Urwid home page: http://excess.org/urwid/ Tarball: http://excess.org/urwid/urwid-0.8.8.tar.gz or: https://excess.org/urwid/urwid-0.8.8.tar.gz Summary: This release adds a new web_display module that can emulate a console display with

Re: Resume after exception

2005-06-14 Thread [EMAIL PROTECTED]
Richard Lewis schreef: > Is it possible to have an 'except' case which passes control back to the > point after the exception occurred? No, not in Python. The concept has however been discussed, under the name "resumable exceptions". http://www.google.com/search?num=100&q=%22resumable+exceptions%

Re: Where is Word?

2005-06-14 Thread Guy Lateur
My original post is called "Start application & continue after app exits". Is there a better way to refer to past posts, btw? I want to make a temporary file (directory listing), open it in Word to let the user edit, layout and print it, and then delete the temp file afterwards. I don't think w

Re: sudo open() ? (python newbee question)

2005-06-14 Thread TZOTZIOY
On 14 Jun 2005 08:12:17 -0400, rumours say that Dan Sommers <[EMAIL PROTECTED]> might have written: >On Tue, 14 Jun 2005 11:52:13 +0200, >Denis WERNERT <[EMAIL PROTECTED]> wrote: > >> The script could be SUID Root, and you could use os.setuid immediately >> after having performed the task to switc

Re: Show current ip on Linux

2005-06-14 Thread Sibylle Koczian
David Van Mosselbeen schrieb: > > Thanks for support. > I have read the refered page you show above. I try some piece of code that > im have copy and paste it into a blank file that i give the name > "ip_adress.py" to test it. > > > THE SOURCE CODE : > - > > import commands > >

Re: What is different with Python ?

2005-06-14 Thread Peter Hansen
Roy Smith wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>High and low tides aren't caused by the moon. > > They're not??? Probably he's referring to something like this, from Wikipedia, which emphasizes that while tides are caused primarily by the moon, the height of the high and low

AIX 4.3, Python 2.4.1 fails in test_exceptions with a core dump

2005-06-14 Thread mkent
I'm attempting to switch from 2.3.2 to 2.4.1 on our AIX 4.3 development system. I have no problems building Python 2.3.2. I build Python 2.4.1 using 'configure --without-threads; gmake; gmake test', and always get a coredump during the tests on 'test_exceptions'. I've searched for any reports of

Re: Resume after exception

2005-06-14 Thread Richard Lewis
On Tue, 14 Jun 2005 10:09:30 +0100, "Richard Lewis" <[EMAIL PROTECTED]> said: > Hi there, > > Is it possible to have an 'except' case which passes control back to the > point after the exception occurred? > > e.g. > > # a function to open the file > # raises FileLockedException is file contains

Re: Where is Word?

2005-06-14 Thread Peter Hansen
Guy Lateur wrote: > My original post is called "Start application & continue after app exits". > Is there a better way to refer to past posts, btw? No, the subject is a good way to refer to past posts. I just meant forcing us to dig back, when the post may no longer even be on our servers, is

Re: Python as CGI on IIS and Windows 2003 Server

2005-06-14 Thread jean-marc
[EMAIL PROTECTED] wrote: > jean-marc schrieb: > > Some bits are coming back to me: the problems stemmed from adresses - > > getting the root of IIS was different so accessing files didn't work > > the same way. > > thanks for that. > you are right, IIS versions are different. > Wich kind of adres

Re: [OT ?] (Pythonic) detection word protected files

2005-06-14 Thread Gilles Lenfant
Tim Golden a écrit : > [Gilles Lenfant] > | I'm building an utility that makes a catalog of M$ word files > | in a giant > | directory tree. The password protected files must be marked, and I > | didn't find how to guess which files are password protected and which > | ones are not. > | > | I

Re: "also" to balance "else" ?

2005-06-14 Thread TZOTZIOY
On Tue, 14 Jun 2005 07:20:06 GMT, rumours say that Andrew Dalke <[EMAIL PROTECTED]> might have written: >Given the Python maxim of > There should be one-- and preferably only one --obvious way to do it. > >which of these is the preferred and obvious way? > >while f(): > print "Hello!" > if g():

Re: [OT ?] (Pythonic) detection word protected files

2005-06-14 Thread Gilles Lenfant
Gerald Klix a écrit : > Perhaps you can use OpenOffice and it's python UNO Bindings? > I only know about their existence, but perhaps this will be a starting > point: http://udk.openoffice.org/ Thanks, I already considered this but didn't find the way to get the encryption information (protected

RE: Where is Word?

2005-06-14 Thread Tim Golden
[Guy Lateur] | I want to make a temporary file (directory listing), open it | in Word to let | the user edit, layout and print it, and then delete the temp file | afterwards. I don't think we'll be able to fully automate it, | though. The | user should be able to set her own fonts and stuff.

Re: Tiff Image Reader/writer

2005-06-14 Thread James Carroll
Hmm... that's unfortunate. What platform are you on? If Windows, then I believe that PIL is statically linked against LibTIFF and that particular libtiff wasn't compiled with certain options (CCITT formats or something.) (in 1999 that was true, I found a post from Fred here: http://mail.python.o

Single Application Instance Example

2005-06-14 Thread Chris Lambacher
Does anyone know of an example of how to make a Python program only run a single instance. I am specifically looking for examples for win32. I think I should be able to do this with win32all but the method is not obvious. Preferably I would like to be able to get a handle to the already running

Re: windows directory

2005-06-14 Thread Rune Strand
On XP at least you have the environment variable "ProgramFiles". You can fetch the path it holds through os.environ -- http://mail.python.org/mailman/listinfo/python-list

RE: Single Application Instance Example

2005-06-14 Thread Tim Golden
[Chris Lambacher] | Does anyone know of an example of how to make a Python program only | run a single instance. I am specifically looking for examples for | win32. | | I think I should be able to do this with win32all but the method is | not obvious. Preferably I would like to be able to get a

Re: Single Application Instance Example

2005-06-14 Thread Paul McNett
Chris Lambacher wrote: > Does anyone know of an example of how to make a Python program only > run a single instance. I am specifically looking for examples for > win32. The Python Cookbook, Second Edition, page 380, recipe 9.9: Determining Whether Another Instance of a Script is Already Running

Re: What is different with Python ?

2005-06-14 Thread Peter Maas
Andrew Dalke schrieb: > Peter Maas wrote: > >>I think Peter is right. Proceeding top-down is the natural way of >>learning (first learn about plants, then proceed to cells, molecules, >>atoms and elementary particles). > > > Why in the world is that way "natural"? I could see how biology > coul

Re: What is different with Python ?

2005-06-14 Thread Claudio Grondi
> > High and low tides aren't caused by the moon. > They're not??? I suppose, that the trick here is to state, that not the moon, but the earth rotation relative to the moon causes it, so putting the moon at cause is considered wrong, because its existance alone were not the cause for high and low

Re: What is different with Python ? (OT I guess)

2005-06-14 Thread Magnus Lycka
Andrew Dalke wrote: > Andrea Griffini wrote: > >>This is investigating. Programming is more similar to building >>instead (with a very few exceptions). CS is not like physics or >>chemistry or biology where you're given a result (the world) >>and you're looking for the unknown laws. In programming

Re: implicit variable declaration and access

2005-06-14 Thread Scott David Daniels
Tom Anderson wrote: > ... If it's not, try: > x = "myVarName" > y = "myVarValue" > locals()[x] = y Sorry, this works with globals(), but not with locals(). There isn't a simple way to fiddle the locals (the number is determined when the function is built). I do, however, agree with you about what

  1   2   >