Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Tools: Add support for running __main__.py based packages. #7906

Open
vsfeedback opened this issue May 21, 2024 · 1 comment
Open
Assignees

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


Many people shove in a main.py file to make their Python "Package" folder runnable directly. Sadly the Python tools and project type is not smart enough to automatically detect that if you set Startup File to the name of the folder that what it should do instead is actually check and see if the folder has a main.py file inside of it. If so run it just like py -m <folder name> would do from the command line. This functionality is lacking there is good need of this support as it is stupid that one must make a separate vs_main.py file and inform people NOT to use that file and to execute it with py -m <package name> instead with the vs_main.py file being only for debugging in Visual Studio. If this gets fixed then people can remove this needless file which would help keep source trees clean and prevent having similar problems like this in the future just because one needs to be able to debug the code within Visual Studio. What is even more ironic is that this support is built into the JetBrains IDE's and it supports this use case out of the box, except one issue YOU CANNOT DEBUG PYTHON C EXTENSION MODULES within most of their IDE's on top of their Python code if there ever is a problem that one must investigate in both normal Python code and in C extension code.


Original Comments

Feedback Bot on 4/22/2024, 00:40 AM:

(private comment, text removed)

@Ashu229676
Copy link

Print (a+b+c)
If a=10
Value of b=20
Print(a+b)= value of a,h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants