2017-06-11 4 views
1

なぜこのエラーが発生していますか? Screenshot of error msgメインスクリプトのcxFreeze pythonエラー

メインスクリプトのpythonエラーとは、末尾が です。ランタイムエラー、私はまだ学習してい

import sys 
#import os 
from cx_Freeze import setup,Executable 

base = None 

if sys.platform == "win32": 
    base = "win32GUI" 

#os.environ['TCL_LIBRARY'] = r'C:\Users\asus\AppData\Local\Programs\Python\Python36-32\tcl\tcl8.6' 
#os.environ['TK_LIBRARY'] = r'C:\Users\asus\AppData\Local\Programs\Python\Python36-32\tcl\tk8.6' 

setup(name="aplication", 
     version="0.1", 
     description="app", 
     executables=[Executable("TICTACTOE.py", base=base)]) 

は、このエラーを把握することができません

私の主なスクリプトがエラーなしでシェル内で実行されます。ここで

スクリプト

import copy as c 
import sys 

def printBoard(arg): 
    i = 0 
    for v in arg.keys(): 
     i += 1 
     if i % 3 == 0 and i < 9: 
      print(arg[v],'\n- + - + -') 
     elif i==9: 
       print(arg[v]) 
     else: 
      print(arg[v],'','|',end=' ') 



def check(b,arg): 
    def plagfn(b): 
     global looper 
     looper = False 
     plag = input('Play again? y/n ') 
     if plag == 'Y': 
      theBoard=c.copy(newBoard) 
     else: 
      sys.exit() 
    val = list(b.values()) 
    l=['','','','','','','','',''] 
    u=c.copy(l) 
    d=c.copy(l) 
    for i in [0,3,6]: 
     l[i] = (val[i] == val[i+1] == val[i+2] == arg) 
    for i in range(3): 
     u[i] = (val[i] == val[i+3] == val[i+6] == arg) 
    for i in [0,2]: 
     d[i] = (val[i] == val[4] == val[8-i] == arg) 
    if ('' not in b.values()): 
     print('Its draw !') 
     plagfn(b) 
    if (True in l) or (True in u) or (True in d): 
     print(arg , 'is a winner !') 
     plagfn(b) 


while True: 
    theBoard = {'TL': '', 'TM': '', 'TR': '', 
       'ML': '', 'MM': '', 'MR': '', 
       'LL': '', 'LM': '', 'LR': ''} 
    sample={} 
    for bld1 in theBoard.keys(): 
     sample[bld1]=bld1 
    newBoard=c.copy(theBoard)     
    print('The viable inputs are \n') 
    printBoard(sample) 
    print('\nStart') 
    printBoard(theBoard) 
    looper = True 
    i=0 
    while looper: 
     i += 1 
     if i % 2 == 0: 
      arg = 'O' 
     else: 
      arg = 'X' 
     v = input('\nYour turn ' + str(arg) + '! \n') 
     while v not in list(theBoard.keys()): 
      print('The viable inputs are \n') 
      printBoard(sample) 
      v = input('\nYour turn ' + str(arg) + '! \n') 
     while theBoard[v] : 
      print('Already played.') 
      v = input('Your turn ' + str(arg) + '! \n') 
     theBoard[v]=arg 
     printBoard(theBoard) 
     check(theBoard,arg) 

はお時間をいただき、ありがとうございますされています。

答えて

0

これは役立つはず:

import sys 

from cx_Freeze import setup, Executable 

setup(name="aplication", 
     version="0.1", 
     description="app", 
     executables=[Executable("TICTACTOE.py", base="Console")]) 
+0

それは感謝を働きました。 –

関連する問題