Home > other >  Come in and have a look and help me to analyse the comparison of these two python file, where is the
Come in and have a look and help me to analyse the comparison of these two python file, where is the

Time:09-16

There is a getname. Py

One paragraph is
.
The response=json. Loads (result. The read ())
Result. The close ()
: the total number of print ", "len (response [' result '])
For the user in the response [' result '] :
User ID: "print", the user [' userid '], "host name:", the user [' name '], ", "
.

Run the./getname. Py
Output the result:

The total number of 5
User ID: 001 user name: Jack,
User ID: 002 user name: Lisa,
User ID: 003 user name: zhang SAN,
User ID: 004 user name: li si,
User ID: 005 user name: John,

There is another test. Py

Content is the
Print "total: 5"
Print user ID: 001 user name: "Jack,"
Print "user ID: 002 user name: Lisa,"
Print "user ID: 003 user name: zhang SAN,"
Print "user ID: 004 user name: li si,"
Print user ID: 005 user name: "John,"

Run the./test. Py output is the result of the

The total number of 5
User ID: 001 user name: Jack,
User ID: 002 user name: Lisa,
User ID: 003 user name: zhang SAN,
User ID: 004 user name: li si,
User ID: 005 user name: John,

And front getname. Py output the result is almost the same, so the two output is essentially the difference is in where?
Because she has a problem, the getname. Py the output of the need to deal with the again, I got this result, ready to deal with again, and found that I got this result is that the

The total number of 5
User ID: 001 user name: Jack,
User ID: 002 user name: Lisa,
User ID: 003 user name:

Starting from zhang SAN, the content of the back and the Chinese no longer shows here? What's the matter? Then I tried to change the zhang SAN to Rose, li si to Mike can normal to get such result
User ID: 001 user name: Jack,
User ID: 002 user name: Lisa,
User ID: 003 user name: Rose,
User ID: 004 user name: Mike,
User ID: 005 user name: John,

As to take the test. The result of py, is normal, can directly take to such result
User ID: 001 user name: Jack,
User ID: 002 user name: Lisa,
User ID: 003 user name: zhang SAN,
User ID: 004 user name: li si,
User ID: 005 user name: John,

Say more, I hope you can understand what I mean, I just hope the getname. Py results, to
User ID: 001 user name: Jack,
User ID: 002 user name: Lisa,
User ID: 003 user name: zhang SAN,
User ID: 004 user name: li si,
User ID: 005 user name: John,
How to revise the getname. Py to get the results I want? I don't know is where there is a problem now?

CodePudding user response:

Grass, I read it twice to read,
Test. The content of py is dead, is the test. The py the content inside the
Getname. Py content is the file, the file content changed, getname, py results changed

CodePudding user response:

A malicious person, you can read this!!!!!!

CodePudding user response:

In a language implements, end,

CodePudding user response:

This should is because the character set or encoding problem. Before utf-8 or load should be specified when the coding can be solved
  • Related