On 2005-06-02 14:43:40, Jan Danielsson wrote:
> a = [ 'Foo', 'Bar' ]
> b = [ 'Boo', 'Far' ]
> q = [ a, b ]
>Or, better yet, how do I store a and b in q, and then tell Python
> that I want a and b to point to new lists, without touching the contents
> in q?
There are several ways to create a
rstand what __repr__ should be.
It is an *exact* (if possible) description of the object's content,
nicely packaged into a string.
>>> repr(0.1)
0.10001
>>> repr("it's a bad idea")
'"it\'s a bad idea"'
>
Errata:
>>> str(0.1)
'0.1'
>>> str("it's a bad idea")
"it's a bad idea"
>>> repr(0.1)
' 0.10001'
>>> repr("it's a bad idea")
'"it\'s a bad idea"'
SB
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Imagine that you have a PyObject pointer 'object'
pointing to a Python integer ... let's say 42.
How would do you attach the variable "answer" to
it so that the code
PyRun_SimpleString("print answer");
works as expected ?
My current solution is:
__main__ = PyImport_ImportModule("__main__"
701 - 704 of 704 matches
Mail list logo