22 lines
544 B
Python
22 lines
544 B
Python
import sys, time, random
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) > 1:
|
|
call = sys.argv[1]
|
|
if call == 'temperature':
|
|
temperature = 19.5 + random.randint(0,9)
|
|
print(temperature)
|
|
elif call == 'humidity':
|
|
humidity = 78
|
|
print(humidity)
|
|
elif call == 'pressure':
|
|
pressure = 1025
|
|
print(pressure)
|
|
elif call == 'ON':
|
|
print("Iam On")
|
|
elif call == 'OFF':
|
|
print("Iam OFF")
|
|
|
|
|
|
|