• # python3.6以上版本

    def get_bcc(inputStr: str) -> str:
    bcc = 0
    for i in inputStr.split(' '):
    bcc = bcc ^ int(i, 16)
    return f'{bcc:x}'


    def test():
    inputStr = "23 23 02 35 35 36 36 37 37 35 35 36 36 37 37 35 35 36 36 37 02 01 00 a1 13 0b 04 0b 1d 20 03 C8 01 00 00 00 00 00 00 35 35 36 36 37 37 35 35 36 36 37 37 35 35 36 36 37 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 00 02 32 00 64 af af 01 90 03 e8 13 88 13 88 7d 03 e8 28 60 28 60 01 f4 5a 7d 01 07 3b 5e 64 01 d4 a9 da 00 00 03 e8 80 01 7d 00 00 00 64 5a 00 00 13 88 00 00 00 32 28 60"
    assert get_bcc(inputStr) == "43"

  • 实在是百度不出来

    😂 你都百度了啥。。。。百度下“python 循环导入”吧

  • 一般很少这样用吧,pytest就是单元测试,注意控制变量啊,我用pytest-lazy-fixture插件试了下好像可以,如果有更好的方式请告诉我🤔

    import pytest


    class Test_case123:

    @pytest.fixture(params=[pytest.lazy_fixture('get_x'),
    pytest.lazy_fixture('get_y')])
    def param_info(self, request):
    return request.param

    @pytest.fixture
    def get_x(self):
    return self.__class__.x

    @pytest.fixture
    def get_y(self):
    return self.__class__.y

    def test_1(self):
    self.__class__.x = "希望小学"

    def test_2(self):
    self.__class__.y = "希望小学生"

    @pytest.mark.parametrize('z', [pytest.lazy_fixture('param_info')])
    def test_3(self, z):
    assert "希望" in z
  • 夜未央 at October 22, 2019

    看见=号结尾一般就是base64编码😂

  • 我确实有每天定时跑线上冒烟的自动化脚本需求,但是目前云真机都太贵了,用不起用不起😂

  • sudo python3 setup.py install 试试

  • 有线耳机也有风险,看这个http://tieba.baidu.com/p/6133768735#

  • 首先就应该把外放的音量调到最低。。。

  • int和integer的数据结构是不一样的,需要先进行转化

    select = jpype.java.lang.Integer(1)
  • 这是base64编码的图片数据,用base64去解码后就可以了

    import base64
    img_base64 = 'iVBORw0KGgoAAAANSUhEUgAAAKAAAABGCAMAAAB8DG+AAAAAP1BMVEUAAAA9fEB6uX1SkVVvrnIPThJPjlJ5uHwubTEcWx9TklZioWU1dDh3tno9fEA0czd3tnowbzMUUxcKSQ0xcDSd5F48AAAAAXRSTlMAQObYZgAAA0xJREFUeJzsmduO4yAMhm2qNu1Fm4u+/7uu0nDwESZAtb2IpdWMMsR8/NjGZOG000477bTTTjuty3D7h58f8x3PcIMbHe4/hNPX69XnNGx4OIUQpXG+HkKEEIJw1Y0HWbo5gNFRwDkKRjjqegSQLBemCChSQwEei0GxFzNyRABpwGPOmIIzTPHYhI/H44C7mdXKBjT4KGHwvU0upQaNuTk7YHocQnAGz6p7VY+uguV5yHB8SyfVvQaMt8dCWLOyf0FBvcUmNCCu9DmagHYFWOYDWqPWdUW+Cl7xXMJlGSGUHp0yyBVEIJVOBGH8lWbPOJ+c1xgEZUJxXCOoGDQOzG5Aq1NQe76h0X3ktYXy5a4NeKPwHGFMpzraC0dTQTABkycSo/f7HeD53AjD5XLpI0zrtgDTrpe/1PiYgpvd7zth5OsizAraSZge5fCPD1Jyoqo+NHsi4Md6AYEUWP9gyeyF70PI+ViSbc5mAXIY9iRBC9AIiCVGUa0ux2AhHOcTrQ1XDksO74D5DXqooFjfLEO79QJS44CQLsuSiRD52Sw8TOJDa5OA1TikA0kxAcDK4bz/vqfUbYSw0XlFBQWHzGFxjBS+T0rdbr2EWE0QUAqqvcx++H2pbMpxBVl0mROiraB5fZbvQVnOASY1OwILbz1Ej0+vNW7l+WzqbmFZXZDlwQDkParsaar+RwERXTWMVjGv5a+I/RKSS48zExdWaILYvJ7jKGMJJMcBkvJIoo/9saWhWSGOQVYnUPcjeTNp8Dlt5iRDYCkhZzJTP7+pSuc3EX0JxXC0P259jRCNdAcfkI9Dq9nm/td1FRMeXAWNIS2hUTw9CWlOMz5B2BT6/X5bfEBzsuoO/QIUAa/Xax2wVrve70JYtos0gqJftF25/iPf9Rr9OIAVFTNgbuL9OO+qvwgRcF+bisFWPiVAzE2p+2ZvWibAyuts4zQh/VKv38udzAihl9R5JqfIZhBHZ78iHjYrzS0GI6Brs3MFx25sfo8iQfRNzpenUz+VCdRdHVF8XWtO3yWfkavEYcVIpROxNfnY9Pn+YFnHZuD+L1MNwW8attPqtN+y8h9qv2khTCYc/PaorBvQSZLhr6PSegHdNJ6toB2D/wIAAP//DV8OoEXRcU8AAAAASUVORK5CYII='
    img_bin = base64.decodestring(img_base64)
    with open('base64.png', 'wb') as f:
    f.write(img_bin)