A strange question about PYTHON strings, I can't figure it out
淡淡烟草味
淡淡烟草味 2017-05-18 10:50:20
0
2
578

Using python to make restful api server, on home computer and work computer, now I encounter some strange problems

Use postman to send a post request. The value of the key received by the home computer will be found to be u'Chinese' when debugging is interrupted. However, if it is a computer at work, it will be displayed as 'Chinese' when debugging is interrupted. Yes, the difference is whether there is a u in front or not. This difference between the two computers almost makes me depressed,

I am using python 3.61 64bit, and the environment is synchronized using requirements.txt. The installed libraries should be consistent. Why does this happen? how to solve this problem? The difference between the two computers is killing me

The code should be the same, use github to synchronize the warehouse of two computers

Is it related to the settings of pycharm I use?

淡淡烟草味
淡淡烟草味

reply all(2)
phpcn_u1582

Py3’s strings are unicode by default, regardless of whether there is a u prefix or not

小葫芦

Are the Python versions of the two environments inconsistent? Those with u are generally generated by py2. Just change the Python version to py3

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!