I am writing a program but I am curious to know when I am running it I want to see what are the operations going on in the RAM. I want to see how RAM access the data and run it. And I want to see the data stores on RAM. How can I see the data written on RAM?
-
Or this: [How can I read the memory of another process in Python in Windows?](https://stackoverflow.com/questions/1794579/how-can-i-read-the-memory-of-another-process-in-python-in-windows) – Green Cloak Guy Aug 12 '20 at 19:49
1 Answers
Please bear in mind that python interpreter actually executes the code you're writing in python. This interpreter is usually just an application running on some operating system (linux, windows etc. unless we're talking about some hard-embedded stuff, but I assume not). So, we've got abstraction over hardware (the aforementioned RAM) in form of the operating system and another abstraction in form of python language (which is a high-level programming language, and unlike in assembly, you don't have full control over what happens in the memory or registers for each line). There's a concept of virtual memory in context of operating systems - I recommend reading a bit about it. What you'll eventually learn is that from within the OS, the mapping between RAM and your process memory might not necessarily be one-to-one all the time.
If you simply want to look up your process' stack and variables, I recommend PDB.

- 2,988
- 3
- 11
- 16