Python Forum
What is error: "TypeError: 'module' object is not callable"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is error: "TypeError: 'module' object is not callable"
#1
import getpass
import sys
import telnetlib
HOST = input("Enter device IP: ")
user = input("Enter your telnet user: ")
password = getpass.getpass()
tn = telnetlib(HOST)
tn.read("Username: ")
tn.write(user + "\n")
if password:
	tn.read_until("Password: ")
	tn.write(password + "\n")
tn.write("enable\n")
tn.write("cisco\n")
tn.write("config t\n")
tn.write("int loopback 0\n")
tn.write("ip address 1.1.1.1 255.255.255.255\n")
tn.write("end\n")
tn.write("exit\n")
print(tn.read())
Anyone help me this error:
Error:
Traceback (most recent call last): File "D:\NetworkAutomation\AssignIP.py", line 7, in <module> tn = telnetlib(HOST) TypeError: 'module' object is not callable
Thanks you so much.
Reply


Messages In This Thread
What is error: "TypeError: 'module' object is not callable" - by phutran - Apr-18-2020, 08:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'str' object is not callable peterkl 10 11,922 Oct-17-2016, 06:45 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020