From: Kent J. <ke...@td...> - 2004-09-08 10:04:28
|
Claire, Please include the entire error message - there should be two more lines with the actual error. You may have an indentation problem in example_py.py; it's hard to tell from your email. That would cause a SyntaxError. But your approach is kind of strange - generally you don't need to use os.system() to run a Python script from Jython. You would only need this if the Python script uses features that are not available in Jython. Normally you would just import the Python module the same way you would use it from Python. Finally, with example_py.py running from os.system, I don't think you will get a command-line window to type the input. You need to use one of the os.popen family of functions and supply an input stream. Kent > > From: "claire letienne" <cla...@ho...> > Date: 2004/08/17 Tue AM 09:37:54 EDT > To: jyt...@li... > Subject: [Jython-users] using python module: input problem > > I am trying to use simple python modules in jython, but I have a probleme > with the "input" in python: > > example_py.py: print "give a number" > a=input() > def double(a): > return a*2 > print double(a) > > example_jy.py: import os > print os.system("python example.py) > > when compiling: Traceback (most recent call last): > File "example_py.py", line 2, in ? > a=input() > > and it doesn't work > Thank you very much for your help! > Claire > > _________________________________________________________________ > Dialoguez en direct et gratuitement avec vos amis sur > http://g.msn.fr/FR1001/866 MSN Messenger ! > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |