import requests
url='http://xxx:15672/api/queues/ponponon-it?page=1&page_size=100&name=&use_regex=false&sort=messages&sort_reverse=true&pagination=true'
response=requests.get(url)
items:list[dict]=response.json()['items']
items
上面的代码,死活无法用快捷键格式化,所以手动输入 autopep8 看看
╰─➤ autopep8 dev/rabbtimq_queues.py --in-place 130 ↵
Traceback (most recent call last):
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/bin/autopep8", line 8, in <module>
sys.exit(main())
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 4548, in main
results = fix_multiple_files(args.files, args, sys.stdout)
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 4443, in fix_multiple_files
ret = _fix_file((name, options, output))
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 4413, in _fix_file
return fix_file(*parameters)
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 3615, in fix_file
fixed_source = fix_lines(fixed_source, options, filename=filename)
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 3595, in fix_lines
fixed_source = fix.fix()
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 618, in fix
self._fix_source(filter_results(source=''.join(self.source),
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 562, in _fix_source
modified_lines = fix(result)
File "/Users/ponponon/.local/share/virtualenvs/crawler_console-J8uqt1Xz/lib/python3.10/site-packages/autopep8.py", line 766, in fix_e225
pycodestyle.missing_whitespace_around_operator(fixed, ts))
AttributeError: module 'pycodestyle' has no attribute 'missing_whitespace_around_operator'. Did you mean: 'whitespace_around_operator'?
懒得去管是哪个模块引起的问题了
先无脑升级第三方试试
─➤ pip install --upgrade -r requirements-dev.txt && pip install --upgrade -r requirements-prd.txt
升级之后,问题就解决了
具体是哪个包引起的问题,我懒得去找了,反正全部升级就对了
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。