![]() Or use \ quote before the space char, It always split variables if it reach a space char. No matter i try to list it: subprocess.Popen() Like this:īut I get this of python Popen: subprocess.Popen("terrariad \"say something\"", shell=True) I found the "terrariad" script expect just one argument, but the Popen is splitting my argument into two no matter the method I use, as my input string has one space char in the middle. I abandoned the python solution, by now I'll try it with bash instead, seem to be more logic to do this way. If I send the command manually in the ssh putty terminal, it works! I tried so much things but I get the same result. It stop the command in the space char, output this on the terminal: : say Subprocess.Popen("terrariad \"say something\"", shell=True) ![]() This works fine, but if I try to input a string with space: import subprocess Subprocess.Popen("terrariad save", shell=True) ![]() Here is a code used to send a command, in python: import subprocess I follow these instructions to install the server:Īnd config my router to forward a dedicated port to the terraria server.Īll is working fine, but I really struggle to make python send a command via "terrariad" bash script, described in the link above. ![]() send a message, via internal in-game chat, so I thought use a special character ($) in front of the desired command ('$say something' or '$save', for instance) and a python program, that read the terminal output via pipe, interpreter the command and send it back with a bash command. My friends ask me if there is a way for them to control the server, e.g. This server should be powered on 24/7, without any GUI, only been accessed by SSH on internal LAN. In the past week I install a Terraria 1.3.5.3 server into an Ubuntu v18.04 OS, for playing online with friends. ![]()
0 Comments
Leave a Reply. |