python-3.x 我遇到到达文件末尾错误

31moq8wy  于 2023-01-03  发布在  Python
关注(0)|答案(2)|浏览(110)

我是python的新手,正在尝试以下代码

class Arm(object):
def __init__(self, SNo, ActivityDate, RequesterTeam, RequesterSignumId, RequesterEmailId,Circle,Customer,Technology,WOType,ProblemTitle,ActivityTypeorEqType,SiteID,BSCFACID,EngineerName,EngineerSignum,DetailDescriptionOfActivityToBePerformed,TimelineforActivityCompletion,WOIDbyWFM ):

    self.SNo= SNo
    self.ActivityDate=ActivityDate
    self.RequesterTeam=RequesterTeam
    self.RequesterSignumId=RequesterSignumId
    self.RequesterEmailId=RequesterEmailId
    self.Circle=Circle
    self.Customer=Customer
    self.Technology=Technology
    self.WOType=WOType
    self.ProblemTitle=ProblemTitle
    self.ActivityTypeorEqType=ActivityTypeorEqType
    self.SiteID=SiteID
    self.BSCFACID=BSCFACID
    self.EngineerName=EngineerName
    self.EngineerSignum=EngineerSignum
    self.DetailDescriptionOfActivityToBePerformed=DetailDescriptionOfActivityToBePerformed
    self.TimelineforActivityCompletion=TimelineforActivityCompletion
    self.WOIDbyWFM=WOIDbyWFM

def __str__(self):
    return("Arm object:\n"
        "SNo = {0}\n"
        "ActivityDate = {1}\n"
        "RequesterTeam = {2}\n"
        "RequesterSignumId = {3}\n"
        "RequesterEmailId = {4}\n"
        "Circle = {5}\n"
        "Customer = {6}\n"
        "Technology = {7}\n"
        "WOType = {8}\n"
        "ProblemTitle = {9}\n"
        "ActivityTypeorEqType = {10}\n"
        "SiteID = {11}\n"
        "BSCFACID = {12}\n"
        "EngineerName = {13}\n"
        "EngineerSignum = {14}\n"
        "DetailDescriptionOfActivityToBePerformed = {15}\n"
        "TimelineforActivityCompletion= {16}\n"
        "WOIDbyWFM = {17}\n"
        .format(self.SNo, 
                self.ActivityDate,
                self.RequesterTeam,
                self.RequesterSignumId,
                self.RequesterEmailId,
                self.Circle,
                self.Customer,
                self.Technology,
                self.WOType,
                self.ProblemTitle,
                self.ActivityTypeorEqType,
                self.SiteID,
                self.BSCFACID,
                self.EngineerName,
                self.EngineerSignum,
                self.DetailDescriptionOfActivityToBePerformed,
                self.TimelineforActivityCompletion,
                self.WOIDbyWFM)

我越来越
文件"C:\Users\OpenSource\eclipse-workspace\PythonWorkSpace\数据隐藏\src\Hiding.py",第26行^语法错误:解析错误时出现意外的EOF
当运行这代码.请建议我在哪里我正在犯错误.

2lpgd968

2lpgd9681#

您应该具有“WOIDbyWFM = {17}\n”.. format(self.SNo,..... a a。您在return语句末尾缺少右括号。

gcmastyq

gcmastyq2#

请使用PyCharm编辑器,它会像eclipse一样显示所有错误,然后您可以正确地缩进代码以使其无bug。

相关问题