Skip to content

Instantly share code, notes, and snippets.

View emrehorsanali's full-sized avatar
🔥
THIS IS FINE.

Emre Horsanalı emrehorsanali

🔥
THIS IS FINE.
View GitHub Profile
@emrehorsanali
emrehorsanali / access_thread.py
Last active May 15, 2019 13:51
Python Access Data (Flag) From Another Thread (Stop Program with CTRL-Z or Wait Until It Stops)
import logging
import threading
import time
import sys
def thread_function(name):
global flag1, flag2
time.sleep(10)
flag1 = True
logging.info("Thread %s: starting FLAG1", name)