我试图在其他程序中调用该函数,得到如下错误:
[\'UnboundLocalError\', ["local variable \'x\' referenced before assignment"]]
请帮忙
connect FSN1 @FSN1 @MANTISPORT
connect FSN2 @FSN2 @MANTISPORT
* from commonFunctions import *
* import os
* import sys
* import shutil
import io
*:
#********* Common Variables**********
exactShareNameFound = False
def findExact(logMessage, share):
f = open('logFile', 'w+')
f.write(logMessage)
for line in f:
if line.find('%s')%(share) >= 0: exactShareNameFound = True
if exactShareNameFound: x+= line
if line.find('Share Name')>=0:
if line.find('%s')(share)<0: exactShareNameFound = False
else:
print('ERROR!!')
else:
print('Error in Executing Loop')
return x