Link to home
Start Free TrialLog in
Avatar of davidw88
davidw88

asked on

Crontab question: can not invoke Python script

Hi experts,

I have two Python scripts "A" and "B". In "A" I use "os.system(...)" to invoke script "B". If I manually run "A", then "B" can be invoked successfully. However, when I use crontab to execute "A", "B" does not run in this case.

Anybody knows how to fix this?

Thanks so much.
ASKER CERTIFIED SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davidw88
davidw88

ASKER

hi cxr,

thanks for your reply. I used

command = ("python %s") % (B.py)
os.system(command)

Following your suggestion I have added full path to the python executabe. so let's wait and see how it works.

It does not work.

I just combined the two scripts into one script. This solved the problem.

Thanks cxr for your reply. Appreciated.