Question

Is there a way to express a specific drive in both windows/linux? Windows usually uses"D:\etc" and Ubuntu/etc uses something like "/media/user/drive_name". Is there a awy to just refer to something like "/dev/sdc1" which both Windows and Ubuntu will recognize as the same drive?

I am trying to put this in a config file for a python program which can be run on an external data drive from an internal drive containing multiple OSs. The program has to refer to a separate external data drive, but I would like the program to work the same way for all of the OSs.

Is this possible?

No correct solution

OTHER TIPS

Either you just need to account for your OS type in each machines properties file or test for the OS in the code and act accordingly.

import os
if os.name == "windows"
    path = "D:/windows/path"
elif
    path = "/unix/path"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top