Sublime Forum

Python on sublime cant create the new txt file and write to tham

#1

Hello
I create the program(python)!

f = open(‘2ch.txt’, ‘w’)
print(‘something in 2ch’)
f.write(‘something’)
f.close()

But this code redactor cant start my program! It’s print ‘something in 2ch’ to panel, but new text file is not create!
On IDLE (python) it works right. Please help me!

0 Likes

#2

did you try specifying an absolute path? maybe it’s got a different working directory in ST vs IDLE

0 Likes

#3

I solved this problem.

f = open(‘2ch.txt’, ‘w’)

turned into f = open(‘D:\way\2ch.txt’, ‘w’)

0 Likes