Beispiel #1
0
def main():
    done = 0
    while (done == 0):
        one.main()
        two.main()
        three.main()
        q = input(" * ")
        if (q == "1"):
            done = 1
Beispiel #2
0
def main():
    event, values = sg.Window('Choose an option', [[
        sg.Text('Select one->'),
        sg.Listbox(['Form', 'Execute', 'Auto'], size=(40, 10), key='LB')
    ], [sg.Button('Ok'), sg.Button('Cancel')]]).read(close=True)

    if event == 'Ok':
        if values["LB"][0] == 'Form':
            one.main()
        elif values["LB"][0] == 'Execute':
            two.main()
        else:
            return
    else:
        return
def main():
    one.main()
    print('=' * 50)
    print("The value __name__ is:", __name__)
Beispiel #4
0
#! /usr/bin/env python3

"""two.py
Second module for testing"""

import one


print(">>>Top level in two.py")

print(repr(__name__))
print(repr(__name__))


one.main()

one.func()


def main():
    print("hello from two.py")


if __name__ == '__main__':
    print("two.py is being run directly")
    main()
else:
    print("two.py is being imported into another module")
Beispiel #5
0
#file two.py

import one

print("top-level in two.py")
one.main()

if __name__ == "__main__":
    print("two.py is being run directly")
else:
    print("two.py is being imported into another module")
Beispiel #6
0
import one
x = [int(i) for i in open("input.txt").readlines()[0].split()]
#x = [0,2,7,0] # test input, expecting 5
backlog=[]
while True:
    maxx=max(x)
    location=x.index(maxx)
    x[location]=0
    i=0
    while i != maxx:
        x[(location+1+i)%len(x)]+=1
        i+=1
    if backlog.count(tuple(x)) == 2:
        break
    backlog.append(tuple(x))
print((len(backlog)+1)-one.main())