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

Alan Gauld alan.gauld at btinternet.com
Thu Feb 15 18:39:00 CET 2007

"Mark Bystry" <mabystry at verizon.net> wrote

> 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 

You might want to look at my Using the OS topic in my tutorial
It covers basic file manipulation and starting external programs 

> that they can be run on either my windows or linux workstations.

That might be harder than you think due to differences in paths etc.
Also some external commands will be different, and ones with the 
same name take different arguments/orders or args etc

If you write them in pure Python you should be OK but if you 
just run sequences of OS commands (typical of batch files) 
then you might run into problems.

> The first things that I want to learn is how to do basic stuff 
> like copying, moving, and deleting files around from folder to 
> folder. 

Try my tutor topic.

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list