I want to save the calculation results in a file (in a different folder than the script, but on the same level). The filename should contain parts of sys.argv[1]. Should work under Linux/Windows.
When I replace the outpufilename with a string it works and the outputfilename works if I dont use os.path.join. The cause must be the combination.
inputfilename = str(sys.argv[1])
outputfilename = inputfilename.split(".")[0] + "__calculated.csv"
basedir = '../results/'
fileDir = os.path.dirname(os.path.realpath('__file__'))
outputfile = os.path.join(fileDir, basedir + outputfilename)