question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `console_scripts`

See original GitHub issue

I tried running scalene on one of my CLI programs. It didn’t go well:

  • I tried running python -m scalene --help; this does not work
  • I generally write my CLI programs to launch console_scripts entry points, which doesn’t seem supported.
  • I added an explicit if __name__ == "__main__" to my CLI program and scalene no longer aborted; however it also didn’t produce any output beyond what my program already produced.

Any guidance on proper usage would be appreciated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Insutantocommented, Apr 11, 2020

I have a new pull request for support console_scripts. 😸

1reaction
emerybergercommented, Jan 11, 2020

Updated to provide conventional command-line help and output redirection.

 % python3 -m scalene --help                                   
usage: scalene [-h] [-o OUTFILE] prog

Scalene: a high-precision CPU and memory profiler.
https://github.com/emeryberger/scalene

    for CPU profiling only:
  % python -m scalene yourprogram.py
    for CPU and memory profiling (Mac OS X):
  % DYLD_INSERT_LIBRARIES=$PWD/libscalene.dylib PYTHONMALLOC=malloc python -m scalene yourprogram.py
    for CPU and memory profiling (Linux):
  % LD_PRELOAD=$PWD/libscalene.dylib PYTHONMALLOC=malloc python -m scalene yourprogram.py

positional arguments:
  prog                  program to be profiled

optional arguments:
  -h, --help            show this help message and exit
  -o OUTFILE, --outfile OUTFILE
                        file to hold profiler output (default: stdout)

Will work on the other issue described here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Scripts — Python Packaging Tutorial
Many Python packages include command line tools. This is useful for distributing support tools which are associated with a library, or just taking...
Read more >
The Scripting Console View
Overview. The Scripting Console is a tool in Code Composer Studio which allows users to specify commands to the IDE through a console....
Read more >
Entry Points - setuptools 65.6.3.post20221224 documentation
The package would like to provide commands to be run at the terminal. This functionality is known as console scripts. The command may...
Read more >
Representative Console - Client Scripting API - BeyondTrust
Use the BeyondTrust Remote Support Client Script (BRCS), which is a file that contains a sequence of commands to be executed by the...
Read more >
Scripting console | PyCharm Documentation - JetBrains
The IDE Scripting Console can be used to write simple scripts that automate PyCharm features and extract various information.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found