rui_mac
12-06-2010, 05:53 PM
How can I manipulate filenames in python?
Lets say that I want to add a filename at the end of a path. Or I simply want to print an absolute path.
I have a path that I got with:
pref_folder=c4d.storage.GeGetC4DPath(c4d.C4D_PATH_PREFS)
Now I want to add a filename to the end to save a file in the preferences folder, for example. How do I do that? I tried using os.path.join(pref_folder,"myfile.txt")
But it tells me that the name "os" is not defined.
I searched the documentation for ways to handle filenames but I only found references to the os.path stuff.
Damn, I complained about the COFFEE documentation but sometimes the python documentation is way more complex.
Rui Batista
Lets say that I want to add a filename at the end of a path. Or I simply want to print an absolute path.
I have a path that I got with:
pref_folder=c4d.storage.GeGetC4DPath(c4d.C4D_PATH_PREFS)
Now I want to add a filename to the end to save a file in the preferences folder, for example. How do I do that? I tried using os.path.join(pref_folder,"myfile.txt")
But it tells me that the name "os" is not defined.
I searched the documentation for ways to handle filenames but I only found references to the os.path stuff.
Damn, I complained about the COFFEE documentation but sometimes the python documentation is way more complex.
Rui Batista
