I want to run
python ~/program/proxy.py in a terminal when I boot up. And then hide this terminal window (because it is just a proxy program, and I don't want to see the debug info). So how can I get it to work?
IMHO, the optimal solution is to run that proxy as system daemon.
This tutorial from Novel should teach you core concepts. Unluckily it is a little bit SuSE-centric, on other distributions the details could be slightly different. Use it as starting point.
P.S. There is something strange in your question, a service started at boot doesn't have a terminal window. A program started when you log on can have a terminal window. Perhaps do you have auto-login feature enabled, so you are confusing boot process with log-in process.
tmux you can start a detached process, which is effectively "hidden", and attach it to check its status, as and when you like. If you start it from a terminal, you can even close that terminal session, and subsequently attach to your tmux python process from another terminal ...
This example uses
watch as the command to run, but just substitute your python command... It starts the tmux session in an already deteched state.
tmux new -d 'watch -n 1 -d date'
To view the current state of the "hidden" (detached) session, just type
tmux attach in a Terminal window...
You can also use
screen, but I believe
tmux may be the better choice, based on the comments in this Unix-&-Linux answer...
To provide you a literal answer to your question, you could use a program such as AllTray*. You could then pass it a command to start up a terminal, and pass a command to that terminal to run your program. If you tell AllTray to hide the terminal, then it will be embedded in the system tray, ready for you to pull up if you need to view the output.
However, I would recommend you go with andcoz's answer and run this program as a system dæmon. Have the output go to a log file. The only way that wouldn't work is if it were an interactive program, but by the sounds of it, we're not talking about an interactive program.
* Disclaimer: I am the maintainer of AllTray
Depending on how early in the boot you want this to run, you may want to use cron @reboot.
(You may need to play with environmental variables.)
Then wrap it in a detached terminal.
tmux new -d '/path/to/python /full/path/program/proxy.py'
# or #
screen -d -m '/path/to/python /full/path/program/proxy.py'
Effectively these are backgrounded to synthetic terminals.
This is commonly done for "mickey mouse" server process such as "sinatra" or "minecraft" or even headless "folding at home".
For neatness/control, you may want to use a shell script to wrap up the launch and invoke that from cron.