Re: [Tutor] Releasing a File for Access

2008-09-12 Thread Alan Gauld
"Wayne Watson" <[EMAIL PROTECTED]> wrote I need to use something like sys.exit(). sys.exit won't change the file permissions etc. It simply sets the exit status of the program. I suspect the problem is that you still have IDLE running. Have you tried testing the program outside IDLE? You mi

Re: [Tutor] Releasing a File for Access

2008-09-12 Thread Tim Golden
Wayne Watson wrote: Enclosed is a segment of a program which copies a txt file, but replaces the first line with a new one. The new one has a suffix of tmp. After it executed the code and exited the program normally (running out of code), I couldn't access the new tmp file. It was listed by Win

Re: [Tutor] How to create array of variants?

2008-09-12 Thread Krasyn
Alan Gauld wrote: > > > "Krasyn" <[EMAIL PROTECTED]> wrote > >>> >>> I'm trying to translate the following VB code into Python and not >>> sure how >>> to create an array of variants. > > All variables in Python are effectively variants - variables that can > store any type. So an array of v

[Tutor] No Blank Separator between Date and Time Valid?

2008-09-12 Thread Wayne Watson
Title: Signature.html (I'm reposting this. I do not see the original as posted yet--nearly 18 hours ago.) This program segment allows an invalid date to go undetected. See below. from datetime import datetime import time def set_time_stamp(d1):     # /mm/dd hh:mm:ss in, vmmdd_hhmms

Re: [Tutor] Releasing a File for Access

2008-09-12 Thread Wayne Watson
Title: Signature.html Thanks very much for the tips. Things to look into yet. At this point, I'm not sure what ufilenames are. Linux related? My first cut at this is to make the program available to Win users. I'm not sure how many Linux and Apple users we have in our widely dispersed group o

Re: [Tutor] Releasing a File for Access

2008-09-12 Thread Wayne Watson
Title: Signature.html I'm using 2.4 for Win. I'll look into the tempfile module. Tim Golden wrote: Wayne Watson wrote: Enclosed is a segment of a program which copies a txt file, but replaces the first line with a new one. The new one has a suffix of tmp. After it executed the code and exit

[Tutor] How Fix Misdirected Posts to Tutor

2008-09-12 Thread Wayne Watson
Title: Signature.html My Reply posts to the list only show the poster, and not the list, tutor@python.org. If I don't replace the person's e-mail address with tutor@python.org, then my post never goes to the list. I have no idea why this is happening, but it makes matters awkward. Maybe the sol

Re: [Tutor] Releasing a File for Access

2008-09-12 Thread Wayne Watson
Title: Signature.html txt files only contain text. The mate to the txt file is a dat file, which contains video. I'm only changing its name to match that of its corresponding txt file. The txt file has a time stamp in it. That's why I'm changing the first line to match the new time stamp. Both

Re: [Tutor] How Fix Misdirected Posts to Tutor

2008-09-12 Thread Kent Johnson
On Fri, Sep 12, 2008 at 7:39 AM, Wayne Watson <[EMAIL PROTECTED]> wrote: > My Reply posts to the list only show the poster, and not the list, Yes, that is the way the list is configured. Use Reply All. Kent ___ Tutor maillist - Tutor@python.org http:/

Re: [Tutor] No Blank Separator between Date and Time Valid?

2008-09-12 Thread Wayne Watson
Title: Signature.html Ah, thanks. I think I figured it out. It's my wonderful Yahoo/Spamguard. It's  probably holding the messages, including mine(!), on the server in the spam folder. In the meantime I'll look at the URL. Kent Johnson wrote: On Fri, Sep 12, 2008 at 7:28 AM, Wayne Watson <

Re: [Tutor] How Fix Misdirected Posts to Tutor

2008-09-12 Thread Wayne Watson
Title: Signature.html Thanks. That seems to work. However, I thought I had experimented with it and found otherwise.  Now to remember to do that. It's the only list I have that requires Reply All. It's certainly working now! Kent Johnson wrote: On Fri, Sep 12, 2008 at 7:39 AM, Wayne Watson

[Tutor] SBC/Yahoo and Spamguard--Stuck in Limbo

2008-09-12 Thread Wayne Watson
Title: Signature.html I see a number of tutor posts are sometimes not getting to me, including my own, because my SBC Global use of Spamguard holds them in my Spam folder. By and large they make it they make it through. Does anyone know how to tell Spamguard to let all main with Tutor in the ti

Re: [Tutor] How Fix Misdirected Posts to Tutor

2008-09-12 Thread Tim Golden
Wayne Watson wrote: Thanks. That seems to work. However, I thought I had experimented with it and found otherwise. Now to remember to do that. It's the only list I have that requires Reply All. It's certainly working now! There has been much debate on this in the past. (About every six months

Re: [Tutor] No Blank Separator between Date and Time Valid?

2008-09-12 Thread Wayne Watson
Title: Signature.html Thanks. Yes, 2.4 for Win. Now to find out if the fellow who wrote the s/w package I'm writing a utility for can move his s/w to 2.4. Martin Walsh wrote: Wayne Watson wrote: This program segment allows an invalid date to go undetected. See below. def s

Re: [Tutor] How Fix Misdirected Posts to Tutor

2008-09-12 Thread W W
On Fri, Sep 12, 2008 at 10:10 AM, Tim Golden <[EMAIL PROTECTED]> wrote: > Wayne Watson wrote: > >> Thanks. That seems to work. However, I thought I had experimented with it >> and found otherwise. Now to remember to do that. It's the only list I have >> that requires Reply All. It's certainly wor

Re: [Tutor] SBC/Yahoo and Spamguard--Stuck in Limbo

2008-09-12 Thread W W
You may be able to create a filter. If you're checking from a different account you should at least be able to create one to forward to that account. -Wayne On Fri, Sep 12, 2008 at 10:08 AM, Wayne Watson <[EMAIL PROTECTED] > wrote: > I see a number of tutor posts are sometimes not getting to me

[Tutor] Hey Variables

2008-09-12 Thread Jeremiah Stack
I was wondering If you could help me out. I am trying to set a variable for the number of variables. ? Any help would be awesome ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] No Blank Separator between Date and Time Valid?

2008-09-12 Thread Wayne Watson
Do you know of a work around? I can probably provide a simple one by looking for a blank between the time and date. Wayne Watson wrote: Thanks. Yes, 2.4 for Win. Now to find out if the fellow who wrote the s/w package I'm writing a utility for can move his s/w to 2.4. Martin Walsh

Re: [Tutor] Hey Variables

2008-09-12 Thread Bob Gailer
On Fri, Sep 12, 2008 at 1:51 PM, Jeremiah Stack <[EMAIL PROTECTED]> wrote: > I was wondering If you could help me out. > > I am trying to set a variable for the number of variables. ? > > Any help would be awesome > More details would be wonderful. I have no idea of what you want! -- Bob Gail

[Tutor] Hay Variables

2008-09-12 Thread Jeremiah Stack
Sorry, Okay, Say i want to calculate the average for Math = 91 Science = 97 and English = 96, I Declare a variable = Number of classes to divide by. So instead say later I want to add another class. Instead of adding a variable And changing the (Number of Classes = 3) variable. I would like t

Re: [Tutor] Hay Variables

2008-09-12 Thread christopher . henk
I would use a list of grades and the length of the list. Chris "Jeremiah Stack" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/12/2008 02:08 PM To "Python Tutor" cc Subject [Tutor] Hay Variables Sorry, Okay, Say i want to calculate the average for Math = 91 Science = 97 and Engl

Re: [Tutor] No Blank Separator between Date and Time Valid?

2008-09-12 Thread Kent Johnson
On Fri, Sep 12, 2008 at 11:23 AM, Wayne Watson <[EMAIL PROTECTED]> wrote: > Do you know of a work around? You could use a regular expression match to check the format. Something like import re dateRe = re.compile(r'\d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d') if dateRe.match(d1): # handle correctly forma

Re: [Tutor] Hay Variables

2008-09-12 Thread Kent Johnson
On Fri, Sep 12, 2008 at 2:13 PM, <[EMAIL PROTECTED]> wrote: > > I would use a list of grades and the length of the list. or perhaps a list of (class name, grade) pairs. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

[Tutor] PySQLite vs SQLalchemy

2008-09-12 Thread Patrick
I guess I am a Python framework burnout. I have tried so many of them over the past two months, they are just not right for me right now. I am trying to put together a program to generate my website offline via the MVC paradigm, all I need to deal with is lots of static data. I like SQLite, it's

[Tutor] Python class at Foothill College

2008-09-12 Thread Elaine
If you would like to learn Python, Foothill College is offering a course in Palo Alto starting Wednesday evening, 24 Sept, at 6 pm. This 12-week course is designed for students who are already familiar with another structured programming language. Here is more detailed information: CIS 68K "IN

Re: [Tutor] How to create array of variants?

2008-09-12 Thread Alan Gauld
"Krasyn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] # -*- coding:UTF-8 -*- from comtypes.client import * from array import array Any reason why you are using array here? Why not just a Python list? acad = GetActiveObject("AutoCAD.Application") dwg = acad.ActiveDocument mspa

Re: [Tutor] PySQLite vs SQLalchemy

2008-09-12 Thread Alan Gauld
"Patrick" <[EMAIL PROTECTED]> wrote I like SQLite, it's really easy to work with. I would like to model my database in it natively but I am having quite a bit of trouble mapping the variables in the SQLIte database via PySQLite. It appears that this sort of thing is SQLalchemy's strong suit. H

Re: [Tutor] PySQLite vs SQLalchemy

2008-09-12 Thread johnf
On Friday 12 September 2008 03:30:13 pm Patrick wrote: > I guess I am a Python framework burnout. I have tried so many of them > over the past two months, they are just not right for me right now. I am > trying to put together a program to generate my website offline via the > MVC paradigm, all I n

Re: [Tutor] PySQLite vs SQLalchemy

2008-09-12 Thread Jeff Younker
On Sep 12, 2008, at 3:30 PM, Patrick wrote: I like SQLite, it's really easy to work with. I would like to model my database in it natively but I am having quite a bit of trouble mapping the variables in the SQLIte database via PySQLite. It appears that this sort of thing is SQLalchemy's strong

[Tutor] Listing imported modules

2008-09-12 Thread Tim Johnson
If I execute the following code: imported = sys.modules.keys() print imported Do I indeed get a list of _all_ modules imported by this module? If so, then could anyone offer suggestion on how to "parse" the non-standard modules from this list. I.E. modules _not_ included in the standard python dis

Re: [Tutor] Python class at Foothill College

2008-09-12 Thread Wayne Watson
Title: Signature.html Interesting. I've been quite surprised that some community college in the Bay Area hasn't offered Python recently. However, I'm long gone from there. Sacramento, Davis, Rocklin, anyone? Haven't even seen any in UC extension classes. I'm going to be near there early next we

Re: [Tutor] Python class at Foothill College

2008-09-12 Thread wesley chun
On Fri, Sep 12, 2008 at 5:59 PM, Wayne Watson <[EMAIL PROTECTED]> wrote: > Interesting. I've been quite surprised that some community college in the > Bay Area hasn't offered Python recently. However, I'm long gone from there. > Sacramento, Davis, Rocklin, anyone? Haven't even seen any in UC extens

Re: [Tutor] Python class at Foothill College

2008-09-12 Thread johnf
On Friday 12 September 2008 06:34:53 pm wesley chun wrote: > On Fri, Sep 12, 2008 at 5:59 PM, Wayne Watson > > <[EMAIL PROTECTED]> wrote: > > Interesting. I've been quite surprised that some community college in the > > Bay Area hasn't offered Python recently. However, I'm long gone from > > there

[Tutor] Printing Scripts with color/good formatting

2008-09-12 Thread Mike Meisner
I've been working with Python on two different machines: under Windows XP and under 64-bit Vista. In the XP version, the Python 32-bit editor prints my scripts using the color coding in the editor and a comfortable to read font. Under Vista 64-bit, only the IDLE environment is available which