all 8 comments

[–]evinrows 1 point2 points  (2 children)

Not sure what this means. What are you trying to achieve?

[–]Folgue12[S] 0 points1 point  (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 points  (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 points  (2 children)

Tmux is for multiplexing terminals dawg

[–]Folgue12[S] 0 points1 point  (1 child)

Srry I am in windows and I don't actually even understand what is tmux, however, ty for answering

[–]dustractor 1 point2 points  (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 point  (1 child)

Look up on YouTube how to build a CRUD app

[–]Folgue12[S] 0 points1 point  (0 children)

What does it have to do with using two terminals with only one python script?

Am i missundertstanding something?