create_new_stock.py 410 B

123456789101112
  1. from datetime import timedelta
  2. import model
  3. if __name__ == '__main__':
  4. timeout = float(input('How long will the initial selling be available? (minutes):'))
  5. try:
  6. expiry = model.current_db_timestamp() + timedelta(minutes=timeout)
  7. print(model.new_stock(expiry))
  8. model.cleanup()
  9. except OverflowError:
  10. print('The expiration time is too far in the future.')