Home > other >  Python import module
Python import module

Time:12-05

Consult everybody python beginner, there is a problem,

Amy polumbo y, I have import some of the modules,
 

The from urllib. Request the import urlopen
The from urllib. Parse the import urlencode
The import json
The import contextlib
The import webbrowser
The import pprint
The import OS
The import CSV

Application of p. y, I direct import Amy polumbo y
 

The import smtplib
From the email. The header import header
From email. Mime. The text import MIMEText
From email. Mime. Image import MIMEImage
From email. Mime. Multipart import MIMEMultipart
Import A
The from urllib. Request the import urlopen
The import contextlib

Originally I thought program has the import of A, B the import of A module can be directly used in B,
But found that is not right, but also the import you need in the B part (e.g., the last two lines in the program B),
Why is this?
  • Related