Partitioning and formatting a USB drive using Python 2.7 -


is there way partition usb drive multiple times , format each partition different type using python 2.7.x?

edit: using windows 7 operating system

as said in comments can use python subprocess windows command line tools. formatting can done using format

( running windows shell commands python <- can use diskpart )

for partitioning can use diskpart tool in combination batch file. disadvantage have save batch file on computer

https://social.technet.microsoft.com/forums/windows/en-us/c69d3bb5-328c-43e3-9239-837171e42b88/diskpart-batch-file?forum=w7itproinstall

with following can invoke batch file python

from subprocess import popen p = popen("batch.bat", cwd=r"c:\path\to\batchfolder") stdout, stderr = p.communicate() 

run .bat file using python code


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -