Forum Archive

Python file directory in Xcode

donnieh

When I create a new file programmatically (f.open) in my python script, the new file appears in python's main directory. When I copy and paste this script into the Xcode template and run it, where do the files get created? I do not see them in any folder, yet.

ccc

You should be able to get the current working directory (cwd in Unix speak) like this:

import os
print(os.getcwd())   # ascii or...
print(os.getcwdu())  # unicode