How to print the variable?

Hans Schwaebli hans_schwaebli at yahoo.com
Wed Feb 14 08:47:31 EST 2007


Hi,
   
  am am a Python beginner with Java knowledge background. Infact I need to use Jython.
   
  My first beginner question is how to determine of what type a variable is?
   
  In program which supports Jython there is a variable called "rc" available. I can use the methods on that variable like rc.logMessage("hello"). But if I try to execute "print "${rc}" it tells me "Invalid variable syntax for attribute 'code' with value 'print "${rc}".'
   
  In Java I can print any variable. What I want is to do something like variable.getClass().getName(). Can this be done with that rc variable in Python/Jython scripts?
   
  Then I would know how to instantiate the rc variable.
   
  I apologize for my beginner questions. I should read more or get a teaching, but the last I won't get and for the first I have not so much time.
   
  Thanks in advance.

 
---------------------------------
Now that's room service! Choose from over 150,000 hotels 
in 45,000 destinations on Yahoo! Travel to find your fit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070214/e868cdd0/attachment.html>


More information about the Python-list mailing list