Reputation: 21
I am trying to run cProfile on a Python script that uses an ArgumentParser to parse arguments given from the Command Line. Amongst the arguments, there are two file names that are used by the script for data input.
I was wondering whether I am able to provide the arguments somehow via the cProfile in order to be able to profile my functions using actual data.
Thank you very much in advance.
Upvotes: 1
Views: 5960
Reputation: 11585
You can just pass them through on the command line like you normally would.
python -m cProfile -s time my_app.py <args>
Upvotes: 3