summaryrefslogtreecommitdiffstats
path: root/Main/test.py
blob: 7b0b5751c6aad6586028dd13cbfe7285d2fe7ba7 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import io, sys, os
import importlib

class Capturing(list):
    def __enter__(self):
        self._stdout = sys.stdout
        sys.stdout = self._stringio = io.StringIO()
        return self
    def __exit__(self, *args):
        self.extend(self._stringio.getvalue().splitlines())
        del self._stringio    # free up some memory
        sys.stdout = self._stdout


filename = "test2.py"
# file =


for i in range(3):
    with Capturing() as output:
        x = os.system(filename)

    print("\n".join(output), type(output))
    print("a")


# test = {1:0,2:1,3:-1}
# print(max(test.values()))


# test = {1,2,3}
# test2 = test
# test3 = test.copy()
#
# # test2.add(4)
# test3.add(4)
#
# print(test)
# print(test2)
# print(test3)

# test = [1,2,3,4]
#
# def shift(t, val):
#     for i in range(3):
#         t[i] = t[i+1]
#     t[-1] = val
#
# shift(test,5)
# print(test)


# test = {"A":'a', "B":'b'}
#
# if "A" in test:
#     print("1")
#
# if "a" in test:
#     print("2")
#
# test['C'] = 'c'
#
# test[(0,0)] = 'd'
#
# print(test)
#
# test["A"] = 'L'
#
# for i in test.values():
#     print(i)
#
# print("--------------------")
#
# a = [1,2,3]
# print(a[:-1])

# test = {"A":{1,2,3}, 1:[1,1]}
#
# test["A"].remove(1)
#
#
# test2 = test.copy()
#
# test2["B"] = 1
# test2[1].append(2)
#
# print(test)
# print(test2)