I wrote a simple capital city quiz in python then complied it using pyinstaller and it is over 300MB! The code is below. Any ideas as to why it is so large!
Cheers,
Rich
import pandas as pd
from random import shuffle
from requests import post
difficulty=""
while difficulty.lower() != "easy" and difficulty.lower() != "hard":
difficulty = input("Easy or Hard? ")
filename = "capitals_"+difficulty+".csv"
dataset = pd.read_csv(filename)
quiz_data = dataset.iloc[:, 0:2].astype(str).values.tolist()
shuffle(quiz_data)
name=""
while name.lower() != "beth" and name.lower() != "penny":
name = input("Are you Beth or Penny? ")
webhooks_event=name + "Flash"
score=0
for n in range(10):
ans=input(f"What is the capital city of {quiz_data[n][0]}? ")
if ans.lower()==quiz_data[n][1].lower():
print("Correct!")
score+=1
else:
print(f"Sorry the correct answer was {quiz_data[n][1]}")
if score < 5:
print(f"You need to do more studying! you got {score} out of 10!")
elif score <10:
print(f"Well done you got {score} out of 10")
else:
print("Excellent, you got them all right!")
post(f"https://maker.ifttt.com/trigger/{webhooks_event}/with/key/#")
input("Press enter to continue")