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 2 years ago.
Improve this question
Background:
In order to troubleshoot some crashing python programs, I want to create a stacktrace. Now it just says python.exe has stopped working.
In order to do so, I would like to trigger a fault like this, so I can check if the stacktraces work.
Question:
How can I make a python program crash with the python.exe has stopped working on my local Windows machine? Preferably from a console app.
I tried creating a python program which calls a C++ dll, and calls a function which contains an access violation. When I do this, it still just shows me a stacktrace.
I also tried to keep opening files untill I ran out of memory. It still shows me a MemoryError, with the line number where the operation failed.
Thank you!
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 hour ago.
Improve this question
I have a pretty big python program for data generation and ETL that has around 30 modules. It runs in a docker container and every module that runs also logs its success or failure. I want to capture module versions so I can relate success or failure of a module to its version. Is there a best practice to create a version based on commits or git version for each module?
Ideally I would like to have the logging system automatically capture the module version.
Right now I kick off all the modules as arguments in main.py. When I call one of them I pass it a version from the main.py file. It works, but I also need to remember to update the versions in that file every time I do an update (several times a day)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I usually start building up code in a jupyter notebook, and then make that into a function/ class that I drop in multiple files. To access/ edit those files I used Xcode. Whereas this works more or less ok, it does require to reload the classes/ functions on the jupyter notebook every time I make a change and having to use two different softwares to code seems unsatisfying. What is the optimal way of going about this?
Have you tried PyCharm? It comes with an extension that runs Jupyter inside the IDE.
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.
This post was edited and submitted for review 18 days ago.
Improve this question
I am new to Python and VS Code and am trying to debug a simple python program via "F5" or "Run with debugger".
Whenever I try to debug a simple python program using the python extension, a pop up appears at the bottom right "The Python path in your debug configuration is invalid."
It suggests opening launch.json, but doesn't explain what to add.
How can I easily debug my new python program?
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 4 years ago.
Improve this question
So I am running python 3.6.5 on a school computer the most things are heavily restricted to do on a school computer and i can only use python on drive D. I cannot use batch either. I had python 2.7 on it last year until i deleted all the files and installed python 3.6.5 after that i couldn't double click on a .py file to open it as it said continue using E:\Python27\python(2.7).exe I had the old python of a USB which is why it asks this but know i would like to change that path the the new python file so how would i do that in windows
Go to your Windows Settings --> Standard-Apps for Filetyp. There you can choose with wich program you want to open a specific filtyp, in this case ".py".
Let me know if this works :)
Just open your Python IDE and open the file manually.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Why don't people just use the compiled python file whenever they need optimization? Then the code won't have to be interpereted then compiled.
Is there something I am missing? It seems to me like a simple problem.
I believe this is enough to correct your misunderstanding.
A program doesn’t run any faster when it is read from a .pyc or .pyo file than when it is read from a .py file; the only thing that’s faster about .pyc or .pyo files is the speed with which they are loaded.
source : https://docs.python.org/2/tutorial/modules.html#packages
Python is interpreted even if it's read from a pyc-file. As already said in this answer, pyc-files only speed up program starting, not execution. Commands stored into pyc-files are not machine codes, it's just python level commands that will be interpreted anyway by python interpreter. On the other hand, when you use program written in C, executable file of such program consists of machine codes, that are "interpreted" directly by CPU.