Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

write the output of a function in a txt file

def out_fun():
  return "Hello World" 
output = out_fun() 
file = open("sample.txt","w") 
ile.write(output) file.close() 
#Copy and paste...will work. 
Source by www.quora.com #
 
PREVIOUS NEXT
Tagged: #write #output #function #txt #file
ADD COMMENT
Topic
Name
6+1 =