To know or get a file location or path, you first of all create a file module, i dont think you can create both aton creating the same timefile name module, python already knows its path. To create a module name use
import os os.mkdir('data.txt') youYou can use the code below to know or display the file locationmodule path displayed in your output result = os shell.getcwd()
import os result = os.getcwd() youYou can then further to create the file using
with open('data2.txt', 'w') as f: f.write('You are good') I added 2 to the file name i.e 'data2.txt' because python does not permit say modulesame name for file module as file name in the same directory.