IronPython - how to rename a folder name

for example: how to rename C: \ Program Files \ Music_Files to C: \ Program Files \ MusicFiles

+4
source share
4 answers

And if you want to do it in python way:

import os os.rename("c:\\Program Files\\Music_Files", "c:\\Program Files\\MusicFiles") 
+7
source

Why not use .Net libraries since IronPython can access them?

There should be a Move method in System.IO.Directory that you can use.

0
source

You can just use

 os.rename(old_filename, new_filename) 

Or you can use this method from the .net library

 System.IO.File.Move(@old_filename, @new_filename); 

Check out this Ironpython guide for android https://play.google.com/store/apps/details?id=com.gavin.gbook

0
source

This will work:

os.rename ("C: // your_directory / old_folder_name", "C: // your_directory / new_folder_name")

0
source

All Articles