Is there a way to partition a USB drive multiple times and format each partition as a different type using Python 2.7.x?
Edit: Using Windows 7 as the operating system
Is there a way to partition a USB drive multiple times and format each partition as a different type using Python 2.7.x?
Edit: Using Windows 7 as the operating system
as said in the comments you can use python subprocess
with windows command line tools. formatting can be done using format
( Running windows shell commands with python <- you can also use diskpart
with this )
for partitioning you can use the diskpart
tool in combination with a batch file. the disadvantage is that you have to save the batch file on the computer
with the following you can invoke a batch file from python
from subprocess import Popen
p = Popen("batch.bat", cwd=r"C:\Path\to\batchfolder")
stdout, stderr = p.communicate()