Trying to run a python script from ubuntu crontab

前端 未结 3 727
暖寄归人
暖寄归人 2021-01-07 05:44

Hey I am running into an issue when trying to run a cron job with a python script from ubuntu. This is what I have done:

1.) Wrote a simple tkinter app: source for

3条回答
  •  被撕碎了的回忆
    2021-01-07 06:28

    I'm not sure what you expect to happen here. The cronjob won't have access to a display where it can display the GUI, so the button will never be displayed, so print_this will never be run

    FWIW, when I tried to run your code I got an error:

      File "./t.py", line 4
        def __init__(self,parent):
          ^
    IndentationError: expected an indented block
    

    Not sure if that's just caused by copy/paste into the page or if it's a real problem with your code.

提交回复
热议问题