ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Jython-dev
Jython-dev
[Jython-dev] Having trouble using telnetlib.py
by Anand, Shashvat other posts by this author
Nov 11 2003 4:04PM messages near this date
Re: [Jython-dev] Problems installing the jython | Re: [Jython-dev] Having trouble using telnetlib.py
Hi there,
I'm new to jython and am trying to port some simple code written in python to jython.  The m
ain problem I am having is importing telnetlib.py.
I continue to get the message "ImportError: no module named select"

Looking at http://www.jython.org/docs/differences.html, I think my understanding is that sel
ect is a built in extension module that doesn't exist in Jython.  But, I'm a little confused
 because does that mean that I can't use telnetlib.py?  Is there some other way to get aroun
d this? 

I did look on the newsgroups for jython, and the last person with this problem was in 2001, 
but I didn't quite understand how it was solved.

Looking for some assistance.   Here's the beginning of my code.  

import org.python.util.PythonInterpreter; 
import org.python.core.*; 
 
public class SimpleEmbedded
{ 
    public static void main(String []args)
               throws PyException
    { 
               PythonInterpreter interp =
                   new PythonInterpreter();
 
               System.out.println("Hello, brave new world");


//               interp.exec("import getpass");
               interp.exec("import sys");
               interp.exec("import telnetlib");    


               interp.set("a", new PyInteger(42));
               interp.exec("print a");
               interp.exec("x = 2+2");
               PyObject x = interp.get("x");
               System.out.println("x: "+x);
               System.out.println("Goodbye, cruel world");
    }
}


Just running this code gives me the error.  




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Jython-dev mailing list
Jython-dev@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-dev
Thread:
Anand, Shashvat
Kent Johnson

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved