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 of potential users. From what I know, it's highly loaded with Win users. There are probably only 50 users total.  In the case of Apple, I would guess the file structure is like Linux.

I've been thinking, in the back of my mind, about file protection, but very likely am safe.  The main software program is pretty straightforward, and the users just interested in the data in the files, mainly the video portion. I doubt any, if not all, have no clue about file protection. However, it's still something to consider. I'm assuming there is some mechanism that will allow me to determine if a file is locked, or that I can break the lock at some level.

Alan Gauld wrote:
"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 might find it works OK there.

Also have you checked your file permissions? You may need to change the default settings using the os module.

However, I'm in development mode right now with IDLE, and there's a small penalty for using it with IDLE.

The "penalty" is actually a benefit since having to restart IDLE and reload your working files each time you run your code is much less convenient than clicking a dialog button! :-)

Although a user might try to rename  500 files at a single shot.

I assume you are intending enhancing the program to accept multiple ufilenames?

     def modify_txt_file(old_fname, new_event_date):
         old_prefix = old_fname[0:19]

You might want to use os.basename() here as a more reliable way of extracting the extension.

         input_file=open(old_fname,'r')
         output_file=open(old_prefix+'.tmp','w')

         print "modified txt file with event info"
         # now copy tmp back to ...

And you might want to use os.remove() and os.rename() to do the final copy of the tmp file back to the original.

Just some thoughts


--
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet
            
          "If voting made any difference they wouldn't let us do it." 
                        -- Mark Twain
            
                    Web Page: <www.speckledwithstars.net/>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to