The following script is script1.py:
A= ' AAAA '
b= ' bbbb '
Print A,b,c
1. Use import in command line interactive mode 1:
>>>import SCRIPT1
Then enter the command print separately:
>>>print script1. A, Script1. B, Script1. C
>>>print A,b,c
The results are as follows:
Can see
Print script1. A, Script1. B, Script1. C Normal fetch to the value of A,b,c
But print a,b,c an error, and a didn't declare it.
2. Use the From ... import ... The way to import:
>>>from script1 Import A,b,c
Enter the command to print separately:
>>>print script1. A, Script1. B, Script1. C
>>>print A,b,c
The results of the operation are as follows:
As you can see, the print a,b,c correctly takes the value, but script1. A error, SCRIPT1 not declared
There are two ways to introduce the difference, the two ways to import the variable storage is this:
Python import xxx with the From XXX import XX module introduces the difference