How can i find the address that my program variable are saved at? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 3

How can i find the address that my program variable are saved at?

16th May 2020, 9:06 PM
Jason
Jason - avatar
10 Respuestas
+ 3
id(variable)
16th May 2020, 9:11 PM
Abhay
Abhay - avatar
+ 3
num = 2 print (hex (id (num)))
17th May 2020, 12:02 AM
Manish
Manish - avatar
+ 2
Jason when I asked a similar question, they did not answer me. I believe that it is better to use the C language for working with memory. in python, the data storage process is very cleverly organized. memory from under used variables is cleared immediately. but I want hope that i misstake
16th May 2020, 10:24 PM
Petr
16th May 2020, 10:31 PM
Petr
+ 1
Sorry even I don't have any idea about that! I thought you were talking about randomly printing the memory addresses of different variables
16th May 2020, 9:35 PM
Abhay
Abhay - avatar
0
I want to write a program to print ram data randomly! Can you help me !?
16th May 2020, 9:16 PM
Jason
Jason - avatar
0
Yup but what kind of help you need?
16th May 2020, 9:22 PM
Abhay
Abhay - avatar
0
I dont know how to read data from ram ?! I familiar with working with file in python by i cant read data from cpu or ram
16th May 2020, 9:31 PM
Jason
Jason - avatar
0
Its ok can you explain more?!
16th May 2020, 10:33 PM
Jason
Jason - avatar
0
I want to do exactly the opposite, that is, randomly read the data of running programs from the RAM.
17th May 2020, 3:15 PM
Jason
Jason - avatar