Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a python file with no argparse implementation in its __main__, yet, I'm interested in having a look at the functions and modules implemented in it from the commandline. I'm tempted to write a function to perform such exploration but I wanted to find out first whether this is already available.
EDIT 1: to make it more concrete, I'm interested in names of functions and classes + their docs.
You may be looking for a tool like python-fire.
From the repository:
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. [...] Python Fire helps with exploring existing code or turning other people's code into a CLI.
It is available as a package on pip.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Some programming languages provide capability t create a self contained packages that can run on any machine.
For example, dotnet core can self-contained apps per below:
https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained
The C# self-contained apps can be single large file, or a directory of all files required to run the application. The package can target Linux, mac or Windows.
In Python, what is the closest feature to self-contained app packages described above?
PyInstaller seems to be the current go to, and it works well in my experience. However, some people have reported that it has very large file sizes, but I've personally never found that to be a major issue.
If you use that, you would also probably need some kind of UI, but that's a separate issue in itself.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I heard that it is not possible to give input to the python program In VS Code and for this issue We should open the python file on Command Prompt.
I wonder is it really true? Because Sometimes I write code on VS Code it asks for Input but sometimes It doesn't show anything. So what is going on?
The official python extension of VSCode provides Run and Debugging, almost like a IDE. It's impossible not to support input.
As for the source of your misunderstanding, it may be an extension like Code Runner, which does not support input, just quickly help you run the code and display the output.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Before you get confused, I am going to compile it with the auto-py-to-exe module after, its just the source code is in python. How do I do this?
If Python is not installed you wouldn't even be able to run a script to check if it's installed.
I'm pretty sure there isn't from inside the Python script. Because the interpreter isn't installed, so it'll never be able to understand HOW to execute the script at all.
You'll have to check outside in whatever is initiating the Python script and the compilation (bash script?) and do it there.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to understand the difference between distributing a python application. The application should be used on both Windows and Mac OS platforms. I see there are two ways of doing it.
Either create a executable using py2exe / py2app etc
Distribute the application using pip.
I would like to understand the use-cases for both the solutions.
A few things. As Sam Chats mentioned, one possible use case for creating the executable is if you don't want to share your source code, while if you distribute the application using pip, you will be able to. Additionally, if you distribute using pip vs. creating an application, more users may be able to easily access your application. As an example, check out this StackOverflow answer as a reason for using pip over Anaconda
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm using Blender and Python and want to give the .py file to other users to use my script... My script uses external modules (like NumPy) which will rise the errors (like can't find module xxxx).
Not all people can install NumPy (or even Python :D) as many Blender users are just artists.
Another note is that NumPy doesn't work with Blender (I install it in the system's Python, then delete Blender Python so it relies on the system Python).
If you want to distribute your code with external dependencies then you should build a Python egg. The .egg format was created to solve the issue you are dealing with. It is a self-contained release of your code with dependencies and meta-data. Here is some information on how create Python eggs.