I am writing a python script that copies some data to an external drive attached to Ubuntu host. I do not want to pass the device file of the drive to the python script. But I can set the Volume label of the drive and export it as an environment variable in the linux shell.
My question is how to I access this shell environment variable in my python script ?
Thanks!
The
osmodule provides access to environmental variables. Suppose that you have exported$VOL="/BLAH". Then, in Python: