├── Python ├── Atm │ ├── README │ ├── atm │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ │ ├── bin │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── atm_action.cpython-36.pyc │ │ │ └── atm_action.py │ │ ├── config │ │ │ └── __init__.py │ │ ├── core │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── auth.cpython-36.pyc │ │ │ │ ├── main.cpython-36.pyc │ │ │ │ ├── manage.cpython-36.pyc │ │ │ │ └── transaction.cpython-36.pyc │ │ │ ├── auth.py │ │ │ ├── main.py │ │ │ ├── manage.py │ │ │ └── transaction.py │ │ └── db │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── account_sample.cpython-36.pyc │ │ │ ├── account_sample.py │ │ │ └── accounts │ │ │ └── zpp.json │ └── shopping_mall │ │ ├── __init__.py │ │ ├── shopping.py │ │ └── sum.json ├── Bootstrap │ ├── Helloworld.html │ ├── bootstrap-4.1.1-dist │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ └── jquery-3.3.1.min.js ├── Day1 │ ├── login.py │ ├── menu.py │ └── name.txt ├── Day12 │ ├── orm_fk.py │ └── orm_sqlalchemy.py ├── Day17 │ ├── jQuery.html │ ├── jquery-1.12.4.js │ ├── logo.jpg │ └── style.css ├── Day2 │ ├── String.py │ ├── dict.py │ ├── shopping.py │ └── sys_python.py ├── Day3 │ ├── files.py │ ├── gather.py │ ├── set.py │ └── yesterday ├── Day4 │ ├── decorator.py │ ├── generator.py │ └── 携程.py ├── Day5 │ └── calculator.py ├── Django │ ├── Readme.txt │ └── firstDjango │ │ ├── .idea │ │ ├── firstDjango.iml │ │ ├── inspectionProfiles │ │ │ └── profiles_settings.xml │ │ ├── modules.xml │ │ └── workspace.xml │ │ ├── cmdb │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── admin.cpython-36.pyc │ │ │ ├── models.cpython-36.pyc │ │ │ └── views.cpython-36.pyc │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ ├── __init__.py │ │ │ └── __pycache__ │ │ │ │ └── __init__.cpython-36.pyc │ │ ├── models.py │ │ ├── tests.py │ │ └── views.py │ │ ├── firstDjango │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── settings.cpython-36.pyc │ │ │ ├── urls.cpython-36.pyc │ │ │ └── wsgi.cpython-36.pyc │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── openstack │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ └── views.py │ │ ├── static │ │ └── jquery.min.js │ │ └── templates │ │ ├── home.html │ │ └── login.html ├── Student_management_system │ ├── Client │ │ ├── __init__.py │ │ ├── bin │ │ │ ├── __init__.py │ │ │ └── sd_mg_system.py │ │ ├── conf │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── config.cpython-36.pyc │ │ │ └── config.py │ │ └── core │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── lecturer.cpython-36.pyc │ │ │ ├── login.cpython-36.pyc │ │ │ ├── student.cpython-36.pyc │ │ │ └── views.cpython-36.pyc │ │ │ ├── lecturer.py │ │ │ ├── lecturer_base.py │ │ │ ├── login.py │ │ │ ├── student.py │ │ │ └── views.py │ ├── Server │ │ ├── __init__.py │ │ ├── bin │ │ │ ├── __init__.py │ │ │ └── student_server.py │ │ ├── conf │ │ │ └── __init__.py │ │ ├── core │ │ │ ├── __init__.py │ │ │ └── views.py │ │ ├── data │ │ │ └── __init__.py │ │ └── log │ │ │ └── __init__.py │ └── __init__.py ├── abc ├── adb_apk.py ├── adb_pm.py ├── adb_pm_base.py ├── adb_pm_package.py ├── apk_info ├── ftp_client │ ├── ftp_client.py │ ├── outlook 2007 wind-mobi邮箱设置方法.pdf │ └── wiki模板.txt ├── ftp_server │ ├── bin │ │ └── __init__.py │ ├── conf │ │ ├── __init__.py │ │ └── zpp │ ├── core │ │ ├── __init__.py │ │ └── main.py │ └── log │ │ └── __init__.py ├── keybox │ ├── base │ │ ├── aaa │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400000.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400001.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400002.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400003.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400004.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400005.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400006.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400007.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400008.attestation.secure │ │ │ ├── Lenovo_TB-X705-TAB510PLUS-00400009.attestation.secure │ │ │ └── Lenovo_TB-X705-TAB510PLUS-00400010.attestation.secure │ │ └── rename_keymaster │ │ │ ├── LenovoTAB510Plus100000000.xml │ │ │ ├── LenovoTAB510Plus100000001.xml │ │ │ ├── LenovoTAB510Plus100000002.xml │ │ │ ├── LenovoTAB510Plus100000003.xml │ │ │ ├── LenovoTAB510Plus100000004.xml │ │ │ ├── LenovoTAB510Plus100000005.xml │ │ │ ├── LenovoTAB510Plus100000006.xml │ │ │ ├── LenovoTAB510Plus100000007.xml │ │ │ ├── LenovoTAB510Plus100000008.xml │ │ │ ├── LenovoTAB510Plus100000009.xml │ │ │ └── LenovoTAB510Plus100000010.xml │ ├── keybox.zip │ ├── keybox │ │ ├── X705F │ │ │ ├── keymaster │ │ │ │ ├── Lenovo TB-X705F-X705F-00812000.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812001.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812002.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812003.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812004.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812005.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812006.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812007.attestation.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-00812008.attestation.secure │ │ │ │ └── Lenovo TB-X705F-X705F-00812009.attestation.secure │ │ │ └── widevine │ │ │ │ ├── Lenovo TB-X705F-X705F-04320000.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320001.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320002.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320003.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320004.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320005.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320006.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320007.bin.secure │ │ │ │ ├── Lenovo TB-X705F-X705F-04320008.bin.secure │ │ │ │ └── Lenovo TB-X705F-X705F-04320009.bin.secure │ │ ├── X705F_update │ │ │ └── widevine │ │ │ │ ├── X705F100000000 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000001 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000002 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000003 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000004 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000005 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000006 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000007 │ │ │ │ └── keybox.bin │ │ │ │ ├── X705F100000008 │ │ │ │ └── keybox.bin │ │ │ │ └── X705F100000009 │ │ │ │ └── keybox.bin │ │ ├── X705L │ │ │ ├── keymaster │ │ │ │ ├── Lenovo TB-X705L-X705L-01112000.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112001.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112002.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112003.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112004.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112005.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112006.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112007.attestation.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-01112008.attestation.secure │ │ │ │ └── Lenovo TB-X705L-X705L-01112009.attestation.secure │ │ │ └── widevine │ │ │ │ ├── Lenovo TB-X705L-X705L-04620000.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620001.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620002.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620003.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620004.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620005.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620006.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620007.bin.secure │ │ │ │ ├── Lenovo TB-X705L-X705L-04620008.bin.secure │ │ │ │ └── Lenovo TB-X705L-X705L-04620009.bin.secure │ │ ├── X705M │ │ │ ├── keymaster │ │ │ │ ├── Lenovo TB-X705M-X705M-01412000.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412001.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412002.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412003.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412004.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412005.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412006.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412007.attestation.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-01412008.attestation.secure │ │ │ │ └── Lenovo TB-X705M-X705M-01412009.attestation.secure │ │ │ └── widevine │ │ │ │ ├── Lenovo TB-X705M-X705M-04920000.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920001.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920002.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920003.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920004.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920005.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920006.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920007.bin.secure │ │ │ │ ├── Lenovo TB-X705M-X705M-04920008.bin.secure │ │ │ │ └── Lenovo TB-X705M-X705M-04920009.bin.secure │ │ ├── keybox.py │ │ ├── keybox_script.zip │ │ ├── keybox_thread.py │ │ ├── keybox_thread_old.py │ │ ├── script │ │ │ ├── keybox_thread.py │ │ │ └── turn_thread.pl │ │ ├── turn.pl │ │ ├── turn_thread.pl │ │ └── 脚本执行SOP.docx │ ├── keybox转换格式脚本_20180616.zip │ ├── keymaster │ │ └── PTO19990199012 │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400000.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400001.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400002.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400003.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400004.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400005.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400006.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400007.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400008.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400009.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400010.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400011.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400012.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400013.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400014.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400015.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400016.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400017.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400018.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400019.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400020.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400021.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400022.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400023.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400024.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400025.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400026.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400027.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400028.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400029.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400030.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400031.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400032.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400033.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400034.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400035.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400036.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400037.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400038.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400039.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400040.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400041.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400042.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400043.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400044.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400045.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400046.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400047.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400048.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400049.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400050.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400051.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400052.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400053.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400054.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400055.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400056.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400057.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400058.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400059.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400060.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400061.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400062.attestation.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-00400063.attestation.secure │ │ │ └── Lenovo TB-X705-TAB510PLUS-00400064.attestation.secure │ ├── rename_keymaster.sh │ ├── turn.pl │ ├── turn.zip │ ├── widevine │ │ ├── Lenovo TB-X705-TAB510PLUS-04020003.bin.secure │ │ └── PTO19990199012 │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020000.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020001.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020002.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020003.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020004.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020005.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020006.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020007.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020008.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020009.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020010.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020011.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020012.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020013.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020014.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020015.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020016.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020017.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020018.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020019.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020020.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020021.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020022.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020023.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020024.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020025.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020026.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020027.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020028.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020029.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020030.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020031.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020032.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020033.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020034.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020035.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020036.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020037.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020038.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020039.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020040.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020041.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020042.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020043.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020044.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020045.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020046.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020047.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020048.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020049.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020050.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020051.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020052.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020053.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020054.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020055.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020056.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020057.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020058.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020059.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020060.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020061.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020062.bin.secure │ │ │ ├── Lenovo TB-X705-TAB510PLUS-04020063.bin.secure │ │ │ └── Lenovo TB-X705-TAB510PLUS-04020064.bin.secure │ └── widevine导入和验证SOP.docx ├── new.py ├── package ├── package_B23 ├── python编程快速上手 │ ├── 第七章正则表达式 │ │ ├── pwdverify.py │ │ └── strip.py │ ├── 第三章函数 │ │ ├── collatz.py │ │ └── guess_number.py │ ├── 第五章字典 │ │ ├── addtoinventory.py │ │ ├── characterCount.py │ │ └── displayInventory.py │ ├── 第八章读写文件 │ │ ├── capitalsquiz1.txt │ │ ├── capitalsquiz2.txt │ │ ├── capitalsquiz_answers1.txt │ │ ├── capitalsquiz_answers2.txt │ │ ├── mcb.py │ │ └── randomQuizGenerator.py │ ├── 第六章字符串 │ │ ├── picnicTable.py │ │ └── printtable.py │ └── 第四章列表 │ │ ├── 字符图网格.py │ │ └── 逗号代码.py ├── python高级编程 │ └── 第一章正则表达式 │ │ └── re.py └── spider │ └── apk_automate.py ├── README.md └── code ├── P100_download_logs.py ├── Z216usermeizubanbenxiazai.py ├── android(4).log ├── bmi.py ├── grade.py ├── hello.py ├── kw_args.py ├── test.py ├── trim.py └── var_args.py /Python/Atm/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/README -------------------------------------------------------------------------------- /Python/Atm/atm/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Atm/atm/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/bin/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Atm/atm/bin/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/bin/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/bin/__pycache__/atm_action.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/bin/__pycache__/atm_action.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/bin/atm_action.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import os 6 | import sys 7 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 8 | print(BASE_DIR) 9 | sys.path.append(BASE_DIR) 10 | 11 | from core import main 12 | 13 | main.main() -------------------------------------------------------------------------------- /Python/Atm/atm/config/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Atm/atm/core/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Atm/atm/core/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/core/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/core/__pycache__/auth.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/core/__pycache__/auth.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/core/__pycache__/main.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/core/__pycache__/main.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/core/__pycache__/manage.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/core/__pycache__/manage.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/core/__pycache__/transaction.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/core/__pycache__/transaction.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/core/auth.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import json 6 | import os 7 | from db import account_sample 8 | import os 9 | 10 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 11 | dir = BASE_DIR + "\\db\\accounts" 12 | os.chdir(dir) 13 | 14 | def auth_decoration(func): 15 | def decoration(*args,**kwargs): 16 | account_name = args[0] + ".json" 17 | if os.path.exists(account_name): 18 | func(*args,**kwargs) 19 | else: 20 | new = input("Your account was not found, do you need new?(n or y):") 21 | if new == "y": 22 | account_sample.init(*args,**kwargs) 23 | print("Congratulations on your successful login authentication!!") 24 | f = open(account_name,"r") 25 | data = json.load(f) 26 | f.close() 27 | return data 28 | elif new == "n": 29 | print("Welcome to atm home page!!") 30 | return decoration 31 | 32 | @auth_decoration 33 | def auth(name,password): 34 | account_name = name + ".json" 35 | f = open(account_name,"r") 36 | data = json.load(f) 37 | count = 0 38 | if data["unlock"]: 39 | while count < 3: 40 | if password == data["password"]: 41 | print("Congratulations on your successful login authentication!!") 42 | return data 43 | else: 44 | count += 1 45 | if count < 3: 46 | print("The password was entered incorrectly %s times, Your have %s times." %(count,(3 - count))) 47 | password = input("Please input your password:") 48 | else: 49 | data["unlock"] = 0 50 | f = open(account_name, "w") 51 | json.dump(data,f) 52 | print("The password was entered incorrectly three times, Your account is locked.") 53 | return False 54 | else: 55 | print("Your account is locked.") 56 | return False 57 | f.close() 58 | 59 | -------------------------------------------------------------------------------- /Python/Atm/atm/core/main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | from core import auth 6 | from core import transaction 7 | from core import manage 8 | 9 | def main(): 10 | print("Welcome to atm home page!!") 11 | operation = input("Please input your operation(m > 管理 , l > 登陆):") 12 | if operation == "m": 13 | manage.atm_manage() 14 | elif operation == "l": 15 | name = input("Please input your name:") 16 | password = input("Please input your password:") 17 | login_data = auth.auth(name,password) 18 | if login_data: 19 | transaction.transaction(login_data) 20 | -------------------------------------------------------------------------------- /Python/Atm/atm/core/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | manage = ["添加账户","冻结账号"] 6 | 7 | def atm_manage(): 8 | pass -------------------------------------------------------------------------------- /Python/Atm/atm/core/transaction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | function = ["账号额度","消费流水","转账","提现","还款"] 6 | 7 | def transaction(data): 8 | 9 | pass -------------------------------------------------------------------------------- /Python/Atm/atm/db/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Atm/atm/db/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/db/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/db/__pycache__/account_sample.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Atm/atm/db/__pycache__/account_sample.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Atm/atm/db/account_sample.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import json 6 | from db import * 7 | import os 8 | 9 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 10 | account_key = ["name", "password", "unlock", "lump_sum", "balance"] 11 | account_value = ["abc","abc",1,15000,15000] 12 | 13 | def init(name,password): 14 | #print(os.getcwd()) 15 | dir = BASE_DIR + "\\db\\accounts" 16 | os.chdir(dir) 17 | #print(os.getcwd()) 18 | account_name = name + ".json" 19 | f = open(account_name,"w") 20 | account = dict(zip(account_key,account_value)) 21 | account["name"] = name 22 | account["password"] = password 23 | lump_sum = input("Please input your lump sum.:") 24 | if lump_sum: 25 | account["lump_sum"] = lump_sum 26 | account["balance"] = lump_sum 27 | json.dump(account,f) 28 | f.close() 29 | -------------------------------------------------------------------------------- /Python/Atm/atm/db/accounts/zpp.json: -------------------------------------------------------------------------------- 1 | {"name": "zpp", "password": "123", "unlock": 1, "lump_sum": "20000", "balance": "20000"} -------------------------------------------------------------------------------- /Python/Atm/shopping_mall/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Atm/shopping_mall/shopping.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import os 6 | import sys 7 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 8 | sys.path.append(BASE_DIR) 9 | 10 | import json 11 | from atm import * 12 | 13 | prod_list = {"iphone":5800, "asus":1588, "huawei":2888, "xiaomi":1988, "oppo":2188, "vivo":2588, "meizu":2288} 14 | cart = [] 15 | 16 | def login(): 17 | print("Welcome login shopping mall!!") 18 | 19 | def show_prods(): 20 | for i in prod_list: 21 | print("%s %s" %(i,prod_list[i])) 22 | 23 | def add_cart(prod): 24 | cart.append(prod) 25 | 26 | def show_cart(): 27 | sum = 0 28 | if cart: 29 | for i in cart: 30 | print("%s %s" % (i, prod_list[i])) 31 | sum = sum + prod_list[i] 32 | print("You products sum is:",sum) 33 | action = input("What are you doing?( 'q' > quit, 'd' > delete)>>>") 34 | if action is "d": 35 | while True: 36 | del_prod = input("Please enter the item to be deleted.( 'q' > quit,or delete product)>>>") 37 | if del_prod is "q": 38 | break 39 | else: 40 | cart.remove(del_prod) 41 | for i in cart: 42 | print("%s %s" % (i, prod_list[i])) 43 | sum = sum - prod_list[del_prod] 44 | print("You products sum is:", sum) 45 | elif action is "q": 46 | pass 47 | else: 48 | print("Your shopping cart is empty!!") 49 | 50 | def buy(): 51 | sum = 0 52 | for i in cart: 53 | sum = sum + prod_list[i] 54 | with open("sum.json","w") as f: 55 | json.dump(sum,f) 56 | 57 | 58 | def shopping(): 59 | login() 60 | show_prods() 61 | while True: 62 | action = input("What are you doing?( 'i'> Inquire,'b' > Buy ,'q' > quit,or add products)>>>") 63 | if action is "i": 64 | show_cart() 65 | elif action is "b": 66 | buy() 67 | elif action is "q": 68 | break 69 | else: 70 | add_cart(action) 71 | 72 | shopping() 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Python/Atm/shopping_mall/sum.json: -------------------------------------------------------------------------------- 1 | 8388 -------------------------------------------------------------------------------- /Python/Bootstrap/Helloworld.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Title 7 | 8 | 9 | 10 |

Hello,world!!!

11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Python/Bootstrap/bootstrap-4.1.1-dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /Python/Day1/login.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import getpass 6 | import os 7 | 8 | account = {'zhangsan': 'ad123', 'lishi': '123456', 'wangwu': 'sd12345'} 9 | 10 | name = input("please input name:") 11 | password = input("please input password:") 12 | res = account.get(name,-1) 13 | time = 0 14 | 15 | if name in account: 16 | if os.path.exists('name.txt'): 17 | file = open('name.txt','r') 18 | time = int(file.read()) 19 | else: 20 | file = open('name.txt', 'w') 21 | file.write(str(1)) 22 | if time <= 3: 23 | if password == account[name]: 24 | print("Welcome to login account!!") 25 | else: 26 | print("Your password is error!!") 27 | time += 1; 28 | file = open('name.txt', 'w') 29 | file.write(str(time)) 30 | else: 31 | print("Your password error time is three times,your account is locked!!") 32 | else: 33 | print("Your name isn't exist!!") 34 | 35 | -------------------------------------------------------------------------------- /Python/Day1/menu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | face = {'pro':1, 'oop':2} 6 | pro = ['c', 'vb'] 7 | oop = ['java', 'c++', 'python'] 8 | 9 | print("Programming") 10 | one_menu = input('please select one menu:') 11 | if one_menu: 12 | for key in face.keys(): 13 | print(key, end=" ", flush=True) 14 | print('\n') 15 | two_menu = input('please select two menu:') 16 | if two_menu == 'd': 17 | print("Programming") 18 | elif two_menu == '1': 19 | for menu in pro: 20 | print(menu, end=" ", flush=True) 21 | print('\n') 22 | thr_menu = input('please select three menu:') 23 | if thr_menu == 'd': 24 | print("Programming") 25 | elif two_menu == '2': 26 | for menu in oop: 27 | print(menu, end=" ", flush=True) 28 | print('\n') 29 | thr_menu = input('please select three menu:') 30 | -------------------------------------------------------------------------------- /Python/Day1/name.txt: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /Python/Day12/orm_fk.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import sqlalchemy 6 | from sqlalchemy import create_engine 7 | from sqlalchemy.ext.declarative import declarative_base 8 | from sqlalchemy import Column, Integer, String, DATE, Enum, ForeignKey 9 | from sqlalchemy.orm import sessionmaker, relationship 10 | from sqlalchemy import func 11 | 12 | engine = create_engine("mysql+pymysql://root:123456@localhost/zpp",encoding="utf-8") 13 | 14 | Base = declarative_base() 15 | class Student(Base): 16 | __tablename__ = "student" 17 | id = Column(Integer,autoincrement=True,primary_key=True) 18 | name = Column(String(32),nullable=False) 19 | register_date = Column(DATE,nullable=False) 20 | 21 | def __repr__(self): 22 | return "" %(self.id, self.name) 23 | 24 | class StudyRecord(Base): 25 | __tablename__ = "studyrecord" 26 | id = Column(Integer,autoincrement=True,primary_key=True) 27 | day = Column(Integer,nullable=False) 28 | status = Column(String(32),nullable=False) 29 | stu_id = Column(Integer,ForeignKey("student.id")) 30 | student = relationship("Student",backref="my_study_record") 31 | 32 | def __repr__(self): 33 | return "" %(self.student.name, self.day, self.status) 34 | 35 | Base.metadata.create_all(engine) 36 | 37 | Session_class = sessionmaker(bind=engine) 38 | session = Session_class() 39 | 40 | # s1 = Student(name="lishunbo",register_date="2017-04-15") 41 | # s2 = Student(name="sunhuihui",register_date="2017-08-19") 42 | # s3 = Student(name="sunxiaolong",register_date="2018-01-15") 43 | # s4 = Student(name="xuyi",register_date="2018-04-05") 44 | # 45 | # study1 = StudyRecord(day=1,status="YES",stu_id=1) 46 | # study2 = StudyRecord(day=2,status="NO",stu_id=1) 47 | # study3 = StudyRecord(day=3,status="YES",stu_id=1) 48 | # study4 = StudyRecord(day=1,status="YES",stu_id=2) 49 | # study5 = StudyRecord(day=2,status="NO",stu_id=2) 50 | # study6 = StudyRecord(day=3,status="NO",stu_id=2) 51 | # study7 = StudyRecord(day=1,status="YES",stu_id=3) 52 | # study8 = StudyRecord(day=2,status="YES",stu_id=3) 53 | # study9 = StudyRecord(day=3,status="YES",stu_id=3) 54 | # study10 = StudyRecord(day=1,status="YES",stu_id=4) 55 | # study11 = StudyRecord(day=2,status="NO",stu_id=4) 56 | # study12 = StudyRecord(day=3,status="NO",stu_id=4) 57 | 58 | # session.add_all([s1,s2,s3,s4,study1,study2,study3,study4,study5,study6,study7,study8,study9,study10,study11,study12]) 59 | 60 | stu = session.query(Student).filter(Student.name == "sunhuihui").first() 61 | print(stu.my_study_record) 62 | session.commit() 63 | 64 | 65 | -------------------------------------------------------------------------------- /Python/Day12/orm_sqlalchemy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import sqlalchemy 6 | from sqlalchemy import create_engine 7 | from sqlalchemy.ext.declarative import declarative_base 8 | from sqlalchemy import Column, Integer, String, DATE, Enum 9 | from sqlalchemy.orm import sessionmaker 10 | from sqlalchemy import func 11 | 12 | engine = create_engine("mysql+pymysql://root:123456@localhost/zppdb",encoding="utf-8") 13 | 14 | Base = declarative_base() 15 | class User(Base): 16 | __tablename__ = "user" 17 | id = Column(Integer,autoincrement=True,primary_key=True) 18 | name = Column(String(32)) 19 | password = Column(String(64)) 20 | 21 | def __repr__(self): 22 | return "" %(self.id,self.name) 23 | 24 | class Student(Base): 25 | __tablename__ = "student" 26 | id = Column(Integer,autoincrement=True,primary_key=True) 27 | name = Column(String(32),nullable=False) 28 | register_date = Column(DATE,nullable=False) 29 | gender = Column(Enum("M","F"),nullable=False) 30 | 31 | Base.metadata.create_all(engine) 32 | 33 | Session_class = sessionmaker(bind=engine) 34 | Session = Session_class() 35 | 36 | # user_obj = User(name="lishunbo", password="abdia") 37 | # print(user_obj.name,user_obj.id) 38 | # Session.add(user_obj) 39 | # print(user_obj.name,user_obj.id) 40 | # 41 | # Session.commit() 42 | # print(user_obj.name,user_obj.id) 43 | 44 | # data = Session.query(User).filter(User.name=="lishunbo").filter(User.id==1).first() 45 | # print(data) 46 | # data.name = "sunhuihui" 47 | # data.password = "1242343" 48 | # print(dir(Session)) 49 | 50 | # fake_user = User(name="sunxiaolong",password="124234") 51 | # Session.add(fake_user) 52 | # print(Session.query(User).filter(User.name.in_(["sunhuihui", "sunxiaolong"])).all()) 53 | # Session.rollback() 54 | print(Session.query(User.name,func.count(User.name)).group_by(User.name).all()) 55 | print(Session.query(User).filter(User.name.in_(["sunhuihui", "sunxiaolong"])).count()) 56 | # print(Session.query(User,Student).filter(User.id==Student.id).all()) 57 | Session.commit() 58 | -------------------------------------------------------------------------------- /Python/Day17/jQuery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 |
10 |
11 | 14 | 34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | 42 | 45 | 46 | -------------------------------------------------------------------------------- /Python/Day17/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Day17/logo.jpg -------------------------------------------------------------------------------- /Python/Day17/style.css: -------------------------------------------------------------------------------- 1 | .pg-header{ 2 | position: fixed; 3 | right: 0; 4 | left: 0; 5 | top: 0; 6 | height: 76px; 7 | background-color: lightseagreen; 8 | line-height: 76px; 9 | } 10 | .pg-header .header { 11 | width: 980px; 12 | margin: 0 auto; 13 | } 14 | .pg-header .header .logo{ 15 | height: 76px; 16 | float: left; 17 | } 18 | .pg-header .header .logo .img{ 19 | width: 76px; 20 | height: 76px; 21 | } 22 | .pg-header .header .menu ul{ 23 | width: 450px; 24 | height: 35px; 25 | float: right; 26 | margin-top: 30px; 27 | margin-bottom: 11px; 28 | line-height: 35px; 29 | } 30 | .pg-header .header .menu .menu_li{ 31 | width: 65px; 32 | height: 25px; 33 | padding-top: 5px; 34 | padding-bottom: 5px; 35 | margin-right: 20px; 36 | background-color: #5ab2ce; 37 | line-height: 25px; 38 | text-align: center; 39 | list-style: none; 40 | float: left; 41 | font-size: 16px; 42 | display: inline-block; 43 | } 44 | a:-webkit-any-link { 45 | color: #fff; 46 | text-decoration: none; 47 | cursor: pointer; 48 | } 49 | .pg-header .header .menu .menu_li:hover{ 50 | background-color: #7bc3d6; 51 | } 52 | 53 | .pg-body .bd_menu{ 54 | width: ; 55 | } -------------------------------------------------------------------------------- /Python/Day2/String.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | name = "My name is ZhangPP" 6 | age = "-" 7 | age_list = ['m','y',' ','a','g','e'] 8 | s1 = "I am {},I'm {} years old!" 9 | s2 = "I am {1},I'm {0} years old!" 10 | s3 = "I am {name},I'm {age} years old!" 11 | 12 | print(name) 13 | print(name.index("is")) ##获取首字符索引 14 | print(name.find("me")) ##搜索到字符,并返回首字符索引 15 | print(name.count("a")) ##统计字符出现的次数 16 | print(name.strip()) ##去掉字符前后空格 17 | print(name.split("n")) ##分割字符,返回列表 18 | print(name.replace("zhangpp","zhangtt")) ##替换字符 19 | print(age.join(age_list)) ##将列表以指定字符拼接成新的字符串 20 | print(s1.format("zhangpp","27")) 21 | print(s2.format("27","zhangpp")) 22 | print(s3.format(name = "zhangpp", age = "27")) ##字符串格式化,传参 23 | print(name.encode('utf-8')) ##对字符进行编码 24 | print(name.encode('utf-8').decode('utf-8')) ##解码字符串 25 | print(name.title()) ##字符串以Title形式显示 26 | print(name.startswith("my")) ##字符串是否以my字符开头 27 | print(name.endswith("tt")) ##字符串是否以tt字符结尾 28 | print(name.upper()) ##字符串改为大写 29 | print(name.lower()) ##字符串改为小写 30 | print(name.swapcase()) ##字符串大小写转换 31 | print(name.center(50,"*")) 32 | print(name.find('am',5)) -------------------------------------------------------------------------------- /Python/Day2/dict.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | print('''|---欢迎进入通讯录程序---| 6 | |---1、 查询联系人资料---| 7 | |---2、 插入新的联系人---| 8 | |---3、 删除已有联系人---| 9 | |---4、 退出通讯录程序---|''') 10 | addressBook={}#定义通讯录 11 | 12 | while True: 13 | temp = input('请输入指令代码:') 14 | if not temp.isdigit(): 15 | print("输入的指令错误,请按照提示输入") 16 | continue 17 | item = int(temp) # 转换为数字 18 | if item == 4: 19 | print("|---感谢使用通讯录程序---|") 20 | break 21 | name = input("请输入联系人姓名:") 22 | if item == 1: 23 | if name in addressBook: 24 | print(name, ':', addressBook[name]) 25 | continue 26 | else: 27 | print("该联系人不存在!") 28 | if item == 2: 29 | if name in addressBook: 30 | print("您输入的姓名在通讯录中已存在-->>", name, ":", addressBook[name]) 31 | isEdit = input("是否修改联系人资料(Y/N):") 32 | if isEdit == 'Y': 33 | userphone = input("请输入联系人电话:") 34 | addressBook[name] = userphone 35 | print("联系人修改成功") 36 | continue 37 | else: 38 | continue 39 | else: 40 | userphone = input("请输入联系人电话:") 41 | addressBook[name] = userphone 42 | print("联系人加入成功!") 43 | continue 44 | 45 | if item == 3: 46 | if name in addressBook: 47 | del addressBook[name] 48 | print("删除成功!") 49 | continue 50 | else: 51 | print("联系人不存在") -------------------------------------------------------------------------------- /Python/Day2/shopping.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | salay = int(input("your salay:")) 6 | line = [1, 2, 3, 4, 5] 7 | goods = ["Iphone", "Mac Pro", "Starbuck Latte", "Python book", "Bike"] 8 | price = [5800, 12000, 31, 58, 800] 9 | buy = [] 10 | 11 | while True: 12 | for i in range(5): 13 | print("{0}.{1} {2}".format(line[i],goods[i],price[i])) 14 | total = 0 15 | shop = input(">>>:") 16 | buy_len = len(buy) 17 | if shop is not "q": 18 | shop = int(shop) - 1 19 | if buy_len > 0: 20 | for i in buy: 21 | total += int(price[i]) 22 | total = total + int(price[shop]) 23 | print("total = ", total) 24 | if total > salay: 25 | print("I'm sorry, your balance is insufficient!!") 26 | else: 27 | buy.append(shop) 28 | else: 29 | if price[shop] > salay: 30 | print("I'm sorry, your balance is insufficient!!") 31 | else: 32 | buy.append(shop) 33 | else: 34 | if buy_len > 0: 35 | print("Your shopping cart is:") 36 | for i in buy: 37 | total += int(price[i]) 38 | print("{0} {1}".format(goods[i],price[i])) 39 | print("Your total amount of goods: ",total) 40 | else: 41 | print("Your shopping cart is empty!!") 42 | break 43 | -------------------------------------------------------------------------------- /Python/Day2/sys_python.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import sys 6 | 7 | print(sys.path) -------------------------------------------------------------------------------- /Python/Day3/files.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | #data = open("yesterday",encoding="utf-8").read() 6 | file = open("yesterday",'a',encoding="utf-8") 7 | 8 | file.write("\n zhangpp is very good!!") 9 | 10 | file.close() -------------------------------------------------------------------------------- /Python/Day3/gather.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | list_1 = [1,4,3,4,5,3,7,4,9] 6 | #生成集合,无序的 7 | list_1 = set(list_1) 8 | 9 | print(list_1,type(list_1)) 10 | list_2 = set([1,3,4,8]) 11 | 12 | #交集 & 13 | print(list_1.intersection(list_2)) 14 | #并集 | 15 | print(list_1.union(list_2)) 16 | #差集 in list_1 but not in list_2 - 17 | print(list_1.difference(list_2)) 18 | 19 | list_3 = set([1,3,4]) 20 | #子集 21 | print(list_1.issubset(list_2)) 22 | #父集 23 | print(list_1.issuperset(list_2)) 24 | print(list_1.issuperset(list_3)) 25 | 26 | #对称差集 ^ 27 | print(list_1.symmetric_difference(list_2)) 28 | #若没有交集返回True 29 | list_4 = set([7,5,6]) 30 | print(list_3.isdisjoint(list_4)) 31 | 32 | #添加 33 | list_1.add(88) 34 | print(list_1) 35 | #批量添加 36 | list_1.update([22,33,44]) 37 | print(list_1) 38 | #删除某个元素,如果不存在,就报错 39 | list_1.remove(33) 40 | print(list_1) 41 | #任意删除 42 | list_1.pop() 43 | print(list_1) 44 | #删除某个元素,如果不存在,就什么都不做 45 | list_1.discard(99) 46 | print(list_1) -------------------------------------------------------------------------------- /Python/Day3/set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | s = {1,2,3,4} 6 | 7 | print(type(s)) -------------------------------------------------------------------------------- /Python/Day3/yesterday: -------------------------------------------------------------------------------- 1 | Oh, yesterday when I was young 2 | 噢 昨日当我年少轻狂 3 | So many, many songs were waiting to be sung 4 | 有那么那么多甜美的曲儿等我歌唱 5 | So many wild pleasures lay in store for me 6 | 有那么多肆意的快乐等我享受 7 | And so much pain my eyes refused to see 8 | 还有那么多痛苦 我的双眼却视而不见 9 | There are so many songs in me that won't be sung 10 | 我有太多歌曲永远不会被唱起 11 | I feel the bitter taste of tears upon my tongue 12 | 我尝到了舌尖泪水的苦涩滋味 13 | The time has come for me to pay for yesterday 14 | 终于到了付出代价的时间 为了昨日 15 | When I was young 16 | 当我年少轻狂 17 | zhangpp is very good!! -------------------------------------------------------------------------------- /Python/Day4/decorator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import time 6 | user,passwd = 'aaa','abc123' 7 | def auth(auth_type): 8 | print("auth func:",auth_type) 9 | def outer_wrapper(func): 10 | def wrapper(*args, **kwargs): 11 | print("wrapper func args:", *args, **kwargs) 12 | if auth_type == "local": 13 | username = input("Username:").strip() 14 | password = input("Password:").strip() 15 | print("Username:", username) 16 | print("Password:", password) 17 | print("User:", user) 18 | print("Passwd:", passwd) 19 | if user == username and passwd == password: 20 | print("\033[32;1mUser has passed authentication\033[0m") 21 | res = func(*args, **kwargs) # from home 22 | print("---after authenticaion ") 23 | return res 24 | else: 25 | exit("\033[31;1mInvalid username or password\033[0m") 26 | elif auth_type == "ldap": 27 | print("搞毛线ldap,不会。。。。") 28 | return wrapper 29 | return outer_wrapper 30 | 31 | 32 | def index(): 33 | print("Welcome to index page") 34 | 35 | @auth(auth_type="local") # home = wrapper 36 | def home(): 37 | print("Welcome to home page") 38 | return "form home" 39 | 40 | @auth(auth_type="ldap") 41 | def bbs(): 42 | print("Welcome to user page") 43 | 44 | index() 45 | print(home()) 46 | bbs() 47 | -------------------------------------------------------------------------------- /Python/Day4/generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | def fib(max): 6 | n, a, b = 0, 0, 1 7 | while n < max: 8 | yield b 9 | a, b = b, a+b 10 | n += 1 11 | return "####" 12 | 13 | f = fib(10) 14 | print(f.__next__()) 15 | # while True: 16 | # try: 17 | # x = f.__next__() 18 | # print("f:",x) 19 | # except StopIteration as e: 20 | # print("Generator return value:",e.value) 21 | # break 22 | -------------------------------------------------------------------------------- /Python/Day4/携程.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import time 6 | 7 | def consumer(name): 8 | print("%s 准备吃包子!" %(name)) 9 | while True: 10 | baozi = yield 11 | print("包子[%s]来了,被[%s]吃了。" %(baozi,name)) 12 | 13 | def producer(name,number): 14 | c = consumer("A") 15 | c2 = consumer("B") 16 | c.__next__() 17 | c2.__next__() 18 | print("[%s]开始做包子了!" %(name)) 19 | for i in range(number): 20 | time.sleep(1) 21 | print("做了一个包子。") 22 | c.send(i) 23 | c2.send(i) 24 | 25 | producer("zhangpp",10) 26 | -------------------------------------------------------------------------------- /Python/Day5/calculator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import re 6 | 7 | def adder_subtractor(x,y): 8 | return x + y 9 | 10 | def multiply_divide(x,y): 11 | return x * y 12 | 13 | def bracket(s): 14 | pass 15 | 16 | def main(): 17 | operation = input("Please input operation:").strip() 18 | num = re.search("\(+.+\)","(((1 + 3) * (5 - 2)) * 4)/5") 19 | print(num) 20 | 21 | main() 22 | -------------------------------------------------------------------------------- /Python/Django/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/Readme.txt -------------------------------------------------------------------------------- /Python/Django/firstDjango/.idea/firstDjango.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 1526906695538 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/__init__.py -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CmdbConfig(AppConfig): 5 | name = 'cmdb' 6 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/migrations/__init__.py -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/cmdb/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/cmdb/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | 5 | from django.views import View 6 | from django.shortcuts import HttpResponse 7 | from django.shortcuts import render 8 | from django.shortcuts import redirect 9 | 10 | def login(request): 11 | error_msg = "" 12 | if request.method == "POST": 13 | user = request.POST.get("user",None) 14 | pwd = request.POST.get("pwd",None) 15 | if user == "root" and pwd == "123456": 16 | return redirect("/home/") 17 | else: 18 | error_msg = "用户名或密码错误" 19 | return render(request,"login.html",{"error_msg" : error_msg}) 20 | 21 | USER_LIST = [ 22 | {"username":"zhangheting","email":"zht@wind-mobi.com","gender":"男"}, 23 | {"username":"lishunbo","email":"lsb@wind-mobi.com","gender":"男"}, 24 | {"username":"liuyang","email":"ly@wind-mobi.com","gender":"女"}, 25 | ] 26 | 27 | def home(request): 28 | error_add = "" 29 | error_delete = "" 30 | idex=None 31 | if request.method == "POST": 32 | username = request.POST.get("username",None) 33 | email = request.POST.get("email",None) 34 | gender = request.POST.get("gender",None) 35 | add = request.POST.get("add",None) 36 | delete = request.POST.get("delete",None) 37 | print("username = %s,email = %s,gender = %s" %(username,email,gender)) 38 | if add is not None: 39 | if username != "" and email != "" and gender != "": 40 | temp = {"username":username,"email":email,"gender":gender} 41 | USER_LIST.append(temp) 42 | else: 43 | error_add = "信息输入不正确" 44 | elif delete is not None: 45 | for user in USER_LIST: 46 | if user["username"] == username: 47 | idex = USER_LIST.index(user) 48 | if idex is not None: 49 | USER_LIST.pop(idex) 50 | else: 51 | error_delete = "用户名不存在" 52 | return render(request,"home.html",{"user_list":USER_LIST,"error_add":error_add,"error_delete":error_delete}) 53 | 54 | def detail(request,*args,**kwargs): 55 | return HttpResponse("Hello world!!") -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/firstDjango/__init__.py -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/firstDjango/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/firstDjango/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/firstDjango/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/firstDjango/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for firstDjango project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.0.2. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'kt(craqh2khd)xds$6^cws$+e!ghlxja2u(3j-68bvhzk(51w4' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'cmdb', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | #'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'firstDjango.urls' 54 | 55 | TEMPLATES = [ 56 | { 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 58 | 'DIRS': [os.path.join(BASE_DIR, 'templates')] 59 | , 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'firstDjango.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.0/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.sqlite3', 81 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 82 | } 83 | } 84 | 85 | 86 | # Password validation 87 | # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators 88 | 89 | AUTH_PASSWORD_VALIDATORS = [ 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 92 | }, 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 101 | }, 102 | ] 103 | 104 | 105 | # Internationalization 106 | # https://docs.djangoproject.com/en/2.0/topics/i18n/ 107 | 108 | LANGUAGE_CODE = 'en-us' 109 | 110 | TIME_ZONE = 'UTC' 111 | 112 | USE_I18N = True 113 | 114 | USE_L10N = True 115 | 116 | USE_TZ = True 117 | 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/2.0/howto/static-files/ 121 | 122 | STATIC_URL = '/static/' 123 | STATICFILES_DIRS = ( 124 | os.path.join(BASE_DIR, "static"), 125 | ) 126 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/urls.py: -------------------------------------------------------------------------------- 1 | """firstDjango URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.conf.urls import url 18 | from cmdb import views 19 | 20 | urlpatterns = [ 21 | url(r'^admin/', admin.site.urls), 22 | url(r'^login/$', views.login), 23 | url(r'^home/$', views.home), 24 | url(r'^detail-(?P\d+)-(?P\d+).html/$', views.detail), 25 | ] 26 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/firstDjango/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for firstDjango project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "firstDjango.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "firstDjango.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/openstack/__init__.py -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class OpenstackConfig(AppConfig): 5 | name = 'openstack' 6 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Django/firstDjango/openstack/migrations/__init__.py -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/openstack/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |
9 |
10 |
11 | 12 | 13 | 14 | 15 | {{ error_add }} 16 |
17 |
18 |
19 |
20 | 21 | 22 | {{ error_delete }} 23 |
24 |
25 |
26 | 27 | {% for row in user_list %} 28 | 29 | 30 | 31 | 32 | 33 | {% endfor %} 34 |
{{ row.username}}{{ row.email}}{{ row.gender}}
35 |
36 | 37 | -------------------------------------------------------------------------------- /Python/Django/firstDjango/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 13 | 14 | 15 |
16 |

17 | 18 | 19 |

20 |

21 | 22 | 23 | 24 | {{ error_msg }} 25 |

26 |
27 | 28 | -------------------------------------------------------------------------------- /Python/Student_management_system/Client/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Client/bin/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Client/bin/sd_mg_system.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import os,sys 5 | 6 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 7 | print(BASE_DIR) 8 | sys.path.append(BASE_DIR) 9 | 10 | if __name__ == "__main__" : 11 | from core import views 12 | views.main() 13 | 14 | -------------------------------------------------------------------------------- /Python/Student_management_system/Client/conf/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Client/conf/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/conf/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/conf/__pycache__/config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/conf/__pycache__/config.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/conf/config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | from core import lecturer 6 | from core import student 7 | 8 | sys_port = { 9 | "lecturer": lecturer.lecturer_page, 10 | "student": student.student_page 11 | } 12 | 13 | account_info = { 14 | "login": "yes", 15 | "way": "", 16 | "name": "", 17 | "password": "", 18 | "new": "no" 19 | } 20 | 21 | auth_return = { 22 | "1001": "登陆成功!!", 23 | "1002": "账号或密码错误,是否重新输入?('y' or 'n')>>", 24 | "1003": "账号不存在,是否注册新账户?('y' or 'n')>>", 25 | "1004": "恭喜,新账户创建成功!!" 26 | } -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/core/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/__pycache__/lecturer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/core/__pycache__/lecturer.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/__pycache__/login.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/core/__pycache__/login.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/__pycache__/student.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/core/__pycache__/student.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/Student_management_system/Client/core/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/lecturer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import sys 5 | from core import login 6 | 7 | class lecturer(object): 8 | def __init__(self): 9 | print("Welcome into lecturer page.") 10 | 11 | def own_login(self): 12 | return login.login("lecturer") 13 | 14 | def lecturer_page(): 15 | lecturer_obj = lecturer() 16 | login = lecturer_obj.own_login() 17 | if login: 18 | pass 19 | else: 20 | print("用户登陆失败!!") 21 | sys.exit() -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/lecturer_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import sys 5 | import socket 6 | import json 7 | from conf import config 8 | 9 | class lecturer(object): 10 | def __init__(self): 11 | print("Welcome into lecturer page.") 12 | self.lec_client = socket.socket() 13 | self.addr = ("localhost",9999) 14 | self.account_info = config.account_info 15 | 16 | def auth(self,name,password): 17 | self.lec_client.connect(self.addr) 18 | self.account_info["name"] =name 19 | self.account_info["password"] = password 20 | self.account_info["way"] = "lecturer" 21 | self.lec_client.send(json.dumps(self.account_info).encode("utf-8")) 22 | auth_result = self.lec_client.recv(1024).decode("utf-8") 23 | return auth_result 24 | 25 | def new_account(self): 26 | while True: 27 | name = input("请输入新用户名:") 28 | password = input("请输入密码:") 29 | if len(name) > 0 and len(password) > 0: 30 | self.account_info["way"] = "lecturer" 31 | self.account_info["name"] = name 32 | self.account_info["password"] = password 33 | self.account_info["new"] = "yes" 34 | self.lec_client.send(json.dumps(self.account_info).encode("utf-8")) 35 | new_result = self.lec_client.recv(1024).decode("utf-8") 36 | return new_result 37 | else: 38 | print("新用户名或密码输入有误!!") 39 | 40 | def login(self): 41 | while True: 42 | name = input("请输入用户名:") 43 | password = input("请输入密码:") 44 | if len(name) > 0: 45 | auth_result = self.auth(name,password) 46 | else: 47 | print("用户名未输入!!") 48 | if auth_result == "1001": 49 | print(config.auth_return[auth_result]) 50 | return True 51 | elif auth_result == "1002": 52 | while True: 53 | resume = input(config.auth_return[auth_result]) 54 | if resume == "y": 55 | break 56 | elif resume == "n": 57 | return False 58 | elif resume != "": 59 | print("输入有误!!") 60 | elif auth_result == "1003": 61 | while True: 62 | new = input(config.auth_return[auth_result]) 63 | if new == "y": 64 | new_result = self.new_account() 65 | if new_result == "1004": 66 | print(config.auth_return[new_result]) 67 | return True 68 | else: 69 | return False 70 | elif new == "n": 71 | return False 72 | elif new != "": 73 | print("输入有误!!") 74 | 75 | def lecturer_page(): 76 | lecturer_obj = lecturer() 77 | login = lecturer_obj.login() 78 | if login: 79 | pass 80 | else: 81 | print("用户登陆失败!!") 82 | sys.exit() -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/login.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import socket 6 | import json 7 | from conf import config 8 | 9 | lec_client = socket.socket() 10 | addr = ("localhost", 9999) 11 | 12 | def auth( name, password): 13 | """ 14 | Check account and password. 15 | """ 16 | lec_client.connect(addr) 17 | account_info["name"] = name 18 | account_info["password"] = password 19 | lec_client.send(json.dumps(account_info).encode("utf-8")) 20 | auth_result = lec_client.recv(1024).decode("utf-8") 21 | return auth_result 22 | 23 | 24 | def new_account(): 25 | """ 26 | New account. 27 | """ 28 | while True: 29 | name = input("请输入新用户名:") 30 | password = input("请输入密码:") 31 | if len(name) > 0 and len(password) > 0: 32 | account_info["name"] = name 33 | account_info["password"] = password 34 | account_info["new"] = "yes" 35 | lec_client.send(json.dumps(account_info).encode("utf-8")) 36 | new_result = lec_client.recv(1024).decode("utf-8") 37 | return new_result 38 | else: 39 | print("新用户名或密码输入有误!!") 40 | 41 | 42 | def login(way): 43 | """ 44 | Login account. 45 | """ 46 | global account_info 47 | account_info = config.account_info 48 | while True: 49 | name = input("请输入用户名:") 50 | password = input("请输入密码:") 51 | account_info["way"] = way 52 | if len(name) > 0: 53 | auth_result = auth(name, password) 54 | else: 55 | print("用户名未输入!!") 56 | continue 57 | if auth_result == "1001": 58 | print(config.auth_return[auth_result]) 59 | return True 60 | elif auth_result == "1002": 61 | while True: 62 | resume = input(config.auth_return[auth_result]) 63 | if resume == "y": 64 | break 65 | elif resume == "n": 66 | return False 67 | elif resume != "": 68 | print("输入有误!!") 69 | elif auth_result == "1003": 70 | while True: 71 | new = input(config.auth_return[auth_result]) 72 | if new == "y": 73 | new_result = new_account() 74 | if new_result == "1004": 75 | print(config.auth_return[new_result]) 76 | return True 77 | else: 78 | return False 79 | elif new == "n": 80 | return False 81 | elif new != "": 82 | print("输入有误!!") -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/student.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import sys 5 | from core import login 6 | 7 | class student(object): 8 | def __init__(self): 9 | print("Welcome into student page.") 10 | 11 | def own_login(self): 12 | return login.login("student") 13 | 14 | def student_page(): 15 | student_obj = student() 16 | login = student_obj.own_login() 17 | if login: 18 | pass 19 | else: 20 | print("用户登陆失败!!") 21 | sys.exit() -------------------------------------------------------------------------------- /Python/Student_management_system/Client/core/views.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import sys 5 | from conf import config 6 | 7 | def main(): 8 | """ 9 | 进入程序 10 | :return: 11 | """ 12 | print("""请输入登陆方式: 13 | 1、讲师 14 | 2、学员""") 15 | while True: 16 | way = input(">>") 17 | if way == "1": 18 | config.sys_port["lecturer"]() 19 | elif way == "2": 20 | config.sys_port["student"]() 21 | elif way == "q": 22 | sys.exit() 23 | elif way != "": 24 | print("输入错误,请输入登陆方式序号,谢谢。") -------------------------------------------------------------------------------- /Python/Student_management_system/Server/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Server/bin/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Server/bin/student_server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import os,sys 5 | 6 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 7 | print(BASE_DIR) 8 | sys.path.append(BASE_DIR) 9 | 10 | if __name__ == "__main__" : 11 | from core import views 12 | views.main() -------------------------------------------------------------------------------- /Python/Student_management_system/Server/conf/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Server/core/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Server/core/views.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | def main(): 6 | pass -------------------------------------------------------------------------------- /Python/Student_management_system/Server/data/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/Server/log/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/Student_management_system/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/abc: -------------------------------------------------------------------------------- 1 | Community versionName:2.1.33_20171219 2 | package:/system/framework/framework-res.apk=android appName:Android System versionName:8.0.0:size:34190.41KB 3 | er versionName:8.0.0:size:17.24KB 4 | package:/system/app/BluetoothMidiService/BluetoothMidiService.apk=com.android.bluetoothmidiservice appName:Bluetooth MIDI Service versionName:8.0.0:size:5.18KB 5 | package:/system/app/ParallaxLiveWallpaper/ParallaxLiveWallpaper.apk=com.amax.livewallpaper.parallaxwallpaper appName:Radiant Wallpaper versionName:1.2.0.0_171227:size:23789.09KB 6 | package:/system/priv-app/CarrierConfig/CarrierConfig.apk=com.android.carrierconfig appName:null versionName:1.0.0:size:128.91KB 7 | package:/system/app/PAIStub/PAIStub.apk=android.autoinstalls.config.asus.pai appName:Device configuration versionName:1:size:4.38KB 8 | package:/system/app/CaptivePortalLogin/CaptivePortalLogin.apk=com.android.captiveportallogin appName:CaptivePortalLogin versionName:8.0.0:size:62.92KB 9 | 10 | package:/system/priv-app/CallLogBackup/CallLogBackup.apk=com.android.calllogbackup appName:Call Log Backup/Restore versionName:8.0.0:size:15.09KB 11 | package:/system/priv-app/ConfigUpdater/ConfigUpdater.apk=com.google.android.configupdater appName:ConfigUpdater versionName:8.0.0-4147944:size:1499.74KB 12 | 5.59KB 13 | 944:size:20.81KB 14 | .0.0.5_180315:size:1626.29KB 15 | -------------------------------------------------------------------------------- /Python/adb_apk.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Author:zhangyanbin 3 | 4 | import os 5 | import re 6 | 7 | os.system('adb version') 8 | os.system('adb devices') # os.system是不支持读取操作的 9 | out = os.popen("adb shell pm list packages -f --show-versionname --show-appname").read() # os.popen支持读取操作 10 | print(out) 11 | 12 | 13 | # 下面的代码是获取当前窗口的component参数 14 | def getFocusedPackageAndActivity(): 15 | pattern = re.compile( 16 | r"[a-zA-Z0-9\.]+/[a-zA-Z0-9\.]+") # 这里使用了正则表达式,对输出的内容做了限制,只会显示类似"com.mediatek.factorymode/com.mediatek.factorymode.FactoryMode"的字符串 17 | out = os.popen("adb shell dumpsys window windows | findstr \/ | findstr name=").read() # window下使用findstr 18 | list = pattern.findall(out) 19 | component = list[0] # 输出列表中的第一条字符串 20 | 21 | return component 22 | 23 | 24 | #print(getFocusedPackageAndActivity()) -------------------------------------------------------------------------------- /Python/adb_pm.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import subprocess 7 | import sys 8 | import threading 9 | 10 | #FileName = sys.argv[1] 11 | FileName = "abc" 12 | FileName_Base = FileName + "_base" 13 | 14 | os.system('adb version') 15 | os.system('adb devices') # os.system是不支持读取操作的 16 | file = open(FileName, "w",encoding = "utf-8") 17 | out = subprocess.Popen('adb shell "pm list packages -f --show-versionname --show-appname"', shell=True, 18 | stdout=subprocess.PIPE) 19 | data = out.stdout.read().decode("utf-8") 20 | file.write(data) 21 | file.close() 22 | with open(FileName, "r",encoding = "utf-8") as file,open(FileName_Base, "w",encoding = "utf-8") as file_base: 23 | for line in file: 24 | if line == '\n': 25 | line = line.strip("\n") 26 | file_base.write(line) 27 | 28 | def cmd_ls(line): 29 | with open(FileName, "a", encoding="utf-8") as file: 30 | if line.startswith("package"): 31 | list = line.partition("=") 32 | path = list[0].partition(":")[2] 33 | cmd = 'adb shell "ls -l {}"'.format(path) 34 | size_list = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read().decode("utf-8") 35 | size = str(round(int(size_list.split()[4])/1024,2)) 36 | size_str = ":size:" + size + "KB" + "\n" 37 | line = line.strip("\n") + size_str 38 | file.write(line) 39 | 40 | thd = [] 41 | with open(FileName_Base, "r",encoding = "utf-8") as file_base: 42 | print("正在获取对应apk size") 43 | os.remove(FileName) 44 | for line in file_base: 45 | cmd = threading.Thread(target=cmd_ls,args=(line,)) 46 | cmd.start() 47 | thd.append(cmd) 48 | 49 | for t in thd: 50 | t.join() 51 | 52 | os.remove(FileName_Base) 53 | print("成功获取apk size") 54 | 55 | 56 | -------------------------------------------------------------------------------- /Python/adb_pm_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import subprocess 7 | import sys 8 | 9 | # FileName = sys.argv[1] 10 | FileName = "package" 11 | FileName_Base = FileName + "_base" 12 | 13 | os.system('adb version') 14 | os.system('adb devices') # os.system是不支持读取操作的 15 | # os.system('adb shell "pm list packages -f --show-versionname --show-appname"') 16 | file = open(FileName, "w",encoding = "utf-8") 17 | out = subprocess.Popen('adb shell "pm list packages -f --show-versionname --show-appname"', shell=True, 18 | stdout=subprocess.PIPE) 19 | # out = os.popen('adb shell "pm list packages -f --show-versionname --show-appname"').read() # os.popen支持读取操作 20 | data = out.stdout.read().decode("utf-8") 21 | file.write(data) 22 | file.close() 23 | with open(FileName, "r",encoding = "utf-8") as file,open(FileName_Base, "w",encoding = "utf-8") as file_base: 24 | for line in file: 25 | if line == '\n': 26 | line = line.strip("\n") 27 | file_base.write(line) 28 | 29 | with open(FileName_Base, "r",encoding = "utf-8") as file_base,open(FileName, "w",encoding = "utf-8") as file: 30 | for line in file_base: 31 | if line.startswith("package"): 32 | list = line.partition("=") 33 | path = list[0].partition(":")[2] 34 | cmd = 'adb shell "ls -l {}"'.format(path) 35 | size_list = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read().decode("utf-8") 36 | #size = int(size_list.split()[4])/1024/1024 37 | size = size_list.split()[4] 38 | size_str = ":size:" + size + "\n" 39 | line = line.strip("\n") + size_str 40 | file.write(line) 41 | os.remove(FileName_Base) 42 | 43 | 44 | -------------------------------------------------------------------------------- /Python/adb_pm_package.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import subprocess 7 | import sys 8 | 9 | FileName = sys.argv[1] 10 | FileName_Base = FileName + "_base" 11 | 12 | os.system('adb version') 13 | os.system('adb devices') # os.system是不支持读取操作的 14 | file = open(FileName, "w",encoding = "utf-8") 15 | out = subprocess.Popen('adb shell "pm list packages -f --show-versionname --show-appname"', shell=True, 16 | stdout=subprocess.PIPE) 17 | data = out.stdout.read().decode("utf-8") 18 | file.write(data) 19 | file.close() 20 | with open(FileName, "r",encoding = "utf-8") as file,open(FileName_Base, "w",encoding = "utf-8") as file_base: 21 | for line in file: 22 | if line == '\n': 23 | line = line.strip("\n") 24 | file_base.write(line) 25 | 26 | with open(FileName_Base, "r",encoding = "utf-8") as file_base,open(FileName, "w",encoding = "utf-8") as file: 27 | print("正在获取对应apk size") 28 | for line in file_base: 29 | if line.startswith("package"): 30 | list = line.partition("=") 31 | path = list[0].partition(":")[2] 32 | cmd = 'adb shell "ls -l {}"'.format(path) 33 | size_list = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read().decode("utf-8") 34 | size = str(round(int(size_list.split()[4])/1024,2)) 35 | size_str = ":size:" + size + "KB" + "\n" 36 | line = line.strip("\n") + size_str 37 | file.write(line) 38 | os.remove(FileName_Base) 39 | print("成功获取apk size") 40 | 41 | 42 | -------------------------------------------------------------------------------- /Python/apk_info: -------------------------------------------------------------------------------- 1 | {'QQ': 'http://www.wandoujia.com/apps/com.tencent.mobileqq/binding'} 2 | {'作业帮': 'http://www.wandoujia.com/apps/com.baidu.homework/binding'} 3 | {'爱奇艺': 'http://www.wandoujia.com/apps/com.qiyi.video/binding'} 4 | {'微信': 'http://www.wandoujia.com/apps/com.tencent.mm/binding'} 5 | {'酷狗音乐': 'http://www.wandoujia.com/apps/com.kugou.android/binding'} 6 | {'腾讯视频': 'http://www.wandoujia.com/apps/com.tencent.qqlive/binding'} 7 | {'抖音短视频': 'http://www.wandoujia.com/apps/com.ss.android.ugc.aweme/binding'} 8 | {'快手': 'http://www.wandoujia.com/apps/com.smile.gifmaker/binding'} 9 | {'UC浏览器': 'http://www.wandoujia.com/apps/com.UCMobile/binding'} 10 | {'全民K歌': 'http://www.wandoujia.com/apps/com.tencent.karaoke/binding'} 11 | {'优酷': 'http://www.wandoujia.com/apps/com.youku.phone/binding'} 12 | {'QQ音乐': 'http://www.wandoujia.com/apps/com.tencent.qqmusic/binding'} 13 | {'淘宝': 'http://www.wandoujia.com/apps/com.taobao.taobao/binding'} 14 | {'百度': 'http://www.wandoujia.com/apps/com.baidu.searchbox/binding'} 15 | {'影音先锋': 'http://www.wandoujia.com/apps/com.xfplay.play/binding'} 16 | {'拼多多': 'http://www.wandoujia.com/apps/com.xunmeng.pinduoduo/binding'} 17 | {'互动作业': 'http://www.wandoujia.com/apps/com.v.study/binding'} 18 | {'支付宝': 'http://www.wandoujia.com/apps/com.eg.android.AlipayGphone/binding'} 19 | {'哔哩哔哩': 'http://www.wandoujia.com/apps/tv.danmaku.bili/binding'} 20 | {'迅雷': 'http://www.wandoujia.com/apps/com.xunlei.downloadprovider/binding'} 21 | {'QQ浏览器': 'http://www.wandoujia.com/apps/com.tencent.mtt/binding'} 22 | {'网易云音乐': 'http://www.wandoujia.com/apps/com.netease.cloudmusic/binding'} 23 | {'芒果TV': 'http://www.wandoujia.com/apps/com.hunantv.imgo.activity/binding'} 24 | -------------------------------------------------------------------------------- /Python/ftp_client/ftp_client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import socket 6 | import json 7 | import hashlib 8 | import os 9 | 10 | class FtpClient(object): 11 | ''' 12 | The clsss id ftp client class. 13 | ''' 14 | def __init__(self): 15 | self.client = socket.socket() 16 | self.inf = {} 17 | self.msg = {} 18 | self.path = "" 19 | 20 | def help(self): 21 | msg = ''' 22 | ls 23 | pwd 24 | cd ../.. 25 | mkdir dir 26 | get filename 27 | put filename 28 | ''' 29 | print("The command is :",msg) 30 | 31 | def connect(self,host,port): 32 | self.client.connect((host, port)) 33 | 34 | def client_inf(self,new): 35 | m = hashlib.md5() 36 | name = input("Please input your name:").strip() 37 | password = input("Please input your password:").strip() 38 | m.update(password.encode("utf-8")) 39 | password_md5 = m.hexdigest() 40 | self.inf = { 41 | "login": "yes", 42 | "name": name, 43 | "password": password_md5, 44 | "new": "no" 45 | } 46 | if new == "yes": 47 | self.inf["new"] = "yes" 48 | return self.inf 49 | 50 | def login(self): 51 | new = "no" 52 | while True: 53 | client_msg = self.client_inf(new) 54 | self.client.send(json.dumps(client_msg).encode("utf-8")) 55 | login_state = self.client.recv(1024).decode("utf-8") 56 | if login_state == "correct": 57 | self.path = client_msg["name"] 58 | print("%s, Welcome to the FTP." %client_msg["name"]) 59 | break 60 | elif login_state == "fail": 61 | again = input("Wrong password, please enter again?(y or n):").strip() 62 | if again == "n": 63 | return False 64 | elif login_state == "none": 65 | new = input("The user does not exist, whether the new user?(y or n):").strip() 66 | if new == "y": 67 | new = "yes" 68 | elif new == "n": 69 | return False 70 | return True 71 | 72 | def interactive(self): 73 | while True: 74 | cmd = input("%s>>" %self.path).strip() 75 | if len(cmd) == 0: continue 76 | cmd_str = cmd.split()[0] 77 | if hasattr(self,"cmd_%s" %cmd_str): 78 | func = getattr(self,"cmd_%s" %cmd_str) 79 | func(cmd) 80 | else: 81 | self.help() 82 | 83 | def command_single(self,*args): 84 | cmd = args[0].split() 85 | server_response = "" 86 | if len(cmd) > 1: 87 | self.help() 88 | else: 89 | self.msg = { 90 | "action" : cmd[0] 91 | } 92 | self.client.send(json.dumps(self.msg).encode("utf-8")) 93 | server_response = self.client.recv(1024).decode("utf-8") 94 | return server_response 95 | 96 | def commend_multi(self,*args): 97 | cmd = args[0].split() 98 | server_response = "" 99 | if len(cmd) > 1: 100 | self.msg = { 101 | "action" : cmd[0], 102 | "target" : cmd[1] 103 | } 104 | self.client.send(json.dumps(self.msg).encode("utf-8")) 105 | server_response = self.client.recv(1024).decode("utf-8") 106 | else: 107 | self.help() 108 | return server_response 109 | 110 | def cmd_ls(self,*args): 111 | server_response = json.loads(self.command_single(args[0])) 112 | for i in server_response: 113 | print(i) 114 | 115 | def cmd_pwd(self,*args): 116 | server_response = self.command_single(args[0]) 117 | print(server_response) 118 | 119 | def cmd_cd(self,*args): 120 | self.commend_multi(*args) 121 | 122 | def cmd_mkdir(self,*args): 123 | cmd = args[0].split() 124 | if len(cmd) > 1: 125 | self.help() 126 | else: 127 | self.msg = { 128 | "action" : cmd[0] 129 | } 130 | self.client.send(json.dumps(self.msg).encode("utf-8")) 131 | 132 | def cmd_put(self,*args): 133 | cmd = args[0].split() 134 | if len(cmd) > 1: 135 | filename = cmd[1] 136 | if cmd[0] == "put" and os.path.isfile(filename): 137 | self.client.send(cmd.encode("utf-8")) 138 | recv = self.client.recv(1024) 139 | elif cmd[0] == "get": 140 | pass 141 | elif cmd[0] == "cd": 142 | pass 143 | else: 144 | self.help() 145 | 146 | def cmd_get(self,*args): 147 | cmd = args[0].split() 148 | if len(cmd) > 1: 149 | self.help() 150 | else: 151 | self.msg = { 152 | "action" : cmd[0] 153 | } 154 | self.client.send(json.dumps(self.msg).encode("utf-8")) 155 | 156 | def close(self): 157 | print("client is close") 158 | self.close() 159 | 160 | 161 | client = FtpClient() 162 | client.connect('localhost',9999) 163 | login_state = client.login() 164 | if login_state: 165 | client.interactive() 166 | 167 | client.close() 168 | 169 | 170 | -------------------------------------------------------------------------------- /Python/ftp_client/outlook 2007 wind-mobi邮箱设置方法.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/ftp_client/outlook 2007 wind-mobi邮箱设置方法.pdf -------------------------------------------------------------------------------- /Python/ftp_client/wiki模板.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/ftp_client/wiki模板.txt -------------------------------------------------------------------------------- /Python/ftp_server/bin/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/ftp_server/conf/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/ftp_server/conf/zpp: -------------------------------------------------------------------------------- 1 | {"name": "zpp", "password": "e10adc3949ba59abbe56e057f20f883e", "disk": "100M"} -------------------------------------------------------------------------------- /Python/ftp_server/core/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/ftp_server/core/main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import socketserver 6 | import json 7 | import os 8 | 9 | BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 10 | ACCOUNT_PATH = BASE_PATH + "\\conf" 11 | DATA_PATH = BASE_PATH + "\\data" 12 | print(DATA_PATH) 13 | 14 | class MyFTPHandler(socketserver.BaseRequestHandler): 15 | ''' 16 | The request handler class for ftp server. 17 | ''' 18 | 19 | def __init__(self, request, client_address, server): 20 | super(MyFTPHandler, self).__init__(request, client_address, server) 21 | self.user_current_dir = "" 22 | self.home_dir = "" 23 | 24 | def handle(self): 25 | while True: 26 | try: 27 | print("client address:",self.client_address[0]) 28 | self.data = self.request.recv(1024).strip() 29 | print("{} wrote:".format(self.client_address[0])) 30 | print(self.data.decode()) 31 | client_msg = json.loads(self.data.decode()) 32 | if client_msg.get("login") == "yes": 33 | self.login_verify(client_msg) 34 | else: 35 | self.own_operation(client_msg) 36 | except ConnectionResetError as e: 37 | print("error",e) 38 | break 39 | 40 | def login_verify(self,client_msg): 41 | print("login verify:",client_msg) 42 | name = client_msg["name"] 43 | account_file = ACCOUNT_PATH + "\\" + name 44 | own_path = DATA_PATH + "\\" + name 45 | self.user_current_dir = own_path 46 | self.home_dir = own_path 47 | print(own_path) 48 | if client_msg["new"] == "yes": 49 | own_msg_dir = {"name": "", 50 | "password": "", 51 | "disk": "100M"} 52 | os.makedirs(own_path) 53 | own_msg_dir["name"] = client_msg["name"] 54 | own_msg_dir["password"] = client_msg["password"] 55 | with open(account_file,"w") as f: 56 | json.dump(own_msg_dir,f) 57 | self.request.send(b"correct") 58 | else: 59 | if os.path.isfile(account_file): 60 | with open(account_file,"r") as f: 61 | account_msg = json.load(f) 62 | if account_msg["name"] == client_msg["name"] and account_msg["password"] == client_msg["password"]: 63 | self.request.send(b"correct") 64 | else: 65 | self.request.send(b"fail") 66 | else: 67 | self.request.send(b"none") 68 | 69 | def own_operation(self,client_msg): 70 | action = client_msg["action"] 71 | if hasattr(self, "cmd_%s" % action): 72 | func = getattr(self, "cmd_%s" % action) 73 | func(client_msg) 74 | 75 | def cmd_ls(self,*args): 76 | print("This is ls commend") 77 | print(self.user_current_dir) 78 | data = os.listdir(self.user_current_dir) 79 | self.request.send(json.dumps(data).encode("utf-8")) 80 | 81 | def cmd_pwd(self,*args): 82 | print("This is pwd commend") 83 | self.request.send(self.user_current_dir.encode("utf-8")) 84 | 85 | def cmd_cd(self,*args): 86 | print("This is ls commend") 87 | target = args[0]["target"] 88 | if target: 89 | pass 90 | target_path = self.user_current_dir + target 91 | if os.path.isdir(target_path): 92 | self.user_current_dir = target_path 93 | 94 | elif os.path.isfile(target_path): 95 | self.request.send("Your action object is a file!!".encode("utf-8")) 96 | 97 | 98 | def cmd_mkdir(self,*args): 99 | pass 100 | 101 | def cmd_get(self,*args): 102 | pass 103 | 104 | def cmd_put(self,*args): 105 | pass 106 | 107 | if __name__ == "__main__": 108 | HOST, PORT = "localhost", 9999 109 | 110 | server = socketserver.ThreadingTCPServer((HOST, PORT),MyFTPHandler) 111 | server.serve_forever() -------------------------------------------------------------------------------- /Python/ftp_server/log/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp -------------------------------------------------------------------------------- /Python/keybox/keybox.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox.zip -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320000.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 139fccdd8ea782800c6e1bdb919f8b92a0000000200002373e03f96a83f37aa2bb99f8e35da5129b92da5e44b68c026f7116944a966b35bdf07de6bc9c720cf369c77a14218088f47a6edcb83e4a111c55df58f8f2c9bd7ef6b626f78755b4f66 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320001.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 126ce3fffdcbf3cbda90e78ccf9a62f67000000020000237394730b8c668dda29761d11e92e007a7fda381e48ca015c5bcf50088a3254893c44b8f9187a4170f12b79187c336bb70cafe6fb9ba4adc227fb154e8f115846906b626f78f09b81b9 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320002.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1620a10749648726543c42d1a9d68e3f300000002000023730e67f1eeff57d28f57822212385317beba47257930430aaf6fe7c16aca8d17796607b2b58deb309659c82229b14f42643196bf43aa59a2665d2db1c6c3830ebd6b626f78e7b9165d -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320003.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1321d27d25334352e9dc77239651b5ff200000002000023733dae0bc3572a8d4390aac231bf3c3c62c2ca02ea675c04f448c97248ca2ec242fe4c7b65d34e9677496c22376ff65741e5c59322fabfaaa0467dad25479d3af76b626f788c498b18 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320004.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 111261d58a50d236eae2c72e8af80975600000002000023732805d58ce3554ef13dbb133d6da5ecd66e256872b3083b27dc312b9c9a26fb037aebe273e585aeab08fda160031ecd33af7982ad26e842273c9b7f177617c10c6b626f787cf2d39c -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320005.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1a3953411548b254806a937fb0db9caa700000002000023736fee1286c2896398f9867e6a648de4138996d940c302d7a32ac911053679bfe8c7e4690f96cd874a8ac0ac26782ec9985f008b29bb942a775f7b60375a5f88586b626f7831b2d60f -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320006.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 18d1ac345e360f2756ca34b12831d6bdf0000000200002373c62d2cb87a2f522ecf897291f32b1596242050d5d4b91adf8bc79aa4a5de8a806dcf473390a7de32225051de959a030e74944fdb3e84a16648a42008af8d9a6e6b626f78b5a11b97 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320007.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 18d919d9b918a1223534398b281144a850000000200002373e806f7272e64dde75b5577c8b149b3d7669c270b42191259ffe3c2689cebb50fe7ac9f195b714bb575c21e36e22754b4214ffbd3bc84ef2b252d9af3f3ea8c916b626f784def268e -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320008.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1ec9f5bc19f9e1d53670bebf1f47ca891000000020000237372b7356bb99dab30755331e3518839365215d19df0961374b4d3b0dac6a8dbedc33d178e65a3b299f0d97592b4393e5e724958dce94468585ee929d4254280006b626f781432eda5 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F/widevine/Lenovo TB-X705F-X705F-04320009.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 18cd5b3698ce81bdaab9e69ab4d70e80e00000002000023730ebba45f05813fa216da24784a60986a491b624193043d828b9ed33739e0c0339430d3013b9cb31969206097b90ab389bb203d66fc551d7707a278876db073126b626f78881363e8 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000000/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000000/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000001/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000001/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000002/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000002/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000003/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000003/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000004/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000004/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000005/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000005/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000006/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000006/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000007/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000007/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000008/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000008/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705F_update/widevine/X705F100000009/keybox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/X705F_update/widevine/X705F100000009/keybox.bin -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620000.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 11e7c616dd026ab1f01cc56ed2aedf90700000002000023743b16bf3272fa5dd33896404ebaca3396750e564952ec3dd882111afabd19ed00188c6e2354cc27b0d4cf32651fb6316d36cd40077c39ede769618ce431b3d90e6b626f7891e4edaf -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620001.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 142149359e35b79699151bc2b9b6e378c00000002000023743621d76e2f528d75669cad543bc93b6571e047dbc936c63e3fff8f817f24cd5cadbdc8eddc6ae9fab2a0d61732535d469069fc6abcd9bc9bd5db762602cad2226b626f78799b8f7f -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620002.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1251b064240b0c0f3ac5d59c8c0e48f930000000200002374b5960ff96681b2bee5ec280f5554953cb0ea5d4e5feeb25d125a8c638486be6204ab5c1b692667f9e76f2d68f9a5939fe3813c185140ebd71988b3734fb3c2136b626f783a977b90 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620003.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 16a4ee74d6a27527a6f60ed2ca273feb00000000200002374daa46296b57967ed4beab728f9fa72ac1720f9aa0a4a38623cc44df7cdec2420cd3048d65293789ba77615d722ff5eb54f9e10ee1b6ded08629d79849cf0bb526b626f7805055560 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620004.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1939a75bc3bb9f9ebd89a55323d2a81870000000200002374994b8681a6200f9451d3326926bbfe3522e6ab6a5ea2794acdd2ba129fe2224550ae9747528a82195758e65aeae08001a8693c592aec74a03e19ef80742b357c6b626f7899d46d31 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620005.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 11f714bd200c919753ddc112d49e989930000000200002374b6e50c8bb73b24dfadaf3228d18e31957bc90191d76004814da3232fffb6452b4cae382bdda595725331741aa96251a11e57bad1057b226feb1ede15b5e0afab6b626f786a6ad0ff -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620006.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 193c22ba52c21e4b9ed1bf3b9ea3b9aa00000000200002374cd27abe7549340097207617a80607ab694999e3e483d191147b6610690fd9a7e90425eb6c0f0d63461b4c45148eb8980c40c82bacc6c30f588ca5fa5cc5bb9126b626f78be4098e9 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620007.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1e43cbd1d2342c47e2db3d4837565555a0000000200002374388b80fd26a58b4b97260550be6ff184cf7b6cb0ef750074146df315c079c0b09beccbbfc56fb4881d918a1b0cec44dfc0bb1975a2fc2e1f22dc8b75a4d30a866b626f7886553eab -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620008.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 19cfddd297ef8d1303d8e48b8bd7516800000000200002374f039dadaed0b4c0bbb24ba2af08ea47c9b4a9046f57c69b62b87839a795b2068c3716dc0f0fff5b1f25c170fbdd93c3e8026f5d34c5f8228b73fec09bf18d8226b626f78e2610534 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705L/widevine/Lenovo TB-X705L-X705L-04620009.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 185396442d4525ed8ec7708c910f346e4000000020000237430fd7d8d8f7efd3018fceac47e14a1fac57096d4d2df7b660789f5bbb55d7a7c66a43318da7bc92b83a83496dd890c2e75d815ba43f1c80ac633e042a45e545a6b626f787d9eca95 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920000.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1c10ebe191d32de40d3fd9955ccd11e340000000200002375003711e2332796e033179f16a01517d05d45f1160d47dd37bec407d0c0a9dd4a43bbad89d45351406e2beebf434150b5f5bc3369fb4992b082afccdb380bc2c46b626f786ca97d6a -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920001.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1d73bff81e98dab582381d40f7b006e980000000200002375e4f9471572ad52896b8615eeac40081f049b5c05b9c4fe37191c7e2f4e3c0c5dea3dd843244c5b95f30d774bab4db1a2f44a8e54be3a5873a7af9c1014b42ee56b626f78d0f10ade -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920002.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 16247413d95327278c3fc5a9362947d030000000200002375c966ece5c3ce55379e9b3e72c71b77b19d6928b8042657fca4c764a795b066259b03763609d3ad8d5f5f31825f7d113872b017a3163e7a2ef1f56e8529eee1e36b626f78888f2014 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920003.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 114e05e2d1b9f4316d1c1f8f1a5c797c30000000200002375150b4e432432a15b25feca1e8f877bd31e43a057d735dc2ec106ed2ce782f9138d02dd6f65d0cdcd373f475eaad036a47dd8163fdf886060481d0a1b1a2972496b626f786aeb9f82 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920004.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1096c151a8ca56a6ec286a684d44fb4a200000002000023750dd605d41815705adf19cf03225c54d459071d9375007382c5cb90c8b11764ad68f202471c89d4753e30dad70cd230129f8e4ea2b82cf1dfecc93d3301da0d3e6b626f781f31fffe -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920005.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 12aef845a77d2697c8803c19fcf1b64950000000200002375757f60b7bf4949c09056c614753881a5b942991d3d13e4cd613d78edc2d24517b52d248a7d365675818b0baf95c8cc0aa718e1a055fed9afe04652b344443cb96b626f78a2a82a40 -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920006.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 11bb3b135aa74cfd5432e07914473292d0000000200002375ebb30bc3d8c37680f3162560fda6a332cf63c95159881c163c2c95372f3453f1bf8b189cca8024e6ca8f3929b167aa8f172497e76489aab5b09e08d0d4b8b5d46b626f78823ba5fe -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920007.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1c9cbeb0dd0ae25b51016ee00695ee9b400000002000023750925fdcaa8fad05a46b740bc0ba3d794fc179672063a71e3849e89a3f883433d4d7b6d3c340437198d3c03befc94622551a75ad8b6829495036fd65e4b66cb586b626f78e8f88bdf -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920008.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1db0205aaca16b1d9d6ea66d2f91f91d200000002000023757f67f0a55249a8c38b6138516a435881e111a50e1cfde77ff956f764a0fab4475c9c80df63577b452bb09952b8164f8f60ce95f71652cf0a5348e35aff521e956b626f780104520d -------------------------------------------------------------------------------- /Python/keybox/keybox/X705M/widevine/Lenovo TB-X705M-X705M-04920009.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1e0a792b18d627c4af0743a47bad4d92b0000000200002375cf2f8b41f28b335ec454736131916b5171576f29e42217de661c50b38ce4efa4e4d283b898229f3aff6f8cbcedc698b54f8469dbf490ac9bdd0c0ad2c175d0286b626f7838be5029 -------------------------------------------------------------------------------- /Python/keybox/keybox/keybox.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import sys 7 | import shutil 8 | import re 9 | import subprocess 10 | import time 11 | 12 | """ 13 | python keybox.py product model start end 14 | 参数解析: 15 | product 为项目名,如X705F,X705L,X705M 16 | model 为需要操作的keybox,如keymaster或widevine 17 | start 为需要操作keybox起始文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为0) 18 | end 为需要操作keybox结束文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为model目录下文件数目) 19 | """ 20 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 21 | orig_dir = BASE_DIR + "\\" + sys.argv[1] + "\\" + sys.argv[2] 22 | 23 | def keymaster(orig_path,obj_path,deviceid): 24 | obj_file_path = obj_path + "\\" + deviceid + ".xml" 25 | if not os.path.isfile(obj_file_path): 26 | shutil.copy(orig_path,obj_file_path) 27 | else: 28 | print("文件 %s.xml 已存在" % (deviceid)) 29 | 30 | def widevine(orig_path,obj_path,deviceid): 31 | delete_log = True 32 | obj_file_path = obj_path + "\\" + deviceid 33 | #if os.path.isdir(obj_file_path): 34 | # shutil.rmtree(obj_file_path) 35 | if not os.path.isdir(obj_file_path): 36 | os.makedirs(obj_file_path) 37 | filename = "widevine_" + deviceid + ".txt" 38 | file = open(filename,"w") 39 | file.writ 40 | if len(os.listdir(obj_file_path)) == 0: 41 | with open(filename, "w") as perl_file: 42 | perlcmd = 'perl turn.pl "{}" {}'.format(orig_path,deviceid) 43 | popfile = subprocess.Popen(perlcmd,stdout=perl_file,stderr=subprocess.PIPE) 44 | time.sleep(0.5) 45 | with open(filename, "r") as updatefile: 46 | for line in updatefile: 47 | if line.startswith("Parsing keybox data succeeds") and os.path.isfile(deviceid + "_keybox.bin"): 48 | print("DeviceId 为%s的keybox.bin转换成功" %deviceid) 49 | shutil.move(deviceid + "_keybox.bin", obj_file_path + "\\keybox.bin") 50 | break 51 | else: 52 | delete_log = False 53 | print("DeviceId 为%s的keybox.bin转换失败" % deviceid) 54 | if delete_log == True: 55 | os.unlink(filename) 56 | #popfile.terminate() 57 | else: 58 | print("文件 %s %s 已存在" %(deviceid,os.listdir(obj_file_path)[0])) 59 | 60 | if os.path.isdir(orig_dir): 61 | deviceid = None 62 | keybox_list = [] 63 | obj_dir = BASE_DIR + "\\" + sys.argv[1] + "_update" + "\\" + sys.argv[2] 64 | #if os.path.isdir(obj_dir): 65 | # shutil.rmtree(obj_dir) 66 | if not os.path.isdir(obj_dir): 67 | os.makedirs(obj_dir) 68 | for name in os.listdir(orig_dir): 69 | keybox_list.append(re.findall("-(\d+).",name)[0]) 70 | keybox_list.sort() 71 | start = int(sys.argv[3]) if len(sys.argv)>3 else 0 72 | end = (int(sys.argv[4]) + 1) if len(sys.argv)>4 else len(os.listdir(orig_dir)) 73 | total = 0 74 | for i in keybox_list[start:end]: 75 | if len(os.listdir(orig_dir)) > 0: 76 | file_name = re.sub("-(\d+).", "-" + i + ".", os.listdir(orig_dir)[0]) 77 | if file_name in os.listdir(orig_dir): 78 | orig_file_path = orig_dir + "\\" + file_name 79 | with open(orig_file_path, "r") as orig_file: 80 | for line in orig_file: 81 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 82 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 83 | break 84 | if sys.argv[2] == "keymaster": 85 | keymaster(orig_file_path,obj_dir,deviceid) 86 | elif sys.argv[2] == "widevine": 87 | widevine(orig_file_path,obj_dir,deviceid) 88 | total = total + 1 89 | else: 90 | print("文件:%s 不存在" %file_name) 91 | if len(os.listdir(obj_dir)) == total: 92 | print("%s 执行完成!!" %(sys.argv[2])) 93 | else: 94 | print("无此项目,请重新输入,谢谢!!") 95 | -------------------------------------------------------------------------------- /Python/keybox/keybox/keybox_script.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/keybox_script.zip -------------------------------------------------------------------------------- /Python/keybox/keybox/keybox_thread.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import sys 7 | import shutil 8 | import re 9 | import subprocess 10 | import time 11 | import asyncio 12 | 13 | """ 14 | python keybox.py product model start end 15 | 参数解析: 16 | product 为项目名,如X705F,X705L,X705M 17 | model 为需要操作的keybox,如keymaster或widevine 18 | start 为需要操作keybox起始文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为0) 19 | end 为需要操作keybox结束文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为model目录下文件数目) 20 | """ 21 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 22 | orig_dir = BASE_DIR + "\\" + sys.argv[1] + "\\" + sys.argv[2] 23 | sem = asyncio.Semaphore(1000) 24 | 25 | def file_list(path): 26 | for file in os.listdir(path): 27 | yield file 28 | 29 | async def copy_files(file,orig_dir_sub): 30 | sem.acquire() 31 | sub_file_path = "" 32 | sub_name = file 33 | #if sub_name in os.listdir(orig_dir): 34 | sub_file_path = orig_dir + "\\" + sub_name 35 | shutil.copy(sub_file_path, orig_dir_sub) 36 | sem.release() 37 | 38 | async def keymaster_async(orig_path,obj_path,deviceid): 39 | sem.acquire() 40 | obj_file_path = obj_path + "\\" + deviceid + ".xml" 41 | if not os.path.isfile(obj_file_path): 42 | shutil.copy(orig_path,obj_file_path) 43 | else: 44 | print("文件 %s.xml 已存在" % (deviceid)) 45 | sem.release() 46 | 47 | async def widevine_async(orig_path,obj_path,deviceid): 48 | sem.acquire() 49 | delete_log = True 50 | obj_file_path = obj_path + "\\" + deviceid 51 | #if os.path.isdir(obj_file_path): 52 | # shutil.rmtree(obj_file_path) 53 | if not os.path.isdir(obj_file_path): 54 | os.makedirs(obj_file_path) 55 | filename = "widevine_" + deviceid + ".txt" 56 | if len(os.listdir(obj_file_path)) == 0: 57 | with open(filename, "w") as perl_file: 58 | perlcmd = 'perl turn_thread.pl "{}" {}'.format(orig_path,deviceid) 59 | popfile = subprocess.Popen(perlcmd,stdout=perl_file,stderr=subprocess.PIPE) 60 | await asyncio.sleep(1) 61 | with open(filename, "r") as updatefile: 62 | for line in updatefile: 63 | if line.startswith("Parsing keybox data succeeds") and os.path.isfile(deviceid + "_keybox.bin"): 64 | print("DeviceId 为%s的keybox.bin转换成功" %deviceid) 65 | shutil.move(deviceid + "_keybox.bin", obj_file_path + "\\keybox.bin") 66 | break 67 | else: 68 | delete_log = False 69 | print("DeviceId 为%s的keybox.bin转换失败" % deviceid) 70 | if delete_log == True: 71 | os.unlink(filename) 72 | #popfile.terminate() 73 | else: 74 | print("文件 %s %s 已存在" %(deviceid,os.listdir(obj_file_path)[0])) 75 | sem.release() 76 | 77 | # async def keymaster_async(orig_path,obj_path,deviceid): 78 | # keymaster(orig_path, obj_path, deviceid) 79 | 80 | # async def widevine_async(orig_path,obj_path,deviceid): 81 | # widevine(orig_path, obj_path, deviceid) 82 | 83 | if os.path.isdir(orig_dir): 84 | deviceid = None 85 | keybox_list = [] 86 | tasks = [] 87 | copy_tasks = [] 88 | files = file_list(orig_dir) 89 | obj_dir = BASE_DIR + "\\" + sys.argv[1] + "_update" + "\\" + sys.argv[2] 90 | #if os.path.isdir(obj_dir): 91 | # shutil.rmtree(obj_dir) 92 | if not os.path.isdir(obj_dir): 93 | os.makedirs(obj_dir) 94 | for name in os.listdir(orig_dir): 95 | keybox_list.append(re.findall("-(\d+).",name)[0]) 96 | keybox_list.sort() 97 | start = int(sys.argv[3]) if len(sys.argv)>3 else 0 98 | end = (int(sys.argv[4]) + 1) if len(sys.argv)>4 else len(os.listdir(orig_dir)) 99 | total = 0 100 | """time = (end - start)//10000 101 | remainder = (end - start)%10000 102 | if time > 0: 103 | for i in range(time + 1): 104 | start = i*10000 105 | if i == time: 106 | end = start + remainder 107 | else: 108 | end = start + 10000 109 | orig_dir_sub = orig_dir + "_sub" + str(i) 110 | os.makedirs(orig_dir_sub) 111 | id = start 112 | for file in files: 113 | copy_tasks.append(asyncio.ensure_future(copy_files(file,orig_dir_sub))) 114 | id +=1 115 | if id == end: 116 | break 117 | copy_loop = asyncio.get_event_loop() 118 | copy_loop.run_until_complete(asyncio.wait(copy_tasks)) 119 | for id in keybox_list[start:end]: 120 | if len(os.listdir(orig_dir_sub)) > 0: 121 | file_name = re.sub("-(\d+).", "-" + id + ".", os.listdir(orig_dir_sub)[0]) 122 | if file_name in os.listdir(orig_dir_sub): 123 | orig_file_path = orig_dir_sub + "\\" + file_name 124 | with open(orig_file_path, "r") as orig_file: 125 | for line in orig_file: 126 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 127 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 128 | break 129 | if sys.argv[2] == "keymaster": 130 | tasks.append(asyncio.ensure_future(keymaster_async(orig_file_path,obj_dir,deviceid))) 131 | elif sys.argv[2] == "widevine": 132 | tasks.append(asyncio.ensure_future(widevine_async(orig_file_path,obj_dir,deviceid))) 133 | total = total + 1 134 | else: 135 | print("文件:%s 不存在" %file_name) 136 | loop = asyncio.get_event_loop() 137 | loop.run_until_complete(asyncio.wait(tasks)) 138 | else:""" 139 | if True: 140 | for file in files: 141 | #if len(os.listdir(orig_dir)) > 0: 142 | if True: 143 | file_name = file 144 | print(file_name) 145 | if True: 146 | orig_file_path = orig_dir + "\\" + file_name 147 | with open(orig_file_path, "r") as orig_file: 148 | for line in orig_file: 149 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 150 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 151 | break 152 | if sys.argv[2] == "keymaster": 153 | tasks.append(asyncio.ensure_future(keymaster_async(orig_file_path, obj_dir, deviceid))) 154 | elif sys.argv[2] == "widevine": 155 | tasks.append(asyncio.ensure_future(widevine_async(orig_file_path, obj_dir, deviceid))) 156 | total = total + 1 157 | else: 158 | print("文件:%s 不存在" % file_name) 159 | loop = asyncio.get_event_loop() 160 | loop.run_until_complete(asyncio.wait(tasks)) 161 | if len(os.listdir(obj_dir)) == total: 162 | #for i in range(len(os.listdir(BASE_DIR + "\\" + sys.argv[1]))): 163 | # shutil.rmtree(orig_dir + "_sub" + str(i)) 164 | print("%s 执行完成!!" %(sys.argv[2])) 165 | else: 166 | print("无此项目,请重新输入,谢谢!!") 167 | -------------------------------------------------------------------------------- /Python/keybox/keybox/keybox_thread_old.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import sys 7 | import shutil 8 | import re 9 | import subprocess 10 | import time 11 | import asyncio 12 | 13 | """ 14 | python keybox.py product model start end 15 | 参数解析: 16 | product 为项目名,如X705F,X705L,X705M 17 | model 为需要操作的keybox,如keymaster或widevine 18 | start 为需要操作keybox起始文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为0) 19 | end 为需要操作keybox结束文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为model目录下文件数目) 20 | """ 21 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 22 | orig_dir = BASE_DIR + "\\" + sys.argv[1] + "\\" + sys.argv[2] 23 | sem = asyncio.Semaphore(1000) 24 | 25 | async def copy_files(id,orig_dir_sub): 26 | sem.acquire() 27 | sub_file_path = "" 28 | sub_name = re.sub("-(\d+).", "-" + id + ".", os.listdir(orig_dir)[0]) 29 | if sub_name in os.listdir(orig_dir): 30 | sub_file_path = orig_dir + "\\" + sub_name 31 | shutil.copy(sub_file_path, orig_dir_sub) 32 | sem.release() 33 | 34 | async def keymaster_async(orig_path,obj_path,deviceid): 35 | sem.acquire() 36 | obj_file_path = obj_path + "\\" + deviceid + ".xml" 37 | if not os.path.isfile(obj_file_path): 38 | shutil.copy(orig_path,obj_file_path) 39 | else: 40 | print("文件 %s.xml 已存在" % (deviceid)) 41 | sem.release() 42 | 43 | async def widevine_async(orig_path,obj_path,deviceid): 44 | sem.acquire() 45 | delete_log = True 46 | obj_file_path = obj_path + "\\" + deviceid 47 | #if os.path.isdir(obj_file_path): 48 | # shutil.rmtree(obj_file_path) 49 | if not os.path.isdir(obj_file_path): 50 | os.makedirs(obj_file_path) 51 | filename = "widevine_" + deviceid + ".txt" 52 | if len(os.listdir(obj_file_path)) == 0: 53 | with open(filename, "w") as perl_file: 54 | perlcmd = 'perl turn.pl "{}" {}'.format(orig_path,deviceid) 55 | popfile = subprocess.Popen(perlcmd,stdout=perl_file,stderr=subprocess.PIPE) 56 | await asyncio.sleep(1) 57 | with open(filename, "r") as updatefile: 58 | for line in updatefile: 59 | if line.startswith("Parsing keybox data succeeds") and os.path.isfile(deviceid + "_keybox.bin"): 60 | print("DeviceId 为%s的keybox.bin转换成功" %deviceid) 61 | shutil.move(deviceid + "_keybox.bin", obj_file_path + "\\keybox.bin") 62 | break 63 | else: 64 | delete_log = False 65 | print("DeviceId 为%s的keybox.bin转换失败" % deviceid) 66 | if delete_log == True: 67 | os.unlink(filename) 68 | #popfile.terminate() 69 | else: 70 | print("文件 %s %s 已存在" %(deviceid,os.listdir(obj_file_path)[0])) 71 | sem.release() 72 | 73 | # async def keymaster_async(orig_path,obj_path,deviceid): 74 | # keymaster(orig_path, obj_path, deviceid) 75 | 76 | # async def widevine_async(orig_path,obj_path,deviceid): 77 | # widevine(orig_path, obj_path, deviceid) 78 | 79 | if os.path.isdir(orig_dir): 80 | deviceid = None 81 | keybox_list = [] 82 | tasks = [] 83 | copy_tasks = [] 84 | obj_dir = BASE_DIR + "\\" + sys.argv[1] + "_update" + "\\" + sys.argv[2] 85 | #if os.path.isdir(obj_dir): 86 | # shutil.rmtree(obj_dir) 87 | if not os.path.isdir(obj_dir): 88 | os.makedirs(obj_dir) 89 | for name in os.listdir(orig_dir): 90 | keybox_list.append(re.findall("-(\d+).",name)[0]) 91 | keybox_list.sort() 92 | start = int(sys.argv[3]) if len(sys.argv)>3 else 0 93 | end = (int(sys.argv[4]) + 1) if len(sys.argv)>4 else len(os.listdir(orig_dir)) 94 | total = 0 95 | time = (end - start)//10000 96 | remainder = (end - start)%10000 97 | if time > 0: 98 | for i in range(time + 1): 99 | start = i*10000 100 | if i == time: 101 | end = start + remainder 102 | else: 103 | end = start + 10000 104 | orig_dir_sub = orig_dir + "_sub" + str(i) 105 | os.makedirs(orig_dir_sub) 106 | for id in keybox_list[start:end]: 107 | copy_tasks.append(asyncio.ensure_future(copy_files(id,orig_dir_sub))) 108 | copy_loop = asyncio.get_event_loop() 109 | copy_loop.run_until_complete(asyncio.wait(copy_tasks)) 110 | for id in keybox_list[start:end]: 111 | if len(os.listdir(orig_dir_sub)) > 0: 112 | file_name = re.sub("-(\d+).", "-" + id + ".", os.listdir(orig_dir_sub)[0]) 113 | if file_name in os.listdir(orig_dir_sub): 114 | orig_file_path = orig_dir_sub + "\\" + file_name 115 | with open(orig_file_path, "r") as orig_file: 116 | for line in orig_file: 117 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 118 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 119 | break 120 | if sys.argv[2] == "keymaster": 121 | tasks.append(asyncio.ensure_future(keymaster_async(orig_file_path,obj_dir,deviceid))) 122 | elif sys.argv[2] == "widevine": 123 | tasks.append(asyncio.ensure_future(widevine_async(orig_file_path,obj_dir,deviceid))) 124 | total = total + 1 125 | else: 126 | print("文件:%s 不存在" %file_name) 127 | loop = asyncio.get_event_loop() 128 | loop.run_until_complete(asyncio.wait(tasks)) 129 | else: 130 | for id in keybox_list[start:end]: 131 | if len(os.listdir(orig_dir)) > 0: 132 | file_name = re.sub("-(\d+).", "-" + id + ".", os.listdir(orig_dir)[0]) 133 | if file_name in os.listdir(orig_dir): 134 | orig_file_path = orig_dir + "\\" + file_name 135 | with open(orig_file_path, "r") as orig_file: 136 | for line in orig_file: 137 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 138 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 139 | break 140 | if sys.argv[2] == "keymaster": 141 | tasks.append(asyncio.ensure_future(keymaster_async(orig_file_path, obj_dir, deviceid))) 142 | elif sys.argv[2] == "widevine": 143 | tasks.append(asyncio.ensure_future(widevine_async(orig_file_path, obj_dir, deviceid))) 144 | total = total + 1 145 | else: 146 | print("文件:%s 不存在" % file_name) 147 | loop = asyncio.get_event_loop() 148 | loop.run_until_complete(asyncio.wait(tasks)) 149 | if len(os.listdir(obj_dir)) == total: 150 | for i in range(len(os.listdir(BASE_DIR + "\\" + sys.argv[1]))): 151 | shutil.rmtree(orig_dir + "_sub" + str(i)) 152 | print("%s 执行完成!!" %(sys.argv[2])) 153 | else: 154 | print("无此项目,请重新输入,谢谢!!") 155 | -------------------------------------------------------------------------------- /Python/keybox/keybox/script/keybox_thread.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | import os 6 | import sys 7 | import shutil 8 | import re 9 | import subprocess 10 | import time 11 | import asyncio 12 | 13 | """ 14 | python keybox.py product model start end 15 | 参数解析: 16 | product 为项目名,如X705F,X705L,X705M 17 | model 为需要操作的keybox,如keymaster或widevine 18 | start 为需要操作keybox起始文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为0) 19 | end 为需要操作keybox结束文件名,参数为数字,如0,1,2,3 ...(可为空,默认值为model目录下文件数目) 20 | """ 21 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 22 | orig_dir = BASE_DIR + "\\" + sys.argv[1] + "\\" + sys.argv[2] 23 | sem = asyncio.Semaphore(1000) 24 | 25 | def file_list(path): 26 | for file in os.listdir(path): 27 | yield file 28 | 29 | async def copy_files(file,orig_dir_sub): 30 | sem.acquire() 31 | sub_file_path = "" 32 | sub_name = file 33 | #if sub_name in os.listdir(orig_dir): 34 | sub_file_path = orig_dir + "\\" + sub_name 35 | shutil.copy(sub_file_path, orig_dir_sub) 36 | sem.release() 37 | 38 | async def keymaster_async(orig_path,obj_path,deviceid): 39 | sem.acquire() 40 | obj_file_path = obj_path + "\\" + deviceid + ".xml" 41 | if not os.path.isfile(obj_file_path): 42 | shutil.copy(orig_path,obj_file_path) 43 | else: 44 | print("文件 %s.xml 已存在" % (deviceid)) 45 | sem.release() 46 | 47 | async def widevine_async(orig_path,obj_path,deviceid): 48 | sem.acquire() 49 | delete_log = True 50 | obj_file_path = obj_path + "\\" + deviceid 51 | #if os.path.isdir(obj_file_path): 52 | # shutil.rmtree(obj_file_path) 53 | if not os.path.isdir(obj_file_path): 54 | os.makedirs(obj_file_path) 55 | filename = "widevine_" + deviceid + ".txt" 56 | if len(os.listdir(obj_file_path)) == 0: 57 | with open(filename, "w") as perl_file: 58 | perlcmd = 'perl turn_thread.pl "{}" {}'.format(orig_path,deviceid) 59 | popfile = subprocess.Popen(perlcmd,stdout=perl_file,stderr=subprocess.PIPE) 60 | await asyncio.sleep(1) 61 | with open(filename, "r") as updatefile: 62 | for line in updatefile: 63 | if line.startswith("Parsing keybox data succeeds") and os.path.isfile(deviceid + "_keybox.bin"): 64 | print("DeviceId 为%s的keybox.bin转换成功" %deviceid) 65 | shutil.move(deviceid + "_keybox.bin", obj_file_path + "\\keybox.bin") 66 | break 67 | else: 68 | delete_log = False 69 | print("DeviceId 为%s的keybox.bin转换失败" % deviceid) 70 | if delete_log == True: 71 | os.unlink(filename) 72 | #popfile.terminate() 73 | else: 74 | print("文件 %s %s 已存在" %(deviceid,os.listdir(obj_file_path)[0])) 75 | sem.release() 76 | 77 | # async def keymaster_async(orig_path,obj_path,deviceid): 78 | # keymaster(orig_path, obj_path, deviceid) 79 | 80 | # async def widevine_async(orig_path,obj_path,deviceid): 81 | # widevine(orig_path, obj_path, deviceid) 82 | 83 | if os.path.isdir(orig_dir): 84 | deviceid = None 85 | keybox_list = [] 86 | tasks = [] 87 | copy_tasks = [] 88 | files = file_list(orig_dir) 89 | obj_dir = BASE_DIR + "\\" + sys.argv[1] + "_update" + "\\" + sys.argv[2] 90 | #if os.path.isdir(obj_dir): 91 | # shutil.rmtree(obj_dir) 92 | if not os.path.isdir(obj_dir): 93 | os.makedirs(obj_dir) 94 | for name in os.listdir(orig_dir): 95 | keybox_list.append(re.findall("-(\d+).",name)[0]) 96 | keybox_list.sort() 97 | start = int(sys.argv[3]) if len(sys.argv)>3 else 0 98 | end = (int(sys.argv[4]) + 1) if len(sys.argv)>4 else len(os.listdir(orig_dir)) 99 | total = 0 100 | """time = (end - start)//10000 101 | remainder = (end - start)%10000 102 | if time > 0: 103 | for i in range(time + 1): 104 | start = i*10000 105 | if i == time: 106 | end = start + remainder 107 | else: 108 | end = start + 10000 109 | orig_dir_sub = orig_dir + "_sub" + str(i) 110 | os.makedirs(orig_dir_sub) 111 | id = start 112 | for file in files: 113 | copy_tasks.append(asyncio.ensure_future(copy_files(file,orig_dir_sub))) 114 | id +=1 115 | if id == end: 116 | break 117 | copy_loop = asyncio.get_event_loop() 118 | copy_loop.run_until_complete(asyncio.wait(copy_tasks)) 119 | for id in keybox_list[start:end]: 120 | if len(os.listdir(orig_dir_sub)) > 0: 121 | file_name = re.sub("-(\d+).", "-" + id + ".", os.listdir(orig_dir_sub)[0]) 122 | if file_name in os.listdir(orig_dir_sub): 123 | orig_file_path = orig_dir_sub + "\\" + file_name 124 | with open(orig_file_path, "r") as orig_file: 125 | for line in orig_file: 126 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 127 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 128 | break 129 | if sys.argv[2] == "keymaster": 130 | tasks.append(asyncio.ensure_future(keymaster_async(orig_file_path,obj_dir,deviceid))) 131 | elif sys.argv[2] == "widevine": 132 | tasks.append(asyncio.ensure_future(widevine_async(orig_file_path,obj_dir,deviceid))) 133 | total = total + 1 134 | else: 135 | print("文件:%s 不存在" %file_name) 136 | loop = asyncio.get_event_loop() 137 | loop.run_until_complete(asyncio.wait(tasks)) 138 | else:""" 139 | if True: 140 | for file in files: 141 | #if len(os.listdir(orig_dir)) > 0: 142 | if True: 143 | file_name = file 144 | print(file_name) 145 | if True: 146 | orig_file_path = orig_dir + "\\" + file_name 147 | with open(orig_file_path, "r") as orig_file: 148 | for line in orig_file: 149 | if len(re.findall("DeviceID=\"(\w+)\"", line)) > 0: 150 | deviceid = re.findall("DeviceID=\"(\w+)\"", line)[0] 151 | break 152 | if sys.argv[2] == "keymaster": 153 | tasks.append(asyncio.ensure_future(keymaster_async(orig_file_path, obj_dir, deviceid))) 154 | elif sys.argv[2] == "widevine": 155 | tasks.append(asyncio.ensure_future(widevine_async(orig_file_path, obj_dir, deviceid))) 156 | total = total + 1 157 | else: 158 | print("文件:%s 不存在" % file_name) 159 | loop = asyncio.get_event_loop() 160 | loop.run_until_complete(asyncio.wait(tasks)) 161 | if len(os.listdir(obj_dir)) == total: 162 | #for i in range(len(os.listdir(BASE_DIR + "\\" + sys.argv[1]))): 163 | # shutil.rmtree(orig_dir + "_sub" + str(i)) 164 | print("%s 执行完成!!" %(sys.argv[2])) 165 | else: 166 | print("无此项目,请重新输入,谢谢!!") 167 | -------------------------------------------------------------------------------- /Python/keybox/keybox/script/turn_thread.pl: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # ParseKeybox.pl Tool 4 | # 5 | #GENERAL DESCRIPTION 6 | # parse Widevine keybox. 7 | # 8 | #USE: perl ParseKeybox.pl keybox.xml device_ID 9 | #Output: keybox.bin 10 | # 11 | #Copyright (c) 2012 Qualcomm Incorporated. 12 | #All Rights Reserved. 13 | #Qualcomm Confidential and Proprietary 14 | # 15 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ 16 | use strict; 17 | use XML::LibXML; 18 | 19 | my $myID = "DeviceID"; 20 | my $DeviceID = $ARGV[1]; 21 | 22 | my $newparser = XML::LibXML->new(); 23 | my $xmlfile = $newparser->parse_file($ARGV[0]); 24 | my $return = 0; 25 | my $filename = $DeviceID.'_keybox.bin'; 26 | 27 | 28 | #travel all keybox notes 29 | foreach my $keybox ($xmlfile->findnodes('/Widevine/Keybox')) { 30 | my $Key = $keybox->findnodes('./Key'); 31 | my $ID = $keybox->findnodes('./ID'); 32 | my $Magic = $keybox->findnodes('./Magic'); 33 | my $CRC = $keybox->findnodes('./CRC'); 34 | my @attributelist = $keybox->attributes(); 35 | $DeviceID = $attributelist[0]->to_literal; 36 | 37 | if($DeviceID eq $ARGV[1]) 38 | { 39 | #found it, print the keybox info 40 | #check it the Device length 41 | if (length($DeviceID) > 32){ 42 | print "\nError: The length of DeviceID should NOT larger than 32 bytes! \n"; 43 | last; #break 44 | } 45 | $return = 1; 46 | print "DeviceID: ", $DeviceID, "\n"; 47 | print "Key: ", $Key->to_literal, "\n"; 48 | print "ID: ", $ID->to_literal, "\n"; 49 | print "Magic: ", $Magic->to_literal, "\n"; 50 | print "CRC: ", $CRC->to_literal, "\n"; 51 | print "\n\n"; 52 | 53 | #cast string to hexadecima 54 | $Key = $Key->to_literal; 55 | $ID = $ID->to_literal; 56 | $Magic = $Magic->to_literal; 57 | $CRC = $CRC->to_literal; 58 | 59 | #print $Key, "\n"; 60 | open FILE, ">$filename" or die "Unable to create or open the keybox.bin file $!"; 61 | binmode FILE; #added by Andrew 62 | 63 | foreach my $i ( 0...(length($DeviceID) - 1 ) ) 64 | { 65 | my $char = substr($DeviceID, $i, 1); 66 | my $ascii = sprintf("%2x", ord($char)); 67 | #print FILE pack("C",$char); 68 | print FILE pack("H2",$ascii); 69 | #print pack("H2",$char), "\n"; 70 | } 71 | foreach my $i ( 0...(32 - length($DeviceID) -1) ) 72 | { 73 | print FILE "\x00"; 74 | } 75 | 76 | foreach my $i ( 0...(length($Key)/2 - 1 ) ) 77 | { 78 | my $char = substr($Key, $i*2, 2); 79 | print FILE pack("H2",$char); 80 | } 81 | 82 | foreach my $i ( 0...(length($ID)/2 - 1 ) ) 83 | { 84 | my $char = substr($ID, $i*2, 2); 85 | print FILE pack("H2",$char); 86 | } 87 | foreach my $i ( 0...(length($Magic)/2 - 1 ) ) 88 | { 89 | my $char = substr($Magic, $i*2, 2); 90 | print FILE pack("H2",$char); 91 | } 92 | 93 | foreach my $i ( 0...(length($CRC)/2 - 1 ) ) 94 | { 95 | my $char = substr($CRC, $i*2, 2); 96 | print FILE pack("H2",$char); 97 | } 98 | close FILE or die "Unable to close the keybox.bin file $!"; 99 | } 100 | } 101 | if ($return != 1) 102 | { 103 | print "ERROR: Parsing keybox file failed. \n"; 104 | die("There is no such a keybox having DeviceID = ", $ARGV[1], "\n"); 105 | } 106 | print "Parsing keybox data succeeds! \n"; -------------------------------------------------------------------------------- /Python/keybox/keybox/turn.pl: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # ParseKeybox.pl Tool 4 | # 5 | #GENERAL DESCRIPTION 6 | # parse Widevine keybox. 7 | # 8 | #USE: perl ParseKeybox.pl keybox.xml device_ID 9 | #Output: keybox.bin 10 | # 11 | #Copyright (c) 2012 Qualcomm Incorporated. 12 | #All Rights Reserved. 13 | #Qualcomm Confidential and Proprietary 14 | # 15 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ 16 | use strict; 17 | use XML::LibXML; 18 | 19 | my $myID = "DeviceID"; 20 | my $DeviceID = $ARGV[1]; 21 | 22 | my $newparser = XML::LibXML->new(); 23 | my $xmlfile = $newparser->parse_file($ARGV[0]); 24 | my $return = 0; 25 | my $filename = $DeviceID.'_keybox.bin'; 26 | 27 | 28 | #travel all keybox notes 29 | foreach my $keybox ($xmlfile->findnodes('/Widevine/Keybox')) { 30 | my $Key = $keybox->findnodes('./Key'); 31 | my $ID = $keybox->findnodes('./ID'); 32 | my $Magic = $keybox->findnodes('./Magic'); 33 | my $CRC = $keybox->findnodes('./CRC'); 34 | my @attributelist = $keybox->attributes(); 35 | $DeviceID = $attributelist[0]->to_literal; 36 | 37 | if($DeviceID eq $ARGV[1]) 38 | { 39 | #found it, print the keybox info 40 | #check it the Device length 41 | if (length($DeviceID) > 32){ 42 | print "\nError: The length of DeviceID should NOT larger than 32 bytes! \n"; 43 | last; #break 44 | } 45 | $return = 1; 46 | print "DeviceID: ", $DeviceID, "\n"; 47 | print "Key: ", $Key->to_literal, "\n"; 48 | print "ID: ", $ID->to_literal, "\n"; 49 | print "Magic: ", $Magic->to_literal, "\n"; 50 | print "CRC: ", $CRC->to_literal, "\n"; 51 | print "\n\n"; 52 | 53 | #cast string to hexadecima 54 | $Key = $Key->to_literal; 55 | $ID = $ID->to_literal; 56 | $Magic = $Magic->to_literal; 57 | $CRC = $CRC->to_literal; 58 | 59 | #print $Key, "\n"; 60 | open FILE, ">$filename" or die "Unable to create or open the keybox.bin file $!"; 61 | binmode FILE; #added by Andrew 62 | 63 | foreach my $i ( 0...(length($DeviceID) - 1 ) ) 64 | { 65 | my $char = substr($DeviceID, $i, 1); 66 | my $ascii = sprintf("%2x", ord($char)); 67 | #print FILE pack("C",$char); 68 | print FILE pack("H2",$ascii); 69 | #print pack("H2",$char), "\n"; 70 | } 71 | foreach my $i ( 0...(32 - length($DeviceID) -1) ) 72 | { 73 | print FILE "\x00"; 74 | } 75 | 76 | foreach my $i ( 0...(length($Key)/2 - 1 ) ) 77 | { 78 | my $char = substr($Key, $i*2, 2); 79 | print FILE pack("H2",$char); 80 | } 81 | 82 | foreach my $i ( 0...(length($ID)/2 - 1 ) ) 83 | { 84 | my $char = substr($ID, $i*2, 2); 85 | print FILE pack("H2",$char); 86 | } 87 | foreach my $i ( 0...(length($Magic)/2 - 1 ) ) 88 | { 89 | my $char = substr($Magic, $i*2, 2); 90 | print FILE pack("H2",$char); 91 | } 92 | 93 | foreach my $i ( 0...(length($CRC)/2 - 1 ) ) 94 | { 95 | my $char = substr($CRC, $i*2, 2); 96 | print FILE pack("H2",$char); 97 | } 98 | close FILE or die "Unable to close the keybox.bin file $!"; 99 | } 100 | } 101 | if ($return != 1) 102 | { 103 | print "ERROR: Parsing keybox file failed. \n"; 104 | die("There is no such a keybox having DeviceID = ", $ARGV[1], "\n"); 105 | } 106 | print "Parsing keybox data succeeds! \n"; -------------------------------------------------------------------------------- /Python/keybox/keybox/turn_thread.pl: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # ParseKeybox.pl Tool 4 | # 5 | #GENERAL DESCRIPTION 6 | # parse Widevine keybox. 7 | # 8 | #USE: perl ParseKeybox.pl keybox.xml device_ID 9 | #Output: keybox.bin 10 | # 11 | #Copyright (c) 2012 Qualcomm Incorporated. 12 | #All Rights Reserved. 13 | #Qualcomm Confidential and Proprietary 14 | # 15 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ 16 | use strict; 17 | use XML::LibXML; 18 | 19 | my $myID = "DeviceID"; 20 | my $DeviceID = $ARGV[1]; 21 | 22 | my $newparser = XML::LibXML->new(); 23 | my $xmlfile = $newparser->parse_file($ARGV[0]); 24 | my $return = 0; 25 | my $filename = $DeviceID.'_keybox.bin'; 26 | 27 | 28 | #travel all keybox notes 29 | foreach my $keybox ($xmlfile->findnodes('/Widevine/Keybox')) { 30 | my $Key = $keybox->findnodes('./Key'); 31 | my $ID = $keybox->findnodes('./ID'); 32 | my $Magic = $keybox->findnodes('./Magic'); 33 | my $CRC = $keybox->findnodes('./CRC'); 34 | my @attributelist = $keybox->attributes(); 35 | $DeviceID = $attributelist[0]->to_literal; 36 | 37 | if($DeviceID eq $ARGV[1]) 38 | { 39 | #found it, print the keybox info 40 | #check it the Device length 41 | if (length($DeviceID) > 32){ 42 | print "\nError: The length of DeviceID should NOT larger than 32 bytes! \n"; 43 | last; #break 44 | } 45 | $return = 1; 46 | print "DeviceID: ", $DeviceID, "\n"; 47 | print "Key: ", $Key->to_literal, "\n"; 48 | print "ID: ", $ID->to_literal, "\n"; 49 | print "Magic: ", $Magic->to_literal, "\n"; 50 | print "CRC: ", $CRC->to_literal, "\n"; 51 | print "\n\n"; 52 | 53 | #cast string to hexadecima 54 | $Key = $Key->to_literal; 55 | $ID = $ID->to_literal; 56 | $Magic = $Magic->to_literal; 57 | $CRC = $CRC->to_literal; 58 | 59 | #print $Key, "\n"; 60 | open FILE, ">$filename" or die "Unable to create or open the keybox.bin file $!"; 61 | binmode FILE; #added by Andrew 62 | 63 | foreach my $i ( 0...(length($DeviceID) - 1 ) ) 64 | { 65 | my $char = substr($DeviceID, $i, 1); 66 | my $ascii = sprintf("%2x", ord($char)); 67 | #print FILE pack("C",$char); 68 | print FILE pack("H2",$ascii); 69 | #print pack("H2",$char), "\n"; 70 | } 71 | foreach my $i ( 0...(32 - length($DeviceID) -1) ) 72 | { 73 | print FILE "\x00"; 74 | } 75 | 76 | foreach my $i ( 0...(length($Key)/2 - 1 ) ) 77 | { 78 | my $char = substr($Key, $i*2, 2); 79 | print FILE pack("H2",$char); 80 | } 81 | 82 | foreach my $i ( 0...(length($ID)/2 - 1 ) ) 83 | { 84 | my $char = substr($ID, $i*2, 2); 85 | print FILE pack("H2",$char); 86 | } 87 | foreach my $i ( 0...(length($Magic)/2 - 1 ) ) 88 | { 89 | my $char = substr($Magic, $i*2, 2); 90 | print FILE pack("H2",$char); 91 | } 92 | 93 | foreach my $i ( 0...(length($CRC)/2 - 1 ) ) 94 | { 95 | my $char = substr($CRC, $i*2, 2); 96 | print FILE pack("H2",$char); 97 | } 98 | close FILE or die "Unable to close the keybox.bin file $!"; 99 | } 100 | } 101 | if ($return != 1) 102 | { 103 | print "ERROR: Parsing keybox file failed. \n"; 104 | die("There is no such a keybox having DeviceID = ", $ARGV[1], "\n"); 105 | } 106 | print "Parsing keybox data succeeds! \n"; -------------------------------------------------------------------------------- /Python/keybox/keybox/脚本执行SOP.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox/脚本执行SOP.docx -------------------------------------------------------------------------------- /Python/keybox/keybox转换格式脚本_20180616.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/keybox转换格式脚本_20180616.zip -------------------------------------------------------------------------------- /Python/keybox/rename_keymaster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function scandir() 4 | { 5 | cd $1 6 | rename 's/ /_/g' * 7 | cd - 8 | 9 | OLDINF=$IFS 10 | IFS=$'\n\n' 11 | 12 | for file in `ls $1`; do 13 | full_path=$1/$file 14 | full_path=${full_path#./} 15 | name=${full_path##*/} 16 | path=${full_path%/*} 17 | #echo "full_path=$full_path path=$path name=$name" 18 | 19 | new_name=`sed -n '/DeviceID="/p' ${full_path}` 20 | new_name=${new_name##*DeviceID\=\"} 21 | new_name=${new_name%%\">new(); 23 | my $xmlfile = $newparser->parse_file($ARGV[0]); 24 | my $return = 0; 25 | my $filename = 'keybox.bin'; 26 | 27 | 28 | #travel all keybox notes 29 | foreach my $keybox ($xmlfile->findnodes('/Widevine/Keybox')) { 30 | my $Key = $keybox->findnodes('./Key'); 31 | my $ID = $keybox->findnodes('./ID'); 32 | my $Magic = $keybox->findnodes('./Magic'); 33 | my $CRC = $keybox->findnodes('./CRC'); 34 | my @attributelist = $keybox->attributes(); 35 | $DeviceID = $attributelist[0]->to_literal; 36 | 37 | if($DeviceID eq $ARGV[1]) 38 | { 39 | #found it, print the keybox info 40 | #check it the Device length 41 | if (length($DeviceID) > 32){ 42 | print "\nError: The length of DeviceID should NOT larger than 32 bytes! \n"; 43 | last; #break 44 | } 45 | $return = 1; 46 | print "DeviceID: ", $DeviceID, "\n"; 47 | print "Key: ", $Key->to_literal, "\n"; 48 | print "ID: ", $ID->to_literal, "\n"; 49 | print "Magic: ", $Magic->to_literal, "\n"; 50 | print "CRC: ", $CRC->to_literal, "\n"; 51 | print "\n\n"; 52 | 53 | #cast string to hexadecima 54 | $Key = $Key->to_literal; 55 | $ID = $ID->to_literal; 56 | $Magic = $Magic->to_literal; 57 | $CRC = $CRC->to_literal; 58 | 59 | #print $Key, "\n"; 60 | open FILE, ">$filename" or die "Unable to create or open the keybox.bin file $!"; 61 | binmode FILE; #added by Andrew 62 | 63 | foreach my $i ( 0...(length($DeviceID) - 1 ) ) 64 | { 65 | my $char = substr($DeviceID, $i, 1); 66 | my $ascii = sprintf("%2x", ord($char)); 67 | #print FILE pack("C",$char); 68 | print FILE pack("H2",$ascii); 69 | #print pack("H2",$char), "\n"; 70 | } 71 | foreach my $i ( 0...(32 - length($DeviceID) -1) ) 72 | { 73 | print FILE "\x00"; 74 | } 75 | 76 | foreach my $i ( 0...(length($Key)/2 - 1 ) ) 77 | { 78 | my $char = substr($Key, $i*2, 2); 79 | print FILE pack("H2",$char); 80 | } 81 | 82 | foreach my $i ( 0...(length($ID)/2 - 1 ) ) 83 | { 84 | my $char = substr($ID, $i*2, 2); 85 | print FILE pack("H2",$char); 86 | } 87 | foreach my $i ( 0...(length($Magic)/2 - 1 ) ) 88 | { 89 | my $char = substr($Magic, $i*2, 2); 90 | print FILE pack("H2",$char); 91 | } 92 | 93 | foreach my $i ( 0...(length($CRC)/2 - 1 ) ) 94 | { 95 | my $char = substr($CRC, $i*2, 2); 96 | print FILE pack("H2",$char); 97 | } 98 | close FILE or die "Unable to close the keybox.bin file $!"; 99 | } 100 | } 101 | if ($return != 1) 102 | { 103 | print "ERROR: Parsing keybox file failed. \n"; 104 | die("There is no such a keybox having DeviceID = ", $ARGV[1], "\n"); 105 | } 106 | print "Parsing keybox data succeeds! \n"; -------------------------------------------------------------------------------- /Python/keybox/turn.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/turn.zip -------------------------------------------------------------------------------- /Python/keybox/widevine/Lenovo TB-X705-TAB510PLUS-04020003.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 139ebe2cca7bf7425457c6301d175aeb10000000200002269a560f8666c4ff5ce0b509587b8a237c5b1bd31e10532e3cf2b4d0567c83b6ddb8ac81639f70078be129df68f8beebe659acc99f9f86cd56ac0406a6c99da64ab6b626f78ed151a5d -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020000.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1db520c049bc8037015daed5848138d3a00000002000022695602209646d5a88c3494f81075132403c2bfc01051e789510e293451ab606e264223e28eca07399bfba7ce0e9dfee963bf4984ce0381ec146d94a7b489e459446b626f78eee5eac9 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020001.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 176a9a151651dc4c58705dd90eea3d24a0000000200002269d8f5c6580022bd4b35aaf9d8c79d149d02732311f58f1d0e7e9b4d68cacbbdfba1dd8bd4351515562bb7a5774cf14da0f9fb52488fa4e013c44a6cb9cf9a4df66b626f782e72c5ca -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020002.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1ba33800c25a63c66793a2e5e2da340280000000200002269cfeb2581c0952cf6372888db39b22a9ee0f458a58d385ecdce3d8792124426a05dede968258695c8affc0322a4e65eb4e85c3eea0f7bf19521ecbeb0c8b8dc776b626f7821db40b8 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020003.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 139ebe2cca7bf7425457c6301d175aeb10000000200002269a560f8666c4ff5ce0b509587b8a237c5b1bd31e10532e3cf2b4d0567c83b6ddb8ac81639f70078be129df68f8beebe659acc99f9f86cd56ac0406a6c99da64ab6b626f78ed151a5d -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020004.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 196338e92e2193d38bfa616196437ce970000000200002269d0c012e378e49132e4f4ad063fccca196fec9c1c36cd2b221ba82c8f35d41910ab372b0ff0e824eddd5b5e07d138e65ee6b8b97c21ceb5f8f758bc82e79eec136b626f78bc478a9e -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020005.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 12bff54b7ce0118a0b90b3d7f8ab5c3b30000000200002269eb71e332888eae431c831c650fdd9b2ef06ff6bd9fc48e48cfb8f8b1eda87dd474f1adc468be73aa2facd8e4b2cb1fa553d52050760d4efde8bfc77bf0ec396c6b626f782d7368a3 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020006.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1334ca36ce16a3d845118314501228c810000000200002269533816ae6ee79c4f1c6b76506b525dba4ef0443ab9118bc81968fb67a4b62904cfefb4787baf35fdee5c5fc17101bf6884681b1cf6ea7fb267570e38b217c8376b626f785b93563b -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020007.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 12dfe2ab177d12115fca0477efe7dade800000002000022693489028c9a0d88d1beaf8fd7ea2dfa41370699f4676362c7c0d6e82ee443456212ec1612a41a37029f4c2c22bafe38e989e8738c222fbb51f8941a521c1868df6b626f78efe84ca1 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020008.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1871c82e06a391c4f5df04f424b8f10160000000200002269910ddd5f63e2349a7f0104a902919c2012aa0ca00367d0b15b1488fc129a271b9e04b60f703025249d3bf33a4d0589f0c1875e18a826c361e3ca43269be7178b6b626f7892d7dc11 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020009.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1aba0a6265b7e31003d42dd183893554d00000002000022697c51e11248bdbb1dc6d236ec3bb6fb1593da633d771d293fad431640bcd4f447211e81bd7b1bec88e17becb4b8b1b75148b9ef59b5b209bbc83ffd8343df935b6b626f780b0e067c -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020010.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 126008bc2bd558c1eb6708b24f965e29e000000020000226903863d26c93d1ad884bec4f02483e05dfa00a403989006e6ebe1c2f940c06c0fa6bce38268f71fa54ad038886bcd0ed322852945b38d2b32a6d17428911107e16b626f78bf42820b -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020011.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1c91ecf20eba9881551e12b99f4ba51a7000000020000226913cc9146f8015c9f7faadbec7936abd556db52e89d4b73122122bf3a60f923c02316c95622f49b5ff2e0a2a19bb54a38890d7277e9df69693ab8add4f00fa1036b626f78c4bfc476 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020012.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 18c5c9a990af408bf52510a054a77527d00000002000022694c49fe4645f5eb66de39d2e717b919ba86c5af963337f7f79cc1b8912eba6a1731e80da991c2d263f00c342169fe5fd6234dfe5d86b3f62863212747b698991c6b626f7809eecd6e -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020013.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 14288b5af6b06fc2f7d259b364873491400000002000022697d6ff28e5c9dd6310b57c08374f2f136216a4d9f20cf62ed320cfc623549748ce098341ab3c18c59f70ddb26ec5a9d9051be2015290f81f1f9089c2fcaaaa4516b626f7831b35fcb -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020014.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1ee57443adacce2fa814ca6294d24c9a40000000200002269e2443dae357fcb88129b0f876941819f0d07dede7be6040b2813786518627bf464feeeb2eee50c80768627abe0137de90452d181d2166f5bf9f6362eb41e97626b626f78d9e8afec -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020015.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 13e8eccbf8fc148789ebe0920cc0ede610000000200002269095e1e96cdcdb7cbaf484af3ec3eebcf0369496f666460bd3993f7564f63b2bc53ceee89fa06852f4f92b1aa4a176355c044f4adca2b753ffca0ceb21e9877836b626f78569de8bf -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020016.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1032f1f69f94a9bd75e395ebc35e02a2e00000002000022699d2f7a32f5130c173f43d35b8928cc61b9b62f0e1d65998769c49ba4fc8b551ab2af9069a0f6283e4d41a16fd92a55b9e24a3e8b793a0ec6e63d341773cd79546b626f787ee005a2 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020017.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1a12a3e31996af6c78d0ae44979be03bd0000000200002269e092eec792302dc3e56f27782a1d4a04973d8302b9c2202b77589911e1988332457bab84bcc8f52cea6cfc7c2bf6e5242789d02eac3c840b8676d7ab3de25d206b626f784b56074a -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020018.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 107bcc657425fd9a8cf3f67affc341bf800000002000022695d648c2b05dbc9e74659a9b0e9e551f05bc5e9b98b8035116b4d43a21a19284aff2ad33cee5a00b0af65a9e1f9d9cebd1577a8e707d2c4ef4759119ff6d369fa6b626f785a348a2e -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020019.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 16e5718f35eb9ea2ed0ef143c88a060060000000200002269ce885280674ffb2838710e2f40e099af839583fb0017cda836bf4e49361f77097870fb7aa2b86b2fc68a8e2d4be1f8abb28be1448010ab03551cb9c7d7df60de6b626f78615dc325 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020020.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1466f7cf0de7dd85d667817c82bbe14b400000002000022694e682e04053b49e21c37782d5195c2d217a8238e9af6f22e38fdf841c9eeea04fdc9975ef2a65b05e13546ea78c34896dc1cf3c4a3d1879f5fb021c0dd1ad18f6b626f7832cfe6e0 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020021.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 175ec0f27009586c5804aa81e6c590d4100000002000022693233a60cbf2a660e059c805faae8b2adaa35c5979900c3e3ac3821e4e3ae15dff9e4e36bd2d2f61c54301aacdf5492732121ba825e781c3e57cc75946684c8c66b626f78aea9bd23 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020022.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 113fe7d7074066ae3990d88ee275cb3b100000002000022691969729c3966febd577243ea959626d21d721dea44ca2a78d2f30363bb1e7eeea12d835f1d97a3bd78544e280b4464f15b8d75c6a838a7226ec441ed0f3197d06b626f7814b94028 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020023.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 101373fc780e5613ed2a872e47b1d705d0000000200002269d47d47a08b27a30e3ce2af3b825a8b75f10141d6c5e0675f25bb72763422c52127af64b157f13a931568f9f3cb2b471ea6a9e5cb70dc77cc3b464227ae8a3c056b626f7848fa789d -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020024.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 19276448c5adfd5e3b59e1baf9dd62947000000020000226966f04f812ec73729dd178732d2dbd0995bc834a9348c09c4f3b1984e7041e591d50dd7e42b3a606bbf0d457a65b19b1d719843e539fa4210a07f0ad8fdfcf3e66b626f78b296bbac -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020025.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1adc1b193842438caa908da222a10bc1c00000002000022690dcb54c3701af14f0205f7f960defc66ffe8fe38375c026c25e4d9905860db8c04d9c04dd40fa1bd5f1dd2c36e86abf8ea84d6ca42794ea0ce8de1028a8ce3526b626f78747e4a69 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020026.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1012e9a09288f88ee4810aa766124dd140000000200002269866bfddffca1bffce854335e07306ad7436c17a7be1e9c20e1e24a67b491916fec3193bd2c052d42ce7a92c68bbaadb758a3dc582ee8cbd94731db7ed73494a96b626f786d6d7f22 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020027.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 173be05d6ab4918ab43698bb5e5b449a200000002000022692b884d2c9661482d39bc13229fcad1dcd0c321a267a8e615ea6d66904c2e043c5497aa1acdc3204c59717b050c4b12876a2733971616e17698046e2ce11226b76b626f78a9e4e1b0 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020028.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1bb4b20cb24755b97d1c3bc440a5d44560000000200002269523d17f2b4b58cdd07b820da14a00617485046275d330cc833e654e23d8891e7f53af10ebb96c79b72c2d692eec30d3ec73914b70011dfedc22a6eac67fb95736b626f78c7c22c35 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020029.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1334a7db514fc3baaa1a3ca4515c80abc0000000200002269f097e4dc3a6919e294a11a43b6269986f14f57739e1cae671f71b7403037d2929d3113d25481fa8709a9514601c56519b378ace678a18d5b3f79ca3808f01c366b626f7800dc1620 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020030.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1b1963b1afbbc1d8a1714d6ad312d541500000002000022697aa962f2cb4b0c8d39e82084b9199a08898e13c884e82f874573ed95e66250dda516dc112e7e1e90150281a7155af4964834db9be1a6b3e87b0c6f9d2dccc7936b626f782115310a -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020031.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1a99601046554193dcebdf18c282e165e00000002000022695d09542c44ecb33bd6733624032a05b6c2e7f2bac62477edf30c453587a84e1728dd8458b285064f20336b0db30be6db61a4172f5028e09e72ef6c136b819f796b626f78a08640d6 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020032.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1e0c62738bd78739685c7f6b335e8576700000002000022693038f52f0c0d8739d74760850b7eeb8cf447174e9ba2e4fa5727fcc52ee12a8665aa8491e81d05181505efe83b562cf97049541e042c0e9d47d284e59a52dd2f6b626f780d92d8fa -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020033.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 19342da56294128a0e4b5e73d6c2af23e0000000200002269e837c78c3555509516fdaa6756e3fe119c71c387b9fe0484c1cb04a2bbd583d7f25f261c20c8a797cff68fde0946341fe7d2fb7a73b511381ea1aa6b71e08e136b626f780459bcc3 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020034.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1ebf0c1eeb16fd16ac0236cda5587b74c000000020000226952c395f7917e86b54314dce8075d1602fe0f215fbabd9d33c54d433f3585cb35a325044b443a3f8527a7e6c53af70c80d2bddc7fbbdf1cffa7b78eb59493f2536b626f78c03b0124 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020035.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1b9df4831219c27c23401c31c1e4eeaea0000000200002269224b478db6873fbc7ea36db53d9f798d80a3d45417ab3eb83de399577f1b4c2f666d80980618fe5bb9a9c98d925499917e81420c9d56fb3027e45695cc7dd7a96b626f78eb6fb81d -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020036.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 191d1e6a27af22298f6cb4006405c30cb000000020000226987197c2d8dfc049dffb3c15bf378d0b480be40cdde794f40b6e68a5a9ce6fb6d6293ff2f3c7a0d5a4f3e544cb059d599c844e8436a5637dcb7fefcc089ba33ee6b626f78a454571d -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020037.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1b25a7f51aec360cc1f258c9cc279fa1100000002000022691d4cf0de70fcee37f5bc95e25b75d2bc16160d82aa611a3d58e39a5991d39b8b7a47c33988b956264823f724ea89d86b98f3c2905c574fb2208244567da0fbd26b626f7807f997f7 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020038.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1b1ffaccf646317395a96350b45ccbd9e00000002000022694fa41d7ef5c32594aa45101792226c6e7297aceff63a491097af7ae4f93bc91b329341feebcb50a3d999def4b0c489fa93f47ab1cd355f7979686b6693a7bc4f6b626f78be068981 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020039.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1a8ec061dd62359c03ee54fe41213aa3100000002000022698272a08b2dee88dd33dce4f3b2109098fce7ba03d369badeff3a06a33795192af248e9491c2a177fb0495acf1fee856b1e5ba044977d9ff3c94b4536fbe172036b626f7842f25836 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020040.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1b4fe0bd1827581dbbbbcc395fe7d994e000000020000226910a3135af80467213a38fe87f76a68e148fa87f9a6df26445111150e9ce6312c4dc7d987bf96a1b75053f2046e46aa6a51b3e4f4d1f4c994b767b5dd84e7af426b626f78435042f3 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020041.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1e7bbda62322fa3a1d112024e4b0e857c0000000200002269507536caa4a504ba2aaad79c3dbd0c05481c221fd3f0750c2325dee6825224d432ba9d8483d8f324fc4bfab7c18f03c40924438b47c4a88452f5789ded9aadd36b626f78f10ff775 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020042.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 18f34f4ea937518d4d71cd0d10f55adb800000002000022697b1f870100b5168b73bc646e2f70d78487081838eaffdc5e2b2f7db5014a9357ebd6652831e8cdecdc21195770cece7e6a4ee19fa92b0555e760c9d6c4ea04ff6b626f78662a60a5 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020043.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 15168ea22557b4a135767de831a9b27c70000000200002269b39a7034167a2b3f3d91282c3b2f49500533c5efb74b00ab5ad7c334fc36d856ec8a818f220d3d706139ce88bc07359f7e4f226f50401317e8204483d35937016b626f785df248f5 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020044.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1879c65bdd85e7bc1940ceff46ade075b00000002000022695c42b1b4650c0c8903b10dc193e3c76e4e5f297edb5c78a3d54128ef933a9bcfdff5fef259bb2f04230a0f465c1783d5cb76ae2b64b3667b792984952c6510c96b626f78c8ac6df0 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020045.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1fc6fe63f17cd7997f27f5d31d9cdee67000000020000226932a663a7927b3ef6c2c6d3c670b1701f006f8769775c0e4be91141db15f3525037c35ce914ec9196b5c28755102b62f379423da5d23a67beb73c3f1335e7354c6b626f782618a932 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020046.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1ffb09f028c2888fdaf9688a505a0e744000000020000226987dd193107011796af5cd5c295179b25f42236ecf7c7104ad14d2ce68c58e896ace782e8d5bf77a4e69bc4deb5641e04dfaf46cb892efa67834b61d857e8b0b66b626f78edc489b5 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020047.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 14dc5f748751649d703a782ffc9240ada00000002000022695f52e78c613912bae80b28f8667ac619283149ddeb22221773958d95894bd393434aeb84369c1e250c9138f9c9b34868d2da71848f915dfa439dec407339d2816b626f78aada4670 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020048.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 125063d3811d86d93133cfe29a7860c1b000000020000226970c9c070213ef6de9ce519949549af59b141469b3f5b76b34bc4ee1cd8a4b2fce0148c31efdb8445c659e39474071981c06e78f1ecb3bd5143145edfc86ab8ea6b626f782ba622c1 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020049.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 11dc0147c3d962a9ff11e582d0d91c6ee0000000200002269e01c4f8f683b300d574aded1982ee7cf158ab5a7180c076b8b1be33be6af48444606e4bc8aaced80cdf3ae7c689346db0b9d096d60fc20ed9fa289fcda1d53c76b626f78bcffddd8 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020050.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 10ea5f8ed82c680e8ad7b909939b278ff0000000200002269c37397d2a5dcd33a2085ecd1c81e4b6cc1e6b0fb02e5990f3188eee4a1430416d7303d2a10b7bf6c00fb2fa3c9ad398bedc4bd9c9915502035b1a3b0c1ddfc8c6b626f78b4eaedef -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020051.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1c69fd447f531a90d4eb1adcc516de18d00000002000022697dabaad5157fcdedf3550d4a96879545ed51b639f401fe3460fe79b2431a6c68d205381a89c250f6958e2e6048eb2187a7fd803af753f47b57341baf95a912fe6b626f78f3b129ab -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020052.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 113f36f725dd1272cc639acef7e99b5410000000200002269aba36935e413f7307b0f4094d26949397b7beb70556f967b31207f4e3a6e6cbdbd40bf1f6e7285371b93fd99c6261fbc2e1252446dc5418273271bb759874b716b626f78efa87b57 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020053.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1037bca6351bb2f58c42cfcb2b4d567d40000000200002269f1789a2111c7c0cfbfa539bccece6f2225b6d32246149565b12963849ef2420318e94dc081e191e5febf731a426753fd9305a5c276745eb08091bf459dd04abb6b626f78ddf2bc42 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020054.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 149cc1037a1888d0a32872b761e7e14d80000000200002269164eea07d4fcd1340d2f72c7af07c88807f9beff688beb351e5342ccb9f353f56e4abe63051aa06cd4be3ef5ba447ab6f57a22b1e8fd5c922cd194041de4f0046b626f78d8e97f6a -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020055.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1c69fed0227557d50fb65cb82c2d54a44000000020000226980a816eeb1aa9e18d84b5be55561f3ba34352cb54583213b8e975598eadfda4dc5fb9b516ff581d4a830f5f13a380624b5d7f29f244dc96b1689fc0f2ad1b6c86b626f785e637dd8 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020056.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1a366b70f3e7041dbc5bc4cfc3c149ca100000002000022690130a5b1f92b1dc997404a6769b68a8d0bda7a80bb5e23508a9e226419bb5f48e80c7d7c2fc7d0fbd53bf380b525c01be80c04deb96b0bf2e6b3810542dfb74e6b626f78347ad15c -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020057.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1d3e67021e3d5881a2a7138214ed8f155000000020000226947cb8ee235370c778e25c529fb6e62a137da532136d968f05347d411a7ac9902cabbe36b30055067d408df52d1a840df12aba5654ad2044c8091f81d2433a09c6b626f78060f3b8a -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020058.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1553f3d7b8403e8f548c509e262011eaf00000002000022693218fe7b642a47f1b6f7dc008fd351c48be2d34b3d92471c7e966c77c987479ddc5c45b83ce6f26b8bef3ebcb0153d1a0f3895cb9787bcb11e9e16bc6ec0a43b6b626f78d9629c3c -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020059.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1837108268b2dcea7eb847030c68cbfe9000000020000226918dcd862ccff45568b7441dfa247954908e0f7d92c74431e06becf3f5e6e5fa1e9b1b573dd4c93d1d4d4bbddf2628d09b3a268c3c42da876034bc121b05e19e76b626f784ebd5098 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020060.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1e4d60adc144171fd50197b27ec44381d000000020000226971537a66f7fa480755d5188a5a14fe36f9ae20349a3236b76994605cbb2be33b9d9ba5ac3d4c703f6fb3d8dc0191058740778469e11b516aa0567a10f6c902836b626f787037298a -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020061.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 17e7ebbd82f53e82055b3b3e5ec54d35c0000000200002269c385377587fbd4d9d0366f4d8879ac3a09196a1f27196c2a4795ed966b1e4e3fe4955fa16b27441226a64a47927dfc5b235495fafb77fb07d359043c8a9ce41b6b626f78f004b3eb -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020062.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 186f860848836756e78fa124096bfae7a0000000200002269854c768ae22518dd2b7ea71bebabb827c67eee65e1be29c8bc7c14bd3b473619f1e65c3234a26b7f1ae6bc8bae11f071b81d7413ba1a00c736ff861152771cd36b626f7823eb1ac5 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020063.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 180c7b3b93ea6fdb2b0e4ee4382ff197600000002000022690b99fd8c7b39fa9de6d2318d66674965cf23f6b158c000dedae000a7d035cf01632d2665e78d8b0299cbbcbe4be1f0cab29079418350c1d04a3ffde90d8644416b626f781ea70328 -------------------------------------------------------------------------------- /Python/keybox/widevine/PTO19990199012/Lenovo TB-X705-TAB510PLUS-04020064.bin.secure: -------------------------------------------------------------------------------- 1 | 2 | 1592bfcfe03ea3dec68221b553e69318d00000002000022690580380b1e39f715730d808f288fece369633f549e9002a4918fe8b82afefbc12abfa7e4e12996e02a838220a86c12519b689f8530b282ec9b7a62f564b74d166b626f78ccef1164 -------------------------------------------------------------------------------- /Python/keybox/widevine导入和验证SOP.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zybpp/Python/e947ba4ec61412b3d492726217a1db50f6af55d9/Python/keybox/widevine导入和验证SOP.docx -------------------------------------------------------------------------------- /Python/new.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | a1 = [4,6,13,24,26,42,87] 6 | a2 = [2,4,13,34,42,55,65,76,89] 7 | new = [] 8 | 9 | def f(x, l=[]): 10 | print(id(l)) 11 | for i in range(x): 12 | l.append(i**2) 13 | print(id(l)) 14 | print(l) 15 | print("#########") 16 | 17 | #print(id(f.__defaults__)) 18 | f(2) # [0, 1] 19 | #print(id(f.__defaults__)) 20 | f(3, [3, 2, 1]) # [3, 2, 1, 0, 1, 4] 21 | #print(id(f.__defaults__)) 22 | f(3) # [0, 1, 0, 1, 4] 23 | #print(id(f.__defaults__)) 24 | f(4) -------------------------------------------------------------------------------- /Python/python编程快速上手/第七章正则表达式/pwdverify.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import re 6 | 7 | def pwdverify(str): 8 | pwdRegex = re.compile("") 9 | if len(str) >= 8: 10 | pass 11 | else: 12 | print("字符串长度不少于8个字符!") -------------------------------------------------------------------------------- /Python/python编程快速上手/第七章正则表达式/strip.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import re 6 | 7 | def own_strip(str,replace=None): 8 | if replace == None: 9 | replaceRegex = re.compile(r"(^\s*)(\S.*\S)(\s*$)",re.DOTALL) 10 | string = replaceRegex.search(str) 11 | return string[2] 12 | 13 | if __name__ == "__main__": 14 | while True: 15 | str = input("请输入内容:") 16 | new_str = own_strip(str) 17 | print(new_str) 18 | -------------------------------------------------------------------------------- /Python/python编程快速上手/第三章函数/collatz.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | def collatz(number): 6 | if number%2 == 0: 7 | return number//2 8 | elif number%2 == 1: 9 | return (3*number + 1) 10 | 11 | print("Please enter number:") 12 | num = int(input()) 13 | while True: 14 | num = collatz(num) 15 | print(str(num)) 16 | if num == 1: 17 | break -------------------------------------------------------------------------------- /Python/python编程快速上手/第三章函数/guess_number.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | # This is a guess the number game. 5 | import random 6 | 7 | secretNumber = random.randint(1,20) 8 | print("I am thinking of a number between 1 and 20,you can only guess at most six times.") 9 | 10 | for i in range(1,7): 11 | print("Take a guess.") 12 | num = int(input()) 13 | if num < secretNumber: 14 | print("Your guess is too low.") 15 | elif num > secretNumber: 16 | print("Your guess is too high.") 17 | else: 18 | print("Good job! You guessed my number in " + str(i) + " guesses!") 19 | break 20 | if num != secretNumber: 21 | print("Nope. The number I was thinking of was " + str(secretNumber)) 22 | 23 | 24 | -------------------------------------------------------------------------------- /Python/python编程快速上手/第五章字典/addtoinventory.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | def addToInventory(inventory, addedItems): 6 | for drag in addedItems: 7 | inventory.setdefault(drag,0) 8 | inventory[drag] += 1 9 | return inventory 10 | 11 | def displayInventory(inventory): 12 | print("Inventory:") 13 | total = 0 14 | for k,v in inventory.items(): 15 | print(str(v) + " " + k) 16 | total += v 17 | print("Total number of items: ",str(total)) 18 | 19 | if __name__ == "__main__": 20 | inv = {'gold coin': 42, 'rope': 1} 21 | dragonLoot = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby'] 22 | inv = addToInventory(inv, dragonLoot) 23 | displayInventory(inv) -------------------------------------------------------------------------------- /Python/python编程快速上手/第五章字典/characterCount.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | message = "It was a bright cold day in April, and the clocks were striking thirteen." 6 | count = {} 7 | 8 | for character in message: 9 | count.setdefault(character,0) 10 | count[character] += 1 11 | 12 | print(count) -------------------------------------------------------------------------------- /Python/python编程快速上手/第五章字典/displayInventory.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | stuff = {'rope': 1, 'torch': 6, 'gold coin': 42, 'dagger': 1, 'arrow': 12} 5 | 6 | def displayInventory(dict): 7 | print("Inventory:") 8 | count_total = 0 9 | for k,v in dict.items(): 10 | print(str(v) + " " + k) 11 | count_total += v 12 | print("Total number of items:%d" %count_total) 13 | 14 | if __name__ == "__main__": 15 | displayInventory(stuff) -------------------------------------------------------------------------------- /Python/python编程快速上手/第八章读写文件/capitalsquiz_answers1.txt: -------------------------------------------------------------------------------- 1 | 1. B 2 | 2. D 3 | 3. A 4 | 4. D 5 | 5. D 6 | 6. B 7 | 7. D 8 | 8. D 9 | 9. C 10 | 10. B 11 | 11. A 12 | 12. C 13 | 13. B 14 | 14. D 15 | 15. D 16 | 16. D 17 | 17. C 18 | 18. B 19 | 19. B 20 | 20. D 21 | 21. A 22 | 22. C 23 | 23. C 24 | 24. D 25 | 25. A 26 | 26. D 27 | 27. D 28 | 28. C 29 | 29. A 30 | 30. D 31 | 31. B 32 | 32. B 33 | 33. C 34 | 34. A 35 | 35. A 36 | 36. C 37 | 37. A 38 | 38. A 39 | 39. C 40 | 40. B 41 | 41. C 42 | 42. D 43 | 43. A 44 | 44. B 45 | 45. A 46 | 46. C 47 | 47. B 48 | 48. B 49 | 49. D 50 | 50. D 51 | -------------------------------------------------------------------------------- /Python/python编程快速上手/第八章读写文件/capitalsquiz_answers2.txt: -------------------------------------------------------------------------------- 1 | 1. B 2 | 2. B 3 | 3. B 4 | 4. D 5 | 5. D 6 | 6. A 7 | 7. D 8 | 8. C 9 | 9. A 10 | 10. D 11 | 11. D 12 | 12. A 13 | 13. C 14 | 14. A 15 | 15. D 16 | 16. C 17 | 17. C 18 | 18. A 19 | 19. B 20 | 20. A 21 | 21. B 22 | 22. C 23 | 23. C 24 | 24. C 25 | 25. A 26 | 26. A 27 | 27. D 28 | 28. D 29 | 29. A 30 | 30. C 31 | 31. A 32 | 32. B 33 | 33. A 34 | 34. D 35 | 35. B 36 | 36. D 37 | 37. B 38 | 38. B 39 | 39. D 40 | 40. D 41 | 41. A 42 | 42. D 43 | 43. A 44 | 44. A 45 | 45. A 46 | 46. C 47 | 47. D 48 | 48. A 49 | 49. B 50 | 50. D 51 | -------------------------------------------------------------------------------- /Python/python编程快速上手/第八章读写文件/mcb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | # mcb.pyw - Saves and loads pieces of text to the clipboard. 6 | # Usage: python mcb.py save - Saves clipboard to keyword. 7 | # python mcb.py - Loads keyword to clipboard. 8 | # python mcb.py list - Loads all keywords to clipboard. 9 | # python mcb.py delete - Loads all keywords to clipboard. 10 | import shelve, pyperclip, sys 11 | mcbShelf = shelve.open('mcb') 12 | # Save clipboard content. 13 | if len(sys.argv) == 3 and sys.argv[1].lower() == 'save': 14 | mcbShelf[sys.argv[2]] = pyperclip.paste() 15 | elif len(sys.argv) == 2: 16 | # List keywords and load content. 17 | if sys.argv[1].lower() == 'list': 18 | pyperclip.copy(str(list(mcbShelf.keys()))) 19 | elif sys.argv[1] in mcbShelf: 20 | pyperclip.copy(mcbShelf[sys.argv[1]]) 21 | 22 | mcbShelf.close() -------------------------------------------------------------------------------- /Python/python编程快速上手/第八章读写文件/randomQuizGenerator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | # randomQuizGenerator.py - Creates quizzes with questions and answers in 5 | # random order, along with the answer key. 6 | 7 | import random 8 | # The quiz data. Keys are states and values are their capitals. 9 | capitals = {'Alabama': 'Montgomery', 'Alaska': 'Juneau', 'Arizona': 'Phoenix', 10 | 'Arkansas': 'Little Rock', 'California': 'Sacramento', 'Colorado': 'Denver', 11 | 'Connecticut': 'Hartford', 'Delaware': 'Dover', 'Florida': 'Tallahassee', 12 | 'Georgia': 'Atlanta', 'Hawaii': 'Honolulu', 'Idaho': 'Boise', 'Illinois': 13 | 'Springfield', 'Indiana': 'Indianapolis', 'Iowa': 'Des Moines', 'Kansas': 14 | 'Topeka', 'Kentucky': 'Frankfort', 'Louisiana': 'Baton Rouge', 'Maine': 15 | 'Augusta', 'Maryland': 'Annapolis', 'Massachusetts': 'Boston', 'Michigan': 16 | 'Lansing', 'Minnesota': 'Saint Paul', 'Mississippi': 'Jackson', 'Missouri': 17 | 'Jefferson City', 'Montana': 'Helena', 'Nebraska': 'Lincoln', 'Nevada': 18 | 'Carson City', 'New Hampshire': 'Concord', 'New Jersey': 'Trenton', 'New Mexico': 19 | 'Santa Fe', 'New York': 'Albany', 'North Carolina': 'Raleigh','North Dakota': 20 | 'Bismarck', 'Ohio': 'Columbus', 'Oklahoma': 'Oklahoma City','Oregon': 21 | 'Salem', 'Pennsylvania': 'Harrisburg', 'Rhode Island': 'Providence', 22 | 'South Carolina': 'Columbia', 'South Dakota': 'Pierre', 'Tennessee': 23 | 'Nashville', 'Texas': 'Austin', 'Utah': 'Salt Lake City', 'Vermont': 24 | 'Montpelier', 'Virginia': 'Richmond', 'Washington': 'Olympia', 'WestVirginia': 25 | 'Charleston', 'Wisconsin': 'Madison', 'Wyoming': 'Cheyenne'} 26 | 27 | # Generate 35 quiz files. 28 | for quizNum in range(2): 29 | # Create the quiz and answer key files. 30 | quizFile = open('capitalsquiz%s.txt' % (quizNum + 1), 'w') 31 | answerKeyFile = open('capitalsquiz_answers%s.txt' % (quizNum + 1), 'w') 32 | # Write out the header for the quiz. 33 | quizFile.write('Name:\n\nDate:\n\nPeriod:\n\n') 34 | quizFile.write((' ' * 20) + 'State Capitals Quiz (Form %s)' % (quizNum + 1)) 35 | quizFile.write('\n\n') 36 | # Shuffle the order of the states. 37 | states = list(capitals.keys()) 38 | random.shuffle(states) 39 | # Loop through all 50 states, making a question for each. 40 | for questionNum in range(50): 41 | # Get right and wrong answers. 42 | correctAnswer = capitals[states[questionNum]] 43 | wrongAnswers = list(capitals.values()) 44 | del wrongAnswers[wrongAnswers.index(correctAnswer)] 45 | wrongAnswers = random.sample(wrongAnswers, 3) 46 | answerOptions = wrongAnswers + [correctAnswer] 47 | random.shuffle(answerOptions) 48 | # Write the question and the answer options to the quiz file. 49 | quizFile.write('%s. What is the capital of %s?\n' % (questionNum + 1,states[questionNum])) 50 | for i in range(4): 51 | quizFile.write(' %s. %s\n' % ('ABCD'[i], answerOptions[i])) 52 | quizFile.write('\n') 53 | # Write the answer key to a file. 54 | answerKeyFile.write('%s. %s\n' % (questionNum + 1, 'ABCD'[answerOptions.index(correctAnswer)])) 55 | quizFile.close() 56 | answerKeyFile.close() -------------------------------------------------------------------------------- /Python/python编程快速上手/第六章字符串/picnicTable.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | def printPicnic(itemsDict, leftWidth, rightWidth): 6 | print('PICNIC ITEMS'.center(leftWidth + rightWidth, '-')) 7 | for k, v in itemsDict.items(): 8 | print(k.ljust(leftWidth, '.') + str(v).rjust(rightWidth)) 9 | picnicItems = {'sandwiches': 4, 'apples': 12, 'cups': 4, 'cookies': 8000} 10 | printPicnic(picnicItems, 12, 5) 11 | printPicnic(picnicItems, 20, 6) -------------------------------------------------------------------------------- /Python/python编程快速上手/第六章字符串/printtable.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | tableData = [['apples', 'oranges', 'cherries', 'banana'], 6 | ['Alice', 'Bob', 'Carol', 'David'], 7 | ['dogs', 'cats', 'moose', 'goose']] 8 | 9 | def printTable(list): 10 | length = 0 11 | if len(list) > 0: 12 | for i in range(len(list)): 13 | for j in range(len(list[i])): 14 | if len(list[i][j]) > length: 15 | length = len(list[i][j]) 16 | for i in range(len(list[0])): 17 | for j in range(len(list)): 18 | #list[j][i].rjust(colWidths[j]) 19 | print(list[j][i].rjust(length),end="") 20 | print() 21 | 22 | if __name__ == "__main__": 23 | printTable(tableData) -------------------------------------------------------------------------------- /Python/python编程快速上手/第四章列表/字符图网格.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | grid = [['.', '.', '.', '.', '.', '.'], 6 | ['.', 'O', 'O', '.', '.', '.'], 7 | ['O', 'O', 'O', 'O', '.', '.'], 8 | ['O', 'O', 'O', 'O', 'O', '.'], 9 | ['.', 'O', 'O', 'O', 'O', 'O'], 10 | ['O', 'O', 'O', 'O', 'O', '.'], 11 | ['O', 'O', 'O', 'O', '.', '.'], 12 | ['.', 'O', 'O', '.', '.', '.'], 13 | ['.', '.', '.', '.', '.', '.']] 14 | 15 | def landscape(list): 16 | len1 = len(list) 17 | len2 = len(list[0]) 18 | for i in range(len2): 19 | for j in range(len1): 20 | print(list[j][i],end="") 21 | print() 22 | 23 | if __name__ == "__main__": 24 | landscape(grid) -------------------------------------------------------------------------------- /Python/python编程快速上手/第四章列表/逗号代码.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | def listToStr(list): 6 | str = "" 7 | for l in list: 8 | if l == list[-1]: 9 | str = str + "and " + l 10 | else: 11 | str = str + l +", " 12 | print(str) 13 | 14 | spam = ['apples', 'bananas', 'tofu', 'cats'] 15 | listToStr(spam) -------------------------------------------------------------------------------- /Python/python高级编程/第一章正则表达式/re.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | import re 5 | 6 | name = "hzjiodhaifhi" 7 | 8 | a = re.search("hai",name).group() 9 | print(a) 10 | -------------------------------------------------------------------------------- /Python/spider/apk_automate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zpp 4 | 5 | import requests 6 | import re 7 | import sys 8 | import urllib 9 | import socket 10 | 11 | class spider(object): 12 | """ 13 | getsource : 14 | geteveryapp: 15 | saveinfo: 16 | saveinfo: 17 | """ 18 | def __init__(self): 19 | print("开始爬取豌豆荚网页上下载排名前1000 apk应用".center(50,"-")) 20 | 21 | def getsource(self,url): 22 | html = requests.get(url) 23 | return html.text 24 | 25 | def geteveryapp(self, source): 26 | everyapp = re.findall('', source, re.S) 27 | return everyapp 28 | 29 | def getinfo(self, eachclass): 30 | str1 = re.findall('', eachclass, re.S) 31 | app_name = re.search('"(.*?)"',re.search('data-app-name=".*?"', str1[0]).group(0)).group(0).split("\"")[1] 32 | app_url = re.search('"(.*?)"', re.search('href=".*?"', str1[0]).group(0)).group(0).split("\"")[1] 33 | info = {app_name:app_url} 34 | return info 35 | 36 | def saveinfo(self, classinfo): 37 | with open('apk_info', 'w',encoding="utf-8") as f: 38 | for each in classinfo: 39 | f.write(str(each)) 40 | f.write("\n") 41 | 42 | def auto_down(self, url): 43 | try: 44 | requests.post(url) 45 | except socket.timeout: 46 | count = 1 47 | while count <= 15: 48 | try: 49 | urllib.urlretrieve(url, filename) 50 | break 51 | except socket.timeout: 52 | err_info = 'Reloading for %d time' % count if count == 1 else 'Reloading for %d times' % count 53 | print(err_info) 54 | count += 1 55 | if count > 15: 56 | print("下载失败") 57 | 58 | class phone(object): 59 | def __init__(self): 60 | pass 61 | 62 | def install(self): 63 | pass 64 | 65 | def uninstall(self): 66 | pass 67 | 68 | if __name__ == '__main__': 69 | appinfo = [] 70 | url = 'http://www.wandoujia.com/top/app' 71 | appurl = spider() 72 | html = appurl.getsource(url) 73 | every_app = appurl.geteveryapp(html) 74 | for each in every_app: 75 | info = appurl.getinfo(each) 76 | appinfo.append(info) 77 | print(appinfo) 78 | appurl.saveinfo(appinfo) 79 | for app in appinfo: 80 | app_name = list(app.keys())[0] 81 | app_url = list(app.values())[0] 82 | print("app name : %s , app url : %s" %(app_name,app_url)) 83 | appurl.auto_down(app_url) 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python 2 | Python learn 3 | -------------------------------------------------------------------------------- /code/P100_download_logs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Author:zhangyanbin 4 | 5 | from ftplib import FTP 6 | import datetime 7 | import time 8 | import re 9 | import sched 10 | import os 11 | 12 | NATIVE_SERVER = r'net use h: "\\10.0.10.2\移动终端bg软件部\02_项目资料\联想\P100&P101\LOG\Logs" "zyb.2017" /user:"zhangyanbin"' 13 | CLIENT_FTP_SERVER = "119.233.254.21" 14 | CLIENT_USERNAME = "lenovoFT" 15 | CLIENT_PASSWORD = "ftplenovo" 16 | srcpath = "/6.Project/Tab5 10Plus/Logs" 17 | #dirpath = r"\\10.0.10.2\移动终端bg软件部\02_项目资料\联想\P100&P101\LOG\Logs" 18 | files_list = [] 19 | 20 | def ftpconnect(ftp_server,username,password): 21 | ftp = FTP() 22 | ftp.connect(ftp_server) 23 | ftp.login(username,password) 24 | print (ftp.getwelcome()) 25 | return ftp 26 | 27 | def is_same_size(ftp, localfile, remotefile): 28 | localfile_size = os.path.getsize(localfile) 29 | print (localfile_size) 30 | 31 | try: 32 | remotefile_size = ftp.size(remotefile) 33 | print (remotefile_size) 34 | except: 35 | remotefile_size = -1 36 | 37 | if remotefile_size == localfile_size: 38 | return 1 39 | else: 40 | return 0 41 | 42 | def get_client_files_list(client_ftp): 43 | dir_list = [] 44 | client_ftp.dir(dir_list.append) 45 | #print(dir_list) 46 | for i in dir_list: 47 | # try: 48 | print(i) 49 | # except UnicodeEncodeError: 50 | # print("zhangyanbin1111") 51 | # i.encode("utf-8") 52 | # print(i.decode("utf-8")) 53 | if i.startswith("d"): 54 | path = client_ftp.pwd() + "/" + re.findall("\d.:\d. (.+)",i)[0] 55 | print(path) 56 | #print(repr(path)) 57 | client_ftp.cwd(path) 58 | get_client_files_list(client_ftp) 59 | else: 60 | path = client_ftp.pwd() + "/" + re.findall("\d.:\d. (.+)",i)[0] 61 | str = re.sub("\d.:\d. (.+)",path,i) 62 | #print(str) 63 | print(str) 64 | files_list.append(str) 65 | #client_ftp.cwd("..") 66 | #print(files_list) 67 | client_ftp.cwd("..") 68 | 69 | def download_ftp_file(): 70 | current_date = datetime.date.today() 71 | print(current_date) 72 | d = (datetime.datetime.now()).strftime('%Y%m%d') 73 | print(d) 74 | 75 | #调用ftp连接函数 76 | os.system(r"net use h: /del /y") 77 | os.system(NATIVE_SERVER) 78 | #os.system(r"net view \\10.0.10.2") 79 | print(os.getcwd()) 80 | print(os.listdir("h:")) 81 | client_ftp = ftpconnect(CLIENT_FTP_SERVER,CLIENT_USERNAME,CLIENT_PASSWORD) 82 | bufsize = 1024 83 | print(srcpath) 84 | client_ftp.cwd(srcpath) 85 | print(client_ftp.pwd()) 86 | if client_ftp.pwd() == srcpath: 87 | get_client_files_list(client_ftp) 88 | print(files_list) 89 | # for name in list: 90 | # #正则过滤掉其他日期 91 | # L = re.match(d,name) 92 | # if L: 93 | # dirfile = os.path.join('v:\\flyme版本\\user', name) 94 | # print (dirfile) 95 | # flag = os.path.exists(dirfile) 96 | # print(flag) 97 | # 98 | # if not os.path.exists(dirfile): 99 | # os.makedirs(dirfile) 100 | # os.makedirs(dirfile+'\\debugs') 101 | # os.makedirs(dirfile+'\\firmware') 102 | # os.makedirs(dirfile+'\\release_notes') 103 | # 104 | # #处理QFIL文件 105 | # if not os.path.exists(dirfile+'\\QFIL.zip') or not is_same_size(ftp, dirfile+'\\QFIL.zip', name + '//bin//QFIL.zip'): 106 | # f = open(dirfile+'\\QFIL.zip','wb') 107 | # filename = 'RETR '+ name + '//bin//QFIL.zip' 108 | # print (filename) 109 | # try: 110 | # ftp.retrbinary(filename,f.write,bufsize) 111 | # except: 112 | # print ("QFIL.zip文件不存在") 113 | # 114 | # #处理debugs文件 115 | # ftp.cwd(name+'//debugs') 116 | # files = ftp.nlst() 117 | # os.chdir(dirfile+'\\debugs') 118 | # for file in files: 119 | # if not os.path.exists(dirfile+'\\debugs\\'+file) or not is_same_size(ftp, dirfile+'\\debugs\\'+file,file): 120 | # f = open(file, 'wb') 121 | # filename = 'RETR ' + file 122 | # try: 123 | # ftp.retrbinary(filename,f.write,bufsize) 124 | # except: 125 | # print ("debugs文件不存在") 126 | # 127 | # #处理firmware文件 128 | # ftp.cwd('..//firmware') 129 | # files = ftp.nlst() 130 | # os.chdir('..\\firmware') 131 | # for file in files: 132 | # if not os.path.exists(dirfile+'\\firmware\\'+file) or not is_same_size(ftp, dirfile+'\\firmware\\'+file,file): 133 | # f = open(file, 'wb') 134 | # filename = 'RETR ' + file 135 | # try: 136 | # ftp.retrbinary(filename,f.write,bufsize) 137 | # except: 138 | # print ("firmware文件不存在") 139 | # 140 | # #处理release_notes文件 141 | # ftp.cwd('..//release_notes') 142 | # files = ftp.nlst() 143 | # os.chdir('..\\release_notes') 144 | # for file in files: 145 | # if not os.path.exists(dirfile+'\\release_notes\\'+file) or not is_same_size(ftp, dirfile+'\\release_notes\\'+file,file): 146 | # f = open(file, 'wb') 147 | # filename = 'RETR ' + file 148 | # try: 149 | # ftp.retrbinary(filename,f.write,bufsize) 150 | # except: 151 | # print ("release_notes文件不存在") 152 | # 153 | # 154 | # ftp.cwd('../..') 155 | # 156 | client_ftp.quit() 157 | os.system(r"net use h: /del /y") 158 | 159 | if __name__ == '__main__': 160 | while True: 161 | download_ftp_file() 162 | time.sleep(3*60*60) 163 | 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /code/bmi.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | name=input('enter name:') 4 | h=input('enter height:') 5 | w=input('enter weight:') 6 | h=float(h) 7 | w=float(w) 8 | print(h) 9 | print(w) 10 | bmi = w / (h * h) 11 | print(bmi) 12 | if (bmi < 18.5): 13 | print("过轻") 14 | elif (18.5 < bmi < 25): 15 | print("正常") 16 | elif (25 < bmi < 28): 17 | print("过重") 18 | elif (28 < bmi < 32): 19 | print("肥胖") 20 | else: 21 | print("严重肥胖") -------------------------------------------------------------------------------- /code/grade.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | name = input('请输入学生姓名:') 5 | grade1 = input('2017年分数:') 6 | grade2 = input('2018年分数:') 7 | grade1 = float(grade1) 8 | grade2 = float(grade2) 9 | per = (grade2 - grade1) / grade1 * 100 10 | print('学生%s2018年分数较2017分数增长率为:%.2f' %(name,per)) -------------------------------------------------------------------------------- /code/hello.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | #name = input('please enter your name: ') 4 | print('Hello') 5 | -------------------------------------------------------------------------------- /code/kw_args.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | def print_scores(**kw): 5 | print(' Name Score') 6 | print('------------------') 7 | for name, score in kw.items(): 8 | print('%10s %d' % (name, score)) 9 | print() 10 | 11 | print_scores(Adam=99, Lisa=88, Bart=77) 12 | 13 | data = { 14 | 'Adam Lee': 99, 15 | 'Lisa S': 88, 16 | 'F.Bart': 77 17 | } 18 | 19 | print_scores(**data) 20 | 21 | def print_info(name, *, gender, city='Beijing', age): 22 | print('Personal Info') 23 | print('---------------') 24 | print(' Name: %s' % name) 25 | print(' Gender: %s' % gender) 26 | print(' City: %s' % city) 27 | print(' Age: %s' % age) 28 | print() 29 | 30 | print_info('Bob', gender='male', age=20) 31 | print_info('Lisa', gender='female', city='Shanghai', age=18) -------------------------------------------------------------------------------- /code/test.py: -------------------------------------------------------------------------------- 1 | from ftplib import FTP 2 | import datetime 3 | import time 4 | import re 5 | import sched 6 | import os 7 | 8 | srcpath1 = 'M1851/DailyBuildM1851/app/国内版/Nougat_Flyme6_M1851/M1851_NF6_base/user' 9 | srcpath = srcpath1.encode("utf-8").decode("latin1") #解决UnicodeEncodeError: 'latin-1' codec can't encode characters in position 9-13: ordinal not in range(256) 10 | #dirpath = r"\\10.0.10.2\\file_exchange\\版本\\flyme版本\\user" 11 | 12 | def ftpconnect(): 13 | ftp = FTP() 14 | ftp_server = '14.152.75.253' 15 | username = 'mzyude' 16 | password = '2018mzvPGhB2' 17 | ftp.connect(ftp_server,21) 18 | ftp.login(username,password) 19 | print (ftp.getwelcome()) 20 | return ftp 21 | 22 | def is_same_size(ftp, localfile, remotefile): 23 | localfile_size = os.path.getsize(localfile) 24 | print (localfile_size) 25 | 26 | try: 27 | remotefile_size = ftp.size(remotefile) 28 | print (remotefile_size) 29 | except: 30 | remotefile_size = -1 31 | 32 | if remotefile_size == localfile_size: 33 | return 1 34 | else: 35 | return 0 36 | 37 | def download_ftp_file(): 38 | #格式化取到昨天的日期 39 | #d = (datetime.datetime.now()- datetime.timedelta(days=1)).strftime('%Y%m%d') 40 | #格式化取到今天的日期 41 | d = (datetime.datetime.now()).strftime('%Y%m%d') 42 | # print (d) 43 | 44 | # print (d) 45 | #调用ftp连接函数 46 | ftp = ftpconnect() 47 | bufsize = 1024 48 | ftp.cwd(srcpath) 49 | list = ftp.nlst() 50 | for name in list: 51 | #正则过滤掉其他日期 52 | L = re.match(d,name) 53 | if L: 54 | dirfile = os.path.join(r'\\10.0.10.2\\file_exchange\\Z210\\flyme版本\\user', name) 55 | print (dirfile) 56 | flag = os.path.exists(dirfile) 57 | print(flag) 58 | 59 | if not os.path.exists(dirfile): 60 | os.makedirs(dirfile) 61 | os.makedirs(dirfile+'\\debugs') 62 | 63 | #处理QFIL文件 64 | # f = open(dirfile+'\\QFIL.zip','wb') 65 | if not os.path.exists(dirfile+'\\QFIL.zip') or not is_same_size(ftp, dirfile+'\\QFIL.zip', name + '//bin//QFIL.zip'): 66 | f = open(dirfile+'\\QFIL.zip','wb') 67 | filename = 'RETR '+ name + '//bin//QFIL.zip' 68 | print (filename) 69 | try: 70 | ftp.retrbinary(filename,f.write,bufsize) 71 | except: 72 | print ("QFIL.zip文件不存在") 73 | 74 | #处理debugs文件 75 | ftp.cwd(name+'//debugs') 76 | files = ftp.nlst() 77 | os.chdir(dirfile+'\\debugs') 78 | for file in files: 79 | # f = open(file, 'wb') 80 | if not os.path.exists(dirfile+'\\debugs\\'+file) or not is_same_size(ftp, dirfile+'\\debugs\\'+file,file): 81 | f = open(file, 'wb') 82 | filename = 'RETR ' + file 83 | try: 84 | ftp.retrbinary(filename,f.write,bufsize) 85 | except: 86 | print ("debugs文件不存在") 87 | 88 | ftp.cwd('../..') 89 | 90 | ftp.quit() 91 | 92 | if __name__ == '__main__': 93 | 94 | while True: 95 | download_ftp_file() 96 | time.sleep(3*60*60) 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /code/trim.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | def trim(s): 3 | for i in range(len(s)): 4 | if s[i:i+1] != ' ': 5 | s = s[i:len(s)] 6 | break 7 | print(s) 8 | for i in range(len(s)): 9 | if s[-i-2:-i-1] != ' ': 10 | if i == 0: 11 | s = s[-len(s):] 12 | else: 13 | s = s[-len(s):-i-1] 14 | break 15 | return s 16 | 17 | # 测试: 18 | if trim('hello ') != 'hello': 19 | print(111) 20 | s = trim('hello ') 21 | print(s) 22 | print('测试失败!') 23 | elif trim(' hello') != 'hello': 24 | print(222) 25 | s = trim(' hello') 26 | print(s) 27 | print('测试失败!') 28 | elif trim(' hello ') != 'hello': 29 | print(333) 30 | s = trim(' hello ') 31 | print(s) 32 | print('测试失败!') 33 | elif trim(' hello world ') != 'hello world': 34 | print(444) 35 | s = trim(' hello world ') 36 | print(s) 37 | print('测试失败!') 38 | elif trim('') != '': 39 | print(555) 40 | s = trim('') 41 | print(s) 42 | print('测试失败!') 43 | elif trim(' ') != '': 44 | print(666) 45 | s = trim(' ') 46 | print(s) 47 | print('测试失败!') 48 | else: 49 | print('测试成功!') -------------------------------------------------------------------------------- /code/var_args.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | def hello(greeting, *args): 5 | if (len(args)==0): 6 | print('%s!' % greeting) 7 | else: 8 | print('%s, %s!' % (greeting, ', '.join(args))) 9 | 10 | hello('Hi') # => greeting='Hi', args=() 11 | hello('Hi', 'Sarah') # => greeting='Hi', args=('Sarah') 12 | hello('Hello', 'Michael', 'Bob', 'Adam') # => greeting='Hello', args=('Michael', 'Bob', 'Adam') 13 | 14 | names = ('Bart', 'Lisa') 15 | hello('Hello', *names) # => greeting='Hello', args=('Bart', 'Lisa') --------------------------------------------------------------------------------