{"id":13932913,"url":"https://github.com/tomoncle/Python-notes","last_synced_at":"2025-07-19T16:32:12.962Z","repository":{"id":97147011,"uuid":"104102734","full_name":"tomoncle/Python-notes","owner":"tomoncle","description":"Python related technologies used in work: crawler, data analysis, timing tasks, RPC, page parsing, decorator, built-in functions, Python objects, multi-threading, multi-process, asynchronous, redis, mongodb, mysql, openstack, etc.","archived":false,"fork":false,"pushed_at":"2019-05-05T01:39:36.000Z","size":380,"stargazers_count":102,"open_issues_count":0,"forks_count":52,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-23T21:42:26.261Z","etag":null,"topics":["bs4","matplotlib","mlab","mongodb","mysql","numpy","openstack","python27","redis","rpc","scheduler","xpath"],"latest_commit_sha":null,"homepage":"https://tomoncle.github.io/PythonStudy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomoncle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-19T16:57:16.000Z","updated_at":"2024-02-29T04:50:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc3e5ad8-ab45-49ea-a449-f832be9e9e5f","html_url":"https://github.com/tomoncle/Python-notes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomoncle%2FPython-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomoncle%2FPython-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomoncle%2FPython-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomoncle%2FPython-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomoncle","download_url":"https://codeload.github.com/tomoncle/Python-notes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226643847,"owners_count":17662967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bs4","matplotlib","mlab","mongodb","mysql","numpy","openstack","python27","redis","rpc","scheduler","xpath"],"created_at":"2024-08-07T21:01:21.400Z","updated_at":"2024-11-26T23:30:47.687Z","avatar_url":"https://github.com/tomoncle.png","language":"Python","readme":"# Python Study\n\u003e 控制台打印乱码： **` print '你好，世界！'.decode('utf-8') `**\n\n```python\nurl = 'http://{0}:{1}/{2}'.format('0.0.0.0', 2375, 'xxx')\nurl = 'http://{ip}:{port}/{uri}'.format(ip='0.0.0.0', port=2375, uri='xxx')\nurl = 'http://%s:%d/%s' % ('0.0.0.0', 2375, 'xxx')\n```\n\n## Windows Python 依赖库[ **PythonLibs**](http://www.lfd.uci.edu/~gohlke/pythonlibs/)\n* 1.找到对应的 `whl` 包下载\n* 2.直接`pip install *.whl` 或者修改`.whl`文件为`.zip`文件，解压缩文件的`Python文件夹`复制到--`python`安装目录下的`Lib`--目录下\n\n## [Python 中文翻译文档集合](http://python.usyiyi.cn/)\n## [Python 官方文档](https://docs.python.org/2.7/)\n## [Top Python APIs](https://www.programcreek.com/python/index/module/list)\n\n## Python2.7环境变量\n\u003e 假如`sys.path`不对,则使用Python终端 ` sys.path = [...] `重新设置即可.\n\u003e 默认环境配置如下：\n\n```shell\nroot@node-40:~# python\nPython 2.7.6 (default, Jun 22 2015, 17:58:13) \n[GCC 4.8.2] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import sys \n\u003e\u003e\u003e sys.path\n['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7']\n\u003e\u003e\u003e \n```\n```shell\n# /etc/profile\n\nexport PYTHONPATH=/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7\nexport PATH=$PATH:$PYTHONPATH\n```\n\n## Windows环境`Python2.7`与`Python3.x` 共同使用\n\n* Python2.7 : `$ py -2`\n* Python3.x : `$ py -3`\n* Python2.7 pip : `$ py -2 -m pip xxx`\n* Python3.x pip : `$ pip3 xxx`\n\n## pycharm\n\u003e settings\n\n* enable Code compatibility inspection: `settings` --\u003e `code compatibility inspection`\n\n## Python内置工具\n\n* 下载服务器：\n  * Python2.x\n     * `$ python -m SimpleHttpServer` 默认端口8000\n     * `$ py -2 -m SimpleHTTPServer` 默认端口8000\n     * `$ py -2 -m SimpleHTTPServer 9090` 指定端口9090\n     * 使用代码：\n     ```python\n     import SimpleHTTPServer\n\n     SimpleHTTPServer.test()\n     ```\n  * Python3.x\n     * `$ python -m http.server`\n     * `$ py -3 -m http.server`\n\n* Json格式化：`$ curl http://localhost:8080/get | python -m json.tool`\n\n* 执行Python代码：`$ python -c \"print 'hello world!'\"`\n\n* 解压zip包：\n  * 创建zip包：`$ python -m zipfile -c tom.zip tom.txt`\n  * 解压zip包：`$ python -m zipfile -e tom.zip .`\n  * 查看zip包：`$ python -m zipfile -l tom.zip`\n\n\n* 文件处理：\n  ```python\n  import shutil\n\n  shutil.copy('C:\\Users\\Administrator\\Desktop\\ctools2.rar','q.rar')\n  ```\n\n\n## 关于Python工作中的一些总结性技术\n\n* [爬虫](https://github.com/tomoncle/PythonStudy/tree/master/crawlers/)\n* [RPC](https://github.com/tomoncle/PythonStudy/tree/master/rpc/)\n* [定时任务](https://github.com/tomoncle/PythonStudy/tree/master/scheduler_task/study_apscheduler/)\n* [mysql](https://github.com/tomoncle/PythonStudy/tree/master/contributed_modules/mysql/)\n* [mongodb](https://github.com/tomoncle/PythonStudy/tree/master/contributed_modules/mongodb/)\n* [redis](https://github.com/tomoncle/PythonStudy/tree/master/contributed_modules/redis/)\n* [数据分析](https://github.com/tomoncle/PythonStudy/tree/master/data_analysis/)：`maptplotlib`, `malb` , `numpy`, `tesseract`\n* [页面解析技术](https://github.com/tomoncle/PythonStudy/tree/master/page_parser/): `bs4`, `xpath`\n* [openstack开源模块](https://github.com/tomoncle/PythonStudy/tree/master/OpenStack/oslo_/)\n* [Python 装饰器](https://github.com/tomoncle/PythonStudy/tree/master/decorator.md)\n* [Python 多线程/多进程](https://github.com/tomoncle/PythonStudy//tree/masterstandard_library/threads/)\n* [Python 内置模块](https://github.com/tomoncle/PythonStudy/tree/master/standard_library/)\n* [Python 使用技巧](https://github.com/tomoncle/PythonStudy/tree/master/skills)\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomoncle%2FPython-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomoncle%2FPython-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomoncle%2FPython-notes/lists"}