I’m trying to reverse FileSensor()
: that is, with
JavaScript
x
2
1
sensor=FileSensor(filepath='test.txt', task_id='dummy_file_test')
2
It will return True if the file exists. But, how can it return False when the file exists and True when it does not?
Advertisement
Answer
You could create a PythonSensor that checks for the existence of a file with the logic that you want.
JavaScript
1
3
1
def my_sensor_func(some_path):
2
return not os.exists(some_path)
3