0

I am a administrator user, not root user. Currently I need to take the following steps everytime I enter Ubuntu:

1.enter /home/nan/goagent/local

2.double click proxy.py, then a dialog shows: enter image description here

3.click "run"

4.over.

But this is really cumbersome. I tried to write command "python /home/nan/goagent/local/proxy.py" at a startup application. but it doesnot work. enter image description here

So, as a None-root user, what should I do to run proxy.py (not in a terminal) automatically when I start Ubuntu? Thanks in advance.

update , this is the py file's property: enter image description here INFO - [Dec 25 02:20:05] resolve common.IPLIST_MAP names=['google_cn', 'google_hk', 'google_ipv6', 'talk.google.com', 'talk.l.google.com', 'talkx.l.google.com'] to iplist INFO - [Dec 25 02:21:01] resolve name=google_hk host to iplist=['173.194.32.21', '74.125.134.83', '173.194.32.22', '173.194.37.85', '173.194.37.86', '74.125.232.117', '74.125.232.118', '74.125.134.19', '74.125.134.18', '74.125.128.103', '74.125.128.105', '74.125.128.104', '74.125.128.106', '74.125.128.147', '74.125.134.17', '173.194.72.94', '173.194.40.245', '173.194.40.246', '173.194.32.54', '74.125.128.199', '173.194.32.53', '74.125.128.83', '74.125.128.94', '173.194.37.53', '74.125.128.99', '173.194.37.54', '74.125.128.18', '74.125.128.19', '74.125.31.94', '74.125.128.17'] INFO - [Dec 25 02:21:01] resolve name=talk.google.com host to iplist=['74.125.128.125']

1 Answer 1

0

Make sure your script it starts with #!/usr/bin/env python (so the shell knows how to interpret it) and then you can just call your script directly without the python executable.

Failing that, some executable places (like the startup) have weird environments. You could try wrapping it all in bash just to make sure things are set up the way you'd expect:

bash -c "python /path/to/script"

As you're still having problems, consider logging the output of the python command, with something like this:

bash -c "python /path/to/script >> /path/to/logfile 2>&1"

If the Python is what's blowing up, at least this way you'll have a chance to debug and fix it.

4
  • I enter bash -c "python /home/nan/goagent/local/proxy.py"​ in the command option of the startup application, but after restart the ubuntu, it still doesnot work.
    – tcpiper
    Dec 24, 2013 at 17:27
  • @Pythoner See edit.
    – Oli
    Dec 24, 2013 at 17:43
  • This time I type bash -c "python /home/nan/goagent/local/proxy.py >> /home/nan/goagent/local/error.txt 2>&1" as you said. errors happened and the content is showed in the question, but wierd thing : It works despite of the error!
    – tcpiper
    Dec 24, 2013 at 18:26
  • Just now, I went back to bash -c "python /home/nan/goagent/local/proxy.py", and it also works! I donot know why it doesnot work in the first time. Anyway, thank you very much!
    – tcpiper
    Dec 24, 2013 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .