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.
A more rough approach is to write a simple script that wraps your program and detaches it from its terminal. Something like:
Then you can put it in your log-in auto-startup sequence (as you, probably, already done).
This example uses
To view the current state of the "hidden" (detached) session, just type
You can also use
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.
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.