Re: Mod_python psp import module problem

2005-06-10 Thread grahamd
May be related to this bug: http://issues.apache.org/jira/browse/MODPYTHON-12 Where you have: import mod_python.psp change it to: psp = apache.import_module("mod_python.psp") Access the PSP object then as: psp.PSP and not: mod_python.psp.PSP It will happen where somewhere else w

Best Web dev language

2005-06-10 Thread Jon Slaughter
I'm trying to get into web development for creating a professional web site and I'm confused on which language I should use. I've read some comparisons between the major languages and I was thinking that python might be the way to go for the most powerful and general language but I am not sure.

Re: anygui,anydb, any opinions?

2005-06-10 Thread Tim Roberts
Renato Ramonda <[EMAIL PROTECTED]> wrote: >Tim Roberts ha scritto: > >> wx uses "sizers" to do the same thing. Same purpose, different philosophy. >> I find sizers more natural, but people should certainly stick to whatever >> makes them comfortable. > >I like sizers too, but in my experience wx

Re: Dealing with marketing types...

2005-06-10 Thread Kay Schluehr
fuzzylollipop wrote: > There are 2 things he can do. > > 1. Get your resume ready and approach the CEO or whomever and say. Why > is this happening? Since I can guarantee you they have already decided > to port this app to Java. The CEO is probably indifferent about particular technology issues b

Re: Dealing with marketing types...

2005-06-10 Thread fuzzylollipop
I was completely serious, he is _NOT_ going to win this one. He has already lost. I have been on both sides of this scenario, the "new guys" were brought in and will win since they are the new "experts from out of town". There may be some other _VALID_ business reason that management has already ma

Re: Dealing with marketing types...

2005-06-10 Thread fuzzylollipop
i think he was actually referering the the architecture astronauts that Joel Spolskyl was talking about -- http://mail.python.org/mailman/listinfo/python-list

Re: Is pyton for me?

2005-06-10 Thread Kirk Job Sluder
Mike Meyer <[EMAIL PROTECTED]> writes: > "Mark de+la+Fuente" <[EMAIL PROTECTED]> writes: > > > I need to write simple scripts for executing command line functions. > > Up till now I've used C-Shell scripts for this, but I'm looking for > > a better alternative. And I keep reading about how “easy

Mod_python psp import module problem

2005-06-10 Thread [EMAIL PROTECTED]
Hi folks... I'm getting a weird problem while loading psp module from mod_python. It only happen somethimes, and I just can't figure out why. I saw other threads in other lists over the net, but none of them solved the problem. My last hope is this last thread before been forced to change my proje

Re: Abstract and concrete syntax

2005-06-10 Thread Kay Schluehr
Terry Reedy wrote: > > lambda x: {True:2,False:3}.get(bool(a)) > > This is limited by the requirement that both branches be computable > regardless of the value of the condition. > > > which is both beautiful and pythonic. > > Beauty is in the eye of the beholder. It seems that relative pythoni

Re: circular import Module

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 07:27 am, Magnus Lycka wrote: > [EMAIL PROTECTED] wrote: > > I have two modules (file1.py and file2.py) > > Is that ok in python (without any weird implication) if my module > > import each other. I mean in module file1.py there exist command import > > file2 and in module fi

Re: Sending mail from 'current user' in Python

2005-06-10 Thread Grig Gheorghiu
I use this function as a platform-independent way of finding out the current user name: def get_username(): if sys.platform == 'win32': return win32api.GetUserName() else: return getpass.getuser() -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way to not create .pyc files?

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 06:52 am, Peter Hansen wrote: > Sorry Terry, but both assumptions are wrong. Yes, thanks. I realized that when I read the other replies. Oh well. I guess I learned something anyway. ;-) The interesting question I'd have then, is what happens if a wrong version .pyc exist

Re: Remove duplicates from list

2005-06-10 Thread Derek Perriero
This is just a follow up from your help Chris.  Everything worked out beautifully.  The method you suggested really cut down on the script time and allowed me to reduce a lot of redundant areas.  Thanks again. -DerekOn 6/9/05, Chris Lambacher <[EMAIL PROTECTED]> wrote: You are probably going about

Re: without shell

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 05:30 am, Tomasz Rola wrote: > On Sun, 12 Jun 2005, km wrote: > > > hi all, > > > > can any linux command be invoked/ executed without using shell (bash) ? > > what abt security concerns ? > > Ops, I missed the word "command" when reading your mail for the first > time, an

Re: Dealing with marketing types...

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 03:06 pm, Kay Schluehr wrote: > Python projects are submarines. You have to care not to go up to soon. Ooh, I like that. I'm going to file that under "useful excuses". Could come in handy! ;-D Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Space

Re: Dealing with marketing types...

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 12:08 pm, Harald Massa wrote: > > They want a > > "scalable, enterprise solution" (though they don't really know what > > that means) and are going crazy throwing around the Java buzzwords > > (not to mention XML). > > > There is a very cheap solution: Ryan Tomayko debunkes

How to use axdebug

2005-06-10 Thread Tim Hoffman
Hi I am trying to work how how to use axdebug, and for the life of me can't work it out. I have tried google ;-) and looked for docs, and now am working through the code. I have a Delphi/C++ app that has a Delphi Scripting component that uses windows underlying Scripting Host, and am successful

Re: Is pyton for me?

2005-06-10 Thread Drazen Gemic
Honestly, I don't think that Python is for you. Python is an object programming language, and you are looking for simple automation tool, in order to avoid programming. If shell scripting is no good enough, try tcl. DG -- http://mail.python.org/mailman/listinfo/python-list

Re: Structure function

2005-06-10 Thread George Sakkis
> Hello, > > Does anyone have an efficient Python routine for calculating the > structure function? > > > Thanks very much, > > > Daran > [EMAIL PROTECTED] Read this first and come back: http://www.catb.org/~esr/faqs/smart-questions.html#beprecise George -- http://mail.python.org/mailman/listin

Structure function

2005-06-10 Thread drife
Hello, Does anyone have an efficient Python routine for calculating the structure function? Thanks very much, Daran [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending mail from 'current user' in Python

2005-06-10 Thread Matt
Mike Meyer wrote: > Leo Breebaart <[EMAIL PROTECTED]> writes: > > > I can get the username info (at least on Unix) via the 'pwd' > > module, but that still leaves me with the domainname, or rather > > the mailname, and I have not been able to spot a way of finding > > that from within Python. (I

Re: re - multiple results

2005-06-10 Thread Michael Hoffman
Pingveno wrote: > I'm working on the Python Challenge (make sure to try it: > http://www.pythonchallenge.com). One of the puzzles requires the use of > regular expressions, but with multiple matches in the text. I tried to > use re.findall(), but I only go one result instead of a list of results. >

Re: Start application & continue after app exits

2005-06-10 Thread Mike Meyer
"Guy Lateur" <[EMAIL PROTECTED]> writes: > To be honest, I don't really understand what it means to have the same file > open for writing by several processes. You don't want to modify data which > is already being modified by someone else, do you? I mean, how do you > determine what changes to

Re: Dealing with marketing types...

2005-06-10 Thread Will McGugan
Diez B. Roggisch wrote: > Will McGugan wrote: > >> Marketing types need a bandwagon to jump on. Point out that Google is >> used by Google, ILM and NASA. > > > Certainly a true statement - but I've got the sneaky suspicion that the > first google was supposed to be python. > Indeed. D'oh. -

Re: Sending mail from 'current user' in Python

2005-06-10 Thread Mike Meyer
Leo Breebaart <[EMAIL PROTECTED]> writes: > I can get the username info (at least on Unix) via the 'pwd' > module, but that still leaves me with the domainname, or rather > the mailname, and I have not been able to spot a way of finding > that from within Python. (I could try opening /etc/mailname

Re: Saving/retrieving user preferences

2005-06-10 Thread Brian Wallis
Brian Wallis wrote: > I want to save user preferences, window sizes, recently opened file names, > etc for a python application and I am looking for a package that does this > in a way that is portable across unix/linux and windows (and mac would be > nice as well). Thank you all for the replies.

Re: Is pyton for me?

2005-06-10 Thread Mike Meyer
"Mark de+la+Fuente" <[EMAIL PROTECTED]> writes: > I need to write simple scripts for executing command line functions. > Up till now I've used C-Shell scripts for this, but I'm looking for > a better alternative. And I keep reading about how “easy” it is to > program with python. Lots of answers

Re: a question from a newcomer to this language

2005-06-10 Thread Steve Horsley
Michael Chermside wrote: > Shankar writes: > >>Is there any way to convert a string into an instruction that will be >>executed? > > > Short answer: > Yes. The exec statement does what you want: > > x = 3 y = 4 exec "z = x * y" print z > > 12 > Ooh! I didn't know that on

Re: Fast text display?

2005-06-10 Thread Mike Meyer
Paul Rubin writes: >> > What about wxwidgets, which wxpython requires? >> >> If the package needs something and it's not installed, the package >> system will get it and install it. That's the *point* of a package >> system. > > Not really. A package system turns a so

Re: using python from c/c++

2005-06-10 Thread Robert Kern
Michael Chermside wrote: > What would be quite nice would be a sort of inverse to SWIG... a > tool to mechanically create C wrappers around a Python program. I > haven't heard of such a beast, but perhaps someone else will write > in to point one out. And how! http://elmer.sourceforge.net -- R

re - multiple results

2005-06-10 Thread Pingveno
I'm working on the Python Challenge (make sure to try it: http://www.pythonchallenge.com). One of the puzzles requires the use of regular expressions, but with multiple matches in the text. I tried to use re.findall(), but I only go one result instead of a list of results. >>> print re.findall(r"m

Re: DB API 2.0 and transactions

2005-06-10 Thread Christopher J. Bottaro
Magnus Lycka wrote: > You might have spotted a fairly nasty bug there! > PostgreSQL violates the SQL standards by running in autocommit mode > unless you explicitly perform its non-standard BEGIN command. If you > are right about the behaviour you describe, the PostgreSQL binding > for Python t

Re: IMAP Proxy

2005-06-10 Thread =?ISO-8859-1?Q?Tarek_Ziad=E9?=
Alex Verstraeten wrote: > Tarek Ziadé wrote: > >> Hi, >> >> I want to write a small TCP Server in Python to make an IMAP Proxy for >> post-processing client requests. >> >> It is not long either complicated but needs to be very robust so... >> maybe someone here has already done such a thing I can

Re: bind in Tkinter

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
Thanks! Your message guided me to the solution to my problem. Shankar - Original Message - From: Markus Weihs <[EMAIL PROTECTED]> Date: Friday, June 10, 2005 5:01 pm Subject: Re: bind in Tkinter > Hi! > > If you press a key, a key-event is passed to the function, here to > self.quit. T

Re: bind in Tkinter

2005-06-10 Thread VK
Shankar Iyer ([EMAIL PROTECTED]) wrote: > I believe the quit function is built in. Anyway, I get the same type of > error if I substitute a function that I have defined. > > Shankar > > - Original Message - > From: VK <[EMAIL PROTECTED]> > Date: Friday, June 10, 2005 4:53 pm > Subject:

Re: Dealing with marketing types...

2005-06-10 Thread Roy Smith
Kay Schluehr <[EMAIL PROTECTED]> wrote: > Python projects are submarines. Sometimes submarines disappear without a trace and loss of all hands aboard. -- http://mail.python.org/mailman/listinfo/python-list

Re: bind in Tkinter

2005-06-10 Thread Markus Weihs
Hi! If you press a key, a key-event is passed to the function, here to self.quit. This is the misterious second argument, which can be useful if you e.g. want to check which key was pressed. Here is a snippet to show how you can do it: from Tkinter import * def quit_program(event): print

Re: bind in Tkinter

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
I believe the quit function is built in. Anyway, I get the same type of error if I substitute a function that I have defined. Shankar - Original Message - From: VK <[EMAIL PROTECTED]> Date: Friday, June 10, 2005 4:53 pm Subject: Re: bind in Tkinter > Shankar Iyer ([EMAIL PROTECTED]) w

Re: bind in Tkinter

2005-06-10 Thread VK
Shankar Iyer ([EMAIL PROTECTED]) wrote: > I have been trying to learn how to associate keyboard events with actions > taken by a Python program using Tkinter. From what I've read online, it > seems that this is done with the bind methods. In one of my programs, I have > included the following:

Re: Using PAMIE to upload and download files...is it possible?

2005-06-10 Thread scrimp
This is your code I used...I didnt change anything from it def useSaveASDialog(filePath=None): from watsup.winGuiAuto import findTopWindow,findControl,setEditText from time import sleep rVal = None handle = winGuiAuto.findTopWindow("Save As") sButton = winGuiAuto.findControl(h

Re: Using PAMIE to upload and download files...is it possible?

2005-06-10 Thread calfdog
Yes, you should be able uploads and downloads, but you have to import modaltest which uses WinGuiAuto to do this. This also handles pop-ups ModalTest.py is in the files section of the Pamie Users Group http://pamie.sourceforge.net. You have to sign up as a member to access the file. Membership i

Re: IMAP Proxy

2005-06-10 Thread Alex Verstraeten
Tarek Ziadé wrote: >Hi, > >I want to write a small TCP Server in Python to make an IMAP Proxy for >post-processing client requests. > >It is not long either complicated but needs to be very robust so... >maybe someone here has already done such a thing I can use or know where >i can get it ? > >Ch

bind in Tkinter

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
I have been trying to learn how to associate keyboard events with actions taken by a Python program using Tkinter. From what I've read online, it seems that this is done with the bind methods. In one of my programs, I have included the following: self.enternumber = Entry(self) self.enternumb

Re: Abstract and concrete syntax

2005-06-10 Thread David Baelde
On Fri, 10 Jun 2005 06:57:19 -0700, Kay Schluehr wrote: >> You can do stuff like this: lambda x: x and 2 or 3 >lambda x: {True:2,False:3}.get(bool(a)) I also think these solutions are just hacks, less efficient, less readable. One shouldn't have to twist her mind to write such an easy idea. _

Re: Abstract and concrete syntax

2005-06-10 Thread David Baelde
> For instance, if assignment were done in an expression, the targets would > have to be quoted to avoid having them evaluated. Or the assignment > expression would have to be a 'special expression' that did not evaluate > all its terms (like setq in some (just older?) lisps). In Python, that

Re: Dealing with marketing types...

2005-06-10 Thread Kay Schluehr
flyingfred0 wrote: > A small software team (developers, leads and even the manager when he's > had time) has been using (wx)Python/PostgreSQL for over 2 years and > developed a successful 1.0 release of a client/server product. > > A marketing/product manager has brought in additional management an

RE: lstat(fileName)[ST_SIZE]

2005-06-10 Thread Michael Chermside
Siva writes: > What is the type of > os.lstat(fileName)[stat.ST_SIZE]. In python 2.0 I am getting it as int and > in 2.3 it is long. I don't know the answer to your question, but I *can* point out that Python 2.0 was released in October 2000... nearly 5 years ago. I am entirely unsurprised to lear

Re: without shell

2005-06-10 Thread Reinhold Birkenfeld
Donn Cave wrote: >> Not according the the docs: >> >> Also, for each of these variants, on Unix, cmd may be a >> sequence, in which case arguments will be passed directly to >> the program without shell intervention (as with os.spawnv()). >> If cmd is a string it will be passed to the she

using python from c/c++

2005-06-10 Thread Michael Chermside
alexandr writes: > Is it possible to create a library from my python module that can be > used from c/c++ application? Yes... the only question is how difficult it is. The basic idea is that you create a library containing Python that contains a hard-coded copy of your python script (or which rea

Re: RE: a question from a newcomer to this language

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
Thank you for your help. I will post the problem in more detail if I find that I cannot avoid using exec. Shankar - Original Message - From: Michael Chermside <[EMAIL PROTECTED]> Date: Friday, June 10, 2005 3:49 pm Subject: RE: a question from a newcomer to this language > Shankar w

Re: Dealing with marketing types...

2005-06-10 Thread Thomas Bartkus
"fuzzylollipop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > get your resume in order and start looking . . . I *hate* the fact that I agree with this post. I, for one, am hoping for serious discussion to address the problem. Thomas Bartkus -- http://mail.python.org/mailman/li

Re: Dealing with marketing types...

2005-06-10 Thread Thomas Bartkus
"flyingfred0" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A small software team (developers, leads and even the manager when he's > had time) has been using (wx)Python/PostgreSQL for over 2 years and > developed a successful 1.0 release of a client/server product. > > A marketing

RE: a question from a newcomer to this language

2005-06-10 Thread Michael Chermside
Shankar writes: > Is there any way to convert a string into an instruction that will be > executed? Short answer: Yes. The exec statement does what you want: >>> x = 3 >>> y = 4 >>> exec "z = x * y" >>> print z 12 HOWEVER... the long answer is that you almost certainly do NOT want to use exe

Re: match groups: optional groups not accessible

2005-06-10 Thread David Reitter
On 10 Jun 2005, at 20:38, Michael Chermside wrote: > David Reitter writes: > >> Why does the following result in an IndexError? >> > [...] > > import re > m = re.match('(?Pmaybe)?yes', "yes") > m.group(1) > m.group('maybe') > >> Traceback (most recent call last): >> File

using python from c/c++

2005-06-10 Thread alexandr
Is it possible to create a library from my python module that can be used from c/c++ application? -- http://mail.python.org/mailman/listinfo/python-list

RE: match groups: optional groups not accessible

2005-06-10 Thread Michael Chermside
David Reitter writes: > Why does the following result in an IndexError? [...] > >>> import re > >>> m = re.match('(?Pmaybe)?yes', "yes") > >>> m.group(1) > >>> m.group('maybe') > Traceback (most recent call last): > File "", line 1, in ? > IndexError: no such group Because the name of the n

a question from a newcomer to this language

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
Hi, I am a undergraduate physics student, and I have been asked to write some code in Python for my summer job. Over the past few days, I have been learning Python and Tkinter, so naturally, I have several questions about the language. Here's one: Is there any way to convert a string into an

Re: Python Developers Handbook

2005-06-10 Thread Robert Kern
Andrew Dalke wrote: > Robert Kern wrote: > >>There is no moderator. We are all moderators. > > I am Spartacus! > > We are all Kosh. Well, if we're starting on the Vorlon quotes, this one seems germane: "The avalanche has already begun. It is too late for the pebbles to vote." -- Robert Kern

Re: try: except: ValueError

2005-06-10 Thread Mike Hoy
> The solution is to use raw_input() which returns the user input as a string. > Then you can do whatever validation you wish, e.g. > menuChoice = int(raw_input("1 = write | 2 = view | 0 = quit")) > which will raise an exception if the input is not a valid integer. yes that did it, thanks --

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-10, Donn Cave <[EMAIL PROTECTED]> wrote: >> Also, for each of these variants, on Unix, cmd may be a >> sequence, in which case arguments will be passed directly to >> the program without shell intervention (as with os.spawnv()). >> If cmd is a string it will be passed to the she

Re: without shell

2005-06-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: ... > According to the current module reference, that's the behavior > of the os.popen*() functions: > > http://docs.python.org/lib/os-newstreams.html#os-newstreams > > > On UNIX, os.popen is posix.popen, is a simple wrappe

Re: Dealing with marketing types...

2005-06-10 Thread fuzzylollipop
get your resume in order and start looking . . . -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Developers Handbook

2005-06-10 Thread Andrew Dalke
Robert Kern wrote: > There is no moderator. We are all moderators. I am Spartacus! We are all Kosh. - Nicolas Bourbaki -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-10 Thread phil
> > What experiences have those in the Python community had in these kinds > of situations? > Ive had lots of experience updating my resume and developing software at home. In Python. Java is a clumsy kludge. And the java environment has gone to hell. Managers DO NOT listen to engineers. M

lstat(fileName)[ST_SIZE]

2005-06-10 Thread Sivakumar Bhaskarapanditha
Hi,   I need your help in this. What is the type of os.lstat(fileName)[stat.ST_SIZE]. In python 2.0 I am getting it as int and in 2.3 it is long. Because it is an int in 2.0 the file size reported is negative for file sizes > INT_MAX. Do you know if this is a bug in 2.0. Are there other w

Re: Python Developers Handbook

2005-06-10 Thread Robert Kern
phil wrote: > Not taking a position for or against the original post: > > Everytime this comes up, on any group, one little annoying > post results in and endless discussion and sometimes > hurtful flame war. Ah, USENET! > Perhaps the rest of us should let the moderator handle it > and get back

Re: Destructive Windows Script

2005-06-10 Thread John J. Lee
Grant Edwards <[EMAIL PROTECTED]> writes: > > I take this to mean the the drive is non-functional and might > > have well been melted, except that demagnetising is cheaper. > > Yup. In a frequently cited scary paper (on the web &c.), Peter Gutmann claims claims that's not true in practise, IIRC:

Re: Generating HTML from python

2005-06-10 Thread Roger Binns
"Philippe C. Martin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I wish to use an easy way to generate reports from wxPython and feel > wxHtmlEasyPrinting could be a good solution. > > I now need to generate the HTML wxHtmlEasyPrinting can print: I need to have > a title

Re: Python Developers Handbook

2005-06-10 Thread phil
Not taking a position for or against the original post: Everytime this comes up, on any group, one little annoying post results in and endless discussion and sometimes hurtful flame war. Perhaps the rest of us should let the moderator handle it and get back to something interesting, like Python.

Re: Using PAMIE to upload and download files...is it possible?

2005-06-10 Thread scrimp
Thank you. I will try to come up with something I will post more if I have any other questions. Thanks -- http://mail.python.org/mailman/listinfo/python-list

RE: SMTP Test Rig

2005-06-10 Thread Hughes, Chad O
Thanks very much it works great and does exactly what I need for a test I have to perform. I started teaching myself the SMTP protocol last night and it does not look to hard. But this saves me a great deal of time an effort. I hope you can find a good place to host it, as it is the only example

Re: how to retrieve info about print jobs

2005-06-10 Thread guy lateur
Perhaps I should mention this: we have printers from HP, and they come with a tool called JetDirect. This allows you to browse to it and check it's status/stats. Maybe I should write something that automatically gathers the info from the printer homepage. Would that be a good/easy way to go abou

Re: Annoying behaviour of the != operator

2005-06-10 Thread David M. Cooke
Robert Kern <[EMAIL PROTECTED]> writes: > greg wrote: >> David M. Cooke wrote: >> To solve that, I would suggest a fourth category of "arbitrary ordering", but that's probably Py3k material. >>> >>>We've got that: use hash(). >>>[1+2j, 3+4j].sort(key=hash) >> What about objects that are no

Re: without shell

2005-06-10 Thread David M. Cooke
Donn Cave <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: >> >> >>py> file_list = os.popen("ls").read() >> >> >> >>Stores the output of ls into file_list. >> >> >> > These commands invoke

Re: python bytecode grammar

2005-06-10 Thread Terry Reedy
"M1st0" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > where I can find the grammar of python bytecode ? ( better if is in BCF I believe the top-level production is something like BYTECODE := (OPCODE ARGS)* See the documentation for the dis module for symbolic opcodes and corresp

Re: Abstract and concrete syntax

2005-06-10 Thread Benji York
George Sakkis wrote: > Another case I've found handy to use lambdas and expressions instead of > named functions and statements is for simple properties: > > class SomeArray(object): > dimensions = property( > fget = lambda self: (self.x,self.y), > fset = lambda self,(x,y): set

Re: try: except: ValueError

2005-06-10 Thread Kent Johnson
Mike Hoy wrote: > hi > > my goal is to handle the problem of a user typing a letter or symbol > rather than a number I found something called try: and ValueError: > > Anyway this is what i attempted: > > #menuloop > menuChoice = 7 > printMenu() > while menuChoice != 0: > try: >

Re: Annoying behaviour of the != operator

2005-06-10 Thread Dan Sommers
On Fri, 10 Jun 2005 09:50:56 -0500, Rocco Moretti <[EMAIL PROTECTED]> wrote: > Dan Sommers wrote: >> On Thu, 09 Jun 2005 15:50:42 +1200, >> Greg Ewing <[EMAIL PROTECTED]> wrote: >> >>> Rocco Moretti wrote: >>> The main problem is that Python is trying to stick at least three different

[no subject]

2005-06-10 Thread python-list-bounces+archive=mail-archive . com
#! rnews 1443 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: python bytecode grammar X-Nntp-Post

Re: Getting a DOM element's children by type (STUPID)

2005-06-10 Thread uche . ogbuji
""" If i get myself a DOM tree using xml.dom.minidom (or full-fat xml.dom, i don't mind) """ Don't do that. Stick to minidom. The "full" xml.dom from PyXML is ancient and slow. Of course, there are other, better libraries available now, too. """ is there an easy way to ask a element for its ch

Re: Annoying behaviour of the != operator

2005-06-10 Thread Rocco Moretti
George Sakkis wrote: > "Rocco Moretti" wrote: > > >>One way to handle that is to refuse to sort anything that doesn't have a >>"natural" order. But as I understand it, Guido decided that being able >>to sort arbitrary lists is a feature, not a bug. > > > He has changed his mind since then > (ht

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-10, Donn Cave <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: >> >> >>py> file_list = os.popen("ls").read() >> >> >> >>Stores the output of ls into file_list. >> >> >> > These co

Release announcement

2005-06-10 Thread Philippe C. Martin
Dear all, I am very happy to anounce the release of SnakeCard's School-ID, a school/university Smart Card based security solution that can be extended using Python or other languages that can "talk" to Python modules. The current release includes the following features: Student/Faculty Identific

RE: without shell

2005-06-10 Thread Michael Chermside
KM writes: > can any linux command be invoked/ executed without using shell (bash) ? > what abt security concerns ? Yes. See: http://docs.python.org/lib/module-subprocess.html An exerpt: > On Unix, with shell=False (default): In this case, the Popen class uses > os.execvp() to execute the child

Re: Abstract and concrete syntax

2005-06-10 Thread Terry Reedy
"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mandus schrieb: >> You can do stuff like this: lambda x: x and 2 or 3 This is limited by the requirement (often met) that bool(true-branch) == True > You can also do this > > lambda x: {True:2,False:3}.get(bool(a))

Re: Start application & continue after app exits

2005-06-10 Thread Terry Reedy
"Guy Lateur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To be honest, I don't really understand what it means to have the same > file open for writing by several processes. You don't want to modify data > which is already being modified by someone else, do you? I mean, how do

Re: unittest and XML output

2005-06-10 Thread Peter Hansen
James Jeffers wrote: > I couldn't find any resource that addresses output from the unittest package > in python 2.4.x. I can't beleive that there isn't an output formatter/test > runner for the unittest package.. surely some needed this before. > > Is there a working group or package maintainer

try: except: ValueError

2005-06-10 Thread Mike Hoy
hi my goal is to handle the problem of a user typing a letter or symbol rather than a number I found something called try: and ValueError: Anyway this is what i attempted: #menuloop menuChoice = 7 printMenu() while menuChoice != 0: try: menuChoice = int("1 = write | 2 = v

Re: without shell

2005-06-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: > > >>py> file_list = os.popen("ls").read() > >> > >>Stores the output of ls into file_list. > >> > > These commands invoke shell indeed. > > Under Unix, popen will not invo

Re: Annoying behaviour of the != operator

2005-06-10 Thread Terry Reedy
"Rocco Moretti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The "wackyness" I refered to wasn't that a list of complex numbers isn't > sortable, but the inconsistent behaviour of list sorting. As you > mentioned, an arbitraty collection of objects in a list is sortable, but > as

RE: how to operate the excel by python?

2005-06-10 Thread Hughes, Chad O
Sorry, I meant to spell check but I did not somehow. Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hughes, Chad O Sent: Friday, June 10, 2005 10:01 AM To: python-list@python.org Subject: RE: how to operate the excel by python? Here are two script

Re: match groups: optional groups not accessible

2005-06-10 Thread Peter Hansen
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > >> Why does the following result in an IndexError? >> I try to match an optional group, and then access it via its group >> name. The group happens to not participate in the match, but is >> obviously defined in the pattern. >> > m = re.match('(

Re: Dealing with marketing types...

2005-06-10 Thread Harald Massa
> They want a > "scalable, enterprise solution" (though they don't really know what > that means) and are going crazy throwing around the Java buzzwords > (not to mention XML). > There is a very cheap solution: Ryan Tomayko debunkes all these myths. You can google it up, "astronaut architects"

Re: Abstract and concrete syntax

2005-06-10 Thread George Sakkis
"Kay Schluehr" wrote: > > You can do stuff like this: lambda x: x and 2 or 3 > > You can also do this > >lambda x: {True:2,False:3}.get(bool(a)) > > which is both beautiful and pythonic. > > Kay Beauty is in the eye of the beholder, and the same holds for 'pythonicity'; IMO both are much less

Re: Abstract and concrete syntax

2005-06-10 Thread George Sakkis
"Kay Schluehr" wrote: > > Thu, 09 Jun 2005 03:32:12 +0200 skrev David Baelde: > > [snip] > > > > > > set_callback(obj, > > > lambda x: (if a: > > >2 > > > else: > > >3) > > > > > [snip] > > > > You can do stuff like this: lambda x: x and 2

RE: how to operate the excel by python?

2005-06-10 Thread Hughes, Chad O
Here are two scripts that I have had to build for a class that I teach. You will either need to write the constants explicitly, or I can email neet the constans module that I have built, for the second one to work. I will copy it to the very end. If you have any questions, just let me know. He

Re: Abstract and concrete syntax

2005-06-10 Thread George Sakkis
"Mandus" wrote: > Thu, 09 Jun 2005 03:32:12 +0200 skrev David Baelde: > [snip] > > > > set_callback(obj, > > lambda x: (if a: > >2 > > else: > >3) > > > [snip] > > You can do stuff like this: lambda x: x and 2 or 3 > > Of course, you are st

How to overcome automatic cyrillic-to-/hex convert

2005-06-10 Thread degoor_python
Hi friends, I am really sorry to bother you with such a simple stupid question but today it's my second day spent in searching manuals, mail-archives (I downloaded over 100MB from "python-list"), etc., and I could not find anything that can solve the matter. I am from Bulgaria and I use Python (+

Re: Annoying behaviour of the != operator

2005-06-10 Thread Jp Calderone
On 10 Jun 2005 09:05:53 -0700, Dan Bishop <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: >... >> If you were to ask, "which is bigger, 1+2j or 3+4j?" then you >> are asking a question about mathematical size. There is no unique answer >> (although taking the absolute value must surely come clos

Re: Changing entities

2005-06-10 Thread Kent Johnson
Daniel wrote: > Hi Kent > > This isn't work with the following line: > FieldGraphic56::= GraphicString EBCDIC BC= " " SIZE (56 > BYTES) > > byter = re.compile(r'SIZE \((\d+) BYTE\)') Because the string doesn't match the pattern, can you see the difference? Do you understand what

  1   2   >