-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinputfile.py
More file actions
48 lines (35 loc) · 1.14 KB
/
inputfile.py
File metadata and controls
48 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 13:41:15 2019
@author: msra2nk3
"""
def safe_input(question):
while True:
x = input(question)
if not(x.isdigit()):
print("This must be a positive integer!")
x = input(question)
else:
break
while True:
if not float(x) % 1 == 0:
print("This must be a positivo integer!")
x = input(question)
else:
break
while False:
if x == 0:
print("This must be a positivi integer!")
x = input(question)
else:
break
return x
a = safe_input("How many sheep should there be?" )
b = safe_input("For how many iterations should the model run?")
c = safe_input("How large should the neighborhoods be?")
d = safe_input("How many Zombie sheep should there be?")
e = safe_input("How many landmines should there be?")
f = safe_input("How large should the landmines blast radius be?")
arguments = "%s %s %s %s %s %s" % (a, b, c, d, e, f)
#print (arguments)
runfile("Sean_the_sheep_of_the_dead_takes_input.py", args = arguments)