Kaynağa Gözat

demo test python

blumonilr 5 yıl önce
ebeveyn
işleme
0f7b6dccff
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      demo/test.py

+ 2 - 1
demo/test.py

@@ -17,7 +17,7 @@ RESULT_STR = [
 ]
 ]
 
 
 def compileSrc(src_path):
 def compileSrc(src_path):
-    if os.system('python %s'%src_path) != 0:
+    if os.system('python -m py_compile %s' % src_path) != 0:
         print('compile failure!')
         print('compile failure!')
         return False
         return False
     return True
     return True
@@ -66,6 +66,7 @@ def judge(src_path, td_path, td_total):
             exit(-1)
             exit(-1)
     os.remove('./m')
     os.remove('./m')
 
 
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     import sys
     import sys
     if len(sys.argv) != 4:
     if len(sys.argv) != 4: