How to create new empty file in Python

2 Answers

0 votes
f = open("d:\info.dat", "x")


'''
run:
 

'''

 



answered Nov 15, 2018 by avibootz
edited Nov 26, 2018 by avibootz
0 votes
f = open("d:\data.txt", "x")


'''
run:

FileExistsError: [Errno 17] File exists: 'd:\\data.txt'

'''

 



answered Nov 26, 2018 by avibootz

Related questions

1 answer 249 views
249 views asked Nov 15, 2016 by avibootz
1 answer 249 views
1 answer 291 views
1 answer 260 views
1 answer 258 views
...