I'm learning python. So here's what I'm after:
Inside a python script I have the following:
back_minutes1 = int(sys.argv[2])
back_minutes = timedelta(minutes=back_minutes)
This works fine, but I'm essentially creating a 'trash variable' to make it work. If this wer开发者_JAVA百科e say bash, I could probably do something like
back_minutes = timedelta(minutes=`int(sys.argv[2])`)
This, of course doesn't work. What's the pythonic way to do this without creating this throw-away variable?
Why not
back_minutes = timedelta(minutes=int(sys.argv[2]))
精彩评论