Use of ONLINE_JUDGE macro in python

Правка en1, от pedastrian57, 2020-05-06 07:32:15

Today I am trying to find something similar to #ifndef ONLINE_JUDGE in python . I find a post on stackoverflow .This has worked for me . You can insert the below code in your program to do conditional compilation ....

import sys
zz=not __debug__
if not zz:
	input=sys.stdin.readline
else:	
	sys.stdin=open('input.txt', 'r')
	sys.stdout=open('output.txt','w')

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский pedastrian57 2020-05-06 07:32:15 508 Initial revision (published)