RE: [Tutor] How to substitute an element of a list as a pattern for re.compile()

2004-12-29 Thread Rich Krauter
kumar s wrote: I have Question: How can I substitute an object as a pattern in making a pattern. x = 30 pattern = re.compile(x) Kumar, You can use string interpolation to insert x into a string, which can then be compiled into a pattern: x = 30 pat = re.compile('%s'%x) I really doubt regular

Re: [Tutor] How to put my functions in an array

2004-12-29 Thread 沈洁元
Hello, Mohamed Lrhazi wrote: >def addvirt(): > pass >def remvirt(): > pass > >PROVISION_ACTIONS=[('addvirt','Add Virt'),('remvirt','Remove Virt'),] >formhandlers={} > ># this works >formhandlers["addvirt"]=addvirt >formhandlers["remvirt"]=remvirt > ># this does not work: >for verb,ver

Re: [Tutor] (no subject)(About Pipe)

2004-12-29 Thread ææå
Hello, KTPR I've read your code. May the main problem locates at "cmd". Assume that foo.py and listen.py are at the same directory. It should look like: cmd='python listen.py' or if you included '#!/usr/bin/python' (Linux) or '#!/usr/local/bin/python' (FreeBSD) as the first line in liste

Re: [Tutor] C mailing list

2004-12-29 Thread Isr Gish
I finally found a C mailing list. But it seems to have a verl low traffic. The email address is [EMAIL PROTECTED] You can sign up somewhere on: Www.snippets.org Here is some text from there site: As a lightly moderated conference, the C conference has some rules. You can read these at http://c.s

Re: [Tutor] O.T.

2004-12-29 Thread kumar s
30, Married, will soon be a dad., Live in Baltimore, U.S.A. and I am a Ph.D. student I lived in Denmark and Israel in the past as a part of my research life. Will finish my Ph.D., in Bioinformatics. Got introduced to computers at the age of 25 :-( and more happy it is not 52 :-) Programming l

[Tutor] How to substitute an element of a list as a pattern for re.compile()

2004-12-29 Thread kumar s
Hi Group: I have Question: How can I substitute an object as a pattern in making a pattern. >>> x = 30 >>> pattern = re.compile(x) My situation: I have a list of numbers that I have to match in another list and write them to a new file: List 1: range_cors >>> range_cors[1:5] ['161:378',

Re: [Tutor] O.T.

2004-12-29 Thread Roger Merchberger
Rumor has it that Bob Gailer may have mentioned these words: [snip] Programmed in more languages than I care to recall. The more interesting/arcane include Motorola 8080? Assembler and Machine language Yup - that sure is arcane -- It's either an Intel 8080 or a Motorola 6800. ;-) Me: 37, married

Re: [Tutor] text programme in graphical box

2004-12-29 Thread Alan Gauld
> root = Tk() > cv = Canvas(root, width=400, height=300, bg="blue") > cv.pack() > cv.create_rectangle(50,30,320,290,outline="yellow",fill="red",width=10 ) > > mainloop() > > any way what i would like to do is create a programme that would run my text > programme from this graphical box You need to

Re: [Tutor] jpg to doc

2004-12-29 Thread Alan Gauld
This has been asked before, please try searching the archives on ActiveState web site. The short answer is that you probably are better off finding a good OCR program than trying to do it yourself, coz it's hard! Once you get the text out of the image it's not so hard to put it into Word, either

Re: [Tutor] leastsquares.py

2004-12-29 Thread Alan Gauld
> I am trying to use a least squares method (the one written by Konrad Hinsen), > but I do not want the method to be able to generate negative values. Is there > a way to stop least squares programs from doing so? def _leastSquare(): # do the thing that might generate negatives def leastSquar

RE: [Tutor] try here for tkinter lessons

2004-12-29 Thread John Purser
Thanks. I've bounced off tkinter several times and have been looking for a new approach. I'll check it out as soon as I can. John Purser -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Alvarado Sent: Wednesday, December 29, 2004 13:52 To: tutor@pyt

[Tutor] try here for tkinter lessons

2004-12-29 Thread Ron Alvarado
I've had problems getting started with tkinter, but since reading these lessons everything is beginning to make sense. If anyone is interested this is the link. http://bembry.org/tech/python/index.php Ron A ___ Tutor maillist - Tutor@python.org http:/

Re: [Tutor] Comments appreciated

2004-12-29 Thread Luis N
> [Jeff] > > Also, even though this is intended to be a quick shell script, it's > > not a bad idea to make everything except function defs into a little > > main() function, and call it in a script-only section. > > > [Luis] > > > The only thing I'm not clear about is how 'trashcan' can be a >

[Tutor] hello form moldova

2004-12-29 Thread Gheorghe Zugravu
hello to everybody,, mu name is george and I am from Moldova, for those who dont know, a small country placed between Romania and Ukraine. in order to respect the subject of this mail list I wannt to say that I just discovered the python and I can not say to much about it, but i just wait to

Re: [Tutor] How to put my functions in an array

2004-12-29 Thread Mohamed Lrhazi
Thanks alot Jeff. This worked for me: formhandlers={} for verb,verb_desc in PROVISION_ACTIONS: try: formhandlers[verb]=globals()[verb] except KeyError: pass On Wed, 2004-12-29 at 14:37, Jeff Shannon wrote: > If you can't make that change to PROVIS

Re: [Tutor] How to put my functions in an array

2004-12-29 Thread Jeff Shannon
Mohamed Lrhazi wrote: def addvirt(): pass def remvirt(): pass PROVISION_ACTIONS=[('addvirt','Add Virt'),('remvirt','Remove Virt'),] formhandlers={} # this works formhandlers["addvirt"]=addvirt formhandlers["remvirt"]=remvirt # this does not work: for verb,verb_desc in PROVISION_ACTI

Re: [Tutor] Output to a printer

2004-12-29 Thread Luc Saffre
Hello Alan and Bob, wow, two interested people! This gave me the necessary motivation to work today on getting the thing published ;-) First look here for a more complete example: http://lsaffre.dyndns.org/~luc/timwebs/lino/26.htm The textprinter package is a part of "Lino", and I'm afraid you wi

Re: [Tutor] leastsquares.py

2004-12-29 Thread Jason Child
mdcooper wrote: Hello all, I am trying to use a least squares method (the one written by Konrad Hinsen), but I do not want the method to be able to generate negative values. Is there a way to stop least squares programs from doing so? I have probably not included enough information but I am not

[Tutor] How to put my functions in an array

2004-12-29 Thread Mohamed Lrhazi
def addvirt(): pass def remvirt(): pass PROVISION_ACTIONS=[('addvirt','Add Virt'),('remvirt','Remove Virt'),] formhandlers={} # this works formhandlers["addvirt"]=addvirt formhandlers["remvirt"]=remvirt # this does not work: for verb,verb_desc in PROVISION_ACTIONS: if cal

[Tutor] moving widgets around

2004-12-29 Thread Sean McIlroy
I'd like to get some example code showing how to move widgets around in drag-and-drop fashion. I've tried looking at tkDND.py (I think that's what it's called) but that was a little involved - what I want to know is the barest of bare bones. Any help would be majorly fabulous. Merci beaucoup. STM

[Tutor] (no subject)

2004-12-29 Thread ktpr
Hi all, I am trying to supply input to another program using pipes. I can read from it just fine, but writing to its stdin doesn't seem to be working. foo.py (gets pipe to listen.py) --- from popen2 import popen2 cmd = "listen.py" #stdout, stdin r, w = popen2(cmd) w.write("Message sent") w.c

[Tutor] Hi.

2004-12-29 Thread Chris Andrew
Hi, everybody.  I've just subscribed to the list, and am armed with O'Reilly's "Learning Python" book.  I don't have any programming experience, but have been knocking around with linux for about 6 years.  After much consideration, I inally decided Python looked like the best place to start. I loo

[Tutor] leastsquares.py

2004-12-29 Thread mdcooper
Hello all, I am trying to use a least squares method (the one written by Konrad Hinsen), but I do not want the method to be able to generate negative values. Is there a way to stop least squares programs from doing so? I have probably not included enough information but I am not sure what peopl

[Tutor] text programme in graphical box

2004-12-29 Thread cm012b5105
Hello i want to put an interactive text programme in to a graphical box this is a small section of my text programme s = raw_input ("Hello whats your name? ") if s=='melvyn': print "your my boss's Dad the one they call in indian language DEEP THOUGHT LITTLE HORSE" if s=='carol': p

Re: [Tutor] silly question

2004-12-29 Thread jasonchild
awesome. thanks for the advice! >> how do I change global variables within a function: >> > > by declaring them as global. > See my tutorial topic: "Whats in a Name?" for a discussion of this. > >> ## >> VAR = "TEST" >> >> def m(): >> VAR="no test" > > creates a

Re: [Tutor] Another ? on large text files

2004-12-29 Thread Hugo González Monteverde
Hi Ara, I'd go something like this: filep = open("myfile") in_data = False output_files = ["file1.txt", "file2.txt" . ] for i in output_files: while True: dataline = filep.readline() if not dataline: break if not in

Re: [Tutor] how to check if a file is being used by another person or application before writing to it?

2004-12-29 Thread Hugo González Monteverde
Maybe you can accomplish this using the stat function in the os module. say: import os filename = "foo.txt" mystat = os.stat(filename) #Stat has a number of attributes, such as mystat.st_atime #time of most recent access atime = time.ctime(mystat.st_atime) print atime 'Wed Nov 17 23:51:11 2004' The

Re: [Tutor] O.T.

2004-12-29 Thread Jeff Shannon
I'm 36, unmarried, male, and live in Seattle, Washington (USA). I've dabbled with computers and programming on and off since junior high (around 1980), but have only gotten serious about it in the last 10 years or so (almost entirely self-taught), and have only been employed in the field for a

Re: [Tutor] O.T.

2004-12-29 Thread Kent Johnson
Age 49, two children, getting divorced :-( Live in New Hampshire (US) with one daughter. In love with computers and programming since forever (well, maybe only since 1968 or so...) Working as a professional programmer mostly since 1977. Languages I have actually been paid to program in include Ass

Re: [Tutor] O.T.

2004-12-29 Thread Alan Gauld
> interested in computer science because (to me) writing programs > feels a lot like writing short stories or poetry. Hmm, given that several of the programs I've worked on have had more words in them than the bible, I'm not so sure about *short* stories. But I think I know what you mean...

[Tutor] Re:OT

2004-12-29 Thread Ron Phillips
54 years old -- father of 3, grandfather of 4 (and counting.)   I started Pythoning because I work for a governmental agency that does Civil Engineering. To support mapping, I needed a wrapper for ESRI products (Python, AML, VBA), to support drafting, I needed a wrapper for AutoDesk products

RE: [Tutor] O.T.

2004-12-29 Thread pcarey
27, married, have a 6-month-old boy. After an MA in literature, I went back to school for a CS degree (about halfway finished now). Java and XSLT/XML pay the bills, but I would use python if I could. I enjoy Faulkner, Bach, algorithms, and swimming. I got interested in computer science because (t

RE: [Tutor] O.T.

2004-12-29 Thread Robert, Andrew
I'm a father of two girls, living in Massachusetts. Professionally, I've been a VMS/Unix Systems Admin for the last 17 years. This includes designing high availability, fault tolerant configurations and management of disparate fiber storage area networking solutions. As an admin, I do a good

Re: [Tutor] O.T.

2004-12-29 Thread Gonçalo Rodrigues
Jacob S. wrote: I hate to sound weird... But who are you all, what are you're ages, what do you do, marriage status, etc? You obviously don't have to answer, I'm just curious who I'm boldly sending emails to. Jacob Schmidt P.S. I'm a student. 14 years. Play the piano better than I write scripts. Si

Re: [Tutor] O.T.

2004-12-29 Thread Eri Mendz
joining in this ASL thread. i'm my kids dad, father of 2, an expat workin in saudi arabia. a newbie trying to learn python to see how far i could go... know a bit of shell scripting, tried Perl but never went far. i like Python's clear syntax, so close to basic english. but of course there'

Re: [Tutor] O.T.

2004-12-29 Thread XemonerdX
I'm 31, male, living in the Netherlands, with the love of my life (not married tho). I work as a web developer for a small web agency, doing mostly Flash ActionScript, ColdFusion, PHP, MySQL and (X)HTML. Also involved as a moderator on several Flash communities and heavily intrigued by mathematics,

[Tutor] Re: Tutor Digest, Vol 10, Issue 105

2004-12-29 Thread Chris Cox
No longer required. - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, December 29, 2004 6:00 AM Subject: Tutor Digest, Vol 10, Issue 105 Send Tutor mailing list submissions to tutor@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.