Oct-24-2020, 07:31 AM
Your description is very limited, but i assume you mean this:
somewhere in your app you have:
Elsewhere you have an input() statement for the user,
and you want him/her to be able to type ">rotate(6)".
The simplest way would be to have two inputs:
a = input("What angle do you need ? ") -> convert that to int()
c = input("What command should I execute? ")
For the variable c you will have to construct some logic that says:
if it's "r" do rotate, if its "x" do something else.
My 2 cts,
Paul
somewhere in your app you have:
Quote:def rotate(angle):rotate is a function and angle the argument.
....do_something
Elsewhere you have an input() statement for the user,
and you want him/her to be able to type ">rotate(6)".
The simplest way would be to have two inputs:
a = input("What angle do you need ? ") -> convert that to int()
c = input("What command should I execute? ")
For the variable c you will have to construct some logic that says:
if it's "r" do rotate, if its "x" do something else.
My 2 cts,
Paul