-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathattach.py
More file actions
44 lines (29 loc) · 741 Bytes
/
attach.py
File metadata and controls
44 lines (29 loc) · 741 Bytes
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
import argparse
import sys
import debugpy
a = 10
def foo():
print("Foo")
return 5
class Bar:
def __init__(self, value):
print("Bar constructor")
self.value = value
def main():
print("Main")
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--port", type=int, required=False, default=5678)
args = parser.parse_args()
debugpy.listen(("127.0.0.1", args.port))
print("DAP server listening", file=sys.stderr, flush=True)
debugpy.wait_for_client()
print("Resuming")
b = 20
c = Bar(10)
foo()
print("Hello world")
with open("out.txt", "w") as outfile:
outfile.write("ok")
if __name__ == "__main__":
print("Main guard")
main()