Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- print('###################################Genarating Global Variables##########################')
- storage_file = open("Storage-output.txt", 'w')
- sys.stdout = storage_file
- print ('whatever')
- storage_file.close()
- import sys
- print('###################################Genarating Global Variables##########################')
- storage_file = open("Storage-output.txt", 'w')
- sys.stdout = storage_file
- print ('what')
- storage_file.close()
- print('Completed Global variables creation')
- import sys
- print('###################################Genarating Global Variables##########################')
- stdout = sys.stdout
- with open("Storage-output.txt", 'w') as storage_file:
- sys.stdout = storage_file
- print ('what')
- sys.stdout = stdout
- print('Completed Global variables creation')
- import sys
- print('###################################Genarating Global Variables##########################')
- storage_file = open("Storage-output.txt", 'w')
- sys.stdout = storage_file
- print ('what')
- storage_file.close()
- sys.stdout = sys.__stdout__ # return to its original value as stated in https://docs.python.org/2/library/sys.html#sys.__stdout__
- print('Completed Global variables creation')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement