-2

I run command: run('sleep 1000'). How to limit time ( for example 100) for this command ?

Bdfy
  • 21,109
  • 53
  • 126
  • 178

2 Answers2

0

Several points to be precised in your question

  • your question is not really a python one, but is more focused on the sleep command, right ? I did not find any run command for any standard python package... Or you may want to use python's time.sleep instead ??
  • I guess you want to set a max value for the sleep command, to be used if the value passed is greater... Is this ok ?

If so, in case you use time.sleep, there is no way to do what I suppose you want to, as this previous post shows; I did not find any other way to limit the sleep command either via online documentation.

Community
  • 1
  • 1
Emmanuel
  • 13,267
  • 11
  • 46
  • 70
0

The closest functionality Fabric provides for that would be fabric.operations.prompt. It can validate the input and set default inputs as optional add-ons.

Rawkcy
  • 139
  • 1
  • 3