我想建立一个由一些问题(< 10)组成的调查,每个问题有4个选项。我尝试了不同的方式(Microsoft调查,SurveyMonkey或Excel等),最后转向Python,以便我学习一些东西并实现我想要的。我能够通过列表和循环正确列出问题和选项。现在我想将它们保存在Excel或其他类似数据库中。试图克制Xls,因为我将这个调查发送给大约50人,Excel可能会带来一些危害。我不确定它是否可能,但想法是在Python中创建一个.exe并与组共享它们,当它们提供答案时(运行.exe时),这些答案应记录在某处。我不是在寻找太多的分析或超级报告,但欢迎拥有。我写的代码如下:
print("enter your name")
name=input()
print("how many teams you play for ?")
number_of_teams=int(input())
s=number_of_teams
print("you have to fill this form",s,"times")
//list of question in my survey
questions_list = ["Q1.A ?","Q2. B? ", "Q3. C?", "Q4. D?", "Q5. E ?", "Q6. F
?","Q7. G ? "]
//list of options for each of those questions
answers_list = [["A.1 ", " B.2 ", " C.3 "," D.4 "],
["A.1 ", " B.2 ", " C.3 "," D.4 "],
["A.1 ", " B.2 ", " C.3 "," D.4 "],
["A.1 ", " B.2 ", " C.3 "," D.4 "],
["A.1 ", " B.2 ", " C.3 "," D.4 "],
["A.1 ", " B.2 ", " C.3 "," D.4 "],
["A.1 ", " B.2 ", " C.3 "," D.4 "],]
i=0
while i<s:
print("enter your team name")
team=input()
for questions, answers in zip(questions_list, answers_list):
print(questions + '\n' + ''.join(answers)+'\n')
get_answer = input()
print('\n')
i=i+1
不能使用第三方库(因为数据共享问题)。
答案 0 :(得分:-1)
可以使用PyInstaller使用python创建.exe。我建议创建一个与SQLite
数据库交互的python程序。然后,使用PyInstaller将其转换为.exe程序。
我提供了一些可能有用的链接:Python Excel Tutorial,Python SQLite和PyInstaller