Ask Your Question
0

spending time for writng

asked 2017-08-09 17:28:50 -0600

Amir90 gravatar image

Hello,

I want to write a load model in savnw.dyr file, but when I open the file, I couldn't see anything, actually it's taking too late to write on it, I don't know what't the problem. can you help me? Thanks.

I My code is as follow:

import time
start = time.clock() 
f= open("savnw.dyr","a") 
LM=20 
SM=50
DL=6
CP=7
Rem=10
f.write('\t\t\t%0.2f\t%0.2f\t%0.2f\t%0.2f\t%0.2f'%(LM,SM,DL,CP,Rem))
end = time.clock()
print end
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2017-08-09 23:12:21 -0600

jconto gravatar image

It is a good practice to use the close() method to close a file. After the f.write line add:

f.close()

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-08-09 17:28:50 -0600

Seen: 175 times

Last updated: Aug 09 '17