Python is cross-platform and the script doesn't use any platform-specific code so it should work on all platforms. Behind the scenes python does the heavy lifting to translate the script to platform-specific code.
Thanks for script,
Is it OS specific?
Are there pre-requisites? Install python etc?
Thanks
JamesOn Sat, Nov 21, 2009 at 10:20 AM, saidimu apale <saidimu@gmail.com> wrote:
_______________________________________________I needed to quickly and painlessly rename some files by replacing spaces with underscores (_). Here's a quick and dirty python script that did it for me. I ran it from the python interpreter command-line (I didn't save the script to a file... lazy).----- begin script-----import osfor file in os.listdir(os.getcwd()):newname = "_".join(file.split())os.rename(file, newname)----- end script------It's a quick and dirty script so there's no error-handling of *any* sort. But that's trivial to add if you needed it.
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
--
Best Regards
James Wachira
Nairobi .ke
| twitter: jwaciira | yahoo: jwaciira | gtalk: jwaciira
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general