Posts: 4,653
Threads: 1,496
Joined: Sep 2016
i see many examples where / filename separators are used for Windows. but a user of my script on Windows might type in \ as the file separator. should i replace all \ characters with /? what if a file name on Windows has a / in its name much like Linux can have \ in a file name?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
Oct-01-2019, 04:53 AM
(This post was last modified: Oct-01-2019, 04:59 AM by Skaperen.)
open(fn,'w')
should fail with an invalid filename, correct? i would expect
open(fn,'r')
to fail, somehow, too.
one of the disadvantages of not being a windows user ... i don't end up knowing these things.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
i didn't know / was invalid in Windows. that actually eliminates the issues around portability. all that is needed is replacing every / with \ before it goes to the system. and python apparently takes care of this for me. so i just have paths with / characters. since users could type in \ i just need to replace those with / before letting open() or other python code have it have it.
i should go figure out how to start up a cloud instance with Windows in it then learn how to install Python3 in it.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.