File: _always_live_program.py

package info (click to toggle)
pydevd 2.9.5%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,880 kB
  • sloc: python: 75,138; cpp: 1,851; sh: 310; makefile: 40; ansic: 4
file content (32 lines) | stat: -rw-r--r-- 679 bytes parent folder | download
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
import sys
import struct
print('Executable: %s' % sys.executable)
import os
def loop_in_thread():
    while True:
        import time
        time.sleep(.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(.5)
        sys.stdout.write('.')
        sys.stdout.flush()
        if i % 40 == 0:
            sys.stdout.write('\n')
            sys.stdout.flush()