I'm trying to store the print output from a function of another module imported, as a string and write it into a file. However, that function does not return a string, it only prints the output. so I need something like:
import someModule
......
f.open('test.v','w')
out = storetheprintoutputasstring(someModule.main())
f.write(out)
f.close
How do I do this? Please help me out and thank you in advance