Advertisement
Guest User

Untitled

a guest
Jan 25th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. test.py
  2. -------
  3. import Test
  4.  
  5. class TargetClass(object):
  6. def _getattribute(self):
  7. return self.__attribute
  8. def _setattribute(self, value):
  9. self.__attribute = value
  10. attribute = property(_getattribute, _setattribute)
  11.  
  12. target = TargetClass()
  13. test = Test(target=target)
  14. test.value = ('bleh', 'blah')
  15. print target.attribute
  16.  
  17.  
  18. Test.java
  19. ---------
  20. import org.python.core.PyObject;
  21.  
  22. public class Test {
  23. public PyObject target;
  24.  
  25. public void setValue(PyObject value) {
  26. target.__setattr__("attribute", value);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement