I work from two different computers with the same script. Writing files to my cloud storage \has a slightly different path on both computers. I thought I could use a try-except to simply see which path works (depending on which computer I am using).
I thought I could solve this by doing the following:
import os
try:
os.chdir('C://Users//comp1//Cloud//Data')
except:
os.chdir('C://Users//comp2//Cloud//Data')
However if I run it, I still get:
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C://Users//comp1//Cloud//Data')
Could someone tell me what I am doing wrong here, or whether I should perhaps use a different solution.