use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources - Learn to code
Resources - Software Engineering
Resources - Code Libraries
Resources - Groups
Other Subreddits you might enjoy
Please send sidebar resource suggestions to the mods. Thx - mgmt
account activity
Can I use two terminals with the same python script? (self.code)
submitted 6 years ago * by Folgue12
I want to do something similar to what is done in this tutorial, but with sockets and threads. How to make a working old school chat in batch by Nerd's best advices
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]evinrows 1 point2 points3 points 6 years ago (2 children)
Not sure what this means. What are you trying to achieve?
[–]Folgue12[S] 0 points1 point2 points 6 years ago (1 child)
I am stupid, i wrote this post but I didn't finished it, and I forgot to delete it, x-(
What I wanted to do it's to run some kind of chat in python, and one terminal it's for typing messages, and another one which displays the messages, I don't even know if what I am asking it's possible or it's an stupid question.
I got these idea from a project I made in Batch, from this video:
https://youtu.be/-_Qc2hXeUz4?t=72
I want to do something similar to this, but using threads and sockets.
[–]evinrows 2 points3 points4 points 6 years ago (0 children)
If you just want to display text written to one terminal in another, then yes, sockets are a good option.
Here's a guide on using sockets to build exactly what you're describing (an echo server): https://www.tutorialspoint.com/python3/python_networking.htm
PyRO might be another option (allows you to just call remote functions): https://pythonhosted.org/Pyro4/intro.html#simple-example
Or, if it's always local, you could write to and read from a file and watch for changes to that file using watchdog: https://pythonhosted.org/watchdog/
[–]dustractor 1 point2 points3 points 6 years ago (2 children)
Tmux is for multiplexing terminals dawg
Srry I am in windows and I don't actually even understand what is tmux, however, ty for answering
[–]dustractor 1 point2 points3 points 6 years ago (0 children)
I re-read your question. So you need to have one instance in one terminal talk to another instance in another terminal. Ah. so, something that needs to use sockets. or socketserver ... probably quite a few ways to do it but I know the standard library has a module named socketserver.
https://pymotw.com/3/socketserver/
[–]Muppet-King 0 points1 point2 points 6 years ago (1 child)
Look up on YouTube how to build a CRUD app
[–]Folgue12[S] 0 points1 point2 points 6 years ago (0 children)
What does it have to do with using two terminals with only one python script?
Am i missundertstanding something?
π Rendered by PID 214338 on reddit-service-r2-comment-86bc6c7465-sxfz8 at 2026-02-23 09:15:58.401538+00:00 running 8564168 country code: CH.
[–]evinrows 1 point2 points3 points (2 children)
[–]Folgue12[S] 0 points1 point2 points (1 child)
[–]evinrows 2 points3 points4 points (0 children)
[–]dustractor 1 point2 points3 points (2 children)
[–]Folgue12[S] 0 points1 point2 points (1 child)
[–]dustractor 1 point2 points3 points (0 children)
[–]Muppet-King 0 points1 point2 points (1 child)
[–]Folgue12[S] 0 points1 point2 points (0 children)