tFlush stdout in python when writing to it - tordam - A library for peer discovery inside the Tor network HTML git clone https://git.parazyd.org/tordam DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit fef7f290c2817471b77e212ea8eb7fd0d75f3b26 DIR parent 6ead90df16d53a7699efb5405129c053ef538d1f HTML Author: parazyd <parazyd@dyne.org> Date: Fri, 8 Dec 2017 18:06:46 +0100 Flush stdout in python when writing to it Diffstat: M python/decodehs.py | 4 +++- M python/dirauth.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) --- DIR diff --git a/python/decodehs.py b/python/decodehs.py t@@ -47,9 +47,11 @@ def main(): service = start_hs(ctl=controller, ktype=ktype, kcont=kcont) - stdout.write('Started HS at %.onion\n' % service.service_id) + stdout.write('Started HS at %s.onion\n' % service.service_id) + stdout.flush() while True: stdout.write('OK\n') + stdout.flush() sleep(10) if __name__ == '__main__': DIR diff --git a/python/dirauth.py b/python/dirauth.py t@@ -13,3 +13,4 @@ from stem.control import Controller with Controller.from_port() as ctl: ctl.authenticate(password='topkek') stdout.write(ctl.get_hidden_service_descriptor(argv[1]).permanent_key) + stdout.flush()