├── .gitignore ├── README.md ├── chaoxi ├── 2020-11-08-plotly │ └── plotpy_test.ipynb ├── 521_love │ ├── love.py │ └── love1.py ├── BaseMap │ ├── Python_BaseMap1.py │ └── main_city ├── Earth_view │ ├── guizhou_map_3d.html │ ├── guizhou_map_3d.py │ ├── map3d_china_base.html │ ├── map3d_china_base.py │ ├── world_map.html │ ├── world_map.py │ ├── world_map_3d.html │ └── world_map_3d.py ├── FilesToPDF │ └── files2pdf.py ├── Image_Recogn │ └── main.ipynb ├── Matplotlib_3D │ ├── Matplotlib_line.py │ ├── matplotlib_3d.py │ ├── matplotlib_3d1.py │ ├── matplotlib_diagram.py │ └── review_2d.py ├── Pandas1 │ └── pandas_example.py ├── Pandas2 │ └── pandas_example1.py ├── Plotly-express │ └── Plotly_Express.ipynb ├── Plotly-graph │ └── Python-graph-lines.ipynb ├── Python_xlwings │ └── Handle_excel.py ├── README.md ├── Turtle_time │ ├── Nixie_tube.py │ ├── love_python.py │ └── turtle_time.py ├── Women │ └── women_code.py ├── five_code │ ├── baidu_code.png │ ├── five_code.py │ └── wordcloud.txt ├── flower │ └── flower_tree.py ├── mother_day │ ├── mother's_day_word.py │ ├── mother.jpg │ ├── mother1.jpg │ └── mother_love.py ├── opencv_img │ └── opencv_img.py ├── pkq │ ├── pikaqiu1.py │ └── pikaqiu2.py ├── python_sort │ └── python_sort.py ├── qixi │ ├── biu.py │ ├── erweima.py │ └── sumiao.py ├── twoai_chat │ ├── moli_chat.py │ ├── tuling_chat.py │ └── twoai_chat.py ├── work_pro │ ├── cac_txt.py │ ├── phone_excel.py │ └── phone_txt.py └── xlsxwriter │ └── Python_excel_xlsxwriter.py ├── doudou ├── 2020-03-27-duo-la-a-meng │ └── duo-la-a-meng.py ├── 2020-03-27-pyechars │ └── my_pyechars.py ├── 2020-04-04-greedy-snake │ ├── db.txt │ ├── greedy_snake.py │ └── pygame_hello_world.py ├── 2020-05-17-520 │ └── love.py ├── 2020-05-17-character-drawing │ └── image_to_chars.py ├── 2020-06-12-maze │ └── maze.py ├── 2020-06-19-skills │ └── skills.py ├── 2020-11-10-resisting-us-aid-korea │ └── app.py ├── 2021-01-02-GitHub-Python-Top10 │ └── app.py ├── 2021-01-10-fake-data │ ├── api.py │ ├── faker_app.py │ └── mimesis_app.py ├── 2021-03-09-programmer-romance │ └── poetry.md ├── 2021-09-08-text-img │ ├── AliPuHui-Bold.ttf │ ├── app.py │ └── moon.png ├── 2021-10-21-pig │ └── app.py ├── 2021-10-28-pillow │ ├── AliPuHui-Bold.ttf │ ├── app.py │ └── cat.jpg ├── 2021-12-31-img-excel │ ├── 03.png │ └── app.py ├── 2022-04-29-turtle │ ├── t_3.py │ ├── t_android.py │ ├── t_feiji.py │ ├── t_view.py │ └── t_yingtao.py ├── 2022-05-16-turtle │ └── app.py ├── 2022-05-18-games │ ├── 001.py │ ├── 002.py │ ├── 003.py │ ├── 004.py │ └── 005.py ├── README.md └── python-office-automation │ └── app.py ├── fans ├── README.md ├── beautyPandas │ └── beautyp.py ├── dns │ └── demo.py ├── filenaming │ └── demo.py ├── imgupload │ └── imgupload.py ├── shift │ └── ssw.txt ├── sqlquery │ └── 代码获取.txt └── tricat │ └── tricat.py ├── jiguang ├── README.md └── oneline │ └── line.py ├── moumoubaimifan ├── README.md ├── convertHtml │ └── convertHtml.py ├── face_contrast │ └── face_contrast.py ├── filestools │ ├── filestoolsDemo.py │ ├── 一线城市.log │ └── 一线城市2.log ├── game │ └── game.py ├── psutil-flask │ ├── app.py │ └── templates │ │ ├── components.html │ │ ├── index.html │ │ ├── macro │ │ ├── nb_components.html │ │ ├── nb_jupyter_globe.html │ │ ├── nb_jupyter_lab.html │ │ ├── nb_jupyter_lab_tab.html │ │ ├── nb_jupyter_notebook.html │ │ ├── nb_jupyter_notebook_tab.html │ │ ├── nb_nteract.html │ │ ├── simple_chart.html │ │ ├── simple_globe.html │ │ ├── simple_page.html │ │ └── simple_tab.html ├── pysnooper │ └── longestCommonPrefix.py ├── removeWatermark │ └── removeWatermark.py ├── simple_pip_upload │ ├── LICENSE │ ├── README.md │ ├── example │ │ ├── __init__.py │ │ └── math.py │ └── setup.py └── siri │ └── siri.py ├── qingxiangke ├── PandasSift │ └── main.py ├── README.md ├── easyWeb │ └── main.py ├── joint │ └── main.py ├── pandasMerge │ └── main.py └── shift │ └── ssw.txt ├── taiyangxue ├── README.md ├── busclock │ ├── BusClock.py │ ├── config.json │ ├── config.py │ ├── mail.py │ ├── requirements.txt │ └── service.py ├── dice │ ├── asset │ │ ├── dice │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ └── 6.png │ │ └── rolling │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ └── 4.png │ └── rollDice.py ├── diffusionsimulator │ ├── app.py │ └── people.py ├── fake-thread │ └── main.py ├── matrix │ ├── chain.py │ ├── eatjs.py │ ├── is.py │ ├── sting.py │ └── walrus.py ├── mazegame │ ├── maze.py │ └── mazegame.py ├── meta │ ├── metaClient.py │ ├── metaServer.py │ └── serversocket.py ├── pygame │ ├── chimp.py │ └── chimp_data │ │ ├── chimp.bmp │ │ ├── fist.bmp │ │ ├── punch.wav │ │ └── whiff.wav ├── pypandoc │ └── code.py ├── python-thread │ ├── code.py │ └── data.txt ├── python39 │ └── app.py ├── pythondocx │ └── word.py ├── pythonxlsx │ └── app.py ├── pywebview-flask │ ├── app.py │ ├── main.py │ ├── requirements.txt │ └── templates │ │ ├── detail.html │ │ └── index.html ├── recursion │ └── fractalTree.py ├── resize │ └── app.py ├── sandman2 │ ├── app.py │ └── sandman2_test_data.sql ├── showdata │ ├── analyse │ │ ├── baidu_api.py │ │ └── main.py │ ├── ip_cache.txt │ ├── ironman │ │ ├── app.py │ │ ├── data.py │ │ ├── nginx_log_data.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── barrager.css │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── dashboard.css │ │ │ │ ├── shCoreDefault.css │ │ │ │ └── style.css │ │ │ └── js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── china.js │ │ │ │ ├── echarts-wordcloud.min.js │ │ │ │ ├── echarts.js │ │ │ │ └── echarts.min.js │ │ └── templates │ │ │ ├── bar.html │ │ │ ├── china.html │ │ │ ├── index.html │ │ │ ├── layout.html │ │ │ ├── line.html │ │ │ ├── pie.html │ │ │ └── wordcloud.html │ ├── nginx_access.zip │ └── requirements.txt ├── simple-game │ ├── v1.py │ ├── v2.py │ └── v3.py ├── simplenumpy │ └── app.py ├── timefriend │ ├── test.py │ └── timefriend.py └── why │ └── app.py ├── wuya ├── README.md ├── imgmodify │ └── imgmodify.py └── level │ ├── doc │ └── 1_evidence.xls │ └── level_count.py ├── xianhuan ├── .DS_Store ├── README.md ├── bosscoming │ └── monitor.py ├── changeFace │ └── changeface.py ├── charPic │ └── demo.py ├── christmashat │ └── christmashat.py ├── christmastree │ └── christmastree.py ├── circlegame │ └── circlegame.py ├── couplets │ └── draw1.py ├── cut-pic │ ├── cut_nine.py │ └── mv.jpg ├── drawclock │ └── drawclock.py ├── enhancevideo │ └── enhancevideo.py ├── extractaudio │ └── demo.py ├── facemerge │ ├── boy.jpg │ ├── facemerge.py │ ├── girl.jpg │ ├── man.jpg │ └── result.jpg ├── gengif │ └── gengif.py ├── glob │ └── globstudy.py ├── glom │ └── glomstudy.py ├── gooey │ └── gooeydemo.py ├── imageenhance │ └── imgeenhance.py ├── koutu │ └── koutu.py ├── loguru │ └── logurustudy.py ├── monitor │ └── monitor.py ├── morse │ └── morse.py ├── pandasexcel │ ├── pandas_excel.py │ └── tables │ │ ├── 专项户外运动装备&呼吸管-呼吸器.xlsx │ │ ├── 专项户外运动装备&安全带.xlsx │ │ ├── 专项户外运动装备&救生衣.xlsx │ │ ├── 专项户外运动装备&滑雪护具.xlsx │ │ ├── 专项户外运动装备&滑雪眼镜.xlsx │ │ ├── 专项户外运动装备&潜水袜.xlsx │ │ ├── 专项户外运动装备&脚蹼.xlsx │ │ ├── 专项户外运动装备&面镜.xlsx │ │ ├── 垂钓装备&其他垂钓用品.xlsx │ │ ├── 垂钓装备&垂钓装备.xlsx │ │ ├── 垂钓装备&太空豆.xlsx │ │ ├── 垂钓装备&打水桶.xlsx │ │ ├── 垂钓装备&抄网.xlsx │ │ ├── 垂钓装备&抄网头.xlsx │ │ ├── 垂钓装备&抄网杆.xlsx │ │ ├── 垂钓装备&支架.xlsx │ │ ├── 垂钓装备&浮漂.xlsx │ │ ├── 垂钓装备&渔具包.xlsx │ │ ├── 垂钓装备&绑钩器.xlsx │ │ ├── 垂钓装备&装鱼桶.xlsx │ │ ├── 垂钓装备&钓竿.xlsx │ │ ├── 垂钓装备&钓箱.xlsx │ │ ├── 垂钓装备&钓鱼伞.xlsx │ │ ├── 垂钓装备&钓鱼帽.xlsx │ │ ├── 垂钓装备&钓鱼手套.xlsx │ │ ├── 垂钓装备&钓鱼椅、凳.xlsx │ │ ├── 垂钓装备&铅坠.xlsx │ │ ├── 垂钓装备&铅皮.xlsx │ │ ├── 垂钓装备&饵料盒.xlsx │ │ ├── 垂钓装备&鱼护.xlsx │ │ ├── 垂钓装备&鱼线.xlsx │ │ ├── 垂钓装备&鱼线轮.xlsx │ │ ├── 垂钓装备&鱼网-虾笼-其它渔具.xlsx │ │ ├── 垂钓装备&鱼钩.xlsx │ │ ├── 垂钓装备&鱼饵.xlsx │ │ ├── 户外休闲家具&充气床.xlsx │ │ ├── 户外休闲家具&吊床.xlsx │ │ ├── 户外休闲家具&户外休闲家具.xlsx │ │ ├── 户外休闲家具&户外桌椅套装.xlsx │ │ ├── 户外休闲家具&户外椅子凳子.xlsx │ │ ├── 户外服装&一次性内裤.xlsx │ │ ├── 户外服装&冲锋衣.xlsx │ │ ├── 户外服装&冲锋裤.xlsx │ │ ├── 户外服装&户外休闲衣.xlsx │ │ ├── 户外服装&户外服装.xlsx │ │ ├── 户外服装&抓绒衣.xlsx │ │ ├── 户外服装&抓绒裤.xlsx │ │ ├── 户外服装&滑雪裤.xlsx │ │ ├── 户外服装&潜水服.xlsx │ │ ├── 户外服装&软壳裤.xlsx │ │ ├── 户外服装&运动户外风衣.xlsx │ │ ├── 户外服装&速干T恤.xlsx │ │ ├── 户外服装&速干衬衣.xlsx │ │ ├── 户外服装&速干裤.xlsx │ │ ├── 户外服装&钓鱼服.xlsx │ │ ├── 户外照明&信号灯-发光棒-救生灯.xlsx │ │ ├── 户外照明&充电器.xlsx │ │ ├── 户外照明&头灯.xlsx │ │ ├── 户外照明&户外照明.xlsx │ │ ├── 户外照明&手电筒.xlsx │ │ ├── 户外照明&电池-燃料.xlsx │ │ ├── 户外照明&营地灯-帐篷灯.xlsx │ │ ├── 户外照明&钓鱼灯.xlsx │ │ ├── 户外鞋靴&户外鞋靴.xlsx │ │ ├── 户外鞋靴&沙滩鞋-凉鞋-拖鞋.xlsx │ │ ├── 户外鞋靴&溯溪鞋.xlsx │ │ ├── 户外鞋靴&登山鞋-徒步鞋.xlsx │ │ ├── 旅行便携装备&其他.xlsx │ │ ├── 旅行便携装备&其他安全防盗产品.xlsx │ │ ├── 旅行便携装备&旅行便携装备.xlsx │ │ ├── 旅行便携装备&普通密码锁.xlsx │ │ ├── 旅行便携装备&晾衣绳.xlsx │ │ ├── 旅行便携装备&转换插头.xlsx │ │ ├── 望远镜-夜视仪-户外眼镜&垂钓望远镜.xlsx │ │ ├── 望远镜-夜视仪-户外眼镜&户外眼镜.xlsx │ │ ├── 望远镜-夜视仪-户外眼镜&普通望远镜.xlsx │ │ ├── 望远镜-夜视仪-户外眼镜&望远镜-夜视仪-户外眼镜.xlsx │ │ ├── 洗漱清洁-护理用品&防虫-防蚊用品.xlsx │ │ ├── 登山杖-手杖&登山杖-手杖.xlsx │ │ ├── 睡袋&睡袋.xlsx │ │ ├── 防护-救生装备&其他防护救生装备.xlsx │ │ ├── 防护-救生装备&急救包-急救箱.xlsx │ │ ├── 防护-救生装备&急救护理用品.xlsx │ │ ├── 防护-救生装备&求生哨.xlsx │ │ ├── 防护-救生装备&求生绳-逃生绳.xlsx │ │ ├── 防护-救生装备&防护-救生装备.xlsx │ │ ├── 防潮垫-地席-枕头&地布-地席.xlsx │ │ ├── 防潮垫-地席-枕头&枕头.xlsx │ │ ├── 防潮垫-地席-枕头&防潮垫-地席-枕头.xlsx │ │ └── 防潮垫-地席-枕头&防潮垫.xlsx ├── panextract │ └── panextract.py ├── pdfkit │ └── demo.py ├── pencilimg │ └── pencilImg.py ├── picinfo │ └── picinfo.py ├── pyautogui2 │ ├── agree.png │ └── demo.py ├── pyscript │ ├── importPackages.html │ ├── labledEles.html │ └── test.html ├── pyscripts │ ├── draftPic │ ├── pdfencry │ ├── sendEmail │ └── zipfile ├── pysimplegui │ └── demo.py ├── qrcode │ └── qrcodedemo.py ├── readwc │ ├── blackheart.jpeg │ ├── gzbg2020 │ ├── stopwordsbd.txt │ ├── wc.png │ └── words_cloud_utils.py ├── retry │ └── retryingdemo.py ├── sds │ └── christmasTree.py ├── shrinkheart │ ├── shrinkheart.py │ └── shrinkheart2.py ├── smartcode │ └── smartCode.py ├── taichi │ ├── demo.py │ └── demo2 ├── tqdm │ └── tqdmdemo.py ├── videobase │ ├── capturevideo.py │ ├── playvideo.py │ └── savevideo.py ├── videorecord │ └── video_record.py └── xpath │ └── xpathstudy.py ├── xuanyuanyulong ├── 2020-02-29-python-spiro │ ├── Spiro.py │ └── __init__.py ├── 2020-03-27-PDF-watermark │ ├── __init__.py │ ├── input.pdf │ ├── watermark.pdf │ └── watermark.py ├── 2020-08-23-getopt-parse-command-arguments │ ├── __init__.py │ ├── manually_parse_argv.py │ ├── test_getopt.py │ └── test_sys.py ├── 2020-08-24-python-dis-bytecode │ ├── __init__.py │ ├── test_compile.py │ └── test_dis.py ├── 2020-08-24-python-with-statement │ ├── __init__.py │ ├── test.txt │ ├── test_context_manager.py │ └── test_with.py ├── 2020-09-28-problem-in-print │ ├── __init__.py │ ├── flushed.py │ ├── no_flush.py │ └── self_flushed.py ├── 2020-09-28-sourcetrail-introduction │ ├── __init__.py │ └── sourcetrail_offcial_home.txt ├── 2020-10-13-import-system │ └── Project_example │ │ ├── A │ │ ├── alpha.py │ │ └── beta.py │ │ ├── B │ │ └── theta.py │ │ └── main │ │ └── main.py ├── 2020-10-20-abuse-of-list-comprehension │ └── problem.py ├── 2020-11-04-python-pdb │ └── test_pdb_intrusive.py ├── 2020-11-23-let-me-google-that-for-you │ └── __init__.py └── README.md ├── yeke ├── README.md ├── py-aljx │ ├── __init__.py │ ├── aljx_cloud.py │ ├── bg.PNG │ ├── cloud.png │ ├── stop_words.txt │ └── wb_spd.py ├── py-ascii │ ├── Courier-New.ttf │ ├── __init__.py │ ├── g1.gif │ ├── g1_ascii.gif │ ├── g2.gif │ ├── g2_ascii.gif │ ├── gif_ascii.py │ ├── static │ │ ├── static.jpg │ │ └── static_ascii.jpg │ ├── static_ascii.py │ └── tmp │ │ ├── g2_tmp_0.png │ │ ├── g2_tmp_1.png │ │ ├── g2_tmp_2.png │ │ ├── g2_tmp_3.png │ │ ├── g2_tmp_4.png │ │ └── g2_tmp_5.png ├── py-cflag │ ├── __init__.py │ ├── america_flag.py │ ├── china_flag.py │ ├── japan_flag.py │ └── switzerland_flag.py ├── py-counter │ ├── __init__.py │ ├── __pycache__ │ │ └── counter.cpython-36.pyc │ ├── build │ │ └── counter │ │ │ ├── Analysis-00.toc │ │ │ ├── EXE-00.toc │ │ │ ├── PKG-00.pkg │ │ │ ├── PKG-00.toc │ │ │ ├── PYZ-00.pyz │ │ │ ├── PYZ-00.toc │ │ │ ├── Tree-00.toc │ │ │ ├── Tree-01.toc │ │ │ ├── base_library.zip │ │ │ ├── counter.exe.manifest │ │ │ ├── warn-counter.txt │ │ │ └── xref-counter.html │ ├── counter.py │ ├── counter.spec │ └── dist │ │ └── counter.exe ├── py-discern │ ├── __init__.py │ ├── card.jpg │ └── idcard_discern.py ├── py-facepalm │ ├── __init__.py │ └── facepalm.py ├── py-firework │ ├── __init__.py │ ├── bg.jpeg │ └── fw_demo.py ├── py-flag │ ├── __init__.py │ ├── apple.jpg │ ├── apple.py │ ├── apple_head.jpg │ ├── head.jpg │ ├── head_flag.py │ ├── sc.jpg │ └── sc_head.jpg ├── py-minesweep │ ├── __init__.py │ ├── minesweep.py │ └── resources │ │ ├── 0.bmp │ │ ├── 1.bmp │ │ ├── 2.bmp │ │ ├── 3.bmp │ │ ├── 4.bmp │ │ ├── 5.bmp │ │ ├── 6.bmp │ │ ├── 7.bmp │ │ ├── 8.bmp │ │ ├── a.TTF │ │ ├── ask.bmp │ │ ├── blank.bmp │ │ ├── blood.bmp │ │ ├── error.bmp │ │ ├── face_fail.bmp │ │ ├── face_normal.bmp │ │ ├── face_success.bmp │ │ ├── flag.bmp │ │ └── mine.bmp ├── py-mouse │ ├── __init__.py │ └── draw_mouse.py ├── py-plane │ ├── __init__.py │ ├── __pycache__ │ │ └── pl_model.cpython-36.pyc │ ├── pl_main.py │ ├── pl_model.py │ └── resources │ │ └── image │ │ ├── bg.png │ │ ├── bg_game_over.png │ │ ├── pause.png │ │ ├── plane.png │ │ ├── shoot.png │ │ └── start.png ├── py-qrcode │ ├── __init__.py │ ├── bg.jpg │ ├── gmqr.png │ ├── gmyqr.gif │ ├── gzh.jpg │ ├── my.gif │ ├── myqr.gif │ ├── myqr.png │ ├── myqr_demo.py │ ├── parseqr_demo.py │ ├── pmyqr.png │ ├── qr.jpg │ └── qr_demo.py ├── py-rain │ ├── __init__.py │ ├── code_rain.py │ ├── num_rain.py │ ├── pic.gif │ └── pic_rain.py ├── py-recogLP │ ├── __init__.py │ ├── car.jpeg │ ├── cars.png │ ├── recogLP_demo1.py │ └── recogLP_demo2.py ├── py-scratch │ ├── __init__.py │ ├── prize │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ └── 6.jpg │ └── scratch.py ├── py-snow │ ├── __init__.py │ ├── bg.jpeg │ ├── my.mp3 │ └── snow_sight.py ├── py-sun │ ├── __init__.py │ └── solar_system.py ├── py-tank │ ├── __pycache__ │ │ ├── bullet.cpython-36.pyc │ │ ├── bullet.cpython-37.pyc │ │ ├── food.cpython-36.pyc │ │ ├── food.cpython-37.pyc │ │ ├── home.cpython-36.pyc │ │ ├── home.cpython-37.pyc │ │ ├── scene.cpython-36.pyc │ │ ├── scene.cpython-37.pyc │ │ ├── tank.cpython-36.pyc │ │ └── tank.cpython-37.pyc │ ├── audios │ │ ├── Gunfire.wav │ │ ├── add.wav │ │ ├── bang.wav │ │ ├── blast.wav │ │ ├── fire.wav │ │ ├── hit.wav │ │ └── start.wav │ ├── bullet.py │ ├── font │ │ └── simkai.ttf │ ├── food.py │ ├── home.py │ ├── images │ │ ├── bullet │ │ │ ├── bullet_down.png │ │ │ ├── bullet_left.png │ │ │ ├── bullet_right.png │ │ │ └── bullet_up.png │ │ ├── enemyTank │ │ │ ├── enemy_1_0.png │ │ │ ├── enemy_1_1.png │ │ │ ├── enemy_1_2.png │ │ │ ├── enemy_1_3.png │ │ │ ├── enemy_2_0.png │ │ │ ├── enemy_2_1.png │ │ │ ├── enemy_2_2.png │ │ │ ├── enemy_2_3.png │ │ │ ├── enemy_3_0.png │ │ │ ├── enemy_3_1.png │ │ │ ├── enemy_3_2.png │ │ │ ├── enemy_3_3.png │ │ │ ├── enemy_4_0.png │ │ │ ├── enemy_4_1.png │ │ │ ├── enemy_4_2.png │ │ │ └── enemy_4_3.png │ │ ├── food │ │ │ ├── food_boom.png │ │ │ ├── food_clock.png │ │ │ ├── food_gun.png │ │ │ ├── food_iron.png │ │ │ ├── food_protect.png │ │ │ ├── food_star.png │ │ │ └── food_tank.png │ │ ├── home │ │ │ ├── home1.png │ │ │ ├── home2.png │ │ │ └── home_destroyed.png │ │ ├── myTank │ │ │ ├── tank_T1_0.png │ │ │ ├── tank_T1_1.png │ │ │ ├── tank_T1_2.png │ │ │ ├── tank_T2_0.png │ │ │ ├── tank_T2_1.png │ │ │ └── tank_T2_2.png │ │ ├── others │ │ │ ├── appear.png │ │ │ ├── background.png │ │ │ ├── boom_dynamic.png │ │ │ ├── boom_static.png │ │ │ ├── gameover.png │ │ │ ├── logo.png │ │ │ ├── mask.png │ │ │ ├── protect.png │ │ │ └── tip.png │ │ └── scene │ │ │ ├── brick.png │ │ │ ├── ice.png │ │ │ ├── iron.png │ │ │ ├── river1.png │ │ │ ├── river2.png │ │ │ └── tree.png │ ├── scene.py │ ├── start.py │ └── tank.py ├── py-teacher │ ├── HZK16 │ ├── __init__.py │ ├── card.png │ ├── hyr3gjm.ttf │ ├── img │ │ ├── 1.jpg │ │ ├── 10.jpg │ │ ├── 11.jpg │ │ ├── 12.jpg │ │ ├── 13.jpeg │ │ ├── 14.jpg │ │ ├── 15.jpg │ │ ├── 16.jpg │ │ ├── 17.jpg │ │ ├── 18.jpg │ │ ├── 19.png │ │ ├── 2.jpg │ │ ├── 20.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ └── 9.jpeg │ ├── output │ │ ├── result1.jpg │ │ ├── result2.jpg │ │ ├── result3.jpg │ │ ├── result4.jpg │ │ └── result5.jpg │ ├── py_card.py │ ├── py_pic.py │ ├── py_sun.py │ ├── test.png │ ├── test1.jpg │ ├── word.txt │ └── wordcloud2.png ├── py-tetris │ ├── __init__.py │ └── tetris.py └── py-xxl │ ├── __init__.py │ ├── py_xxl.py │ └── resources │ ├── images │ ├── gem1.png │ ├── gem2.png │ ├── gem3.png │ ├── gem4.png │ ├── gem5.png │ ├── gem6.png │ ├── gem7.png │ └── simsun.ttc │ └── simsun.ttc └── zhouluobo └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | _site/* 2 | _theme_packages/* 3 | 4 | Thumbs.db 5 | .DS_Store 6 | 7 | !.gitkeep 8 | 9 | .rbenv-version 10 | .rvmrc 11 | /vendor 12 | .idea 13 | .DS_Store 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python 代码实例 2 | 3 | Python技术 公众号文章代码库 4 | 5 | 6 | 关注公众号:python技术,回复"python"一起学习交流 7 | 8 | ![](http://favorites.ren/assets/images/python.jpg) 9 | -------------------------------------------------------------------------------- /chaoxi/BaseMap/main_city: -------------------------------------------------------------------------------- 1 | Shanghai 23019148 31.23N 121.47E China 2 | Mumbai 12478447 18.96N 72.82E India 3 | Karachi 13050000 24.86N 67.01E Pakistan 4 | Delhi 16314838 28.67N 77.21E India 5 | Manila 11855975 14.62N 120.97E Philippines 6 | Seoul 23616000 37.56N 126.99E Korea(South) 7 | Jakarta 28019545 6.18S 106.83E Indonesia 8 | Tokyo 35682460 35.67N 139.77E Japan 9 | Peking 19612368 39.91N 116.39E China 10 | -------------------------------------------------------------------------------- /chaoxi/Earth_view/world_map.py: -------------------------------------------------------------------------------- 1 | from pyecharts import options as opts 2 | from pyecharts.charts import Map 3 | from pyecharts.faker import Faker 4 | 5 | c = ( 6 | Map(init_opts=opts.InitOpts(width='1500px', height='1200px',bg_color='#E0EEEE')) 7 | # 加载世界地图实例 8 | .add("世界地图", [list(z) for z in zip(Faker.country, Faker.values())], "world") 9 | # 不显示地图标志 10 | .set_series_opts(label_opts=opts.LabelOpts(is_show=False)) 11 | .set_global_opts( 12 | # 配置项标题设置 13 | title_opts=opts.TitleOpts(title="世界地图示例"), 14 | visualmap_opts=opts.VisualMapOpts(max_=200) 15 | ) 16 | # 生成超文本文件 17 | .render("world_map.html") 18 | ) 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chaoxi/Earth_view/world_map_3d.py: -------------------------------------------------------------------------------- 1 | import pyecharts.options as opts 2 | from pyecharts.charts import MapGlobe 3 | from pyecharts.faker import POPULATION 4 | 5 | 6 | data = [x for _, x in POPULATION[1:]] 7 | low, high = min(data), max(data) 8 | c = ( 9 | MapGlobe(init_opts=opts.InitOpts(width='1000px', height='1000px',bg_color='#00BBFF'))# 10 | .add_schema() 11 | .add( 12 | maptype="world", 13 | series_name="World Population", 14 | data_pair=POPULATION[1:], 15 | is_map_symbol_show=True, 16 | label_opts=opts.LabelOpts(is_show=True), 17 | ) 18 | .set_global_opts( 19 | title_opts=opts.TitleOpts(title="3D 地球示例"), 20 | # 设置地球属性 21 | visualmap_opts=opts.VisualMapOpts( 22 | min_=low, 23 | max_=high, 24 | range_text=["max", "min"], 25 | is_calculable=True, 26 | range_color=["lightskyblue", "yellow", "orangered"], 27 | ) 28 | ) 29 | .render("world_map_3d.html") 30 | ) -------------------------------------------------------------------------------- /chaoxi/Matplotlib_3D/Matplotlib_line.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from mpl_toolkits.mplot3d import Axes3D 4 | 5 | # 依次获取画布和绘图区并创建 Axes3D 对象 6 | fig = plt.figure() 7 | ax = fig.gca(projection='3d') 8 | 9 | # 第一条3D线性图数据 10 | theta = np.linspace(-4 * np.pi, 4 * np.pi, 100) 11 | z1 = np.linspace(-2, 2, 100) 12 | r = z1**2 + 1 13 | x1 = r * np.sin(theta) 14 | y1 = r * np.cos(theta) 15 | 16 | # 第二条3D线性图数据 17 | z2 = np.linspace(-3, 3, 100) 18 | x2 = np.sin(z2) 19 | y2 = np.cos(z2) 20 | 21 | # 绘制3D线性图 22 | ax.plot(x1, y1, z1, color='b', label='3D Line1') 23 | ax.plot(x2, y2, z2, color='r', label='3D Line2') 24 | 25 | # 设置标题、轴标签、图例,也可以直接使用 plt.title、plt.xlabel、plt.legend... 26 | ax.set_title('3D Line View', pad=15, fontsize='10') 27 | ax.set_xlabel('x ', color='r', fontsize='14') 28 | ax.set_ylabel('y ', color='g', fontsize='14') 29 | ax.set_zlabel('z ', color='b', fontsize='14') 30 | ax.legend() 31 | plt.show() 32 | -------------------------------------------------------------------------------- /chaoxi/Matplotlib_3D/matplotlib_3d.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | from matplotlib import cm 3 | from matplotlib.ticker import LinearLocator, FormatStrFormatter 4 | from mpl_toolkits.mplot3d import Axes3D 5 | import numpy as np 6 | 7 | fig = plt.figure() 8 | 9 | # 指定图形类型是 3d 类型 10 | ax = fig.add_subplot(projection='3d') 11 | 12 | # 构造数据 13 | X = np.arange(-5, 5, 0.25) 14 | Y = np.arange(-5, 5, 0.25) 15 | X, Y = np.meshgrid(X, Y) 16 | R = np.sqrt(X**2 + Y**2) 17 | Z = np.sin(R) 18 | 19 | # Plot the surface. 20 | surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm, 21 | linewidth=0, antialiased=False) 22 | # Customize the z axis. 23 | ax.set_zlim(-1.01, 1.01) 24 | ax.zaxis.set_major_locator(LinearLocator(10)) 25 | ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f')) 26 | # Add a color bar which maps values to colors. 27 | fig.colorbar(surf, shrink=0.5, aspect=5) 28 | 29 | plt.show() 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /chaoxi/Matplotlib_3D/matplotlib_3d1.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from mpl_toolkits.mplot3d import Axes3D 4 | 5 | fig = plt.figure() 6 | # 指定图形类型为 3d 类型 7 | ax = fig.add_subplot(111, projection='3d') 8 | # X, Y value 9 | X = np.arange(-5, 5, 0.25) 10 | Y = np.arange(-5, 5, 0.25) 11 | 12 | # 设置 x-y 平面的网格 13 | X, Y = np.meshgrid(X, Y) 14 | R = np.sqrt(X ** 2 + Y ** 2) 15 | # height value 16 | Z = np.sin(R) 17 | 18 | # rstride:行之间的跨度 cstride:列之间的跨度 19 | # rcount:设置间隔个数,默认50个,ccount:列的间隔个数 不能与上面两个参数同时出现 20 | #vmax和vmin 颜色的最大值和最小值 21 | ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=plt.get_cmap('rainbow')) 22 | 23 | # zdir : 'z' | 'x' | 'y' 表示把等高线图投射到哪个面 24 | # offset : 表示等高线图投射到指定页面的某个刻度 25 | ax.contourf(X,Y,Z,zdir='z',offset=-2) 26 | 27 | # 设置图像z轴的显示范围,x、y轴设置方式相同 28 | ax.set_zlim(-2,2) 29 | 30 | plt.show() -------------------------------------------------------------------------------- /chaoxi/Matplotlib_3D/matplotlib_diagram.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import numpy as np 3 | from mpl_toolkits.mplot3d import Axes3D 4 | 5 | def randrange(n, vmin, vmax): 6 | 7 | return (vmax - vmin) * np.random.rand(n) + vmin 8 | 9 | fig = plt.figure() 10 | ax = fig.add_subplot(111, projection='3d') 11 | 12 | n = 100 13 | 14 | # For each set of style and range settings, plot n random points in the box 15 | # defined by x in [23, 32], y in [0, 100], z in [zlow, zhigh]. 16 | for c, m, zlow, zhigh in [('r', 'o', -50, -25), ('b', '^', -30, -5)]: 17 | xs = randrange(n, 23, 32) 18 | ys = randrange(n, 0, 100) 19 | zs = randrange(n, zlow, zhigh) 20 | ax.scatter(xs, ys, zs, c=c, marker=m) 21 | 22 | ax.set_title('3D Diagram View', pad=15, fontsize='10') 23 | ax.set_xlabel('x ', color='r', fontsize='14') 24 | ax.set_ylabel('y ', color='g', fontsize='14') 25 | ax.set_zlabel('z ', color='b', fontsize='14') 26 | 27 | plt.show() 28 | -------------------------------------------------------------------------------- /chaoxi/Matplotlib_3D/review_2d.py: -------------------------------------------------------------------------------- 1 | import matplotlib.path as mpath 2 | import matplotlib.patches as mpatches 3 | import matplotlib.pyplot as plt 4 | 5 | fig, ax = plt.subplots() 6 | Path = mpath.Path 7 | # Path 控制坐标点绘制贝塞尔曲线 8 | # 图形数据构造 9 | path_data = [ 10 | (Path.MOVETO, (1.88, -2.57)), 11 | (Path.CURVE4, (0.35, -1.1)), 12 | (Path.CURVE4, (-1.75, 1.5)), 13 | (Path.CURVE4, (0.375, 2.0)), 14 | (Path.LINETO, (0.85, 1.15)), 15 | (Path.CURVE4, (2.2, 3.2)), 16 | (Path.CURVE4, (3, 0.05)), 17 | (Path.CURVE4, (2.0, -1.5)), 18 | (Path.CLOSEPOLY, (1.58, -2.57)), 19 | ] 20 | codes,verts = zip(*path_data) 21 | path = mpath.Path(verts, codes) 22 | patch = mpatches.PathPatch(path, facecolor='r', alpha=0.5) 23 | ax.add_patch(patch) 24 | # plot control points and connecting lines 25 | x, y = zip(*path.vertices) 26 | line, = ax.plot(x, y, 'go-') 27 | ax.grid() 28 | ax.axis('equal') 29 | plt.show() -------------------------------------------------------------------------------- /chaoxi/Turtle_time/love_python.py: -------------------------------------------------------------------------------- 1 | def love_python(): 2 | word = "Python技术" 3 | for char in word.split(): 4 | allChar = [] 5 | for y in range(12, -12, -1): 6 | lst = [] 7 | lst_con = '' 8 | for x in range(-30, 28): 9 | # 心型函数实现 10 | formula = ((x * 0.05) ** 2 + (y * 0.1) ** 2 - 1) ** 3 - (x * 0.05) ** 2 * (y * 0.1) ** 3 11 | if formula <= 0: 12 | lst_con += char[(x) % len(char)] 13 | else: 14 | lst_con += ' ' 15 | lst.append(lst_con) 16 | allChar += lst 17 | print('\n'.join(allChar)) 18 | 19 | if __name__ == '__main__': 20 | love_python() 21 | -------------------------------------------------------------------------------- /chaoxi/five_code/baidu_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/chaoxi/five_code/baidu_code.png -------------------------------------------------------------------------------- /chaoxi/five_code/wordcloud.txt: -------------------------------------------------------------------------------- 1 | if you want to grow up,you are welcome to learn python! -------------------------------------------------------------------------------- /chaoxi/mother_day/mother.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/chaoxi/mother_day/mother.jpg -------------------------------------------------------------------------------- /chaoxi/mother_day/mother1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/chaoxi/mother_day/mother1.jpg -------------------------------------------------------------------------------- /chaoxi/qixi/erweima.py: -------------------------------------------------------------------------------- 1 | from MyQR import myqr 2 | myqr.run(words="Welcome to Here!", 3 | version=6, 4 | picture="wife.jpg", 5 | colorized=True, 6 | save_name="ewm.png", 7 | ) 8 | -------------------------------------------------------------------------------- /chaoxi/qixi/sumiao.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | import numpy as np 3 | 4 | a = np.asarray(Image.open(r".\wife.jpg").convert('L')).astype('float') 5 | 6 | depth = 10. # (0-100) 7 | grad = np.gradient(a) # 取图像灰度的梯度值 8 | grad_x, grad_y = grad # 分别取横纵图像梯度值 9 | grad_x = grad_x * depth / 100. 10 | grad_y = grad_y * depth / 100. 11 | A = np.sqrt(grad_x ** 2 + grad_y ** 2 + 1.) 12 | uni_x = grad_x / A 13 | uni_y = grad_y / A 14 | uni_z = 1. / A 15 | 16 | vec_el = np.pi / 2.2 # 光源的俯视角度,弧度值 17 | vec_az = np.pi / 4. # 光源的方位角度,弧度值 18 | dx = np.cos(vec_el) * np.cos(vec_az) # 光源对x 轴的影响 19 | dy = np.cos(vec_el) * np.sin(vec_az) # 光源对y 轴的影响 20 | dz = np.sin(vec_el) # 光源对z 轴的影响 21 | 22 | b = 255 * (dx * uni_x + dy * uni_y + dz * uni_z) # 光源归一化 23 | b = b.clip(0, 255) 24 | 25 | im = Image.fromarray(b.astype('uint8')) # 重构图像 26 | im.save(r".\result.jpg") 27 | print("保存成功,请查看") -------------------------------------------------------------------------------- /chaoxi/twoai_chat/moli_chat.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | send_data = { 4 | "question": '你的梦想是什么?', #构建发送的数据 5 | "api_key": "a6ec389908bcc23fceb2bbe998e3313e", 6 | "api_secret": "bsa0yv06pl1p" 7 | } 8 | api_url = 'http://i.itpk.cn/api.php' 9 | chat_content = requests.post(api_url, data=send_data) #发送请求数据 10 | print(chat_content.text) -------------------------------------------------------------------------------- /chaoxi/twoai_chat/tuling_chat.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | send_data = { 4 | "key": "9fd874929409453991db78f8b46a446b", 5 | "info": '我叫你一声你敢答应吗', #构建发送的数据 6 | "userid": "622952" 7 | } 8 | api_url = 'http://www.tuling123.com/openapi/api' 9 | chat_content = requests.post(api_url, data=send_data) #发送请求数据 10 | print(chat_content.text) -------------------------------------------------------------------------------- /chaoxi/twoai_chat/twoai_chat.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import time 3 | 4 | question = input("请开始你们的表演:") # 输入问题开始表演 5 | 6 | girl = "小姐姐" 7 | boy = "小哥哥" 8 | 9 | print(boy+':'+question) 10 | 11 | while True: 12 | boy_data = { 13 | "key": "9fd874929409453991db78f8b46a446b", 14 | "info": question, #构建发送的数据 15 | "userid": "622952" 16 | } 17 | boy_url = 'http://www.tuling123.com/openapi/api' 18 | boy_content = requests.post(boy_url, data=boy_data) #发送请求数据 19 | print(boy + ':' + eval(boy_content.text)["text"]) # 用eval函数处理一下图灵返回的消息 20 | question = eval(boy_content.text)["text"] 21 | 22 | girl_data = { 23 | "question": question, # 构建发送的数据 24 | "api_key": "a6ec389908bcc23fceb2bbe998e3313e", 25 | "api_secret": "bsa0yv06pl1p" 26 | } 27 | girl_url = 'http://i.itpk.cn/api.php' 28 | girl_content = requests.post(girl_url, data=girl_data) # 发送请求数据 29 | print(girl + ':' + girl_content.text) 30 | time.sleep(3) -------------------------------------------------------------------------------- /chaoxi/work_pro/cac_txt.py: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | import re 3 | #读取目标文本文件 4 | def get_str(path): 5 | f = open(path) 6 | data = f.read() 7 | f.close() 8 | return data 9 | # 输入目标路径 10 | path=input("请输入文件路径:") 11 | 12 | word=re.findall('([\u4e00-\u9fa5])',get_str(path)) 13 | 14 | # 计算出特殊字符外的字数 15 | print("中文字符,除特殊字符外共:",len(word)) -------------------------------------------------------------------------------- /chaoxi/work_pro/phone_txt.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | #读取目标文本文件 4 | def get_str(path): 5 | f = open(path,encoding="utf-8") 6 | data = f.read() 7 | f.close() 8 | return data 9 | 10 | # 正则获取文本号码 11 | def get_phone_number(str): 12 | res = re.findall(r'(13\d{9}|14[5|7]\d{8}|15\d{9}|166{\d{8}|17[3|6|7]{\d{8}|18\d{9})', str) 13 | return res 14 | 15 | #保存得到号码 16 | def save_res(res,save_path): 17 | save_file = open(save_path, 'w') 18 | for phone in res: 19 | save_file.write(phone) 20 | save_file.write('\n') 21 | save_file.write('\n号码共计:'+str(len(res))) 22 | save_file.close() 23 | print('号码读取OK,号码共计:'+str(len(res))) 24 | 25 | if __name__ == '__main__': 26 | path=input("请输入文件路径:") 27 | save_path=input("请输入文件保存路径:") 28 | #read_str=get_str(path) 29 | res=get_phone_number(get_str(path)) 30 | save_res(res,save_path) -------------------------------------------------------------------------------- /doudou/2020-04-04-greedy-snake/db.txt: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /doudou/2020-04-04-greedy-snake/pygame_hello_world.py: -------------------------------------------------------------------------------- 1 | import pygame, sys 2 | 3 | # init 4 | pygame.init() 5 | # new a window 6 | screen = pygame.display.set_mode((640, 480)) 7 | # title 8 | pygame.display.set_caption("Hello World") 9 | font = pygame.font.Font(None, 30) 10 | text = font.render('Hello World', True, pygame.Color("#FFFFFF")) 11 | 12 | while 1: 13 | for event in pygame.event.get(): 14 | if event.type == pygame.QUIT: 15 | pygame.quit() 16 | sys.exit() 17 | 18 | screen.blit(text, (100, 100)) 19 | pygame.display.update() 20 | -------------------------------------------------------------------------------- /doudou/2020-05-17-character-drawing/image_to_chars.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | 3 | WIDTH, HEIGHT = 80, 40 4 | ascii_char = list("$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. ") 5 | 6 | 7 | def get_char_by_rgb(r, g, b, alpha=256): 8 | if alpha == 0: 9 | return ' ' 10 | length = len(ascii_char) 11 | gray = int(0.2126 * r + 0.7152 * g + 0.0722 * b) 12 | unit = 256.0 / length 13 | return ascii_char[int(gray / unit)] 14 | 15 | 16 | def process_image(image_path, file_path='out.txt'): 17 | img = Image.open(image_path) 18 | img = img.resize((WIDTH, HEIGHT)) 19 | width, height = img.size 20 | txt = "" 21 | for x in range(height): 22 | for y in range(width): 23 | txt += get_char_by_rgb(*img.getpixel((y, x))) 24 | txt += '\n' 25 | 26 | with open(file_path, 'w') as f: 27 | f.write(txt) 28 | print(txt) 29 | 30 | 31 | if __name__ == '__main__': 32 | image_path, file_path = '/tmp/qq.jpg', '/tmp/qq.txt' 33 | process_image(image_path, file_path) 34 | -------------------------------------------------------------------------------- /doudou/2020-06-19-skills/skills.py: -------------------------------------------------------------------------------- 1 | def outer(x): 2 | def inner(y): 3 | # 在内函数中 用到了外函数的变量 4 | nonlocal x 5 | x += y 6 | return x + y 7 | 8 | # 外函数的返回值是内函数的引用 9 | return inner 10 | 11 | fun = outer(10) 12 | 13 | print(fun(10)) # 30 14 | print(fun(10)) # 40 15 | print(fun(10)) # 50 -------------------------------------------------------------------------------- /doudou/2021-01-02-GitHub-Python-Top10/app.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from pyecharts.charts import Bar 3 | from pyecharts import options as opts 4 | 5 | 6 | def get_data(): 7 | base_url = 'https://api.github.com/search/repositories?q=language:python+created:%3E2019-12-31&sort=stars&order=desc&per_page=10' 8 | response = requests.get(base_url) 9 | result = response.json() 10 | data = {} 11 | for item in result['items']: 12 | data[item['name']] = [item['html_url'], item['stargazers_count'], item['watchers_count'], item['forks']] 13 | return data 14 | 15 | 16 | def show_img(): 17 | data = get_data() 18 | names = list(data.keys()) 19 | values = [data[name][1] for name in names] 20 | 21 | bar = ( 22 | Bar() 23 | .add_xaxis(names[::-1]) 24 | .add_yaxis("星标数", values[::-1]) 25 | .reversal_axis() 26 | .set_series_opts(label_opts=opts.LabelOpts(position="right")) 27 | .set_global_opts( 28 | yaxis_opts=opts.AxisOpts(name_rotate=0, name="项目", axislabel_opts={'interval': -10, "rotate": 0}), 29 | title_opts=opts.TitleOpts(title="2020 GitHub Python TOP 10")) 30 | ) 31 | bar.render_notebook() 32 | 33 | 34 | if __name__ == '__main__': 35 | show_img() 36 | -------------------------------------------------------------------------------- /doudou/2021-01-10-fake-data/api.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, jsonify, request 2 | from mimesis.schema import Field, Schema 3 | from mimesis.enums import Gender 4 | 5 | app = Flask(__name__) 6 | 7 | _ = Field('zh') 8 | schema = Schema(schema=lambda: { 9 | 'id': _('uuid'), 10 | 'name': _('person.name'), 11 | 'version': _('version', pre_release=True), 12 | 'timestamp': _('timestamp', posix=False), 13 | 'owner': { 14 | 'email': _('person.email', domains=['test.com'], key=str.lower), 15 | 'token': _('token_hex'), 16 | 'creator': _('full_name', gender=Gender.FEMALE) 17 | }, 18 | 'address': { 19 | 'country': _('address.country'), 20 | 'province': _('address.province'), 21 | 'city': _('address.city') 22 | } 23 | }) 24 | 25 | 26 | @app.route('/apps', methods=('GET',)) 27 | def apps_view(): 28 | count = request.args.get('count', default=1, type=int) 29 | data = schema.create(iterations=count) 30 | return jsonify(data) 31 | 32 | 33 | if __name__ == '__main__': 34 | app.run(host='127.0.0.1', port=5200, debug=True) 35 | -------------------------------------------------------------------------------- /doudou/2021-01-10-fake-data/faker_app.py: -------------------------------------------------------------------------------- 1 | from faker import Faker 2 | from faker.providers import BaseProvider 3 | 4 | faker = Faker(locale='zh_CN') 5 | print(f'name: {faker.name()}') 6 | print(f'address: {faker.address()}') 7 | print(f'date: {faker.date()}') 8 | 9 | 10 | class MyProvider(BaseProvider): 11 | def foo(self): 12 | return 'bar' 13 | 14 | 15 | faker.add_provider(MyProvider) 16 | print(f'foo: {faker.foo()}') 17 | -------------------------------------------------------------------------------- /doudou/2021-01-10-fake-data/mimesis_app.py: -------------------------------------------------------------------------------- 1 | from mimesis import Person 2 | from mimesis import Address 3 | from mimesis import Food 4 | 5 | print("#" * 30 + " person " + "#" * 30) 6 | person = Person('zh') 7 | print(f'name: {person.surname() + "" + person.name()}') 8 | print(f'sex: {person.sex()}') 9 | print(f'academic degree: {person.academic_degree()}') 10 | 11 | print("*" * 30 + " person data " + "*" * 30) 12 | print('\n'.join(('%s:%s' % item for item in person._data.items()))) 13 | 14 | print("#" * 30 + " address " + "#" * 30) 15 | address = Address("zh") 16 | print(f'continent: {address.continent()}') 17 | print(f'province: {address.province()}') 18 | print(f'city: {address.city()}') 19 | print(f'street name: {address.street_name()}') 20 | 21 | print("*" * 30 + " address data " + "*" * 30) 22 | print('\n'.join(('%s:%s' % item for item in address._data.items()))) 23 | 24 | print("#" * 30 + " food " + "#" * 30) 25 | food = Food("zh") 26 | print(f'dish: {food.dish()}') 27 | print(f'drink: {food.drink()}') 28 | 29 | print("*" * 30 + " food data " + "*" * 30) 30 | print('\n'.join(('%s:%s' % item for item in food._data.items()))) 31 | -------------------------------------------------------------------------------- /doudou/2021-09-08-text-img/AliPuHui-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/doudou/2021-09-08-text-img/AliPuHui-Bold.ttf -------------------------------------------------------------------------------- /doudou/2021-09-08-text-img/app.py: -------------------------------------------------------------------------------- 1 | # coding:utf-8 2 | 3 | from PIL import Image, ImageDraw, ImageFont 4 | 5 | img_child_size = 15 6 | text = "今晚的月色真美" 7 | font = ImageFont.truetype('AliPuHui-Bold.ttf', img_child_size) 8 | img_path = './moon.png' 9 | 10 | img = Image.open(img_path) 11 | img_w, img_h = img.size 12 | img_child = Image.new("RGB", (img_child_size, img_child_size)) 13 | img_ans = Image.new("RGB", (img_child_size * img_w, img_child_size * img_h)) 14 | 15 | text_w, text_h = font.getsize("中") # 获单个文字的宽、高 16 | offset_x = (img_child_size - text_w) >> 1 # 文字水平居中 17 | offset_y = (img_child_size - text_h) >> 1 # 文字垂直居中 18 | 19 | char_index = 0 20 | draw = ImageDraw.Draw(img_child) # 小图的绘图对象,用于绘制文字 21 | 22 | for x in range(img_w): # 宽在外 高在内,因此文字的方向是从左到右,从上到下排列的 23 | for y in range(img_h): 24 | draw.rectangle((0, 0, img_child_size, img_child_size), fill='lightgray') # 绘制背景,看起来会好一些 25 | draw.text((offset_x, offset_y), text[char_index], font=font, fill=img.getpixel((x, y))) # 用(x,y)处像素点的色值绘制字体 26 | img_ans.paste(img_child, (x * img_child_size, y * img_child_size)) 27 | char_index = (char_index + 1) % len(text) 28 | 29 | img_ans.save('moon-text.png') -------------------------------------------------------------------------------- /doudou/2021-09-08-text-img/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/doudou/2021-09-08-text-img/moon.png -------------------------------------------------------------------------------- /doudou/2021-10-28-pillow/AliPuHui-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/doudou/2021-10-28-pillow/AliPuHui-Bold.ttf -------------------------------------------------------------------------------- /doudou/2021-10-28-pillow/app.py: -------------------------------------------------------------------------------- 1 | from PIL import Image, ImageFilter, ImageEnhance, ImageDraw, ImageFont 2 | 3 | img = Image.open('cat.jpg') 4 | print(F'图片大小为 {img.format}, 格式为 {img.size}, 模式为 {img.mode}') 5 | 6 | # img.show() 7 | 8 | # img.save("cat.png") 9 | 10 | # 剪裁 11 | #point = (1500, 800, 3000, 2300) 12 | #img_crop = img.crop(point) 13 | #img_crop.show() 14 | 15 | # 覆盖 16 | #img.paste(img_crop, (0, 0), None) 17 | #img.show() 18 | 19 | # 缩略图 20 | # thumb_size = (345, 345) 21 | # img.thumbnail(thumb_size) 22 | # img.show() 23 | 24 | # 旋转 25 | # img_rotate = img.transpose(Image.ROTATE_90) 26 | # img_rotate.show() 27 | 28 | # 滤镜 29 | # 高斯模糊 30 | # img_gaussianblur = img.filter(ImageFilter.GaussianBlur(30)) 31 | # img_gaussianblur.show() 32 | 33 | # 轮廓 34 | # img_contour = img.filter(ImageFilter.CONTOUR) 35 | # img_contour.show() 36 | 37 | # 增强 38 | #color = ImageEnhance.Color(img) 39 | #img_color = color.enhance(1.5) 40 | #img_color.show() 41 | 42 | # draw = ImageDraw.Draw(img) 43 | 44 | # 画线 45 | # draw.line((0, 0) + img.size, fill=20, width=3) 46 | # draw.line((0, img.size[1], img.size[0], 0), fill=200, width=3) 47 | 48 | # 写字 49 | # font = ImageFont.truetype('AliPuHui-Bold.ttf', 200) 50 | # text = 'This is a cat!' 51 | # drawing text size 52 | # draw.text((450, 450), text, font=font, fill='pink', align="left") 53 | # img.show() -------------------------------------------------------------------------------- /doudou/2021-10-28-pillow/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/doudou/2021-10-28-pillow/cat.jpg -------------------------------------------------------------------------------- /doudou/2021-12-31-img-excel/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/doudou/2021-12-31-img-excel/03.png -------------------------------------------------------------------------------- /doudou/2022-04-29-turtle/t_3.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | t = turtle.Pen() 4 | t.speed(100) 5 | turtle.bgcolor("black") 6 | sides = 6 7 | colors = ["red", "yellow", "green", "blue", "orange", "purple"] 8 | for x in range(360): 9 | t.pencolor(colors[x % sides]) 10 | t.forward(x * 3 / sides + x) 11 | t.left(360 / sides + 1) 12 | t.width(x * sides / 200) 13 | 14 | print("####结束####") 15 | -------------------------------------------------------------------------------- /doudou/2022-04-29-turtle/t_feiji.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | # 太阳 4 | turtle.color('red') 5 | turtle.penup() 6 | turtle.goto(250,200) 7 | turtle.pendown() 8 | turtle.begin_fill() 9 | turtle.circle(50) 10 | turtle.end_fill() 11 | turtle.color('black','blue') 12 | turtle.begin_fill() 13 | #飞机 14 | turtle.penup() 15 | turtle.home() 16 | turtle.pendown() 17 | turtle.pensize(5) 18 | turtle.goto(-300,150) 19 | turtle.goto(100,50) 20 | turtle.goto(0,0) 21 | turtle.end_fill() 22 | turtle.goto(-30,-125) 23 | turtle.goto(-50,-50) 24 | turtle.begin_fill() 25 | turtle.goto(-300,150) 26 | turtle.goto(-125,-125) 27 | turtle.goto(-50,-50) 28 | turtle.goto(-30,-125) 29 | turtle.goto(-85,-85) 30 | turtle.end_fill() 31 | #线条 32 | turtle.pensize(3) 33 | turtle.penup() 34 | turtle.goto(75,25) 35 | turtle.pendown() 36 | turtle.goto(200,0) 37 | turtle.penup() 38 | turtle.goto(50,-5) 39 | turtle.pendown() 40 | turtle.goto(250,-30) 41 | turtle.penup() 42 | turtle.goto(10,-80) 43 | turtle.pendown() 44 | turtle.goto(100,-150) 45 | turtle.penup() 46 | turtle.goto(-80,-125) 47 | turtle.pendown() 48 | turtle.goto(120,-200) 49 | turtle.done() -------------------------------------------------------------------------------- /doudou/2022-04-29-turtle/t_view.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | from turtle import * 3 | 4 | angle = 60 # 通过改变角度,绘制出各种多边形 5 | t.bgcolor('black') 6 | t.pensize(2) 7 | randomColor = ['red', 'blue', 'green', 'purple', 'gold', 'pink'] 8 | t.speed(0) 9 | for i in range(200): 10 | t.color(randomColor[i % 6]) 11 | t.circle(i) 12 | t.rt(angle + 1) 13 | up() 14 | color("#0fe6ca") 15 | goto(0, 0) 16 | down() 17 | -------------------------------------------------------------------------------- /doudou/2022-04-29-turtle/t_yingtao.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | toplevel = 8 # 一共递归6层 4 | angle = 30 5 | rangle = 15 6 | 7 | 8 | def drawTree(length, level): 9 | turtle.left(angle) # 绘制左枝 10 | turtle.color("black") 11 | turtle.forward(length) 12 | 13 | if level == toplevel: # 叶子 14 | turtle.color("pink") 15 | turtle.circle(2, 360) 16 | 17 | if level < toplevel: # 在左枝退回去之前递归 18 | drawTree(length - 10, level + 1) 19 | turtle.back(length) 20 | 21 | turtle.right(angle + rangle) # 绘制右枝 22 | turtle.color("black") 23 | turtle.forward(length) 24 | 25 | if level == toplevel: # 叶子 26 | turtle.color("pink") 27 | turtle.circle(2, 360) 28 | 29 | if level < toplevel: # 在右枝退回去之前递归 30 | drawTree(length - 10, level + 1) 31 | turtle.color("black") 32 | turtle.back(length) 33 | turtle.left(rangle) 34 | 35 | 36 | turtle.left(90) 37 | turtle.penup() 38 | turtle.back(300) 39 | turtle.pendown() 40 | turtle.forward(100) 41 | turtle.speed(500) 42 | drawTree(80, 1) 43 | 44 | turtle.done() 45 | -------------------------------------------------------------------------------- /fans/README.md: -------------------------------------------------------------------------------- 1 | # Python 代码实例 2 | 3 | Python技术 公众号文章代码库 4 | 5 | 6 | 关注公众号:python技术,回复"python"一起学习交流 7 | 8 | ![](http://favorites.ren/assets/images/python.jpg) 9 | 10 | 11 | ## 实例代码 12 | 13 | [用python免登录实现域名解析](https://github.com/JustDoPython/python-examples/tree/master/fans/dns):用python免登录实现域名解析 14 | 15 | 16 | [美女同事又找我帮忙了,激动!](https://github.com/JustDoPython/python-examples/tree/master/fans/filenaming):美女同事又找我帮忙了,激动! 17 | 18 | [高效办公,pandas美化表格实例演示](https://github.com/JustDoPython/python-examples/tree/master/fans/beautyPandas):高效办公,pandas美化表格实例演示 19 | 20 | [echarts的可视化](https://github.com/JustDoPython/python-examples/tree/master/fans/shift):echarts的可视化 21 | 22 | [PyAutoGUI,轻松搞定图片上传!](https://github.com/JustDoPython/python-examples/tree/master/fans/imgupload):PyAutoGUI,轻松搞定图片上传! 23 | 24 | 25 | [用Python写个工具,同时应付10个客服MM!](https://github.com/JustDoPython/python-examples/tree/master/fans/sqlquery):用Python写个工具,同时应付10个客服MM! 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /fans/filenaming/demo.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | path=os.getcwd() 4 | fr=open(path+'/gaoxiao-dict.txt','r',encoding='utf-8') 5 | dic={} 6 | keys=[] 7 | for line in fr: 8 | v=line.strip().split(':') 9 | dic[v[0]]=v[1] 10 | keys.append(v[0]) 11 | fr.close() 12 | #规范命名的函数 13 | def normalReName(name): 14 | isTikuban=re.findall(r'【题库版】',name) 15 | if len(isTikuban)!=0: 16 | m=name.replace('【题库版】','').replace('_','') 17 | os.rename(name+'.pdf',m+'.pdf') 18 | else: 19 | m=name 20 | s=re.findall(r'.*?大学|.*?学院|.*?(北京)|.*?(华东)|.*?(武汉)',m) 21 | university='' 22 | for i in range (0,len(s)): 23 | university+=s[i] 24 | code=re.search('\d{3}',m) 25 | year=re.findall('\d{4}',m) 26 | if '年' in m: 27 | b=m.replace(university+code.group(),'').replace(year[0]+'年','') 28 | else: 29 | b=m.replace(university+code.group(),'').replace(year[0],'') 30 | new_name=dic[university]+'+'+university+'+'+code.group()+b+'+'+year[0]+'年' 31 | os.rename(m+'.pdf',new_name+'.pdf') 32 | file_name_list=os.listdir(path) 33 | for file in file_name_list: 34 | name=file.split('.')[0] 35 | kuozhan=file.split('.')[1] 36 | if name!='watermark' and kuozhan=='pdf': 37 | normalReName(name) -------------------------------------------------------------------------------- /fans/imgupload/imgupload.py: -------------------------------------------------------------------------------- 1 | import time 2 | import pyautogui 3 | 4 | def auto_upload(x,y,file_path): 5 | # 点击”选择文件“按钮 6 | pyautogui.click(307, 227) 7 | time.sleep(2.5) 8 | 9 | # 弹出对话框后,点击路径那一栏,目的是为下一步粘贴路径 10 | pyautogui.click(993, 332) 11 | time.sleep(1.5) 12 | 13 | # 键入图片路径 14 | pyautogui.typewrite(file_path) 15 | # 按回车键 16 | pyautogui.hotkey('enter') 17 | time.sleep(1) 18 | 19 | # 双击图片 20 | pyautogui.doubleClick(x,y) 21 | # 等文件出现 22 | time.sleep(6) 23 | 24 | # 点击“上传”按钮 25 | pyautogui.click(304, 278) 26 | #等几秒传完 27 | if x == 847: 28 | #847是第一张图片的x坐标,因为我上传的第一张是gif动图,文件大,上传多等几秒 29 | time.sleep(11) 30 | else: 31 | time.sleep(2.5) 32 | 33 | # 点击“copy”按钮 34 | pyautogui.click(297, 545) 35 | time.sleep(1) 36 | 37 | # 点击浏览器的地址栏 38 | pyautogui.click(410, 66) 39 | 40 | # 模拟键盘点击ctrl+v,然后按回车键 41 | pyautogui.hotkey('ctrl','v') 42 | time.sleep(0.5) 43 | pyautogui.hotkey('enter') 44 | 45 | #欣赏美女3秒 46 | time.sleep(3) 47 | 48 | # 点击浏览器的返回按钮 49 | pyautogui.click(32, 67) 50 | time.sleep(2) 51 | 52 | #文件的x,y坐标 53 | file_list = [(847, 489),(965, 490),(1136, 493),(1271, 504),(1391, 498)] 54 | [ auto_upload(f[0],f[1],'C:/Users/0717/Pictures/blog/upload') for f in file_list] -------------------------------------------------------------------------------- /fans/shift/ssw.txt: -------------------------------------------------------------------------------- 1 | 源码下载和安装 2 | 3 | 前端 4 | git clone https://gitee.com/sswfit/vue-morning-shift.git 5 | cd vue-morning-shift 6 | npm install --registry=https://registry.npm.taobao.org 7 | npm run serve 8 | 9 | 后端 10 | git clone https://gitee.com/sswfit/morning_shift.git 11 | cd morning_shift 12 | pip install -r requirements.txt 13 | python manage.py runserver localhost:8887 -------------------------------------------------------------------------------- /fans/sqlquery/代码获取.txt: -------------------------------------------------------------------------------- 1 | vue 2 | ```sh 3 | git clone https://gitee.com/sswfit/vue-morning-shift.git 4 | cd vue-morning-shift 5 | npm install --registry=https://registry.npm.taobao.org 6 | npm run serve 7 | ``` 8 | 9 | django 10 | ```sh 11 | git clone https://gitee.com/sswfit/morning_shift.git 12 | cd morning_shift 13 | pip install -r requirements.txt 14 | python manage.py runserver localhost:8887 -------------------------------------------------------------------------------- /jiguang/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Python 代码实例 3 | 4 | Python技术 公众号文章代码库 5 | 6 | 7 | 关注公众号:python 技术,回复"python"一起学习交流 8 | 9 | ![](http://favorites.ren/assets/images/python.jpg) 10 | 11 | 12 | ## 实例代码 13 | 14 | 15 | 16 | [如果只写一行代码能实现什么?看完我彻底服了](https://github.com/JustDoPython/python-examples/tree/master/jiguang/oneline) :如果只写一行代码能实现什么?看完我彻底服了 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /moumoubaimifan/convertHtml/convertHtml.py: -------------------------------------------------------------------------------- 1 | import pypandoc 2 | import pdfkit 3 | 4 | # web to pdf 5 | pdfkit.from_url(['www.baidu.com','www.bing.com'],'search.pdf') 6 | 7 | # html to pdf 8 | pdfkit.from_file('/Users/xx/Desktop/html/baidu.html', 'html2pdf.pdf') 9 | 10 | # html to word 11 | output = pypandoc.convert_file('/Users/xx/Desktop/html/baidu.html', 'docx', outputfile="baidu.doc") -------------------------------------------------------------------------------- /moumoubaimifan/face_contrast/face_contrast.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import face_recognition 4 | import cv2 5 | import os 6 | import time 7 | 8 | pic_boss = face_recognition.load_image_file("/Users/xx/Desktop/face/0.png") 9 | boss_face_encoding = face_recognition.face_encodings(pic_boss)[0] 10 | 11 | cap = cv2.VideoCapture(0) 12 | while True: 13 | ret, frame = cap.read() 14 | 15 | face_locations = face_recognition.face_locations(frame) 16 | face_encodings = face_recognition.face_encodings(frame, face_locations) 17 | 18 | for face_encoding in face_encodings: 19 | results = face_recognition.compare_faces([boss_face_encoding], face_encoding) 20 | if results[0]: 21 | print("boss来了,快打开其他应用") 22 | os.system('open /Applications/PyCharm.app') 23 | time.sleep(300) -------------------------------------------------------------------------------- /moumoubaimifan/filestools/filestoolsDemo.py: -------------------------------------------------------------------------------- 1 | from watermarker.marker import add_mark 2 | 3 | from filediff.diff import file_diff_compare 4 | 5 | from curl2py.curlParseTool import curlCmdGenPyScript 6 | 7 | # add_mark(r"D:\0.png", "学 python,看 python 技术公众号", angle=15, size=20, space=40, color='#c5094d') 8 | 9 | # file_diff_compare(r"D:\一线城市.log", r"D:\一线城市2.log", diff_out="diff_result.html", max_width=70, numlines=0, no_browser=True) 10 | 11 | curl_cmd = """curl 'https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/mancard/img/side/qrcode@2x-daf987ad02.png' \ 12 | -H 'sec-ch-ua: "Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"' \ 13 | -H 'Referer: https://www.baidu.com/' \ 14 | -H 'sec-ch-ua-mobile: ?0' \ 15 | -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36' \ 16 | -H 'sec-ch-ua-platform: "Windows"' \ 17 | --compressed""" 18 | output = curlCmdGenPyScript(curl_cmd) 19 | print(output) 20 | -------------------------------------------------------------------------------- /moumoubaimifan/filestools/一线城市.log: -------------------------------------------------------------------------------- 1 | 城市 2 | 北京市 3 | 上海市 4 | 广东省:东莞市 5 | 广东省:深圳市 6 | 四川省:成都市 7 | 湖北省:武汉市 8 | 福建省:厦门市 9 | 陕西省:西安市 10 | 江苏省:常州市 11 | 江苏省:苏州市 -------------------------------------------------------------------------------- /moumoubaimifan/filestools/一线城市2.log: -------------------------------------------------------------------------------- 1 | 一线城市 2 | 北京市 3 | 上海市 4 | 广东省:广州市 5 | 广东省:深圳市 6 | 四川省:成都市 7 | 浙江省:杭州市 8 | 湖北省:武汉市 9 | 福建省:厦门市 10 | 陕西省:西安市 11 | 江苏省:常州市 -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/components.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | {{ chart.page_title }} 7 | 8 | 9 | 10 | {{ macro.gen_components_content(chart) }} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/nb_components.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | {% for chart in charts %} 4 | {{ macro.gen_components_content(chart) }} 5 | {% endfor %} 6 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/nb_jupyter_lab.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% for chart in charts %} 9 | {% if chart._component_type in ("table", "image") %} 10 | {{ macro.gen_components_content(chart) }} 11 | {% else %} 12 | {{ macro.render_chart_content(chart) }} 13 | {% endif %} 14 | {% endfor %} 15 | 16 | 17 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/nb_jupyter_lab_tab.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ macro.generate_tab_css() }} 9 | {{ macro.display_tablinks(charts) }} 10 | 11 | {% for chart in charts %} 12 | {% if chart._component_type in ("table", "image") %} 13 | {{ macro.gen_components_content(chart) }} 14 | {% else %} 15 | {{ macro.render_chart_content(chart) }} 16 | {% endif %} 17 | {% endfor %} 18 | {{ macro.switch_tabs() }} 19 | 20 | 21 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/nb_jupyter_notebook.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 10 | 11 | {% for chart in charts %} 12 | {% if chart._component_type in ("table", "image") %} 13 | {{ macro.gen_components_content(chart) }} 14 | {% else %} 15 |
16 | {% endif %} 17 | {% endfor %} 18 | 19 | {{ macro.render_notebook_charts(charts, libraries) }} 20 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/nb_jupyter_notebook_tab.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 10 | 11 | {{ macro.generate_tab_css() }} 12 | {{ macro.display_tablinks(charts) }} 13 | 14 | {% for chart in charts %} 15 | {% if chart._component_type in ("table", "image") %} 16 | {{ macro.gen_components_content(chart) }} 17 | {% else %} 18 |
19 | {% endif %} 20 | {% endfor %} 21 | 22 | {{ macro.render_notebook_charts(charts, libraries) }} 23 | {{ macro.switch_tabs() }} 24 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/nb_nteract.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | {{ macro.render_chart_dependencies(chart) }} 7 | 8 | 9 | {% for c in chart %} 10 | {{ macro.render_chart_content(c) }} 11 | {% endfor %} 12 | 13 | 14 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/simple_chart.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | {{ chart.page_title }} 7 | {{ macro.render_chart_dependencies(chart) }} 8 | 9 | 10 | {{ macro.render_chart_content(chart) }} 11 | 12 | 13 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/simple_page.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | {{ chart.page_title }} 7 | {{ macro.render_chart_dependencies(chart) }} 8 | {{ macro.render_chart_css(chart) }} 9 | 10 | 11 | 12 | {% if chart.download_button %} 13 | 14 | {% endif %} 15 |
16 | {% for c in chart %} 17 | {% if c._component_type in ("table", "image") %} 18 | {{ macro.gen_components_content(c) }} 19 | {% else %} 20 | {{ macro.render_chart_content(c) }} 21 | {% endif %} 22 | {% for _ in range(chart.page_interval) %}
{% endfor %} 23 | {% endfor %} 24 |
25 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /moumoubaimifan/psutil-flask/templates/simple_tab.html: -------------------------------------------------------------------------------- 1 | {% import 'macro' as macro %} 2 | 3 | 4 | 5 | 6 | {{ chart.page_title }} 7 | {{ macro.render_chart_dependencies(chart) }} 8 | {{ macro.render_chart_css(chart) }} 9 | 10 | 11 | {{ macro.generate_tab_css() }} 12 | {{ macro.display_tablinks(chart) }} 13 | 14 |
15 | {% for c in chart %} 16 | {% if c._component_type in ("table", "image") %} 17 | {{ macro.gen_components_content(c) }} 18 | {% else %} 19 | {{ macro.render_chart_content(c) }} 20 | {% endif %} 21 | {% endfor %} 22 |
23 | 24 | 29 | {{ macro.switch_tabs() }} 30 | 31 | 32 | -------------------------------------------------------------------------------- /moumoubaimifan/pysnooper/longestCommonPrefix.py: -------------------------------------------------------------------------------- 1 | import pysnooper 2 | 3 | @pysnooper.snoop() 4 | def longestCommonPrefix(strs): 5 | ans = '' 6 | for i in zip(*strs): 7 | print(i) 8 | if len(set(i)) == 1: 9 | ans += i[0] 10 | else 11 | break 12 | return ans 13 | 14 | if __name__ == 'main': 15 | longestCommonPrefix(["flower","flow","flight"]) 16 | -------------------------------------------------------------------------------- /moumoubaimifan/simple_pip_upload/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /moumoubaimifan/simple_pip_upload/README.md: -------------------------------------------------------------------------------- 1 | 把代码上传到 PyPI -------------------------------------------------------------------------------- /moumoubaimifan/simple_pip_upload/example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/moumoubaimifan/simple_pip_upload/example/__init__.py -------------------------------------------------------------------------------- /moumoubaimifan/simple_pip_upload/example/math.py: -------------------------------------------------------------------------------- 1 | def add(i, y): 2 | print(str(i) + " + " + str(y) + " = " + str((i + y))) 3 | 4 | 5 | def sub(i, y): 6 | print(str(i) + " - " + str(y) + " = " + str((i - y))) 7 | 8 | 9 | def mul(i, y): 10 | print(str(i) + " * " + str(y) + " = " + str((i * y))) 11 | 12 | 13 | def div(i, y): 14 | print(str(i) + " / " + str(y) + " = " + str((i / y))) 15 | -------------------------------------------------------------------------------- /moumoubaimifan/simple_pip_upload/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | setuptools.setup( 5 | name="simple_pip_upload", 6 | version="0.0.2", 7 | author="moumoubaimifan", 8 | author_email="example@example.com", 9 | description="一个简单的四则运算 PyPI 上传例子", 10 | long_description="一个简单的 PyPI 上传测试", 11 | long_description_content_type="text/markdown", 12 | url="https://simple_pip_upload.xx", 13 | packages=setuptools.find_packages(), 14 | classifiers=[ 15 | "Programming Language :: Python :: 3", 16 | "License :: OSI Approved :: MIT License", 17 | "Operating System :: OS Independent", 18 | ], 19 | ) -------------------------------------------------------------------------------- /qingxiangke/README.md: -------------------------------------------------------------------------------- 1 | # Python 代码实例 2 | 3 | Python技术 公众号文章代码库 4 | 5 | 6 | 关注公众号:python技术,回复"python"一起学习交流 7 | 8 | ![](http://favorites.ren/assets/images/python.jpg) 9 | 10 | ## 代码例子 11 | 12 | [网站神器](https://github.com/JustDoPython/python-examples/tree/master/qingxiangke/easyWeb) : 一个超简易网站搭建神器 13 | 14 | [pandas条件筛选](https://github.com/JustDoPython/python-examples/tree/master/qingxiangke/PandasSift) : pandas的多条件筛选 15 | 16 | [pandas的两表连接](https://github.com/JustDoPython/python-examples/tree/master/qingxiangke/pandasMerge) : pandas的两表连接 17 | 18 | [pandas的多表拼接](https://github.com/JustDoPython/python-examples/tree/master/qingxiangke/joint) : pandas的多表拼接 19 | 20 | [echarts的可视化](https://github.com/JustDoPython/python-examples/tree/master/qingxiangke/shift) : echarts的可视化 -------------------------------------------------------------------------------- /qingxiangke/shift/ssw.txt: -------------------------------------------------------------------------------- 1 | 源码下载和安装 2 | 3 | 前端 4 | git clone https://gitee.com/sswfit/vue-morning-shift.git 5 | cd vue-morning-shift 6 | npm install --registry=https://registry.npm.taobao.org 7 | npm run serve 8 | 9 | 后端 10 | git clone https://gitee.com/sswfit/morning_shift.git 11 | cd morning_shift 12 | pip install -r requirements.txt 13 | python manage.py runserver localhost:8887 -------------------------------------------------------------------------------- /taiyangxue/busclock/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "loopWaitSeconds": 60, 3 | "spurtWaitSeconds": 10, 4 | "latestLeaveMinute": 5, 5 | "mailConfig": { 6 | "FROM": "tom@example.com", 7 | "HOST": "smtp.example.com", 8 | "PORT": "465", 9 | "USER": "tom", 10 | "PASS": "password", 11 | "SSL": true 12 | }, 13 | "alertMail": "lily@example.com", 14 | "lines": [{ 15 | "line": "835快", 16 | "dir": "5066222788346588777", 17 | "stop": "13", 18 | "begin": "08:00", 19 | "end": "08:30" 20 | }, { 21 | "line": "835快", 22 | "dir": "4997908670784162973", 23 | "stop": "3", 24 | "begin": "19:00", 25 | "end": "20:30" 26 | }] 27 | } -------------------------------------------------------------------------------- /taiyangxue/busclock/config.py: -------------------------------------------------------------------------------- 1 | class Config: 2 | def __init__(self, config): 3 | self.loopWaitSeconds = config.get("loopWaitSeconds", 60) 4 | self.spurtWaitSeconds = config.get("spurtWaitSeconds", 10) 5 | self.mailConfig = config.get("mailConfig", None) 6 | self.latestLeaveMinute = config.get("latestLeaveTime", 5) 7 | self.lines = config.get("lines", {}) -------------------------------------------------------------------------------- /taiyangxue/busclock/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/busclock/requirements.txt -------------------------------------------------------------------------------- /taiyangxue/dice/asset/dice/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/dice/1.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/dice/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/dice/2.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/dice/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/dice/3.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/dice/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/dice/4.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/dice/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/dice/5.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/dice/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/dice/6.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/rolling/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/rolling/1.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/rolling/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/rolling/2.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/rolling/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/rolling/3.png -------------------------------------------------------------------------------- /taiyangxue/dice/asset/rolling/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/dice/asset/rolling/4.png -------------------------------------------------------------------------------- /taiyangxue/diffusionsimulator/app.py: -------------------------------------------------------------------------------- 1 | # 引入pygame和sys模块 2 | import pygame, sys 3 | import math 4 | from pygame.locals import * 5 | import time 6 | import people 7 | 8 | WIDTH = 500 9 | HEIGHT = 500 10 | 11 | RADIUS = 25 12 | POINT_RADIUS = 5 13 | 14 | BLACK = (0,0,0) 15 | WHITE = (255,255,255) 16 | PINK = (255,192,203) 17 | RED = (255,0,0) 18 | 19 | # 初始化pygame 20 | pygame.init() 21 | 22 | # 设置窗口与窗口标题 23 | windowSurface = pygame.display.set_mode((WIDTH,HEIGHT),0,8) 24 | pygame.display.set_caption('疫情模拟') 25 | 26 | # 初始化人群 27 | p = people.People(600, 1) 28 | 29 | COLORS = [BLACK, PINK, RED] 30 | 31 | # 事件循环 32 | while True: 33 | for event in pygame.event.get(): 34 | if event.type == QUIT: 35 | pygame.quit() 36 | sys.exit() 37 | 38 | windowSurface.fill(WHITE) # 设置画布背景 起到擦除的作用 39 | 40 | for i in range(len(p._status)): # 健康 41 | x_point = p._people[i][0] 42 | y_point = p._people[i][1] 43 | pygame.draw.circle(windowSurface,COLORS[p._status[i]],(int(x_point), int(y_point)), POINT_RADIUS) 44 | 45 | # 绘制窗口到屏幕上 46 | pygame.display.update() 47 | time.sleep(0.1) 48 | p.update() -------------------------------------------------------------------------------- /taiyangxue/matrix/chain.py: -------------------------------------------------------------------------------- 1 | # 命令行下执行 2 | # 思考下下面表达式的值 3 | 4 | (False == False) in [False] # 合乎常理 5 | False == (False in [False]) # 也没问题 6 | False == False in [False] # 现在感觉如何? 7 | True is False == False 8 | False is False is False 9 | 1 > 0 < 1 10 | (1 > 0) < 1 11 | 1 > (0 < 1) -------------------------------------------------------------------------------- /taiyangxue/matrix/eatjs.py: -------------------------------------------------------------------------------- 1 | some_dict = {} 2 | some_dict[5.5] = "Ruby" 3 | some_dict[5.0] = "JavaScript" 4 | some_dict[5] = "Python" 5 | 6 | print(some_dict[5.5]) # Ruby 7 | print(some_dict[5.0]) # Python Javascript 去哪了 -------------------------------------------------------------------------------- /taiyangxue/matrix/is.py: -------------------------------------------------------------------------------- 1 | # 命令行下执行 2 | a = 256 3 | b = 256 4 | a is b # 值是什么 5 | 6 | a = 257 7 | b = 257 8 | a is b # 值是什么 9 | 10 | a = [] 11 | b = [] 12 | a is b # 值是什么 13 | 14 | a = tuple() 15 | b = tuple() 16 | a is b # 值是什么 -------------------------------------------------------------------------------- /taiyangxue/matrix/sting.py: -------------------------------------------------------------------------------- 1 | # 命令行下执行 2 | 3 | a = "some_string" 4 | id(a) 5 | id("some" + "_" + "string") # 不同方式创建的字符串实质是一样的. 6 | 7 | a = "wtf" 8 | b = "wtf" 9 | a is b # 想想结果是什么 10 | 11 | a = "wtf!" 12 | b = "wtf!" 13 | a is b # 结果又会是什么 -------------------------------------------------------------------------------- /taiyangxue/matrix/walrus.py: -------------------------------------------------------------------------------- 1 | # 海象操作符 2 | 3 | a = [1,2,3,4,5] 4 | if n := len(n) > 4: 5 | print(n) 6 | 7 | # 命令行中执行 8 | a = "wtf_walrus" 9 | a := "wtf_walrus" # 报错! 10 | (a := "wtf_walrus") # 奇迹发生,竟然通过了! 11 | 12 | a = 6, 9 # 元组赋值 13 | 14 | (a := 6, 9) # 海象赋值,表达式结果正常 15 | # 现在 a 的值是多少? 16 | 17 | a, b = 6, 9 # 解包赋值 18 | (a, b = 16, 19) # Oh no! 19 | 20 | (a, b := 16, 19) # 这里竟然打印出三员元组! 21 | 22 | # 现在的 a 是多少? -------------------------------------------------------------------------------- /taiyangxue/pygame/chimp_data/chimp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/pygame/chimp_data/chimp.bmp -------------------------------------------------------------------------------- /taiyangxue/pygame/chimp_data/fist.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/pygame/chimp_data/fist.bmp -------------------------------------------------------------------------------- /taiyangxue/pygame/chimp_data/punch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/pygame/chimp_data/punch.wav -------------------------------------------------------------------------------- /taiyangxue/pygame/chimp_data/whiff.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/pygame/chimp_data/whiff.wav -------------------------------------------------------------------------------- /taiyangxue/pypandoc/code.py: -------------------------------------------------------------------------------- 1 | import pypandoc 2 | 3 | input = "**Hello World!**" 4 | output = pypandoc.convert_text(input, 'html', format='md') 5 | 6 | print(output) 7 | 8 | input = """ 9 | # Pandoc 10 | 11 | Pandoc 是个牛X的工具 12 | 13 | ## 用法 14 | 15 | - `convert_text` 16 | - `convert_file` 17 | """ 18 | output = pypandoc.convert_text(input, 'html', format='md') 19 | print(output) 20 | 21 | output = pypandoc.convert_text(input, 'rst', format='md') 22 | print(output) 23 | 24 | convert_test(input, 'epub', format='md', outputfile='test.epub') -------------------------------------------------------------------------------- /taiyangxue/python-thread/data.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | 11 13 | 12 14 | 13 15 | 14 16 | 15 17 | 16 18 | -------------------------------------------------------------------------------- /taiyangxue/pythondocx/word.py: -------------------------------------------------------------------------------- 1 | from docx import Document 2 | import re 3 | 4 | doc = Document(r"D:\论文.docx") 5 | restr = '"(?:[^"])*"' 6 | 7 | for p in doc.paragraphs: 8 | matchRet = re.findall(restr, p.text) 9 | for r in matchRet: 10 | p.text = p.text.replace(r, '“' + r[1:-1] + '”') 11 | doc.save(r'D:\论文_修正.docx') -------------------------------------------------------------------------------- /taiyangxue/pywebview-flask/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from flask import Flask, render_template 4 | 5 | app = Flask(__name__) 6 | @app.route('/') 7 | def index(): # 定义根目录处理器 8 | return render_template('index.html') 9 | 10 | @app.route('/detail') 11 | def detail(): 12 | return render_template('detail.html') 13 | 14 | if __name__ == '__main__': 15 | app.run() # 启动服务 -------------------------------------------------------------------------------- /taiyangxue/pywebview-flask/main.py: -------------------------------------------------------------------------------- 1 | import webview 2 | from contextlib import redirect_stdout 3 | from io import StringIO 4 | from app import app 5 | 6 | if __name__ == '__main__': 7 | window = webview.create_window('Pywebview', app) 8 | webview.start() -------------------------------------------------------------------------------- /taiyangxue/pywebview-flask/requirements.txt: -------------------------------------------------------------------------------- 1 | altgraph==0.17.2 2 | click==8.0.3 3 | colorama==0.4.4 4 | Flask==2.0.2 5 | future==0.18.2 6 | itsdangerous==2.0.1 7 | Jinja2==3.0.3 8 | MarkupSafe==2.0.1 9 | pefile==2021.9.3 10 | proxy-tools==0.1.0 11 | pycparser==2.21 12 | pyinstaller==4.8 13 | pyinstaller-hooks-contrib==2021.5 14 | pythonnet==2.5.2 15 | pywebview==3.5 16 | pywin32-ctypes==0.2.0 17 | Werkzeug==2.0.2 18 | -------------------------------------------------------------------------------- /taiyangxue/pywebview-flask/templates/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 详情 9 | 10 | 11 | 12 |

这是详情页

13 |
返回首页
14 | 15 | 16 | -------------------------------------------------------------------------------- /taiyangxue/pywebview-flask/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Hello Pywebview 9 | 10 | 11 | 12 |

Hello Pywebview

13 |
查看详情
14 | 15 | 16 | -------------------------------------------------------------------------------- /taiyangxue/showdata/ip_cache.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/showdata/ip_cache.txt -------------------------------------------------------------------------------- /taiyangxue/showdata/ironman/data.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2020/8/26 14:48 4 | # @Author : way 5 | # @Site : 6 | # @Describe: 7 | 8 | # from ironman.nginx_log_data import province_data, \ 9 | # line_legend, line_normal, line_spider, \ 10 | # bar_legend, bar_normal, bar_spider, \ 11 | # client_data, spider_data 12 | from ironman.nginx_log_data import * 13 | 14 | class SourceData: 15 | 16 | @property 17 | def china(self): 18 | return province_data 19 | 20 | @property 21 | def line(self): 22 | data = { 23 | '正常访问量': line_normal, 24 | # '爬虫访问量': line_normal, 25 | 'legend': line_legend 26 | } 27 | return data 28 | 29 | @property 30 | def bar(self): 31 | data = { 32 | '正常访问量': bar_normal, 33 | # '爬虫访问量': bar_spider, 34 | 'legend': bar_legend 35 | } 36 | return data 37 | 38 | @property 39 | def pie(self): 40 | return client_data 41 | 42 | # @property 43 | # def wordcloud(self): 44 | # return spider_data 45 | -------------------------------------------------------------------------------- /taiyangxue/showdata/ironman/static/css/barrager.css: -------------------------------------------------------------------------------- 1 | .barrage{position: fixed;bottom:70px;right:-500px;display: inline-block;width: 500px;z-index: 99999} 2 | .barrage_box{background-color: rgba(0,0,0,.5);padding-right: 8px; height: 40px;display: inline-block;border-radius: 25px;transition: all .3s;} 3 | .barrage_box .portrait{ display: inline-block;margin-top: 4px; margin-left: 4px; width: 32px;height: 32px;border-radius: 50%;overflow: hidden;} 4 | .barrage_box .portrait img{width: 100%;height: 100%;} 5 | .barrage_box div.p a{ margin-right: 2px; font-size: 14px;color: #fff;line-height: 40px;margin-left: 18px; } 6 | .barrage_box div.p a:hover{text-decoration: underline;} 7 | .barrage_box .close{visibility: hidden;opacity: 0; text-align: center; width:25px;height: 25px;margin-left: 20px;border-radius: 50%;background:rgba(255,255,255,.1);margin-top:8px; background-image: url(close.png);} 8 | .barrage_box:hover .close{visibility:visible;opacity: 1;} 9 | .barrage_box .close a{display:block;} 10 | .barrage_box .close .icon-close{font-size: 14px;color:rgba(255,255,255,.5);display: inline-block;margin-top: 5px; } 11 | .barrage .z {float: left !important;} 12 | .barrage a{text-decoration:none;} -------------------------------------------------------------------------------- /taiyangxue/showdata/ironman/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block left %} 4 | 13 | {% endblock %} 14 | 15 | {% block right %} 16 | 17 |
18 |

数据可视化

19 | 20 |
21 | {% endblock %} 22 | 23 | -------------------------------------------------------------------------------- /taiyangxue/showdata/nginx_access.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/taiyangxue/showdata/nginx_access.zip -------------------------------------------------------------------------------- /taiyangxue/showdata/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2020.6.20 2 | chardet==3.0.4 3 | click==7.1.2 4 | Flask==1.1.2 5 | idna==2.10 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | numpy==1.19.1 10 | pandas==1.1.1 11 | python-dateutil==2.8.1 12 | pytz==2020.1 13 | PyYAML==5.3.1 14 | requests==2.24.0 15 | six==1.15.0 16 | ua-parser==0.10.0 17 | urllib3==1.25.10 18 | user-agents==2.2.0 19 | Werkzeug==1.0.1 20 | xlrd==1.2.0 21 | -------------------------------------------------------------------------------- /taiyangxue/simple-game/v1.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | num = random.randint(0,10) 4 | 5 | while(True): 6 | n = input("请输入:") 7 | n = int(n) 8 | if num == n: 9 | print("你赢啦!!!\n\n") 10 | break 11 | elif num < n: 12 | print("大") 13 | else: 14 | print("小") -------------------------------------------------------------------------------- /taiyangxue/simple-game/v2.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | anger_face = ["ಠ_ಠ","ノಠ_ಠノ","(¬_¬)", "(┳◇┳)","(◔ д◔)","(ʘдʘ╬)","(눈_눈)","-`д´-"] 4 | 5 | num = random.randint(0,10) 6 | while(True): 7 | n = input("请输入:") 8 | if not n.isdecimal(): 9 | print(random.choice(anger_face)) 10 | continue 11 | 12 | n = int(n) 13 | if num == n: 14 | print("你赢啦!!!\n\n") 15 | break 16 | elif num < n: 17 | print("大") 18 | else: 19 | print("小") -------------------------------------------------------------------------------- /taiyangxue/simple-game/v3.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | anger_face = ["ಠ_ಠ","ノಠ_ಠノ","(¬_¬)", "(┳◇┳)","(◔ д◔)","(ʘдʘ╬)","(눈_눈)","-`д´-","😲","😱","😧"] 4 | 5 | def game(): 6 | print("( ^∀^)/欢迎\( ^∀^)") 7 | num = random.randint(0,10) 8 | 9 | while(True): 10 | n = input(">>>>:") 11 | if not n.isdecimal(): 12 | print(random.choice(anger_face)) 13 | continue 14 | 15 | n = int(n) 16 | if num == n: 17 | print("✌ ('ω')") 18 | break 19 | elif num < n: 20 | print("大") 21 | else: 22 | print("小") 23 | 24 | while(True): 25 | game() 26 | c = input("再来一把 (y)/n?") 27 | if c == "n": 28 | print("(ToT)/~~~") 29 | break -------------------------------------------------------------------------------- /taiyangxue/simplenumpy/app.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | m = np.array([(1,2,3),(2,3,4),(3,4,5)]) 4 | 5 | print(m**2) 6 | 7 | n = np.array([(1,2),(2,3),(3,4)]) 8 | 9 | print(m.dot(n)) 10 | 11 | 12 | # 求和 13 | print(m.sum()) 14 | # 连乘 15 | print(m.prod()) 16 | 17 | # 均值 18 | 19 | x = np.array([1,2,3,4,5,6,7,8]) 20 | 21 | print((1/x.size)*x.sum()) 22 | print(x.sum()/x.size) 23 | 24 | # 实现 Frobenius 范数 25 | print(np.sqrt((m**2).sum())) 26 | 27 | # 样本方差 28 | print(np.sqrt(((x-(x.sum()/x.size))**2).sum()/(x.size-1))) 29 | print(np.sqrt(((x-np.mean(x))**2).sum()/(x.size-1))) 30 | # 标准差 31 | print(np.sqrt(((x-np.mean(x))**2).sum()/x.size)) 32 | print(np.std(x)) 33 | 34 | # 欧拉距离 35 | a = np.array([1,2,3,4,5,6]) 36 | b = np.array([2,3,4,5,6,7]) 37 | print(np.sqrt(((a-b)**2).sum())) 38 | print(np.linalg.norm(a-b)) -------------------------------------------------------------------------------- /taiyangxue/why/app.py: -------------------------------------------------------------------------------- 1 | def sum_of_word(word): 2 | sum = 0 3 | for char in word: 4 | sum += ord(char) - 96 # 为什么需要减去 96 5 | return sum 6 | 7 | with open('results.txt', 'w') as result: 8 | with open('words_alpha.txt', 'r') as file: 9 | for word in file.readlines(): 10 | if sum_of_word(word.strip()) == 100: # 注意这里的 strip 11 | result.write(word) -------------------------------------------------------------------------------- /wuya/README.md: -------------------------------------------------------------------------------- 1 | # Python 代码实例 2 | 3 | - [midAutumn](https://github.com/JustDoPython/python-examples/tree/master/wuya/midAutumn) : 中秋假期,回不了家的程序员,竟然用Python做了这件事... 4 | - [level](https://github.com/JustDoPython/python-examples/tree/master/wuya/level) : 多亏学了这个python库,一晚上端掉了一个传销团伙。。。 5 | - [imgmodify](https://github.com/JustDoPython/python-examples/tree/master/wuya/imgmodify) : 跟女朋友旅游三天,Python治好了我的精神内耗... 6 | 7 | --- 8 | 9 | 从小白到工程师的学习之路 10 | 11 | 关注公众号:python 技术,回复"python"一起学习交流 12 | 13 | ![](http://favorites.ren/assets/images/python.jpg) 14 | -------------------------------------------------------------------------------- /wuya/imgmodify/imgmodify.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | import os 4 | 5 | def modify_image(img_path, target_dir): 6 | # 读取全部图片 7 | pic = cv2.imread(img_path, cv2.IMREAD_UNCHANGED) 8 | # 将图片修改为HSV 9 | pichsv = cv2.cvtColor(pic, cv2.COLOR_BGR2HSV) 10 | # 提取饱和度和明度 11 | H,S,V = cv2.split(pichsv) 12 | # S为饱和度,V为明度 13 | new_pic = cv2.merge([np.uint8(H), np.uint8(S*1.4), np.uint8(V*0.9)]) 14 | # 将合并后的图片重置为RGB 15 | pictar = cv2.cvtColor(new_pic, cv2.COLOR_HSV2BGR) 16 | # 获取原文件名 17 | file_name = img_path.split("/")[-1] 18 | # 将图片写入目录 19 | cv2.imwrite(os.path.join(target_dir, file_name), pictar) 20 | 21 | root, dirs, files = next(os.walk("./test/")) 22 | 23 | for item in files: 24 | img_path = os.path.join(root,item) 25 | modify_image(img_path, "./target/") -------------------------------------------------------------------------------- /wuya/level/doc/1_evidence.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/wuya/level/doc/1_evidence.xls -------------------------------------------------------------------------------- /xianhuan/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/.DS_Store -------------------------------------------------------------------------------- /xianhuan/charPic/demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | #coding: utf-8 3 | 4 | from PIL import Image 5 | 6 | ascii_char = list('M3NB6Q#OC?7>!:–;. ') 7 | 8 | def get_char(r, g, b, alpha=256): 9 | if alpha == 0: 10 | return ' ' 11 | 12 | grey = (2126 * r + 7152 * g + 722 * b) / 10000 13 | 14 | char_idx = int((grey / (alpha + 1.0)) * len(ascii_char)) 15 | return ascii_char[char_idx] 16 | 17 | def write_file(out_file_name, content): 18 | with open(out_file_name, 'w') as f: 19 | f.write(content) 20 | 21 | def main(file_name="input.jpg", width=100, height=80, out_file_name='output.txt'): 22 | text = '' 23 | im = Image.open(file_name) 24 | im = im.resize((width, height), Image.NEAREST) 25 | for i in range(height): 26 | for j in range(width): 27 | text += get_char(*im.getpixel((j, i))) 28 | text += '\n' 29 | print(text) 30 | write_file(out_file_name, text) 31 | 32 | if __name__ == '__main__': 33 | main('dance.png') 34 | 35 | -------------------------------------------------------------------------------- /xianhuan/cut-pic/mv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/cut-pic/mv.jpg -------------------------------------------------------------------------------- /xianhuan/extractaudio/demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | #!/user/bin/env python 7 | # coding=utf-8 8 | 9 | from ffmpy import FFmpeg 10 | import os 11 | import uuid 12 | 13 | 14 | def extract(video_path: str, tmp_dir: str, ext: str): 15 | file_name = '.'.join(os.path.basename(video_path).split('.')[0:-1]) 16 | print('文件名:{},提取音频'.format(file_name)) 17 | return run_ffmpeg(video_path, os.path.join(tmp_dir, '{}.{}'.format(uuid.uuid4(), ext)), ext) 18 | 19 | def run_ffmpeg(video_path: str, audio_path: str, format: str): 20 | ff = FFmpeg(inputs={video_path: None}, 21 | outputs={audio_path: '-f {} -vn'.format(format)}) 22 | ff.run() 23 | return audio_path 24 | 25 | if __name__ == '__main__': 26 | print(extract('C:/个人/视频/aaa.mp4', 'C:/个人/视频', 'wav')) -------------------------------------------------------------------------------- /xianhuan/facemerge/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/facemerge/boy.jpg -------------------------------------------------------------------------------- /xianhuan/facemerge/girl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/facemerge/girl.jpg -------------------------------------------------------------------------------- /xianhuan/facemerge/man.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/facemerge/man.jpg -------------------------------------------------------------------------------- /xianhuan/facemerge/result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/facemerge/result.jpg -------------------------------------------------------------------------------- /xianhuan/gengif/gengif.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | # coding:utf-8 7 | import os 8 | from PIL import Image 9 | 10 | imgFolderPath = "C:\\Users\\xxx\\Downloads\\imgs" 11 | fileList = os.listdir(imgFolderPath) 12 | firstImgPath = os.path.join(imgFolderPath, fileList[0]) 13 | im = Image.open(firstImgPath) 14 | images = [] 15 | for img in fileList[1:]: 16 | imgPath = os.path.join(imgFolderPath, img) 17 | images.append(Image.open(imgPath)) 18 | im.save('C:\\Users\\xxx\\Downloads\\imgs\\beauty.gif', save_all=True, append_images=images, loop=0, duration=500) 19 | -------------------------------------------------------------------------------- /xianhuan/glom/glomstudy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from glom import glom, Coalesce 5 | 6 | d = {"a": {"b": {"c": 1}}} 7 | print(glom(d, "a.b.c")) 8 | 9 | d = {"a": {"b": None}} 10 | # print(d["a"]["b"]["c"]) 11 | # print(glom(d, "a.b.c")) 12 | 13 | data = {"student": {"info": [{"name": "张三"}, {"name": "李四"}]}} 14 | info = glom(data, ("student.info", ["name"])) 15 | print(info) 16 | 17 | info = glom(data, {"info": ("student.info", ["name"])}) 18 | print(info) 19 | 20 | 21 | data_1 = {"school": {"student": [{"name": "张三"}, {"name": "李四"}]}} 22 | data_2 = {"school": {"teacher": [{"name": "王老师"}, {"name": "赵老师"}]}} 23 | 24 | spec_1 = {"name": ("school.student", ["name"])} 25 | spec_2 = {"name": ("school.teacher", ["name"])} 26 | print(glom(data_1, spec_1)) 27 | print(glom(data_2, spec_2)) 28 | 29 | 30 | spec = {"name": (Coalesce("school.student", "school.teacher"), ["name"])} 31 | 32 | print(glom(data_1, spec)) 33 | print(glom(data_2, spec)) 34 | 35 | data = {"school": {"student": [{"name": "张三", "age": 18}, {"name": "李四", "age": 20}]}} 36 | spec = {"sum_age": ("school.student", ["age"], sum)} 37 | print(glom(data, spec)) 38 | -------------------------------------------------------------------------------- /xianhuan/gooey/gooeydemo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | from gooey import Gooey, GooeyParser 7 | 8 | 9 | @Gooey( 10 | richtext_controls=True, # 打开终端对颜色支持 11 | program_name="MQTT连接订阅小工具", # 程序名称 12 | encoding="utf-8", # 设置编码格式,打包的时候遇到问题 13 | progress_regex=r"^progress: (\d+)%$" # 正则,用于模式化运行时进度信息 14 | ) 15 | def main(): 16 | settings_msg = 'MQTT device activation information subscription' 17 | parser = GooeyParser(description=settings_msg) 18 | 19 | subs = parser.add_subparsers(help='commands', dest='command') 20 | 21 | my_parser = subs.add_parser('MQTT消息订阅') 22 | my_parser.add_argument("connect", metavar='运行环境',help="请选择开发环境",choices=['dev环境','staging环境'], default='dev环境') 23 | my_parser.add_argument("device_type",metavar='设备类型',help="请选择设备类型",choices=['H1','H3'],default='H1') 24 | my_parser.add_argument("serialNumber", metavar='设备SN号',default='LKVC19060047',help='多个请用逗号或空格隔开') 25 | 26 | siege_parser = subs.add_parser('进度条控制') 27 | siege_parser.add_argument('num',help='请输入数字',default=100) 28 | 29 | args = parser.parse_args() 30 | print(args, flush=True) # flush=True在打包的时候会用到 31 | 32 | 33 | if __name__ == '__main__': 34 | main() 35 | -------------------------------------------------------------------------------- /xianhuan/imageenhance/imgeenhance.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | from PIL import ImageEnhance, Image 7 | #-*- coding: UTF-8 -*- 8 | 9 | from PIL import Image 10 | from PIL import ImageEnhance 11 | 12 | #原始图像 13 | image = Image.open('girl.jpeg') 14 | image.show() 15 | 16 | #亮度增强 17 | enh_bri = ImageEnhance.Brightness(image) 18 | brightness = 4 19 | image_brightened = enh_bri.enhance(brightness) 20 | image_brightened.show() 21 | 22 | #色度增强 23 | enh_col = ImageEnhance.Color(image) 24 | color = 4 25 | image_colored = enh_col.enhance(color) 26 | image_colored.show() 27 | 28 | #对比度增强 29 | enh_con = ImageEnhance.Contrast(image) 30 | contrast = 4 31 | image_contrasted = enh_con.enhance(contrast) 32 | image_contrasted.show() 33 | 34 | #锐度增强 35 | enh_sha = ImageEnhance.Sharpness(image) 36 | sharpness = 4 37 | image_sharped = enh_sha.enhance(sharpness) 38 | image_sharped.show() 39 | -------------------------------------------------------------------------------- /xianhuan/koutu/koutu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import os, paddlehub as hub 7 | huseg = hub.Module(name='deeplabv3p_xception65_humanseg') # 加载模型 8 | path = './imgs/' # 文件目录 9 | files = [path + i for i in os.listdir(path)] # 获取文件列表 10 | results = huseg.segmentation(data={'image': files}) # 抠图 11 | -------------------------------------------------------------------------------- /xianhuan/loguru/logurustudy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | from loguru import logger 7 | 8 | logger.debug('this is a debug message') 9 | 10 | logger.add('hello.log') 11 | 12 | logger.debug('i am in log file') 13 | 14 | id = logger.add('world.log', format="{time} | {level} | {message}", level="INFO") 15 | logger.info('this is a debug message') 16 | logger.remove(id) 17 | logger.info('this is another debug message') 18 | logger.add('runtime.log') 19 | logger.info('this is an debug message') 20 | 21 | # 超过200M就新生成一个文件 22 | logger.add("size.log", rotation="200 MB") 23 | # 每天中午12点生成一个新文件 24 | logger.add("time.log", rotation="12:00") 25 | # 一周生成一个新文件 26 | logger.add("size.log", rotation="1 week") 27 | 28 | @logger.catch 29 | def a_function(x): 30 | return 1 / x 31 | 32 | a_function(0) 33 | 34 | 35 | 36 | def b_function1(x): 37 | try: 38 | return 1 / x 39 | except ZeroDivisionError: 40 | logger.exception("exception!!!") 41 | 42 | b_function1(0) 43 | -------------------------------------------------------------------------------- /xianhuan/monitor/monitor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | from pynput import keyboard, mouse 7 | from loguru import logger 8 | from threading import Thread 9 | 10 | # 定义日志文件 11 | logger.add('moyu.log') 12 | 13 | 14 | def on_press(key): 15 | logger.debug(f'{key} :pushed') 16 | 17 | 18 | def on_release(key): 19 | if key == keyboard.Key.esc: 20 | return False 21 | 22 | 23 | # 定义键盘监听线程 24 | def press_thread(): 25 | with keyboard.Listener(on_press=on_press, on_release=on_release) as lsn: 26 | lsn.join() 27 | 28 | 29 | def on_click(x, y, button, pressed): 30 | if button == mouse.Button.left: 31 | logger.debug('left was pressed!') 32 | elif button == mouse.Button.right: 33 | logger.debug('right was pressed!') 34 | return False 35 | else: 36 | logger.debug('mid was pressed!') 37 | 38 | 39 | # 定义鼠标监听线程 40 | def click_thread(): 41 | with mouse.Listener(on_click=on_click) as listener: 42 | listener.join() 43 | 44 | 45 | if __name__ == '__main__': 46 | # 起两个线程分别监控键盘和鼠标 47 | t1 = Thread(target=press_thread()) 48 | t2 = Thread(target=click_thread()) 49 | t1.start() 50 | t2.start() 51 | -------------------------------------------------------------------------------- /xianhuan/pandasexcel/pandas_excel.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import pandas as pd 7 | import os 8 | 9 | result = pd.DataFrame() 10 | 11 | for name in os.listdir("./tables"): 12 | try: 13 | df = pd.read_excel("./tables/" + name) 14 | df['销售额'] = df['访客数'] * df['转化率'] * df['客单价'] 15 | df_sum = df.groupby('品牌')['销售额'].sum().reset_index() 16 | result = pd.concat([result, df_sum]) 17 | except: 18 | print(name) 19 | pass 20 | 21 | final = result.groupby('品牌')['销售额'].sum().reset_index().sort_values('销售额', ascending=False) 22 | pd.set_option('display.float_format', lambda x: '%.2f' % x) 23 | print(final.head()) 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&呼吸管-呼吸器.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&呼吸管-呼吸器.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&安全带.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&安全带.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&救生衣.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&救生衣.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&滑雪护具.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&滑雪护具.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&滑雪眼镜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&滑雪眼镜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&潜水袜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&潜水袜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&脚蹼.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&脚蹼.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/专项户外运动装备&面镜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/专项户外运动装备&面镜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&其他垂钓用品.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&其他垂钓用品.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&垂钓装备.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&垂钓装备.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&太空豆.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&太空豆.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&打水桶.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&打水桶.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&抄网.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&抄网.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&抄网头.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&抄网头.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&抄网杆.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&抄网杆.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&支架.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&支架.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&浮漂.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&浮漂.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&渔具包.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&渔具包.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&绑钩器.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&绑钩器.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&装鱼桶.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&装鱼桶.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&钓竿.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&钓竿.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&钓箱.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&钓箱.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&钓鱼伞.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&钓鱼伞.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&钓鱼帽.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&钓鱼帽.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&钓鱼手套.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&钓鱼手套.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&钓鱼椅、凳.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&钓鱼椅、凳.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&铅坠.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&铅坠.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&铅皮.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&铅皮.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&饵料盒.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&饵料盒.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&鱼护.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&鱼护.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&鱼线.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&鱼线.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&鱼线轮.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&鱼线轮.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&鱼网-虾笼-其它渔具.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&鱼网-虾笼-其它渔具.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&鱼钩.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&鱼钩.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/垂钓装备&鱼饵.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/垂钓装备&鱼饵.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外休闲家具&充气床.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外休闲家具&充气床.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外休闲家具&吊床.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外休闲家具&吊床.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外休闲家具&户外休闲家具.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外休闲家具&户外休闲家具.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外休闲家具&户外桌椅套装.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外休闲家具&户外桌椅套装.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外休闲家具&户外椅子凳子.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外休闲家具&户外椅子凳子.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&一次性内裤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&一次性内裤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&冲锋衣.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&冲锋衣.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&冲锋裤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&冲锋裤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&户外休闲衣.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&户外休闲衣.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&户外服装.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&户外服装.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&抓绒衣.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&抓绒衣.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&抓绒裤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&抓绒裤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&滑雪裤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&滑雪裤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&潜水服.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&潜水服.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&软壳裤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&软壳裤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&运动户外风衣.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&运动户外风衣.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&速干T恤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&速干T恤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&速干衬衣.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&速干衬衣.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&速干裤.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&速干裤.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外服装&钓鱼服.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外服装&钓鱼服.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&信号灯-发光棒-救生灯.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&信号灯-发光棒-救生灯.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&充电器.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&充电器.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&头灯.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&头灯.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&户外照明.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&户外照明.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&手电筒.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&手电筒.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&电池-燃料.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&电池-燃料.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&营地灯-帐篷灯.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&营地灯-帐篷灯.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外照明&钓鱼灯.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外照明&钓鱼灯.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外鞋靴&户外鞋靴.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外鞋靴&户外鞋靴.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外鞋靴&沙滩鞋-凉鞋-拖鞋.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外鞋靴&沙滩鞋-凉鞋-拖鞋.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外鞋靴&溯溪鞋.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外鞋靴&溯溪鞋.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/户外鞋靴&登山鞋-徒步鞋.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/户外鞋靴&登山鞋-徒步鞋.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/旅行便携装备&其他.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/旅行便携装备&其他.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/旅行便携装备&其他安全防盗产品.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/旅行便携装备&其他安全防盗产品.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/旅行便携装备&旅行便携装备.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/旅行便携装备&旅行便携装备.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/旅行便携装备&普通密码锁.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/旅行便携装备&普通密码锁.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/旅行便携装备&晾衣绳.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/旅行便携装备&晾衣绳.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/旅行便携装备&转换插头.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/旅行便携装备&转换插头.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&垂钓望远镜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&垂钓望远镜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&户外眼镜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&户外眼镜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&普通望远镜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&普通望远镜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&望远镜-夜视仪-户外眼镜.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/望远镜-夜视仪-户外眼镜&望远镜-夜视仪-户外眼镜.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/洗漱清洁-护理用品&防虫-防蚊用品.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/洗漱清洁-护理用品&防虫-防蚊用品.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/登山杖-手杖&登山杖-手杖.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/登山杖-手杖&登山杖-手杖.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/睡袋&睡袋.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/睡袋&睡袋.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防护-救生装备&其他防护救生装备.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防护-救生装备&其他防护救生装备.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防护-救生装备&急救包-急救箱.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防护-救生装备&急救包-急救箱.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防护-救生装备&急救护理用品.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防护-救生装备&急救护理用品.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防护-救生装备&求生哨.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防护-救生装备&求生哨.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防护-救生装备&求生绳-逃生绳.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防护-救生装备&求生绳-逃生绳.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防护-救生装备&防护-救生装备.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防护-救生装备&防护-救生装备.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防潮垫-地席-枕头&地布-地席.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防潮垫-地席-枕头&地布-地席.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防潮垫-地席-枕头&枕头.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防潮垫-地席-枕头&枕头.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防潮垫-地席-枕头&防潮垫-地席-枕头.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防潮垫-地席-枕头&防潮垫-地席-枕头.xlsx -------------------------------------------------------------------------------- /xianhuan/pandasexcel/tables/防潮垫-地席-枕头&防潮垫.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pandasexcel/tables/防潮垫-地席-枕头&防潮垫.xlsx -------------------------------------------------------------------------------- /xianhuan/pdfkit/demo.py: -------------------------------------------------------------------------------- 1 | import pdfkit 2 | 3 | 4 | path_wkthmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe' 5 | config = pdfkit.configuration(wkhtmltopdf=path_wkthmltopdf) 6 | 7 | pdfkit.from_url(r'https://zhuanlan.zhihu.com/p/421726412', 'studypython.pdf', configuration=config) 8 | 9 | pdfkit.from_file(r'C:\Users\cxhuan\Downloads\ttest\test.html','html.pdf', configuration=config) 10 | 11 | pdfkit.from_string('talk is cheap, show me your code!','str.pdf', configuration=config) 12 | 13 | -------------------------------------------------------------------------------- /xianhuan/pencilimg/pencilImg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import cv2 7 | 8 | # 读取 RGB 格式的美女图片 9 | img = cv2.imread("mv5.jpg") 10 | # 将 BGR 图像转为灰度模式 11 | gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 12 | # 显示灰度图像 13 | # cv2.imshow('grey', gray_img) 14 | # cv2.waitKey(0) 15 | # cv2.imwrite("./grey.jpg", gray_img, [int(cv2.IMWRITE_PNG_COMPRESSION), 0]) 16 | # 反转图像 17 | inverted_img = 255 - gray_img 18 | 19 | # 创建铅笔草图 20 | blurred = cv2.GaussianBlur(inverted_img, (21, 21), 0) 21 | inverted_blurred = 255 - blurred 22 | cv2.imwrite("./inverted_blurred.jpg", inverted_blurred, [int(cv2.IMWRITE_PNG_COMPRESSION), 0]) 23 | pencil_sketch = cv2.divide(gray_img, inverted_blurred, scale=256.0) 24 | # 显示图像 25 | cv2.imshow("original", img) 26 | cv2.imshow("pencil", pencil_sketch) 27 | cv2.waitKey(0) 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /xianhuan/pyautogui2/agree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/pyautogui2/agree.png -------------------------------------------------------------------------------- /xianhuan/pyautogui2/demo.py: -------------------------------------------------------------------------------- 1 | import pyautogui 2 | 3 | # 图像识别(一个) 4 | oneLocation = pyautogui.locateOnScreen('1.png') 5 | print(oneLocation) 6 | # 图像识别(多个) 7 | allLocation = pyautogui.locateAllOnScreen('1.png') 8 | print(allLocation) 9 | print(list(allLocation)) 10 | for left,top,width,height in pyautogui.locateAllOnScreen('1.png'): 11 | print(1) 12 | print(left) -------------------------------------------------------------------------------- /xianhuan/pyscript/importPackages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | - numpy 7 | - matplotlib 8 | 9 | 10 | 11 | 12 |

Let's plot random numbers

13 |
14 | 15 | import matplotlib.pyplot as plt 16 | import numpy as np 17 | 18 | x = np.random.randn(1000) 19 | y = np.random.randn(1000) 20 | 21 | fig, ax = plt.subplots() 22 | ax.scatter(x, y) 23 | fig 24 | 25 | 26 | -------------------------------------------------------------------------------- /xianhuan/pyscript/labledEles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Today is

10 |
11 |
12 | 13 | import datetime as dt 14 | pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y')) 15 | 16 | def compute_pi(n): 17 | pi = 2 18 | for i in range(1,n): 19 | pi *= 4 * i ** 2 / (4 * i ** 2 - 1) 20 | return pi 21 | 22 | pi = compute_pi(100000) 23 | pyscript.write('pi', f'π is approximately {pi:.3f}') 24 | 25 | 26 | -------------------------------------------------------------------------------- /xianhuan/pyscript/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | First PyScript Application 13 | 22 | 23 | 24 | 25 | 26 | print('Hello PyScript!') 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /xianhuan/pyscripts/draftPic: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | img = cv2.imread("C:\\pworkspace\\mypy\\pythontech\\funnyscripts\\elon.png") 4 | 5 | ## Image to Gray Image 6 | gray_image = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) 7 | 8 | ## Gray Image to Inverted Gray Image 9 | inverted_gray_image = 255-gray_image 10 | 11 | ## Blurring The Inverted Gray Image 12 | blurred_inverted_gray_image = cv2.GaussianBlur(inverted_gray_image, (19,19),0) 13 | 14 | ## Inverting the blurred image 15 | inverted_blurred_image = 255-blurred_inverted_gray_image 16 | 17 | ### Preparing Photo sketching 18 | sketck = cv2.divide(gray_image, inverted_blurred_image,scale= 256.0) 19 | 20 | cv2.imshow("Original Image",img) 21 | cv2.imshow("Pencil Sketch", sketck) 22 | cv2.waitKey(0) -------------------------------------------------------------------------------- /xianhuan/pyscripts/pdfencry: -------------------------------------------------------------------------------- 1 | import pikepdf 2 | 3 | pdf = pikepdf.open("test.pdf") 4 | pdf.save('encrypt.pdf', encryption=pikepdf.Encryption(owner="your_password", user="your_password", R=4)) 5 | pdf.close() -------------------------------------------------------------------------------- /xianhuan/pyscripts/sendEmail: -------------------------------------------------------------------------------- 1 | import smtplib 2 | from email.message import EmailMessage 3 | import pandas as pd 4 | 5 | def send_email(remail, rsubject, rcontent): 6 | email = EmailMessage() 7 | # 发件人邮箱 8 | email['from'] = '发件人邮箱' 9 | # 收件人邮箱 10 | email['to'] = remail 11 | # 主题 12 | email['subject'] = rsubject 13 | # 内容 14 | email.set_content(rcontent) 15 | with smtplib.SMTP(host='smtp.qq.com',port=25)as smtp: 16 | smtp.ehlo() 17 | smtp.starttls() 18 | # 授权码登录 19 | smtp.login("发件人邮箱","授权码") 20 | smtp.send_message(email) 21 | print("email send to ",remail) 22 | 23 | if __name__ == '__main__': 24 | send_email('目标邮箱','test','test') 25 | 26 | -------------------------------------------------------------------------------- /xianhuan/pyscripts/zipfile: -------------------------------------------------------------------------------- 1 | # 解压文件 2 | from zipfile import ZipFile 3 | 4 | unzip = ZipFile("C:\\Users\\cxhuan\\Downloads\\file_upload.zip", "r") 5 | unzip.extractall("C:\\Users\\cxhuan\\Downloads\\file_upload") -------------------------------------------------------------------------------- /xianhuan/pysimplegui/demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import PySimpleGUI as sg 7 | 8 | layout = [ 9 | [sg.Text('一句话概括Python')], 10 | [sg.Input(key='-INPUT111-')], 11 | [sg.Input(key='-INPUT222-')], 12 | [sg.Button('确认'), sg.Button('取消')], 13 | [sg.Text('输出:'), sg.Text(key='-OUTPUT-')] 14 | ] 15 | window = sg.Window('PySimpleGUI Demo', layout) 16 | while True: 17 | event, values = window.read() 18 | print(event) 19 | print(values) 20 | if event in (None, '取消'): 21 | break 22 | else: 23 | window['-OUTPUT-'].update(values['-INPUT222-']) 24 | window.close() 25 | 26 | -------------------------------------------------------------------------------- /xianhuan/qrcode/qrcodedemo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import qrcode 7 | import cv2 8 | 9 | img = qrcode.make('https://www.zhihu.com/people/wu-huan-bu-san') 10 | img.save('./pic.jpg') 11 | 12 | d = cv2.QRCodeDetector() 13 | val, _, _ = d.detectAndDecode(cv2.imread("pic.jpg")) 14 | print("Decoded text is: ", val) 15 | 16 | -------------------------------------------------------------------------------- /xianhuan/readwc/blackheart.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/readwc/blackheart.jpeg -------------------------------------------------------------------------------- /xianhuan/readwc/wc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xianhuan/readwc/wc.png -------------------------------------------------------------------------------- /xianhuan/sds/christmasTree.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | 7 | import turtle as tur 8 | 9 | 10 | # 爱心函数 11 | # r为半圆半径,l = 2r为正方形边长 12 | # 调整半径即可调整爱心大小 13 | def loving_heart(r): 14 | l = 2 * r 15 | tur.left(45) 16 | tur.forward(l) 17 | tur.circle(r, 180) 18 | tur.right(90) 19 | tur.circle(r, 180) 20 | tur.forward(l) 21 | 22 | 23 | # 树函数(递归) 24 | def tree(d, s): 25 | if d <= 0: 26 | return 27 | tur.forward(s) 28 | tree(d - 1, s * .8) 29 | tur.right(120) 30 | tree(d - 3, s * .5) 31 | tur.right(120) 32 | tree(d - 3, s * .5) 33 | tur.right(120) 34 | # 回退函数 35 | tur.backward(s) 36 | 37 | 38 | # 画爱心部分 39 | tur.penup() 40 | # 设置起点位置 41 | tur.goto(0, 200) 42 | tur.pendown() 43 | # 设置画笔颜色 44 | tur.pencolor('pink') 45 | tur.color('pink') 46 | # 对图形进行填充 47 | tur.begin_fill() 48 | # 执行画爱心函数 49 | loving_heart(20) 50 | tur.end_fill() 51 | 52 | # 画树部分 53 | n = 100 54 | tur.speed('fastest') 55 | tur.right(225) 56 | tur.color("dark green") 57 | tur.backward(n * 4.8) 58 | tree(15, n) 59 | tur.backward(n / 5) 60 | tur.penup() 61 | tur.Turtle().screen.delay(2) 62 | tur.goto(80, 0) 63 | tur.pendown() 64 | tur.color("gold") 65 | tur.write("Merry Christmas!", font=("Times", 32, "bold")) 66 | tur.hideturtle() 67 | -------------------------------------------------------------------------------- /xianhuan/smartcode/smartCode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | lis = [] 5 | for i in range(1, 10): 6 | lis.append(i*i) 7 | print(lis) 8 | 9 | lis = [x * x for x in range(1, 10)] 10 | print(list) 11 | 12 | list = [x * y for x in range(1, 10) for y in range(1, 10)] 13 | print(lis) 14 | 15 | lis = [i for i in range(1, 11) if i % 2 == 0] 16 | print(lis) # [2, 4, 6, 8, 10] 17 | 18 | dic = {x: x/2 for x in range(1,11) if x % 2 == 0} 19 | print(dic) 20 | 21 | dic = {'half': x/2 for x in range(1,11) if x % 2 == 0} 22 | print(dic) 23 | 24 | set1 = {x for x in range(10) if x % 2 == 0} 25 | print(set1) 26 | 27 | tup=(x for x in range(1,10)) 28 | print(tup) 29 | 30 | tup=tuple(x for x in range(1,10)) 31 | print(tup) 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /xianhuan/taichi/demo.py: -------------------------------------------------------------------------------- 1 | import time 2 | import taichi as ti 3 | 4 | ti.init() 5 | 6 | @ti.func 7 | def is_prime(n): 8 | result = True 9 | for k in range(2, int(n**0.5) + 1): 10 | if n % k == 0: 11 | result = False 12 | break 13 | return result 14 | 15 | @ti.kernel 16 | def count_primes(n: int) -> int: 17 | count = 0 18 | for k in range(2, n): 19 | if is_prime(k): 20 | count += 1 21 | 22 | return count 23 | 24 | t0 = time.time() 25 | print(count_primes(1000000)) 26 | t1 = time.time() 27 | 28 | print(t1-t0) 29 | -------------------------------------------------------------------------------- /xianhuan/tqdm/tqdmdemo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | 7 | from tqdm import tqdm 8 | from time import sleep 9 | from tqdm import trange 10 | 11 | for char in tqdm(['h', 'e', 'l', 'l', 'o']): 12 | sleep(0.25) 13 | 14 | for i in tqdm(range(100)): 15 | sleep(0.05) 16 | 17 | for i in trange(100): 18 | sleep(0.05) 19 | 20 | pbar = tqdm(range(5)) 21 | for char in pbar: 22 | pbar.set_description("Progress %d" %char) 23 | sleep(1) 24 | 25 | 26 | with tqdm(total=100) as pbar: 27 | for i in range(1, 5): 28 | sleep(1) 29 | # 更新进度 30 | pbar.update(10*i) 31 | 32 | with tqdm(total=100, colour='yellow') as pbar: 33 | for i in range(1, 5): 34 | sleep(1) 35 | # 更新进度 36 | pbar.update(10*i) 37 | 38 | 39 | for i in trange(3, desc='outer loop'): 40 | for i in trange(100, desc='inner loop', leave=False): 41 | sleep(0.01) 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /xianhuan/videobase/capturevideo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import cv2 as cv 7 | cap = cv.VideoCapture(0) 8 | if not cap.isOpened(): 9 | print("Cannot open camera") 10 | exit() 11 | while True: 12 | # 逐帧捕获 13 | ret, frame = cap.read() 14 | # 如果正确读取帧,ret为True 15 | if not ret: 16 | break 17 | # 显示结果帧e 18 | cv.imshow('frame', frame) 19 | if cv.waitKey(1) == ord('q'): 20 | break 21 | # 完成所有操作后,释放捕获器 22 | cap.release() 23 | cv.destroyAllWindows() -------------------------------------------------------------------------------- /xianhuan/videobase/playvideo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import cv2 as cv 7 | cap = cv.VideoCapture('video.mp4') 8 | while cap.isOpened(): 9 | ret, frame = cap.read() 10 | # 如果正确读取帧,ret为True 11 | if not ret: 12 | break 13 | cv.imshow('frame', frame) 14 | if cv.waitKey(25) == ord('q'): 15 | break 16 | cap.release() 17 | cv.destroyAllWindows() -------------------------------------------------------------------------------- /xianhuan/videobase/savevideo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | @author: 闲欢 5 | """ 6 | import cv2 as cv 7 | cap = cv.VideoCapture(0) 8 | # 定义编解码器并创建VideoWriter对象 9 | fourcc = cv.VideoWriter_fourcc(*'MJPG') 10 | out = cv.VideoWriter('output.mp4', fourcc, 20.0, (640, 480)) 11 | while cap.isOpened(): 12 | ret, frame = cap.read() 13 | if not ret: 14 | break 15 | frame = cv.flip(frame, 1) 16 | # 写翻转的框架 17 | out.write(frame) 18 | cv.imshow('frame', frame) 19 | if cv.waitKey(1) == ord('q'): 20 | break 21 | # 完成工作后释放所有内容 22 | cap.release() 23 | out.release() 24 | cv.destroyAllWindows() -------------------------------------------------------------------------------- /xuanyuanyulong/2020-02-29-python-spiro/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-02-29-python-spiro/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-03-27-PDF-watermark/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-03-27-PDF-watermark/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-03-27-PDF-watermark/input.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-03-27-PDF-watermark/input.pdf -------------------------------------------------------------------------------- /xuanyuanyulong/2020-03-27-PDF-watermark/watermark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-03-27-PDF-watermark/watermark.pdf -------------------------------------------------------------------------------- /xuanyuanyulong/2020-03-27-PDF-watermark/watermark.py: -------------------------------------------------------------------------------- 1 | import PyPDF2 2 | 3 | inputName = "input.pdf" 4 | watermarkName = "watermark.pdf" 5 | outputName = "output.pdf" 6 | 7 | pdfInput = PyPDF2.PdfFileReader(inputName) 8 | watermark = PyPDF2.PdfFileReader(watermarkName).getPage(0) 9 | 10 | pdfWriter = PyPDF2.PdfFileWriter() 11 | 12 | # print(pdfInput.numPages) 13 | # print(pdfInput.getNumPages()) 14 | 15 | for i in range(pdfInput.numPages): 16 | page = pdfInput.getPage(i) 17 | page.mergePage(watermark) 18 | pdfWriter.addPage(page) 19 | 20 | with open(outputName, "wb") as f: 21 | pdfWriter.write(f) -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-23-getopt-parse-command-arguments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-08-23-getopt-parse-command-arguments/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-23-getopt-parse-command-arguments/manually_parse_argv.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | for index, command_arg in enumerate(sys.argv[1:]): 5 | if command_arg.startswith('--'): 6 | try: 7 | value = sys.argv[1:][index+1] 8 | if not value.startswith('-'): 9 | print("%s 为长参数,参数值为 %s" % (command_arg, value)) 10 | continue 11 | except IndexError: 12 | pass 13 | 14 | print("%s 为长参数,无参数值" % command_arg) 15 | 16 | elif command_arg.startswith('-'): 17 | try: 18 | value = sys.argv[1:][index+1] 19 | if not value.startswith('-'): 20 | print("%s 为短参数,参数值为 %s" % (command_arg, value)) 21 | continue 22 | except IndexError: 23 | pass 24 | 25 | print("%s 为短参数,无参数值" % command_arg) 26 | 27 | 28 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-23-getopt-parse-command-arguments/test_getopt.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import getopt 3 | 4 | 5 | opts, args = getopt.getopt(sys.argv[1:], 'd:t:', ["author=", "country=", "auto"]) 6 | 7 | print(opts) 8 | print(args) -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-23-getopt-parse-command-arguments/test_sys.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(sys.argv) -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-dis-bytecode/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-08-24-python-dis-bytecode/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-dis-bytecode/test_compile.py: -------------------------------------------------------------------------------- 1 | import dis 2 | 3 | with open("test_dis.py", "r", encoding="utf-8") as f: 4 | s = f.read() 5 | 6 | compile_obj = compile(s, "test_dis.py","exec") 7 | 8 | dis.dis(compile_obj) -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-dis-bytecode/test_dis.py: -------------------------------------------------------------------------------- 1 | import dis 2 | 3 | 4 | s = """ 5 | def add(add_1, add_2): 6 | sum_value = add_1 + add_2 7 | 8 | print("Hello World!") 9 | 10 | import sys 11 | """ 12 | 13 | dis.dis(s) -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-with-statement/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-08-24-python-with-statement/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-with-statement/test.txt: -------------------------------------------------------------------------------- 1 | JUST 2 | DO 3 | PYTHON 4 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-with-statement/test_context_manager.py: -------------------------------------------------------------------------------- 1 | class testContextManager: 2 | def __enter__(self): 3 | print("进入运行时上下文,调用__enter__方法") 4 | 5 | def __exit__(self, exc_type, exc_value, traceback): 6 | print("退出运行时上下文,调用__exit__方法") 7 | 8 | 9 | with testContextManager() as o: 10 | pass -------------------------------------------------------------------------------- /xuanyuanyulong/2020-08-24-python-with-statement/test_with.py: -------------------------------------------------------------------------------- 1 | with open("test.txt", "r", encoding="utf-8") as f: 2 | s = f.readlines() 3 | 4 | 5 | print(s) 6 | 7 | # try: 8 | # f = open("test.txt", "a", encoding="utf-8") 9 | # s = f.readlines() 10 | # except: 11 | # print("出现异常") 12 | # finally: 13 | # f.close() -------------------------------------------------------------------------------- /xuanyuanyulong/2020-09-28-problem-in-print/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-09-28-problem-in-print/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-09-28-problem-in-print/flushed.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | import threading 4 | 5 | 6 | def print_sharp(): 7 | while True: 8 | time.sleep(0.5) 9 | print("#", end="") 10 | sys.stdout.flush() 11 | 12 | 13 | t1 = threading.Thread(target=print_sharp) 14 | t1.setDaemon(True) 15 | t1.start() 16 | 17 | time.sleep(5) 18 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-09-28-problem-in-print/no_flush.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | import threading 4 | 5 | 6 | def print_sharp(): 7 | while True: 8 | time.sleep(0.5) 9 | print("#", end="") 10 | # print("#") 11 | 12 | 13 | t1 = threading.Thread(target=print_sharp) 14 | t1.setDaemon(True) 15 | t1.start() 16 | 17 | time.sleep(5) 18 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-09-28-problem-in-print/self_flushed.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | import threading 4 | 5 | 6 | def print_sharp(): 7 | while True: 8 | time.sleep(0.5) 9 | print("#", end="", flush=True) 10 | 11 | 12 | t1 = threading.Thread(target=print_sharp) 13 | t1.setDaemon(True) 14 | t1.start() 15 | 16 | time.sleep(5) 17 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-09-28-sourcetrail-introduction/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-09-28-sourcetrail-introduction/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-09-28-sourcetrail-introduction/sourcetrail_offcial_home.txt: -------------------------------------------------------------------------------- 1 | https://www.sourcetrail.com/ -------------------------------------------------------------------------------- /xuanyuanyulong/2020-10-13-import-system/Project_example/A/alpha.py: -------------------------------------------------------------------------------- 1 | print("name: " + __name__) 2 | print("file: " + __file__) 3 | 4 | def al(): 5 | print("Importing alpha succeeded.") -------------------------------------------------------------------------------- /xuanyuanyulong/2020-10-13-import-system/Project_example/A/beta.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-10-13-import-system/Project_example/A/beta.py -------------------------------------------------------------------------------- /xuanyuanyulong/2020-10-13-import-system/Project_example/B/theta.py: -------------------------------------------------------------------------------- 1 | from A.alpha import al 2 | 3 | al() 4 | 5 | print("Importing theta succeeded.") -------------------------------------------------------------------------------- /xuanyuanyulong/2020-10-13-import-system/Project_example/main/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) 5 | 6 | import A.alpha 7 | 8 | 9 | A.alpha.al() 10 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-10-20-abuse-of-list-comprehension/problem.py: -------------------------------------------------------------------------------- 1 | l1 = [n for n in range(10)] 2 | 3 | l2 = list(range(10)) 4 | 5 | print(l1) 6 | 7 | print(l2) 8 | 9 | print(l1 == l2) 10 | -------------------------------------------------------------------------------- /xuanyuanyulong/2020-11-04-python-pdb/test_pdb_intrusive.py: -------------------------------------------------------------------------------- 1 | import pdb; # pdb.set_trace() 2 | 3 | 4 | def addStr(a, b): 5 | return a + b 6 | 7 | def mergeChar(l: list): 8 | return ''.join(l) 9 | 10 | def getSlogan(a, b, c): 11 | result = addStr(a, b) + mergeChar(c) 12 | return result 13 | 14 | 15 | a = "just" 16 | 17 | b = "do" 18 | 19 | pdb.set_trace() 20 | 21 | c = ['p', 'y', 't', 'h', 'o', 'n'] 22 | 23 | print(a) -------------------------------------------------------------------------------- /xuanyuanyulong/2020-11-23-let-me-google-that-for-you/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/xuanyuanyulong/2020-11-23-let-me-google-that-for-you/__init__.py -------------------------------------------------------------------------------- /xuanyuanyulong/README.md: -------------------------------------------------------------------------------- 1 | # Python 代码实例 2 | 3 | Python技术 公众号文章代码库 4 | 5 | - [2020-02-29-python-spiro](https://github.com/JustDoPython/python-examples/tree/master/xuanyuanyulong/2020-02-29-python-spiro) 6 | - [2020-03-27-PDF-watermark](https://github.com/JustDoPython/python-examples/tree/master/xuanyuanyulong/2020-03-27-PDF-watermark) 7 | 8 | 关注公众号:python 技术,回复"python"一起学习交流 9 | 10 | ![](http://favorites.ren/assets/images/python.jpg) 11 | -------------------------------------------------------------------------------- /yeke/py-aljx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-aljx/__init__.py -------------------------------------------------------------------------------- /yeke/py-aljx/aljx_cloud.py: -------------------------------------------------------------------------------- 1 | from wordcloud import WordCloud 2 | import numpy as np, jieba 3 | from PIL import Image 4 | 5 | def jieba_(): 6 | stop_words = [] 7 | with open('stop_words.txt', 'r', encoding='utf-8') as f: 8 | lines = f.readlines() 9 | for line in lines: 10 | stop_words.append(line.strip()) 11 | content = open('aljx.txt', 'rb').read() 12 | # jieba 分词 13 | word_list = jieba.cut(content) 14 | words = [] 15 | for word in word_list: 16 | if word not in stop_words: 17 | words.append(word) 18 | global word_cloud 19 | # 用逗号隔开词语 20 | word_cloud = ','.join(words) 21 | 22 | def cloud(): 23 | # 打开词云背景图 24 | cloud_mask = np.array(Image.open('bg.png')) 25 | # 定义词云的一些属性 26 | wc = WordCloud( 27 | # 背景图分割颜色为白色 28 | background_color='white', 29 | # 背景图样 30 | mask=cloud_mask, 31 | # 显示最大词数 32 | max_words=300, 33 | # 显示中文 34 | font_path='./fonts/simhei.ttf', 35 | # 最大尺寸 36 | max_font_size=100 37 | ) 38 | global word_cloud 39 | # 词云函数 40 | x = wc.generate(word_cloud) 41 | # 生成词云图片 42 | image = x.to_image() 43 | # 展示词云图片 44 | image.show() 45 | # 保存词云图片 46 | wc.to_file('cloud.png') 47 | 48 | jieba_() 49 | cloud() -------------------------------------------------------------------------------- /yeke/py-aljx/bg.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-aljx/bg.PNG -------------------------------------------------------------------------------- /yeke/py-aljx/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-aljx/cloud.png -------------------------------------------------------------------------------- /yeke/py-ascii/Courier-New.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/Courier-New.ttf -------------------------------------------------------------------------------- /yeke/py-ascii/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/__init__.py -------------------------------------------------------------------------------- /yeke/py-ascii/g1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/g1.gif -------------------------------------------------------------------------------- /yeke/py-ascii/g1_ascii.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/g1_ascii.gif -------------------------------------------------------------------------------- /yeke/py-ascii/g2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/g2.gif -------------------------------------------------------------------------------- /yeke/py-ascii/g2_ascii.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/g2_ascii.gif -------------------------------------------------------------------------------- /yeke/py-ascii/static/static.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/static/static.jpg -------------------------------------------------------------------------------- /yeke/py-ascii/static/static_ascii.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/static/static_ascii.jpg -------------------------------------------------------------------------------- /yeke/py-ascii/tmp/g2_tmp_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/tmp/g2_tmp_0.png -------------------------------------------------------------------------------- /yeke/py-ascii/tmp/g2_tmp_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/tmp/g2_tmp_1.png -------------------------------------------------------------------------------- /yeke/py-ascii/tmp/g2_tmp_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/tmp/g2_tmp_2.png -------------------------------------------------------------------------------- /yeke/py-ascii/tmp/g2_tmp_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/tmp/g2_tmp_3.png -------------------------------------------------------------------------------- /yeke/py-ascii/tmp/g2_tmp_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/tmp/g2_tmp_4.png -------------------------------------------------------------------------------- /yeke/py-ascii/tmp/g2_tmp_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-ascii/tmp/g2_tmp_5.png -------------------------------------------------------------------------------- /yeke/py-cflag/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-cflag/__init__.py -------------------------------------------------------------------------------- /yeke/py-cflag/china_flag.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | turtle.setup(600,400,0,0) 4 | turtle.bgcolor("red") 5 | turtle.fillcolor("yellow") 6 | turtle.color('yellow') 7 | turtle.speed(10) 8 | # 主星 9 | turtle.begin_fill() 10 | turtle.up() 11 | turtle.goto(-280,100) 12 | turtle.down() 13 | for i in range (5): 14 | turtle.forward(150) 15 | turtle.right(144) 16 | turtle.end_fill() 17 | # 副星 18 | turtle.begin_fill() 19 | turtle.up() 20 | turtle.goto(-100,180) 21 | turtle.setheading(305) 22 | turtle.down() 23 | for i in range (5): 24 | turtle.forward(50) 25 | turtle.left(144) 26 | turtle.end_fill() 27 | turtle.begin_fill() 28 | turtle.up() 29 | turtle.goto(-50,110) 30 | turtle.setheading(30) 31 | turtle.down() 32 | for i in range (5): 33 | turtle.forward(50) 34 | turtle.right(144) 35 | turtle.end_fill() 36 | turtle.begin_fill() 37 | turtle.up() 38 | turtle.goto(-40,50) 39 | turtle.setheading(5) 40 | turtle.down() 41 | for i in range (5): 42 | turtle.forward(50) 43 | turtle.right(144) 44 | turtle.end_fill() 45 | turtle.begin_fill() 46 | turtle.up() 47 | turtle.goto(-100,10) 48 | turtle.setheading(300) 49 | turtle.down() 50 | for i in range (5): 51 | turtle.forward(50) 52 | turtle.left(144) 53 | turtle.end_fill() 54 | turtle.hideturtle() 55 | turtle.done() -------------------------------------------------------------------------------- /yeke/py-cflag/japan_flag.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | turtle.setup(width=600, height=400) 4 | # 设置画笔起点 5 | turtle.penup() 6 | turtle.goto(0, -50) 7 | turtle.pendown() 8 | # 设置画笔属性 9 | turtle.pensize(5) 10 | turtle.pencolor("red") 11 | turtle.fillcolor("red") 12 | # 绘制速度 13 | turtle.speed(10) 14 | turtle.begin_fill() 15 | turtle.circle(50) 16 | turtle.end_fill() 17 | turtle.hideturtle() 18 | turtle.mainloop() -------------------------------------------------------------------------------- /yeke/py-cflag/switzerland_flag.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | def draw_crossshaped(aTurtle, width=0, height=0, color=None): 4 | aTurtle = turtle.Turtle() 5 | aTurtle.hideturtle() 6 | aTurtle.penup() 7 | aTurtle.goto(30, 50) 8 | aTurtle.begin_fill() 9 | aTurtle.fillcolor(color) 10 | for i in range(4): 11 | aTurtle.pendown() 12 | aTurtle.fd(width) 13 | aTurtle.rt(90) 14 | aTurtle.fd(height) 15 | aTurtle.rt(90) 16 | aTurtle.fd(width) 17 | aTurtle.lt(90) 18 | aTurtle.end_fill() 19 | 20 | def draw_RQ(times=20.0): 21 | width, height = 26 * times, 26 * times 22 | window = turtle.Screen() 23 | aTurtle = turtle.Turtle() 24 | aTurtle.hideturtle() 25 | aTurtle.speed(10) 26 | aTurtle.penup() 27 | aTurtle.goto(-width / 2, height / 2) 28 | aTurtle.pendown() 29 | aTurtle.begin_fill() 30 | aTurtle.fillcolor('red') 31 | aTurtle.fd(width) 32 | aTurtle.right(90) 33 | aTurtle.fd(height) 34 | aTurtle.right(90) 35 | aTurtle.fd(width) 36 | aTurtle.right(90) 37 | aTurtle.fd(height) 38 | aTurtle.right(90) 39 | aTurtle.end_fill() 40 | draw_crossshaped(aTurtle, width=80, height=80, color='white') 41 | window.exitonclick() 42 | 43 | if __name__ == '__main__': 44 | draw_RQ() 45 | -------------------------------------------------------------------------------- /yeke/py-counter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-counter/__init__.py -------------------------------------------------------------------------------- /yeke/py-counter/__pycache__/counter.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-counter/__pycache__/counter.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-counter/build/counter/PKG-00.pkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-counter/build/counter/PKG-00.pkg -------------------------------------------------------------------------------- /yeke/py-counter/build/counter/PYZ-00.pyz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-counter/build/counter/PYZ-00.pyz -------------------------------------------------------------------------------- /yeke/py-counter/build/counter/base_library.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-counter/build/counter/base_library.zip -------------------------------------------------------------------------------- /yeke/py-counter/build/counter/counter.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /yeke/py-counter/counter.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | block_cipher = None 4 | 5 | 6 | a = Analysis(['counter.py'], 7 | pathex=['E:\\blog_space\\py-counter'], 8 | binaries=[], 9 | datas=[], 10 | hiddenimports=[], 11 | hookspath=[], 12 | runtime_hooks=[], 13 | excludes=[], 14 | win_no_prefer_redirects=False, 15 | win_private_assemblies=False, 16 | cipher=block_cipher, 17 | noarchive=False) 18 | pyz = PYZ(a.pure, a.zipped_data, 19 | cipher=block_cipher) 20 | exe = EXE(pyz, 21 | a.scripts, 22 | a.binaries, 23 | a.zipfiles, 24 | a.datas, 25 | [], 26 | name='counter', 27 | debug=False, 28 | bootloader_ignore_signals=False, 29 | strip=False, 30 | upx=True, 31 | upx_exclude=[], 32 | runtime_tmpdir=None, 33 | console=True ) 34 | -------------------------------------------------------------------------------- /yeke/py-counter/dist/counter.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-counter/dist/counter.exe -------------------------------------------------------------------------------- /yeke/py-discern/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-discern/__init__.py -------------------------------------------------------------------------------- /yeke/py-discern/card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-discern/card.jpg -------------------------------------------------------------------------------- /yeke/py-discern/idcard_discern.py: -------------------------------------------------------------------------------- 1 | from aip import AipOcr 2 | 3 | APP_ID = '' 4 | API_KEY = '' 5 | SECRET_KEY = '' 6 | # 创建客户端对象 7 | client = AipOcr(APP_ID, API_KEY, SECRET_KEY) 8 | # 打开并读取文件内容 9 | fp = open("card.jpg", "rb").read() 10 | # res = client.basicGeneral(fp) # 普通 11 | res = client.basicAccurate(fp) # 高精度 12 | # 遍历结果 13 | for tex in res["words_result"]: 14 | row = tex["words"] 15 | print(row) -------------------------------------------------------------------------------- /yeke/py-facepalm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-facepalm/__init__.py -------------------------------------------------------------------------------- /yeke/py-firework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-firework/__init__.py -------------------------------------------------------------------------------- /yeke/py-firework/bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-firework/bg.jpeg -------------------------------------------------------------------------------- /yeke/py-flag/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-flag/__init__.py -------------------------------------------------------------------------------- /yeke/py-flag/apple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-flag/apple.jpg -------------------------------------------------------------------------------- /yeke/py-flag/apple.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | turtle.setup(600, 600, 0, 0) 4 | turtle.up() 5 | turtle.goto(0, -200) 6 | turtle.down() 7 | # 先画一个圆,并填充为红色 8 | turtle.begin_fill() 9 | turtle.color("red") 10 | turtle.circle(radius=150) 11 | turtle.end_fill() 12 | # 画苹果把 13 | turtle.color("black") 14 | turtle.pu() 15 | turtle.goto(-90, 0) 16 | turtle.pd() 17 | turtle.circle(180, 40) 18 | turtle.pu() 19 | turtle.seth(105) 20 | turtle.goto(-20, 20) 21 | turtle.pd() 22 | turtle.circle(180, 50) 23 | turtle.pd() 24 | # 画左边叶子 25 | turtle.begin_fill() 26 | turtle.color("green") 27 | turtle.circle(180, 50) 28 | turtle.seth(-30) 29 | turtle.circle(180, 55) 30 | turtle.end_fill() 31 | # 画右边叶子 32 | turtle.begin_fill() 33 | turtle.color("green") 34 | turtle.seth(0) 35 | turtle.circle(180, 50) 36 | turtle.seth(-180) 37 | turtle.circle(180, 50) 38 | turtle.end_fill() 39 | turtle.done() -------------------------------------------------------------------------------- /yeke/py-flag/apple_head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-flag/apple_head.jpg -------------------------------------------------------------------------------- /yeke/py-flag/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-flag/head.jpg -------------------------------------------------------------------------------- /yeke/py-flag/head_flag.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | # 读取头像和圣诞老人图片 4 | img_head = cv2.imread('head.jpg') 5 | img_flag = cv2.imread('sc.jpg') 6 | # 获取头像和圣诞老人图片宽度 7 | w_head, h_head = img_head.shape[:2] 8 | w_flag, h_flag = img_flag.shape[:2] 9 | # 计算图案缩放比例 10 | scale = w_head / w_flag / 4 11 | # 缩放图案 12 | img_flag = cv2.resize(img_flag, (0, 0), fx=scale, fy=scale) 13 | # 获取缩放后新宽度 14 | w_flag, h_flag = img_flag.shape[:2] 15 | # 按 3 个通道合并图片 16 | for c in range(0, 3): 17 | img_head[w_head - w_flag:, h_head - h_flag:, c] = img_flag[:, :, c] 18 | # 保存最终结果 19 | cv2.imwrite('sc_head.jpg', img_head) -------------------------------------------------------------------------------- /yeke/py-flag/sc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-flag/sc.jpg -------------------------------------------------------------------------------- /yeke/py-flag/sc_head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-flag/sc_head.jpg -------------------------------------------------------------------------------- /yeke/py-minesweep/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/__init__.py -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/0.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/1.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/2.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/3.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/4.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/5.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/6.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/7.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/8.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/a.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/a.TTF -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/ask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/ask.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/blank.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/blank.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/blood.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/blood.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/error.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/error.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/face_fail.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/face_fail.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/face_normal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/face_normal.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/face_success.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/face_success.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/flag.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/flag.bmp -------------------------------------------------------------------------------- /yeke/py-minesweep/resources/mine.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-minesweep/resources/mine.bmp -------------------------------------------------------------------------------- /yeke/py-mouse/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-mouse/__init__.py -------------------------------------------------------------------------------- /yeke/py-plane/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/__init__.py -------------------------------------------------------------------------------- /yeke/py-plane/__pycache__/pl_model.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/__pycache__/pl_model.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-plane/resources/image/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/resources/image/bg.png -------------------------------------------------------------------------------- /yeke/py-plane/resources/image/bg_game_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/resources/image/bg_game_over.png -------------------------------------------------------------------------------- /yeke/py-plane/resources/image/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/resources/image/pause.png -------------------------------------------------------------------------------- /yeke/py-plane/resources/image/plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/resources/image/plane.png -------------------------------------------------------------------------------- /yeke/py-plane/resources/image/shoot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/resources/image/shoot.png -------------------------------------------------------------------------------- /yeke/py-plane/resources/image/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-plane/resources/image/start.png -------------------------------------------------------------------------------- /yeke/py-qrcode/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/__init__.py -------------------------------------------------------------------------------- /yeke/py-qrcode/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/bg.jpg -------------------------------------------------------------------------------- /yeke/py-qrcode/gmqr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/gmqr.png -------------------------------------------------------------------------------- /yeke/py-qrcode/gmyqr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/gmyqr.gif -------------------------------------------------------------------------------- /yeke/py-qrcode/gzh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/gzh.jpg -------------------------------------------------------------------------------- /yeke/py-qrcode/my.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/my.gif -------------------------------------------------------------------------------- /yeke/py-qrcode/myqr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/myqr.gif -------------------------------------------------------------------------------- /yeke/py-qrcode/myqr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/myqr.png -------------------------------------------------------------------------------- /yeke/py-qrcode/myqr_demo.py: -------------------------------------------------------------------------------- 1 | from MyQR import myqr 2 | 3 | ''' 4 | words:内容 5 | version:容错率 6 | save_name:保存的名字 7 | ''' 8 | # myqr.run(words='https://www.baidu.com/', 9 | # version=1, 10 | # save_name='myqr.png') 11 | 12 | ''' 13 | picture:生成二维码用到的图片 14 | colorized:False 为黑白,True 为彩色 15 | ''' 16 | # myqr.run(words='https://www.baidu.com/', 17 | # version=1, 18 | # picture='bg.jpg', 19 | # colorized=True, 20 | # save_name='pmyqr.png') 21 | 22 | myqr.run(words='https://www.baidu.com/', 23 | version=1, 24 | picture='my.gif', 25 | colorized=True, 26 | save_name='myqr.gif') 27 | -------------------------------------------------------------------------------- /yeke/py-qrcode/parseqr_demo.py: -------------------------------------------------------------------------------- 1 | import zxing 2 | from MyQR import myqr 3 | 4 | reader = zxing.BarCodeReader() 5 | barcode = reader.decode('gzh.jpg') 6 | # print(str(barcode.parsed)) 7 | myqr.run(words=str(barcode.parsed), 8 | version=1, 9 | picture='my.gif', 10 | colorized=True, 11 | save_name='gmyqr.gif') -------------------------------------------------------------------------------- /yeke/py-qrcode/pmyqr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/pmyqr.png -------------------------------------------------------------------------------- /yeke/py-qrcode/qr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-qrcode/qr.jpg -------------------------------------------------------------------------------- /yeke/py-qrcode/qr_demo.py: -------------------------------------------------------------------------------- 1 | import qrcode 2 | 3 | # # 二维码内容 4 | # data = 'https://www.baidu.com/' 5 | # # 生成二维码 6 | # img = qrcode.make(data=data) 7 | # # 显示二维码 8 | # img.show() 9 | # # 保存二维码 10 | # # img.save('qr.jpg') 11 | 12 | ''' 13 | version:二维码的格子矩阵大小,可以是 1 到 40,1 最小为 21*21,40 是 177*177 14 | error_correction:二维码错误容许率,默认 ERROR_CORRECT_M,容许小于 15% 的错误率 15 | box_size:二维码每个小格子包含的像素数量 16 | border:二维码到图片边框的小格子数,默认值为 4 17 | ''' 18 | qr = qrcode.QRCode( 19 | version=2, 20 | error_correction=qrcode.constants.ERROR_CORRECT_L, 21 | box_size=15, 22 | border=3, 23 | ) 24 | # 二维码内容 25 | data = 'https://www.baidu.com/' 26 | qr.add_data(data=data) 27 | # 启用二维码颜色设置 28 | qr.make(fit=True) 29 | img = qr.make_image(fill_color='blue', back_color='white') 30 | # 显示二维码 31 | img.show() -------------------------------------------------------------------------------- /yeke/py-rain/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-rain/__init__.py -------------------------------------------------------------------------------- /yeke/py-rain/num_rain.py: -------------------------------------------------------------------------------- 1 | import random, pygame 2 | 3 | FONT_PX = 15 4 | pygame.init() 5 | winSur = pygame.display.set_mode((400, 500)) 6 | font = pygame.font.SysFont('arial', 16) 7 | bg_suface = pygame.Surface((400, 500), flags=pygame.SRCALPHA) 8 | pygame.Surface.convert(bg_suface) 9 | bg_suface.fill(pygame.Color(0, 0, 0, 13)) 10 | winSur.fill((0, 0, 0)) 11 | # 数字 12 | texts = [font.render(str(i), True, (0, 255, 0)) for i in range(10)] 13 | colums = int(400 / FONT_PX) 14 | drops = [0 for i in range(colums)] 15 | while True: 16 | for event in pygame.event.get(): 17 | if event.type == pygame.QUIT: 18 | exit() 19 | pygame.time.delay(33) 20 | winSur.blit(bg_suface, (0, 0)) 21 | for i in range(len(drops)): 22 | text = random.choice(texts) 23 | winSur.blit(text, (i * FONT_PX, drops[i] * FONT_PX)) 24 | drops[i] += 1 25 | if drops[i] * 10 > 400 or random.random() > 0.95: 26 | drops[i] = 0 27 | pygame.display.flip() 28 | -------------------------------------------------------------------------------- /yeke/py-rain/pic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-rain/pic.gif -------------------------------------------------------------------------------- /yeke/py-recogLP/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-recogLP/__init__.py -------------------------------------------------------------------------------- /yeke/py-recogLP/car.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-recogLP/car.jpeg -------------------------------------------------------------------------------- /yeke/py-recogLP/cars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-recogLP/cars.png -------------------------------------------------------------------------------- /yeke/py-recogLP/recogLP_demo1.py: -------------------------------------------------------------------------------- 1 | # 识别一个车牌 2 | from aip import AipOcr 3 | 4 | APP_ID = '自己的 App ID' 5 | API_KEY = '自己的 Api Key' 6 | SECRET_KEY = '自己的 Secret Key' 7 | # 创建客户端对象 8 | client = AipOcr(APP_ID, API_KEY, SECRET_KEY) 9 | # 建立连接的超时时间,单位为毫秒 10 | client.setConnectionTimeoutInMillis(5000) 11 | # 通过打开的连接传输数据的超时时间,单位为毫秒 12 | client.setSocketTimeoutInMillis(5000) 13 | 14 | # 读取图片 15 | def get_file_content(filePath): 16 | with open(filePath, 'rb') as fp: 17 | return fp.read() 18 | 19 | image = get_file_content('car.jpeg') 20 | res = client.licensePlate(image) 21 | print('车牌号码:' + res['words_result']['number']) 22 | print('车牌颜色:' + res['words_result']['color']) -------------------------------------------------------------------------------- /yeke/py-recogLP/recogLP_demo2.py: -------------------------------------------------------------------------------- 1 | # 识别多个车牌 2 | from aip import AipOcr 3 | 4 | APP_ID = '自己的 App ID' 5 | API_KEY = '自己的 Api Key' 6 | SECRET_KEY = '自己的 Secret Key' 7 | # 创建客户端对象 8 | client = AipOcr(APP_ID, API_KEY, SECRET_KEY) 9 | # 建立连接的超时时间,单位为毫秒 10 | client.setConnectionTimeoutInMillis(5000) 11 | # 通过打开的连接传输数据的超时时间,单位为毫秒 12 | client.setSocketTimeoutInMillis(5000) 13 | 14 | # 读取图片 15 | def get_file_content(filePath): 16 | with open(filePath, 'rb') as fp: 17 | return fp.read() 18 | 19 | image = get_file_content('cars.png') 20 | options = {} 21 | # 参数 multi_detect 默认为 false 22 | options['multi_detect'] = 'true' 23 | res = client.licensePlate(image, options) 24 | for wr in res['words_result']: 25 | print('车牌号码:' + wr['number']) 26 | print('车牌颜色:' + wr['color']) -------------------------------------------------------------------------------- /yeke/py-scratch/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/__init__.py -------------------------------------------------------------------------------- /yeke/py-scratch/prize/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/prize/1.jpg -------------------------------------------------------------------------------- /yeke/py-scratch/prize/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/prize/2.jpg -------------------------------------------------------------------------------- /yeke/py-scratch/prize/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/prize/3.jpg -------------------------------------------------------------------------------- /yeke/py-scratch/prize/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/prize/4.jpg -------------------------------------------------------------------------------- /yeke/py-scratch/prize/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/prize/5.jpg -------------------------------------------------------------------------------- /yeke/py-scratch/prize/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-scratch/prize/6.jpg -------------------------------------------------------------------------------- /yeke/py-scratch/scratch.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import random 4 | import pygame 5 | 6 | path = 'prize' 7 | ptype = ['jpg', 'png', 'bmp', 'JPG', 'PNG', 'BMP'] 8 | # 窗口大小 9 | screen_size = (600, 400) 10 | white = (255, 255, 255, 20) 11 | gray = (192, 192, 192) 12 | pygame.init() 13 | pygame.mouse.set_cursor(*pygame.cursors.diamond) 14 | screen = pygame.display.set_mode(screen_size) 15 | pygame.display.set_caption('刮一刮抽奖') 16 | surface = pygame.Surface(screen_size).convert_alpha() 17 | surface.fill(gray) 18 | filenames = os.listdir(path) 19 | filenames = [f for f in filenames if f.split('.')[-1] in ptype] 20 | imgpath = os.path.join(path, random.choice(filenames)) 21 | image_used = pygame.transform.scale(pygame.image.load(imgpath), screen_size) 22 | while True: 23 | for event in pygame.event.get(): 24 | if event.type == pygame.QUIT: 25 | pygame.quit() 26 | sys.exit(-1) 27 | mouse_event = pygame.mouse.get_pressed() 28 | if mouse_event[0]: 29 | pygame.draw.circle(surface, white, pygame.mouse.get_pos(), 40) 30 | elif mouse_event[-1]: 31 | surface.fill(gray) 32 | image_used = pygame.transform.scale(pygame.image.load(imgpath), screen_size) 33 | screen.blit(image_used, (0, 0)) 34 | screen.blit(surface, (0, 0)) 35 | pygame.display.update() 36 | 37 | 38 | -------------------------------------------------------------------------------- /yeke/py-snow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-snow/__init__.py -------------------------------------------------------------------------------- /yeke/py-snow/bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-snow/bg.jpeg -------------------------------------------------------------------------------- /yeke/py-snow/my.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-snow/my.mp3 -------------------------------------------------------------------------------- /yeke/py-sun/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-sun/__init__.py -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/bullet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/bullet.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/bullet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/bullet.cpython-37.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/food.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/food.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/food.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/food.cpython-37.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/home.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/home.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/home.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/home.cpython-37.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/scene.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/scene.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/scene.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/scene.cpython-37.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/tank.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/tank.cpython-36.pyc -------------------------------------------------------------------------------- /yeke/py-tank/__pycache__/tank.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/__pycache__/tank.cpython-37.pyc -------------------------------------------------------------------------------- /yeke/py-tank/audios/Gunfire.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/Gunfire.wav -------------------------------------------------------------------------------- /yeke/py-tank/audios/add.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/add.wav -------------------------------------------------------------------------------- /yeke/py-tank/audios/bang.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/bang.wav -------------------------------------------------------------------------------- /yeke/py-tank/audios/blast.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/blast.wav -------------------------------------------------------------------------------- /yeke/py-tank/audios/fire.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/fire.wav -------------------------------------------------------------------------------- /yeke/py-tank/audios/hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/hit.wav -------------------------------------------------------------------------------- /yeke/py-tank/audios/start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/audios/start.wav -------------------------------------------------------------------------------- /yeke/py-tank/font/simkai.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/font/simkai.ttf -------------------------------------------------------------------------------- /yeke/py-tank/food.py: -------------------------------------------------------------------------------- 1 | # 食物类 2 | import pygame 3 | import random 4 | 5 | # 食物类, 用于提升坦克能力 6 | class Food(pygame.sprite.Sprite): 7 | def __init__(self): 8 | pygame.sprite.Sprite.__init__(self) 9 | # 消灭当前所有敌人 10 | self.food_boom = 'images/food/food_boom.png' 11 | # 当前所有敌人静止一段时间 12 | self.food_clock = 'images/food/food_clock.png' 13 | # 使得坦克子弹可碎钢板 14 | self.food_gun = 'images/food/food_gun.png' 15 | # 使得大本营的墙变为钢板 16 | self.food_iron = 'images/food/food_gun.png' 17 | # 坦克获得一段时间的保护罩 18 | self.food_protect = 'images/food/food_protect.png' 19 | # 坦克升级 20 | self.food_star = 'images/food/food_star.png' 21 | # 坦克生命+1 22 | self.food_tank = 'images/food/food_tank.png' 23 | # 所有食物 24 | self.foods = [self.food_boom, self.food_clock, self.food_gun, self.food_iron, self.food_protect, self.food_star, self.food_tank] 25 | self.kind = None 26 | self.food = None 27 | self.rect = None 28 | # 是否存在 29 | self.being = False 30 | # 存在时间 31 | self.time = 1000 32 | # 生成食物 33 | def generate(self): 34 | self.kind = random.randint(0, 6) 35 | self.food = pygame.image.load(self.foods[self.kind]).convert_alpha() 36 | self.rect = self.food.get_rect() 37 | self.rect.left, self.rect.top = random.randint(100, 500), random.randint(100, 500) 38 | self.being = True -------------------------------------------------------------------------------- /yeke/py-tank/home.py: -------------------------------------------------------------------------------- 1 | # 大本营类 2 | import pygame 3 | 4 | # 大本营类 5 | class Home(pygame.sprite.Sprite): 6 | def __init__(self): 7 | pygame.sprite.Sprite.__init__(self) 8 | self.homes = ['images/home/home1.png', 'images/home/home2.png', 'images/home/home_destroyed.png'] 9 | self.home = pygame.image.load(self.homes[0]) 10 | self.rect = self.home.get_rect() 11 | self.rect.left, self.rect.top = (3 + 12 * 24, 3 + 24 * 24) 12 | self.alive = True 13 | # 大本营置为摧毁状态 14 | def set_dead(self): 15 | self.home = pygame.image.load(self.homes[-1]) 16 | self.alive = False -------------------------------------------------------------------------------- /yeke/py-tank/images/bullet/bullet_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/bullet/bullet_down.png -------------------------------------------------------------------------------- /yeke/py-tank/images/bullet/bullet_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/bullet/bullet_left.png -------------------------------------------------------------------------------- /yeke/py-tank/images/bullet/bullet_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/bullet/bullet_right.png -------------------------------------------------------------------------------- /yeke/py-tank/images/bullet/bullet_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/bullet/bullet_up.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_1_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_1_0.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_1_1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_1_2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_1_3.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_2_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_2_0.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_2_1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_2_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_2_2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_2_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_2_3.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_3_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_3_0.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_3_1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_3_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_3_2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_3_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_3_3.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_4_0.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_4_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_4_1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_4_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_4_2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/enemyTank/enemy_4_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/enemyTank/enemy_4_3.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_boom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_boom.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_clock.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_gun.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_iron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_iron.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_protect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_protect.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_star.png -------------------------------------------------------------------------------- /yeke/py-tank/images/food/food_tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/food/food_tank.png -------------------------------------------------------------------------------- /yeke/py-tank/images/home/home1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/home/home1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/home/home2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/home/home2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/home/home_destroyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/home/home_destroyed.png -------------------------------------------------------------------------------- /yeke/py-tank/images/myTank/tank_T1_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/myTank/tank_T1_0.png -------------------------------------------------------------------------------- /yeke/py-tank/images/myTank/tank_T1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/myTank/tank_T1_1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/myTank/tank_T1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/myTank/tank_T1_2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/myTank/tank_T2_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/myTank/tank_T2_0.png -------------------------------------------------------------------------------- /yeke/py-tank/images/myTank/tank_T2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/myTank/tank_T2_1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/myTank/tank_T2_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/myTank/tank_T2_2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/appear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/appear.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/background.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/boom_dynamic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/boom_dynamic.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/boom_static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/boom_static.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/gameover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/gameover.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/logo.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/mask.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/protect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/protect.png -------------------------------------------------------------------------------- /yeke/py-tank/images/others/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/others/tip.png -------------------------------------------------------------------------------- /yeke/py-tank/images/scene/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/scene/brick.png -------------------------------------------------------------------------------- /yeke/py-tank/images/scene/ice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/scene/ice.png -------------------------------------------------------------------------------- /yeke/py-tank/images/scene/iron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/scene/iron.png -------------------------------------------------------------------------------- /yeke/py-tank/images/scene/river1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/scene/river1.png -------------------------------------------------------------------------------- /yeke/py-tank/images/scene/river2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/scene/river2.png -------------------------------------------------------------------------------- /yeke/py-tank/images/scene/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tank/images/scene/tree.png -------------------------------------------------------------------------------- /yeke/py-teacher/HZK16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/HZK16 -------------------------------------------------------------------------------- /yeke/py-teacher/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/__init__.py -------------------------------------------------------------------------------- /yeke/py-teacher/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/card.png -------------------------------------------------------------------------------- /yeke/py-teacher/hyr3gjm.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/hyr3gjm.ttf -------------------------------------------------------------------------------- /yeke/py-teacher/img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/1.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/10.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/11.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/12.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/13.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/13.jpeg -------------------------------------------------------------------------------- /yeke/py-teacher/img/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/14.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/15.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/16.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/17.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/18.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/19.png -------------------------------------------------------------------------------- /yeke/py-teacher/img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/2.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/20.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/3.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/4.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/5.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/6.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/7.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/8.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/img/9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/img/9.jpeg -------------------------------------------------------------------------------- /yeke/py-teacher/output/result1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/output/result1.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/output/result2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/output/result2.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/output/result3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/output/result3.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/output/result4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/output/result4.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/output/result5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/output/result5.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/py_card.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | from PIL import Image 4 | from wordcloud import WordCloud 5 | 6 | img = cv2.imread('test.png') 7 | mask = np.zeros(img.shape[:2], np.uint8) 8 | size = (1, 65) 9 | bgd = np.zeros(size, np.float64) 10 | fgd = np.zeros(size, np.float64) 11 | rect = (1, 1, img.shape[1], img.shape[0]) 12 | cv2.grabCut(img, mask, rect, bgd, fgd, 10, cv2.GC_INIT_WITH_RECT) 13 | mask2 = np.where((mask == 2) | (mask == 0), 1, 255) 14 | img = img.astype(np.int32) 15 | img *= mask2[:, :, np.newaxis] 16 | img[img>255] = 255 17 | img =img.astype(np.uint8) 18 | img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) 19 | img = Image.fromarray(img, 'RGB') 20 | img.save('test1.jpg') 21 | fp = open(r"word.txt", "r", encoding="utf-8") 22 | text = fp.read() 23 | mask_pic=np.array(Image.open(r"test1.jpg")) 24 | wordcloud = WordCloud(font_path='hyr3gjm.ttf',mask=mask_pic,max_words=200).generate(text) 25 | image=wordcloud.to_image() 26 | image.save("wordcloud2.png") 27 | cloud_data = np.array(image) 28 | alpha = np.copy(cloud_data[:,:,0]) 29 | alpha[alpha>0] = 255 30 | new_image = Image.fromarray(np.dstack((cloud_data, alpha))) 31 | card = Image.open("test.png") 32 | card = card.convert("RGBA") 33 | card.paste(new_image, (0,0), mask=new_image) 34 | card.save("card.png") -------------------------------------------------------------------------------- /yeke/py-teacher/py_sun.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | turtle.setup(600, 600, 80, 80) 4 | turtle.pencolor("yellow") 5 | turtle.pensize(4) 6 | turtle.penup() 7 | turtle.fd(-150) 8 | turtle.pendown() 9 | for i in range(18): 10 | turtle.fd(300) 11 | turtle.left(100) 12 | turtle.fd(150) 13 | turtle.right(90) 14 | turtle.pensize(8) 15 | turtle.pencolor("green") 16 | turtle.fd(400) 17 | turtle.penup() 18 | turtle.pensize(6) 19 | turtle.pendown() 20 | # 绘制叶子 21 | turtle.fd(-250) 22 | turtle.seth(45) 23 | turtle.circle(-130, 60) 24 | turtle.seth(-135) 25 | turtle.circle(-130, 60) 26 | turtle.seth(135) 27 | turtle.circle(130, 60) 28 | turtle.seth(-45) 29 | turtle.circle(130, 60) 30 | turtle.done() -------------------------------------------------------------------------------- /yeke/py-teacher/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/test.png -------------------------------------------------------------------------------- /yeke/py-teacher/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/test1.jpg -------------------------------------------------------------------------------- /yeke/py-teacher/word.txt: -------------------------------------------------------------------------------- 1 | 春蚕到死丝方尽 蜡炬成灰泪始干 2 | 一日为师 终身为父 3 | 令公桃李满天下 何用堂前更种花 4 | 师者 所以传道授业解惑也 5 | 落红不是无情物 化作春泥更护花 6 | 鹤发银丝映日月 丹心热血沃新花 7 | 古之学者必有师 8 | 桃李不言 下自成蹊 9 | 教师是人类灵魂的工程师 10 | 太阳底下最光辉的职业 人类灵魂的工程师 11 | 一位好老师 胜过万卷书 12 | 古之圣王 未有不尊师者也 13 | 教师不仅是知识的传播者 而且是模范 14 | 为别人照亮道路 自己必须放出光芒 15 | 有一种爱叫无私奉献 有一种态度叫平易近人 有一种付出叫无怨无悔 给予我这些的就是你 我敬爱的老师 教师节来临之际我真心的祝愿你快乐幸福 16 | 您 是载送卫星的火箭 您 是海上的罗盘针 您 是投入 您 是付出 您就是我们孩子最敬爱的老师 您教给我们孩子 学而不思则惘 思而不学则殆 17 | 当我已经能自由翱翔 老师 您可知道 您是我双翼下振翅的风 当我踏进校门的那一天 你给了我无尽的关怀 当我踏出校门的那一天 你已经付出了你的全部 老师你幸苦了 18 | 教学是一种艰苦细致的脑力劳动 老师为此付出了大量的时间和精力 老师要精心设计每一个教学方案 认真上好每一节课 仔细批改每一份作业 老师的工作是辛苦而繁重的 19 | 小小的粉笔就是你的双手 描绘出了你心中的蓝图 上课的铃声就是你征程上的冲锋号角 一路走来把汗水抛在身后 你会为学生优异的成绩感到高兴,你也会为差等的学生耐心的讲解 这全都是你的孩子 你舍不得把哪一个拉下 为了孩子你废寝忘食 为了孩子你鞠躬尽瘁 为了孩子你把心都给了他们 就是这样 你把自己燃烧起来 就是这样你把光明留给大家 你无怨无悔 你甘心付出! 20 | 老师就像是园丁 无微不至地照顾着我们这些温室里的花草 老师就像蔚蓝的天空 我们就像是在蓝天下自由飞翔的小鸟 老师就像是默默无闻的春蚕 无怨无悔的为我们付出 老师我爱您 -------------------------------------------------------------------------------- /yeke/py-teacher/wordcloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-teacher/wordcloud2.png -------------------------------------------------------------------------------- /yeke/py-tetris/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-tetris/__init__.py -------------------------------------------------------------------------------- /yeke/py-xxl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/__init__.py -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem1.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem2.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem3.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem4.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem5.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem6.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/gem7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/gem7.png -------------------------------------------------------------------------------- /yeke/py-xxl/resources/images/simsun.ttc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/images/simsun.ttc -------------------------------------------------------------------------------- /yeke/py-xxl/resources/simsun.ttc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustDoPython/python-examples/d4159751a86b1e9ce7867d0a7f1c12e8b8e0f213/yeke/py-xxl/resources/simsun.ttc -------------------------------------------------------------------------------- /zhouluobo/README.md: -------------------------------------------------------------------------------- 1 | # Python 代码实例 2 | 3 | Python技术 公众号文章代码库 4 | 5 | 6 | 关注公众号:python技术,回复"python"一起学习交流 7 | 8 | ![](http://favorites.ren/assets/images/python.jpg) 9 | 10 | 11 | ## 实例代码 12 | 13 | [用Python分析红楼梦里的那些关系](https://github.com/JustDoPython/python-examples/tree/master/zhouluobo/honglou):用Python分析红楼梦里的那些关系 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | --------------------------------------------------------------------------------