下面是我的代码,为什么我不知道他们有问题,有人可以帮助我吗这是错误消息python3:无法打开文件“import.py”:[Errno 2]没有这样的文件或目录from cs50 import SQLfrom sys import argvimport csv# checking if code is executed properly else exitif len(argv) < 2: print("usage error, import.py characters.csv") exit(1)# Open the database for later reusedb = SQL("sqlite:///students.db")def division_title(initial): n = initial.split() if len(n) == 3: return n else: [n[0],None,n[1]]with open(argv[1]) as csvfile: for row in csv.DictReader(csvfile): n = division_title(row["name"]) db.execute("INSERT INTO student VALUES (?, ?, ?, ?, ?)", n[0],n[1],n[2],row["house"],row["birth"] )
添加回答
举报
0/150
提交
取消