python output content to a local txt file

If you want to write something that is not a string, you will need to be converted:

Examples

#! / usr / bin / to python3

# open a file
F = Open ( "/ tmp / foo1.txt", "W")

value = ( 'www.runoob.com', 14)
S = STR (value)
F. the Write (S)

# close the file opened
f.close ()

Guess you like

Origin www.cnblogs.com/StarZhai/p/12058177.html