[Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Mark Bystry
Hello, This is my first post. I have just begun to code with python. My goal is to convert about a dozen or so DOS/Windows batch scripts(.bat) and vbscripts(.vbs) that I use on a day-to-day basis to python so that they can be run on either my windows or linux workstations. The first things th

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Mark Bystry
Wow! Got a lot of responses to my post. Thanks everyone. After reading all of them, I may have to learn by example after all. I'm going to try Alan Gauld's tutorials first. Mark Alan Gauld wrote the following on 2/15/2007 12:39 PM: > "Mark Bystry" <[EMAIL PROTECTED]&

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Mark Bystry
You guys are great! I'm not sure how I found this mailing list but I'm glad that I subscribed. Mark Rob Andrews wrote the following on 2/15/2007 1:23 PM: > We're good like that. heh > > On 2/15/07, Mark Bystry <[EMAIL PROTECTED]> wrote: >> Wow! Got a

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Mark Bystry
Well, immediately I am having problems. Be patient with me. This what I have... copy_file.py import os import shutil as sh sh.copy('C:\testing_it.txt', 'D:\') raw_input("Done!") ...and it's not working.

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Mark Bystry
es /. So you can replace 'c:\' > with your choice of the following: > > 'c:/' (replacing \ with /) > r'c:\' (the 'r' before the string tells python it's a raw string) > 'c:\\' (the first \ telling python to take the sec

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Mark Bystry
Ahh. Great tip Eric. Thank-you. Mark Eric Walstad wrote the following on 2/15/2007 2:58 PM: > Hey Mark, > Mark Bystry wrote: >> sh.copy('C:\testing_it.txt', 'D:\') > > Also have a look at the os.path module. Because you want these scripts > to work

Re: [Tutor] New Tutor topic(almost)

2007-02-16 Thread Mark Bystry
Well, I'm new here and for the most I haven't got a clue as to what I'm doing, however, I thought your website was a jewel. Most of it was over my head but sometime in the future I'm sure it will become a valuable resource for me. (btw, I'm heading to Borders tonight with my checkbook. Hoping

Re: [Tutor] New Tutor topic(almost)

2007-02-16 Thread Mark Bystry
I'll look for it. Perhaps I should pick up one of the "Dummies" book too. Mark Kent Johnson wrote the following on 2/16/2007 8:35 AM: > Mark Bystry wrote: >> Well, I'm new here and for the most I haven't got a clue as to what I'm >> doing, however,

[Tutor] Add metadata to a dir of files.

2007-02-22 Thread Mark Bystry
Ok. I'm not sure what programming language I want to try this in...since I'm not sure how to write this in any language (thought I'd give python a try. Here's my problem: I have a directory full of about 2,000 pdf files. I want to be able to add the same comment to the "Category" field of each

Re: [Tutor] Add metadata to a dir of files.

2007-02-22 Thread Mark Bystry
Actually no. I want to change the Windows metadata. This is the same metadata that is on all files. It isn't PDF specific. (I wonder if Linux is the same) Basically, I can select 100's of file in a dir, right-click, properties, summary, and add something to the Category field. This obviously a

Re: [Tutor] Add metadata to a dir of files.

2007-02-22 Thread Mark Bystry
help of dsofile.dll the above reads the "Category" attribute of test.txt. Mark Bystry wrote the following on 2/22/2007 1:01 PM: > Actually no. I want to change the Windows metadata. This is the same metadata > that is on all files. > It isn't PDF specific. (I wonder if Lin

Re: [Tutor] Add metadata to a dir of files.

2007-02-22 Thread Mark Bystry
getting even closer. figure out how to write to a file but still in vbscript. dsofile_write.vbs code: Set objFile = CreateObject("DSOFile.OleDocumentProperties") objFile.Open("D:\test.txt") objFile.SummaryProperties.Category = "CAT54" objFile.Save Mark Mark Byst

Re: [Tutor] Add metadata to a dir of files.

2007-02-22 Thread Mark Bystry
1), None) code: import win32com.client props = win32com.client.Dispatch ("DSOFile.OleDocumentProperties") props.Open (r"C:\test.txt") props.SummaryProperties.Category = "CAT69" props.Save () Maybe this is the same com error that you're getting Mark Tim Golde

Re: [Tutor] Add metadata to a dir of files.

2007-02-23 Thread Mark Bystry
Ok, Tim. I believe you're right. If the vbscript is working then I'll continue to use it and expand on it. I'll only be using this on my WinXP box anyway. I just didn't want to offend anyone in this mailing list with vbscript code. I'm really trying to learn some python basics but I'm no progr