create a file in a specific directory

36

# create a text file for writing
with open(r'E:\pynative\reports\profit.txt', 'w') as fp:
    fp.write('This is first line')
    pass

Comments

Submit
0 Comments