Re: [Tutor] Grabbing Information from txt files

2010-11-12 Thread Michael
>Random thoughts: > >1.) Maybe you should be looking at something like Fuppes instead: >http://fuppes.ulrich-voelkel.de/ ? >2.) Even so, continuing with your current direction: there appears to >be a >module/wrapper of MediaInfo for Python, thus removing the need to >scrape >information from Media

[Tutor] hitting a wall (not a collision detection question :P)

2009-07-19 Thread Michael
I have virtually no background in programming. I'm currently teaching myself python using the following books: Beginning Python - From Novice to Professional by Magnus Lie Hetland Beginning Python by Peter Norton et. al. Making Use of Python by Rashi Gupta Learning Python  by Mark Lutz as well a

[Tutor] German Totorial!?!

2005-01-05 Thread michael
Hello, Im a German peaople whou would learn Python. But I cant find a german tutorial. So you know a German Tutorial? Daer Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need Some Help

2007-08-27 Thread Michael
programmes for all sorts of specific uses of Python, just do a search. Michael chinni wrote: > Hi All, > > I am new to python.i need some help about python.i want to learn > python so plz guide me from where can i start.so,that i can learn and > under stand quickly. > &g

[Tutor] validation

2007-08-27 Thread Michael
value? Caomparing it to 'int' or 'str' isn't working, or should I be using the isinstance property? I want to use raw_input and check that it is a number. Can someone point me in the right direction? Thanks Michael ___

Re: [Tutor] validation

2007-08-28 Thread Michael
Thanks Everybody I now have several methods in my arsenal and they all look quite simple, now that I know. Just wondering, when would you use isInstance()? Thanks Alan Gauld wrote: > "Michael" <[EMAIL PROTECTED]> wrote > > >> to check and make sure that an int

[Tutor] interpreted or compiled?

2007-09-12 Thread Michael
Hi As a new Python user I was curious if you can run Python without the environment, ie make it an executable? Thanks Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] interpreted or compiled?

2007-09-12 Thread Michael
wormwood_3 wrote: > Michael, > > The most common method I know of to do this is py2exe: http://www.py2exe.org/ > This lets you turn scripts into executable Windows programs. > > A different, and perhaps better, method is PyInstaller: > http://pyinstaller.python-hosti

Re: [Tutor] Top Programming Languages of 2013

2007-10-08 Thread Michael
I'd guess that by 2013 we'll be using a slightly more graceful, but still horribly wrong (and unsupported by IE 7.666), redo of HTML, CSS, Javascript, Flash, and Java with a poorly conceived back-end marriage of PHP + MySQL or some horrible Microsoft technology for most apps. I'll also venture that

[Tutor] repeat

2007-11-16 Thread Michael
langauge must have a test last structure in it to be considered. Thanks Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] classes and the deepcopy function

2008-01-04 Thread Michael
changes as well. Can anyone give ma a pointer? Thanks Michael -- import copy class point: "represents a point in 2d space" x = 0 y = 0 def printpoints(self): print "x is %g, y is %g" %(self.x, self.y) class rectangle: &qu

Re: [Tutor] classes and the deepcopy function

2008-01-04 Thread Michael
Hi Michael Thanks for the quick reply, I think I get it. So becuase I did not declare them withing the init method using self they are shared by every object that is created, even completely brand new ones? Is it normal practice to declare your variables in a class? I notice that you don&#

Re: [Tutor] classes and the deepcopy function

2008-01-06 Thread Michael
Okay Just when I think I am getting it you throw this in. So why does a become local to each variable but b seem global? Michael bob gailer wrote: > Michael wrote: >> Hi Michael >> >> Thanks for the quick reply, I think I get it. So becuase I did not >> declare t

[Tutor] processing a text file w/ OO?

2006-01-22 Thread Michael
Hi. I'm processing a tab-delimited text file where I read in a file, perform a bunch of operations on the items, and then write them out again to a fixed-width text file. I've been doing this with a very functional approach: - loop over lines - read line into dictionary - process dictionary

Re: [Tutor] processing a text file w/ OO?

2006-01-23 Thread Michael
Thanks, Alan. That's exactly the kind of explanation I was looking for. As this is pretty much a one-off project and the data transformations are pretty different for each field, I'll stick with the functional approach. The rule of thumb you mention is useful, too. I hadn't heard that befor

Re: [Tutor] Decorators

2006-04-11 Thread Michael
tributes. ... are all practical benefits. That means they have practical use in my book :-) Syntactic sugar *IS* a practical benefit. After all, every language above assember is syntactic sugar, and by your definition of no practical use. Michael. ___

Re: [Tutor] unit testing raw_input()

2006-04-18 Thread Michael
portant *how* the mock was called (eg you're testing correct use of a library), your mock could append parameters to a list for later comparision. Eg >>> mocktrace = [] >>> def raw_input_mock(prompt): # create a mock ... mocktrace.append((prompt,)) ... return "y" ... A

Re: [Tutor] Offtopic observation

2006-06-07 Thread Michael
Proust was onto > something ... but then again, I majored in english. It's also called confessional debugging :-) It's also something that actually tends to apply outside programming as well. The act of understanding the problem often leads

Re: [Tutor] Functional Programming

2006-07-06 Thread Michael
that having an understanding of functional programming will generally improve someone's code, but I would suggest that learning the ideas in a language where functional programming is the norm rather the exception is a good idea. The come back to python, and learn to undo you

[Tutor] directory traversal help

2008-07-03 Thread Michael
as well as hidden and other types of folders. Is there a way to modify it to skip folders that would make it crash? I have tried using exception handling (try) and other functions in the os module but I cannot work it out. Any ideas? thanks Michael import os import string def walk(dir

Re: [Tutor] directory traversal help

2008-07-06 Thread Michael
e it crash? I have tried using exception handling (try) and other functions in the os module but I cannot work it out. Any ideas? thanks Michael import os import string def walk(dir): for name in os.listdir(dir): path = os.path.join(dir,name) if os.path.isfile(path): b

Just Because (Was: Re: [Tutor] Global presets ?)

2004-12-05 Thread Patric Michael
<> Folks... I originally discovered this list while searching Google for the mathematical expression to convert yards to inches. Seems someone already did it in a python function. (I think maybe it was Kent?) At any rate, I subscribed to the list out of curiosity, partly because I like pyth

Re: [Tutor] MemoryError

2004-12-08 Thread Michael Janssen
[forgot to cc to the list] -- Forwarded message -- From: Michael Janssen <[EMAIL PROTECTED]> Date: Wed, 8 Dec 2004 14:40:46 +0100 Subject: Re: [Tutor] MemoryError To: Liam Clarke <[EMAIL PROTECTED]> On Wed, 8 Dec 2004 23:29:38 +1300, Liam Clarke <[EMAIL PR

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-09 Thread Patric Michael
<> > Sorry for the delay but I was busy with soemthing else. > The script prints the values of the variables fine in the > browser so there must be a problem with the file writing part. > When I run the script from my bash shell it creates the videodb > database file, but when I run it from the b

Re: [Tutor] Array slices in python with negative step

2010-01-11 Thread Michael Sprayberry
7;,'d','c','b'] because you stopped at index 0 but did not include it a[::-1] uses the last index going back to and including index 0 as the following example shows >>> a =[1,2,3,4,5,6] >>> b = a[5:0:-1] >>> b [6, 5, 4, 3, 2] >>> b = a[5

Re: [Tutor] ipython, PYTHONPATH, on a MAC

2010-02-16 Thread Michael Fourman
http://mactip.blogspot.com/2004/04/setting-environment-variables.html Hope this helps, michael On 16 Feb 2010, at 15:46, John [H2O] wrote: > > Hello, > > I'm not a Mac user, but I'm a promoter of Python! I have a good friend using > a Mac who's becoming sceptical

[Tutor] NLTK needs YAML?

2010-04-23 Thread Michael Scharf
Dear Friends, I'm new to the list, and new to Python. The last time I've tried anything like the below was 20 years ago on a NeXT machine, and I had no clue what I was doing then, either. I've gotten IDLE up and have done some hello worlding. I am now trying to get the NLTK working on my new iM

[Tutor] Exception Handling and Stack traces

2010-09-10 Thread Michael Powe
o be able to give this script to someone who will want to be able to read the error output without having to be a Python programmer experienced in reading stack traces. e.g. a "Badly formed URL" message that tells them they set up the parameters for connecting to the web service incorrectly.

Re: [Tutor] Exception Handling and Stack traces

2010-09-10 Thread Michael Powe
On Fri, Sep 10, 2010 at 03:56:51PM +0200, Peter Otten wrote: > Michael Powe wrote: > > > I can't work out how to suppress stacktrace printing when exceptions > > are thrown. > > [snip rant] > > It might have been a good idea to read a tutorial like &

Re: [Tutor] Exception Handling and Stack traces

2010-09-10 Thread Michael Powe
examples that I am not aware of. It looks like you and Peter have pulled me out of the ditch and for that I am grateful. Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA It could have been an organically based disturbance of the brain -- perhaps a tumor or a m

Re: [Tutor] Exception Handling and Stack traces

2010-09-10 Thread Michael Powe
On Fri, Sep 10, 2010 at 04:42:35PM +0200, Peter Otten wrote: > Michael Powe wrote: > > On Fri, Sep 10, 2010 at 03:56:51PM +0200, Peter Otten wrote: > >> Michael Powe wrote: > >> > I can't work out how to suppress stacktrace printing when excepti

[Tutor] Trapping HTTP Authentication Failure

2010-09-10 Thread Michael Powe
n? Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA "And I'd be a Libertarian, if they weren't all a bunch of tax-dodging professional whiners." -- Berke Breathed pgptBq2mUrmnN.pgp Description: PGP signature ___

Re: [Tutor] Trapping HTTP Authentication Failure

2010-09-11 Thread Michael Powe
connections, retries and fails each time. Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA I hate a fellow whom pride, or cowardice, or laziness drives into a corner, and who does nothing when he is there but sit and ; let him come out as I do, and . -- Sa

Re: [Tutor] Trapping HTTP Authentication Failure

2010-09-11 Thread Michael Powe
ption and exit the loop. > If that's what you're finding, perhaps the quickest way is to > subclass urllib2.HTTPBasicAuthHandler, and override the > http_error_auth_reqed method (essentially keeping it exactly the > same apart from the

Re: [Tutor] Trapping HTTP Authentication Failure

2010-09-11 Thread Michael Powe
e loop. Actually, there's a comment in the code about why it is set to 5 -- it's arbitrary, and allows for the Password Manager to prompt for credentials while not letting the request be reissued until 'recursion depth is exceeded.' I guess I'll have to go back to ground

Re: [Tutor] Trapping HTTP Authentication Failure

2010-09-11 Thread Michael Powe
On Sat, Sep 11, 2010 at 10:48:13AM -0400, Michael Powe wrote: > On Sat, Sep 11, 2010 at 02:25:24PM +0200, Evert Rol wrote: > > > > > >> I'm not sure what you're exactly doing here, or what you're getting, > > >> but I did get curious and d

[Tutor] SOLVED: Re: Trapping HTTP Authentication Failure

2010-09-11 Thread Michael Powe
-0400, Michael Powe wrote: > On Sat, Sep 11, 2010 at 10:48:13AM -0400, Michael Powe wrote: > > On Sat, Sep 11, 2010 at 02:25:24PM +0200, Evert Rol wrote: > > > > > > > > >> I'm not sure what you're exactly doing here, or what you're getting, &g

[Tutor] Documenting a Module

2010-09-13 Thread Michael Powe
f its functionality from the comments and doc strings; and I already wasted a considerable part of my Sunday afternoon trying to get along with Sphinx. I'm not talking about a huge Python project, nor am I likely to need that type of documentation tool in the near future. Thanks. mp -- Mi

Re: [Tutor] wierd replace problem

2010-09-13 Thread Michael Powe
'tis', 1), > > Why does the \ stays here. It should have gone as the test in the python > prompt says. > > Roelof > > > > ___ > Tutor maillist - Tutor@python.org > T

Re: [Tutor] Documenting a Module

2010-09-13 Thread Michael Powe
On Mon, Sep 13, 2010 at 12:03:27PM +0200, r...@schoenian-online.de wrote: > > Hi Michael, > ?? > I can recommend epydoc. You can find it here: > ??http://epydoc.sourceforge.net/??It's a nice tool and you should have no > problems > with the installation. > ?? >

Re: [Tutor] wierd replace problem

2010-09-13 Thread Michael Powe
replace(), it's there to escape the single quote, which is appearing in the middle of a single-quoted string. IF the double-quote had not also been there, python would have replaced the outer quotes with double quotes, as it does on my system before I got to thinking about that lonely double

Re: [Tutor] Documenting a Module

2010-09-13 Thread Michael Powe
On Mon, Sep 13, 2010 at 12:03:27PM +0200, r...@schoenian-online.de wrote: > > Hi Michael, > I can recommend epydoc. You can find it here: > ??http://epydoc.sourceforge.net/??It's a nice tool and you should > have no problems with the installation. > Ralf Hello, I just

[Tutor] A Plea for Sensible Quoting

2010-09-14 Thread Michael Powe
of the mail. A little formatting goes a long way. Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA Fun experiments: Get a can of shaving cream, throw it in a freezer for about a week. Then take it out, peel the metal off and put it where you want..

[Tutor] re.findall parentheses problem

2010-09-14 Thread Michael Scharf
Hi all, I have a regex that matches dates in various formats. I've tested the regex in a reliable testbed, and it seems to match what I want (dates in formats like "1 Jan 2010" and "January 1, 2010" and also "January 2008"). It's just that using re.findall with it is giving me weird output. I'm

Re: [Tutor] re.findall parentheses problem

2010-09-14 Thread Michael Scharf
Hi Evert, Thank you. I should have figured "groups" were the paren groups. I see it clearly now. And your solution will work for the larger thing I'm trying to do --- thanks. And yes: I know this matches some non-date-like dates, but the data is such that it should work out ok. Thanks again,

Re: [Tutor] re.findall parentheses problem

2010-09-14 Thread Michael Powe
On Tue, Sep 14, 2010 at 01:09:21PM -0400, Michael Scharf wrote: > Thank you. I should have figured "groups" were the paren groups. I see it > clearly now. And your solution will work for the larger thing I'm trying to > do --- thanks. > And yes: I know this match

[Tutor] Regex comments

2010-09-16 Thread Michael Powe
x27;t see one. The point would be that in my processing of the match, I could implement the comments as identifiers for the matched value. Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA "The most likely way for the world to be destroyed, most exper

Re: [Tutor] Regex comments

2010-09-16 Thread Michael Powe
On Thu, Sep 16, 2010 at 01:31:09PM +0200, Peter Otten wrote: > Michael Powe wrote: > > The re module includes the option to comment a regular expression with > > the syntax (?#comment). e.g. > > Is there a mechanism for extracting these values from the match, in > &g

[Tutor] "Overloading" methods

2010-09-16 Thread Michael Powe
to put all the parsing code in one method. My question is, is this a bad thing to do in python? Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA War is a sociological safety valve that cleverly diverts popular hatred for the ruling classes into a happy o

[Tutor] Comparing two lists

2010-09-16 Thread Michael Powe
xcrutiatingly painful 'for' loops. Looking for something more efficient and elegant. Thanks. mp -- Michael Powemich...@trollope.orgNaugatuck CT USA "The secret to strong security: less reliance on secrets." -- Whitfield Diffie pgpbadqbDTu

Re: [Tutor] Comparing two lists

2010-09-16 Thread Michael Powe
On Thu, Sep 16, 2010 at 12:59:08PM -0600, Vince Spicer wrote: > On Thu, Sep 16, 2010 at 12:49 PM, Vince Spicer wrote: > > On Thu, Sep 16, 2010 at 12:27 PM, Michael Powe wrote: > >> alist = ['label', 'guid'] > >> blist = ['column0label&#

Re: [Tutor] Comparing two lists

2010-09-16 Thread Michael Powe
On Thu, Sep 16, 2010 at 12:59:08PM -0600, Vince Spicer wrote: > On Thu, Sep 16, 2010 at 12:49 PM, Vince Spicer wrote: > > On Thu, Sep 16, 2010 at 12:27 PM, Michael Powe wrote: > >> I have two lists. > >> alist = ['label', 'guid'] &

[Tutor] Why are arguments sometimes on the left side?

2010-09-20 Thread Michael Scharf
Hi, Why is it list0.extend(list1) and not extend(list 0, list1) or stri0 = stri0.strip() and not stri0 = strip(stri0) Why have arguments on the left side at all, when usually the dot notation left to right implies a hierarchical relation: file.class or class.method

Re: [Tutor] Why are arguments sometimes on the left side?

2010-09-20 Thread Michael Scharf
Okay, we now have a dog named Fluffy, which is just one instance of > our dog class. With the way you would want to do things, I would have > to say > bark(f) > But what is bark? Where is it defined? You can see it is in the dog > class, but Python cannot; you passed a dog instance to bark(), but >

[Tutor] Grabbing Info from Text files?

2010-11-12 Thread Michael Stover
Hello, I have been getting lost when trying to find the needed information on how to grab information from text files to be used in a python script I am working on. Essentially the script is calling upon other programs to grab specific information about files and putting that information into ba

[Tutor] Grabbing Information from txt files

2010-11-12 Thread Michael Stover
My apologies for my last email, admittedly I was more tired that I thought as after re-reading it and the emails coming in, I found that I did not provided "proper" information. 1. I have a script that is detecting multiple various bits of information of a video file using MediaInfo and putting

Re: [Tutor] (no subject)

2009-03-17 Thread Michael Connors
_________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > -- Michael Connors ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Michael Farnham
On Fri, 2009-03-20 at 04:35 -0700, Wayne Watson wrote: > Good. Thanks. > > Here's my code. > == > # Executing a Linux program under Win XP > from subprocess import call > myProg = call(["C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]) If I understand your question - A C program which

[Tutor] Parsing Question

2009-05-09 Thread Michael Morrissey
Forgive me if I'm asking something stupid, but I'm not sure how to do this (there are so many options in Python, I'm overwhelmed and confused). I have a text file that looks like this: 1 the 126 name 2 of 127 very 3 to 128 through 4 and 129 just 5 a 130 form 6 in 131 much 7 is 132 great etc... Eac

Re: [Tutor] Best Python Editor

2009-06-14 Thread Michael Powe
On Sun, Jun 14, 2009 at 12:53:19PM -0700, Emile van Sebille wrote: > On 6/14/2009 8:04 AM Alan Gauld said... > >"Tom Green" wrote > >>Since VIM seems to be the editor of choice and I have been programming in > >>Python for many years using Pyscripter and Eclipse I was wondering how I > >>could t

Re: [Tutor] Best Python Editor

2009-06-15 Thread Michael Connors
Back when I used Windows I used this: http://www.crimsoneditor.com/ I think its not being developed anymore, but it is a great editor/IDE that supports many languages. -- Michael Connors ___ Tutor maillist - Tutor@python.org http://mail.python.org

Re: [Tutor] Best Python Editor

2009-06-15 Thread Michael Powe
On Mon, Jun 15, 2009 at 06:30:50AM -0700, johnf wrote: > On Sunday 14 June 2009 07:31:53 pm Michael Powe wrote: > > However, I will say that while following this thread, it occurred to > > me that the one feature that VS and even the VBA editor in MS Office > > has, is the ab

Re: [Tutor] Best Python Editor

2009-06-15 Thread Michael Powe
On Mon, Jun 15, 2009 at 06:34:04AM -0700, Emile van Sebille wrote: > On 6/15/2009 2:49 AM Tom Green said... > >Yes, vim or any text editor is suitable for Python, but I > >prefer having a nice GUI interface while coding. I mean the automobile > >replaced the horse and buggy, while they both get

[Tutor] Generating Deck Combinations

2009-06-20 Thread Michael Morrissey
I need to generate all possible deck combinations given two different lists as input. The Input: List 1 has Card names listed inside it. List 2 has Maximum Quantities for each Card name. For example: List1[0] would be: "Aether Vial" List2[0] would be: "4" List1[1] would be: "Mountain" List2[1]

[Tutor] Michael Knowles/NONFS/USDAFS is out of the office.

2009-07-22 Thread Michael Knowles
I will be out of the office starting 07/22/2009 and will not return until 07/27/2009. I am out of the office and will respond to your message when I return on Monday, 30 Sep. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listi

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Michael Connors
my friend and he > said that he has the same problem...anybody?...help??? > > It closes because it is finished. If you want to see the result, you could either: - Place another input("") after the print statement. - Run the program from the c

[Tutor] running python program on Linux Virtual Server - Plesk?

2009-09-02 Thread Michael Yang
Hi Everyone, I'm new to programming and to python. I have a program I want to run on my Media Temple Virtual Server (dv) - Linux. which has the latest Plesk 9 virtuozzo installed. Ultimately I want it to run the program (main.py) on a scheduled basis. How do I do this? Thanks! -Mike ___

Re: [Tutor] Pyduino

2009-09-08 Thread Michael Connors
cted arduino would be written in Python. -- Michael Connors Leiden The Netherlands ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Invitation to connect on LinkedIn

2009-09-15 Thread Michael Connors
Gmail adds everyone you mail to your address book, and sites like LinkedIn ask for your email account credentials to search for contacts from your address book. I think this could happen to anyone who is unfamiliar with either service. Michael 2009/9/15 Kent Johnson > I'm going to be ch

[Tutor] Example of use of (?P) and (?P=name) in Python regular expressions?

2009-11-28 Thread Michael Hannon
Greetings. While looking into the use of regular expressions in Python, I saw that it's possible to name match groups using: (?P...) and then refer to them using: (?P=name) I was able to get this to work in the following, nonsensical, example: >>> x = 'Free Fri Fro From' >>>

Re: [Tutor] Example of use of (?P) and (?P=name) in Python regular expressions?

2009-12-03 Thread Michael Hannon
t place. This is as opposed to the thing I was trying to do, which was to use the "P=" syntax in a substitution. -- Mike - Original Message From: Michael Hannon To: tutor@python.org Sent: Sat, November 28, 2009 3:15:36 PM Subject: [Tutor] Example of use of (?P) and (?P=name)

[Tutor] Generating Unique Permutations

2009-12-17 Thread Michael Morrissey
ed child!). Oh, and thanks for this mailing/reading list! I spend countless hours browsing and reading other people's code. It is a lot of fun =). Sincerely, Michael ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Computer Basics

2009-12-30 Thread Michael Sprayberry
verse Engineers". Michael ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Example of use of (?P) and (?P=name) in Python regular expressions?

2010-01-06 Thread Michael Fourman
bb dd ff gg mm nn pp rr tt re.sub("^(?P.*?[aeiouy].*?(?P[bdfgmnprt]?))(?P=dd)$", "\g", word) implements this rule. Best, Michael Michael Hannon-2 wrote: > > Greetings. While looking into the use of regular expressions in Python, I > saw that it&

Re: [Tutor] Tix NoteBook programming problem

2004-12-21 Thread Michael Lange
try to pack() the pages with > hd.pack() > gf.pack() tix doesnt know what to do; by the way, instead of writing > nb.add('hd',label="hard disk",underline=0) > hd = nb.subwidget('hd') you can simply do: hd = nb.add('hd',

[Tutor] Re: Tix Select programming problem

2004-12-22 Thread Michael Lange
27;value') root = Tix.Tk() fruits=Tix.Select(root,label="Fruits:", orientation='horizontal',command=prtS) fruits.add('orange',text="Orange",width=6) fruits.add('lemon',text="Lemon",width=6) fruits.add('apple',text="Apple",width=6) fruits.pack() sel=Tix.Control(root, label="X Coordinates", max=10, min=3, integer=True,command=prtC) sel.pack() root.mainloop() Hope this helped Michael ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] cgi.FieldStorage and dictionary.get(' ')

2004-12-30 Thread Patric Michael
> Hi, > > I've passed this through the interperter line-by-line, yet still can't > get it to work right. > > The first time the cgi driver script initiates it runs the login > function which renders a zpt. Upon submission of their vitals, the I'm not sure what a zpt is, but it sounds like the

Re: [Tutor] O.T.

2004-12-30 Thread Patric Michael
Hi Jacob... > 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. I figure since I bit the bullet and actually posted a reply, I best answer this as well in the faint hope of w

Re: [Tutor] O.T.

2004-12-31 Thread Michael Lange
k had a sticker on it that said something like "No programming knowledge required!" which looked very promising to me back then. A happy new year to all of you Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] cgi.FieldStorage and dictionary.get(' ')

2004-12-31 Thread Patric Michael
Forwarded to the list... > On Thu, 30 Dec 2004 22:58:14 -0800, Patric Michael <[EMAIL PROTECTED]> > wrote: > > First off, make sure that you have the "Content-Type: > text/html\n\n" > line print before anything else whenever you send > output to the web

Re: [Tutor] doctest

2005-01-01 Thread Patric Michael
> Also, anything I can do... Presently, since I'm running windows xp, I > would have to hunt for the command prompt and type in the command Click Start, click Run, type CMD, press Enter. Voila! :) Patric > > '"C:\python24\python.exe" "C:\documents and > settings\jacob\desktop\working python

[Tutor] A not-so-basic question...

2005-01-02 Thread Patric Michael
Hi folks... I was thinking about this the other day while prepping to write up another CGI thing. It occurred to me to wonder how other folks prepare an app, script, whatever. So the question is, and I am not looking for a "right answer" here. (I doubt ther eis one, to be honest.) How do you

Re: [Tutor] dumping .pck files

2005-01-02 Thread Patric Michael
> I want to explore some mailman config files, e.g. > config.pck. Some quick searches informed me that these > contain pickled configuration info. > > My first naive attempt to dump what was in them failed: > > >>> import pickle > >>> pickle.load(open("config.pck")) > traceback > ImportError

[Tutor] here documents

2005-01-03 Thread Michael Powe
Hello, In perl, I create variables of fairly involved text using here documents. For example, $msg = <<"EOF"; a bunch of text here. ... EOF Is there an equivalent method in python? I usually use this method when creating help messages for scripts -- put all the text into a variable and the

Re: [Tutor] here documents

2005-01-03 Thread Michael Powe
On Mon, Jan 03, 2005 at 11:54:06PM -, Alan Gauld wrote: > There was a detailed thread on this recently either here > or on usenet group comp.lang.python... I checked the archives for this list but didn't see anything. I'll try the ng. Thanks. > The bottom line was to use string formatting

Re: [Tutor] Re: here documents

2005-01-03 Thread Michael Powe
On Mon, Jan 03, 2005 at 10:04:18PM -0200, Jorge Luiz Godoy Filho wrote: > Alan Gauld, Segunda 03 Janeiro 2005 21:56, wrote: > > > Oops, those should have been () not {} > > I always do the same mistake ;-) Using "{}" seems more intuitive to me. perhaps because of ${var} shell syntax? ;-) mp

Re: [Tutor] A not-so-basic question...

2005-01-03 Thread Patric Michael
Hi Alan... > Thats a great question, and I hope we get a few responses. Me too! Thank you for taking the time to reply. Your response is far more complex than my original example, but its very illustrative. Not so much in what to do, but how to think about doing it, and that was my goal.

Re: [Tutor] A not-so-basic question...

2005-01-03 Thread Patric Michael
abstracting, right? > > Whenever you are tempted to copy and paste code, look for a way to > abstract the code into a function or class so the copying is not > needed. > > Whenever you are tempted to copy and paste data, look for a way to > centralize the data so all clients

Re: [Tutor] How to run a script file

2005-01-04 Thread Patric Michael
Hi Bernard... The most basic form is to type "python" followed by the script you want to run. If your script is not in the system path, you'll either need to cd to the directory, or give a full pathname: (the pythonpath doesn't come into play until the interperter is running. python /usr/loca

[Tutor] regex problem

2005-01-04 Thread Michael Powe
Hello, I'm having erratic results with a regex. I'm hoping someone can pinpoint the problem. This function removes HTML formatting codes from a text email that is poorly exported -- it is supposed to be a text version of an HTML mailing, but it's basically just a text version of the HTML page.

Re: [Tutor] How to run a script file

2005-01-04 Thread Patric Michael
m assuming your python is in /usr/bin. And that is a hash mark > > followed by an exclamation point. This is called "hash bang" in > > uningo. > > > > John Purser > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED

Re: [Tutor] regex problem

2005-01-05 Thread Michael Powe
On Tue, Jan 04, 2005 at 09:15:46PM -0800, Danny Yoo wrote: > > > On Tue, 4 Jan 2005, Michael Powe wrote: > > > def parseFile(inFile) : > > import re > > bSpace = re.compile("^ ") > > multiSpace = re.compile(r"\s\s+&

Re: [Tutor] regex problem

2005-01-05 Thread Michael Powe
On Wed, Jan 05, 2005 at 07:37:58AM -, Alan Gauld wrote: > > This function removes HTML formatting codes from a text email > Using regex to remove HTML is usually the wrong approach unless > you can guarantee the format of the HTML in advance. The > HTMLparser is usually better and simpler.

Re: [Tutor] regex problem

2005-01-05 Thread Michael Powe
On Wed, Jan 05, 2005 at 06:33:32AM -0500, Kent Johnson wrote: > If you search comp.lang.python for 'convert html text', the top four > results all have solutions for this problem including a reference to this > cookbook recipe: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52297 > >

Re: [Tutor] Something is wrong in file input output functions.

2005-01-10 Thread Michael Powe
On Mon, Jan 10, 2005 at 12:15:18PM -0800, kumar s wrote: > Dear group, > I have written a small piece of code that takes a file > and selects the columns that I am interested in and > checks the value of the column on a condition (value > that eqauls 25) and then write it the to another file. > >

Re: [Tutor] CGI problem

2005-01-10 Thread Patric Michael
Hi David... You need to explicitly name your form element to "inputkey" to make your current code work correctly. ( Based on what you have shown below.) Or, to make the code correct, change "inputkey" to "language". Remember that the name in each form element becomes the key in the key/value

Re: [Tutor] hi

2005-01-11 Thread Michael Janssen
On Tue, 11 Jan 2005 11:39:36 +0530, Gopinath V, ASDC Chennai <[EMAIL PROTECTED]> wrote: > Can any1 please tell me how do i open an editor in python running in > linux os can be as easy as: os.system("editor-cmd") regards Michael

Re: [Tutor] reinitializing namespace

2005-01-13 Thread Michael Janssen
python manpage. On Windows, I don't know). You can also define useful functions or variables in your python startfile. This way, you're really shure that all ugly variables are away without del'iting anything important. regards Michael

Re: [Tutor] reinitializing namespace

2005-01-14 Thread Michael Janssen
lems is to use functions and classes which comes all with their own namespaces. Perhaps you should post code, you find problematic, and we might find strategies to restructure it, so that namespace problems are claryfied. regards Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tix and Table printing

2005-01-14 Thread Michael Lange
ng on it: http://wiki.tcl.tk/12753 Regards Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

  1   2   3   4   5   6   7   8   9   >