File: _always_live_program.py

package info (click to toggle)
pydevd 3.4.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,892 kB
  • sloc: python: 77,580; cpp: 1,873; sh: 374; makefile: 50; ansic: 4
file content (40 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (2)
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
import sys
import struct

print("Executable: %s" % sys.executable)
import os


def loop_in_thread():
    while True:
        import time

        time.sleep(0.5)
        sys.stdout.write("#")
        sys.stdout.flush()


import threading

threading.Thread(target=loop_in_thread).start()


def is_python_64bit():
    return struct.calcsize("P") == 8


print("Is 64: %s" % is_python_64bit())

if __name__ == "__main__":
    print("pid:%s" % (os.getpid()))
    i = 0
    while True:
        i += 1
        import time

        time.sleep(0.5)
        sys.stdout.write(".")
        sys.stdout.flush()
        if i % 40 == 0:
            sys.stdout.write("\n")
            sys.stdout.flush()