Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-24 Thread dieter
Sourabh Kalal writes: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 You should not do this (read the value instead by looking at "x") -- unless you are debugging at "C" level. For "C" level debugging, there is a set

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread breamoreboy
On Monday, January 23, 2017 at 5:59:42 PM UTC, Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 What are you trying to achieve here? If you'd explain that rather than how you're trying to achieve

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 7:26 AM, Skip Montanaro wrote: > On Mon, Jan 23, 2017 at 2:17 PM, Chris Angelico wrote: >>> There. *Now* you have an address. Hack to your heart's content. >> >> No, you now have a hexadecimal representation of an integer. > > You missed my attempt at levity, I think. Ah

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Skip Montanaro
On Mon, Jan 23, 2017 at 2:17 PM, Chris Angelico wrote: >> There. *Now* you have an address. Hack to your heart's content. > > No, you now have a hexadecimal representation of an integer. You missed my attempt at levity, I think. S -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Michael Torrie
On 01/23/2017 10:49 AM, Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 Many objects in python such as numbers like 10 or strings are immutable; they can never be altered once called into existance

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 6:05 AM, Skip Montanaro wrote: > On Mon, Jan 23, 2017 at 12:49 PM, Chris Angelico wrote: >> >> On Tue, Jan 24, 2017 at 4:49 AM, Sourabh Kalal wrote: >> > how we can access the value from using id.. >> > like x=10 >> > id(x) >> > 3235346364 >> > >> > how i can read value 1

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Peter Otten
Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 Use ctypes: $ python3 Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Skip Montanaro
On Mon, Jan 23, 2017 at 12:49 PM, Chris Angelico wrote: > > On Tue, Jan 24, 2017 at 4:49 AM, Sourabh Kalal wrote: > > how we can access the value from using id.. > > like x=10 > > id(x) > > 3235346364 > > > > how i can read value 10 using id 3235346364 > > No, you can't. That isn't a memory addre

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Terry Reedy
On 1/23/2017 12:49 PM, Sourabh Kalal wrote: how we can access the value from using id.. like x=10 id(x) 3235346364 how i can read value 10 using id 3235346364 *In Python*, you cannot. Ids are mainly for internal use of implementations. Implementors also use them to test their implementation

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 4:49 AM, Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 No, you can't. That isn't a memory address - it's just a unique identifier. Python doesn't have memory addresses. C

Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Sourabh Kalal
how we can access the value from using id.. like x=10 id(x) 3235346364 how i can read value 10 using id 3235346364 -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-11 Thread Tim Roberts
Ognjen Bezanov wrote: > >I'm trying to see if there is any way I can make Python share data >between two hosts using DMA transfers over a firewire connection, so >avoiding the need for another layer on top such as IPv4 + Python sockets. > >Thanks to some old python bindings which I updated to py

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-10 Thread Carl Banks
On Nov 10, 3:32 am, Ognjen Bezanov wrote: > Hey, > > Thanks for all the responses guys. In hindsight I probably should have > explained why on earth I'd need the physical address from an interpreted > language. > > I'm trying to see if there is any way I can make Python share data > between two ho

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-10 Thread Dave Angel
Ognjen Bezanov wrote: Hey, Thanks for all the responses guys. In hindsight I probably should have explained why on earth I'd need the physical address from an interpreted language. I'm trying to see if there is any way I can make Python share data between two hosts using DMA transfers over

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-10 Thread Maxim Khitrov
On Tue, Nov 10, 2009 at 6:32 AM, Ognjen Bezanov wrote: > Hey, > > Thanks for all the responses guys. In hindsight I probably should have > explained why on earth I'd need the physical address from an interpreted > language. > > I'm trying to see if there is any way I can make Python share data bet

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-10 Thread Ognjen Bezanov
Hey, Thanks for all the responses guys. In hindsight I probably should have explained why on earth I'd need the physical address from an interpreted language. I'm trying to see if there is any way I can make Python share data between two hosts using DMA transfers over a firewire connection,

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Carl Banks
On Nov 9, 4:47 pm, Ognjen Bezanov wrote: > Hello all, > > Say I have a python variable: > > a = "hello" > > Is it possible for me to get the physical address of that variable (i.e. > where it is in RAM)? > > I know that id(a) will give me it's memory address, but the address > given does not seem

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Dave Angel
Benjamin Kaplan wrote: On Mon, Nov 9, 2009 at 7:47 PM, Ognjen Bezanov wrote: Hello all, Say I have a python variable: a = "hello" Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the addr

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread MRAB
Ognjen Bezanov wrote: Hello all, Say I have a python variable: a = "hello" Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the address given does not seem to correlate with the physical me

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Benjamin Kaplan
On Mon, Nov 9, 2009 at 7:47 PM, Ognjen Bezanov wrote: > Hello all, > > Say I have a python variable: > > a = "hello" > > Is it possible for me to get the physical address of that variable (i.e. > where it is in RAM)? > > I know that id(a) will give me it's memory address, but the address given > d

Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Ognjen Bezanov
Hello all, Say I have a python variable: a = "hello" Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the address given does not seem to correlate with the physical memory. Is this even pos