Argparse with 'mpremote run <xxx>.py arg1 arg2' : OK on unix port , no succcess with ESP32 port ; one trick ? #15635
-
Bonjour , PS: tryed 'input' : not better |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Suppose you have a script "test.py" in the "/tmp" directory, as shown below: import sys
print(sys.platform)
print(arg1, arg2, arg1+arg2) Doing this in a terminal in the "/tmp" directory:
will mount the current working directory ("/tmp"), set the arg1 and arg2 values using Another alternative, which I prefer is to create two scripts in e.g. "/tmp" directory: # args.py
arg1=1
arg2=3 and #test1.py
from args import *
import sys
print(sys.platform)
print(arg1, arg2, arg1+arg2) Then, from a terminal in any directory on your PC, run the following:
Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Suppose you have a script "test.py" in the "/tmp" directory, as shown below:
Doing this in a terminal in the "/tmp" directory:
will mount the current working directory ("/tmp"), set the arg1 and arg2 values using
exec
, load and run the "test.py" script from RAM on your esp32 board.Another alternative, which I prefer is to create two scripts in e.g. "/tmp" directory:
and
Then, from a terminal in any di…