2025-02-09 18:23:09 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
"""
|
|
|
|
Example of running ptpython in another thread.
|
|
|
|
|
|
|
|
(For testing whether it's working fine if it's not embedded in the main
|
|
|
|
thread.)
|
|
|
|
"""
|
2025-02-09 18:34:28 +01:00
|
|
|
|
2025-02-09 18:23:09 +01:00
|
|
|
import threading
|
|
|
|
|
|
|
|
from ptpython.repl import embed
|
|
|
|
|
|
|
|
|
|
|
|
def in_thread():
|
|
|
|
embed(globals(), locals(), vi_mode=False)
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
th = threading.Thread(target=in_thread)
|
|
|
|
th.start()
|
|
|
|
th.join()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|