Anton Shishkov a écrit :
Hi, I can't figure out how can I change the variable type in function.
In C I could do that easily by changing pointer.
(snip)
Others already answered on this. Now, the real question is : why to you
want to do such a thing ?
Of one the most common use case for this
Hi, I can't figure out how can I change the variable type in function.
In C I could do that easily by changing pointer.
Please read about "mutable and immutable objects in Python". If you
understand the difference between them, you will get the idea. I'll
explain program anyway, showing you
On Tue, Apr 27, 2010 at 6:09 AM, Anton Shishkov
wrote:
> Hi, I can't figure out how can I change the variable type in function.
> In C I could do that easily by changing pointer.
>
> Code:
> def add(b):
>
> b = {}
> print type(b)
>
> a = []
> print type(a)
> add(a)
> print type(a)
>
> Output
Hi, I can't figure out how can I change the variable type in function.
In C I could do that easily by changing pointer.
Code:
def add(b):
b = {}
print type(b)
a = []
print type(a)
add(a)
print type(a)
Output:
--
http://mail.python.org/mailman/listinfo/python-list
Well, I think I've got it after a bit of research:
c_char_p(address) seems to do the trick. Thus it would be:
ctypes.c_char_p(address)
Of course still let me know if this is somehow WRONG, or if there
is a better way, but this seems good. Thanks again ctypes!
http://starship.python.net/crew/t
Hi guys,
I'm really lost of on this one. How can I turn this (VB?) code
into Python? Basically I call a function exposed from a dll and
it returns me what I believe is a pointer to a location in
memory? Now I need to read that area to get the string I
need. This link has the solution but it is