[Sugar-devel] query

Benjamin M. Schwartz bmschwar at fas.harvard.edu
Thu Sep 3 14:34:58 EDT 2009


deepanshu arora wrote:
> Is their any way that in paint activity only, a tab(button) should be
> inserted 

I think this is the right idea.  You should be able to click on a tab or
button that changes the view from the image to a  text editor.  This is
not hard to do using Activity.set_canvas(), and there are also other ways.

> which when clicked will take user directly to desenho.py (inside
> pippy activity)...such that user will simply add his/her tool(code) over
> their.

There is no way to edit the main python code of a running activity.
Instead, you should have the user provide some python code in the text
editor, which you read in and accept as a string.   You can then execute
the contents of the string with eval() [1].

[1] http://docs.python.org/library/functions.html#eval

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090903/2e0e9162/attachment.pgp 


More information about the Sugar-devel mailing list