0

I have a couple of python scripts running in the .openshift/cron/[hourly|minutely|etc] directories.

Problem is, .pyc files are being generated and cron is trying to run those as well.

Is this something that can be managed through openshift, limiting the extensions it attempts to run or would I be better off just adding the following to the top of each .py file?

import sys
sys.dont_write_bytecode = True
rtphokie
  • 609
  • 1
  • 6
  • 14

1 Answers1

1

You can set environment variable PYTHONDONTWRITEBYTECODE to something that is non empty string.

Note that cron runs its own shell, so you should either set it in the beginning of crontab or in /etc/default/cron

More information could be found here and here.

Community
  • 1
  • 1
Vlad
  • 9,180
  • 5
  • 48
  • 67