{"id":21557243,"url":"https://github.com/kernel-loophole/python-exe","last_synced_at":"2025-03-18T03:24:30.396Z","repository":{"id":115786086,"uuid":"372892393","full_name":"kernel-loophole/python-exe","owner":"kernel-loophole","description":"include argprase and python practice.","archived":false,"fork":false,"pushed_at":"2023-03-08T18:24:47.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T10:46:47.612Z","etag":null,"topics":["argprase","command-line","competitive-programming","openpyxl","pytest","python","python3","records-management","socket-io","socket-programming","spider","tqdm","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kernel-loophole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-01T16:18:10.000Z","updated_at":"2022-10-10T21:09:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"11f74626-1fbf-4ba8-8d0f-18370adc2460","html_url":"https://github.com/kernel-loophole/python-exe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernel-loophole%2Fpython-exe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernel-loophole%2Fpython-exe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernel-loophole%2Fpython-exe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernel-loophole%2Fpython-exe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kernel-loophole","download_url":"https://codeload.github.com/kernel-loophole/python-exe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244148495,"owners_count":20406196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argprase","command-line","competitive-programming","openpyxl","pytest","python","python3","records-management","socket-io","socket-programming","spider","tqdm","unit-testing"],"created_at":"2024-11-24T08:11:44.767Z","updated_at":"2025-03-18T03:24:30.374Z","avatar_url":"https://github.com/kernel-loophole.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![python pratice](Python.jpeg)\n# unittest with Python\nHI\n```python\nfrom logging import raiseExceptions\nimport unittest\nfrom stringcolor import *\ndef sum(self):\n    return self**2\ndef test_your_name(self):\n    self.x=input(\"enter your name\")\n    return self.x\nclass teststing(unittest.TestCase):\n    def setUp(self):\n        self.widget = ('The widget')\n```\n# Pytest\n```python\nfrom example_test import add_two\nclass TestClass:\n    def test_task1(x):\n        assert add_two(12,12)==24\n    def test_tas2():\n        assert add_two(0,0)==0\ndef test_9():\n    assert add_two(12,0)==12\n\ndef test_check():\n    assert add_two(12,12)==24\n\n```\n# Socket Programming\n\n```python\ndef service_connection():\n    print(\"connect\")\n    conn, addr = lsock.accept()\n    print(cs(\"press 1 for send massage\\n 2 for get file \\n 3 for exit \",\"orange\"))\n    choice=int(input())\n    if choice==1:\n        try:    \n            recv_data = conn.recv(1024).decode('utf-8')        \n            print('Recieve===\u003e', cs(recv_data,\"red\"))\n        except:\n                print(\"error in recive\")\n        try:\n            \n            x=input(\" enter your message\")\n            conn.sendall(bytes(x.encode()))\n            print(cs(\"data send===\u003e\",\"red\"))\n        except:\n            print(\"error\")\n    elif choice==2:\n        name_of_file=input(\"enter the name of file you wanted to put Data\")\n```\n\n# Scrapy\n```python\nfrom fileinput import filename\nfrom unicodedata import name\nfrom django import urls\nimport scrapy\n# classes are spider, item, and fields\nclass Spider(scrapy.Spider):\n    #name: identifies the Spider. It must be unique within a project, that is, you can’t set the same name for different\n       #Spiders.\n    name = \"spider\"\n    def start_requests(self):\n    \n        start_urls = ['http://quotes.toscrape.com/page/1/',\n\n\n        'http://kernel-loophole.github.io/This-Is-Hiader/',]\n        for url in start_urls:\n            yield scrapy.Request(url=url, callback=self.parse)\n    def parse(self, response):\n        page=response.url.split(\"/\")[-2]\n        filename = f'quotes-{page}.html'\n        with open(filename, 'wb') as f:\n            f.write(response.body)\n        self.log(f'Saved file {filename}')    \n```\n# Generator Function\n```python\ndef genator(n):\n    for i in range(n):\n        if i%2==0:\n            yield i\n        else:\n            continue\ndef check_gen(gen):\n    for i in gen:\n        print(i)\ncheck_gen(genator(10))\n```\n\n# String Pattern\n```python\nimport  random\ndef defaulter():\n    string=''' \n\n\n                 ###    ###   ###              ##\n                 ###    ###   ###               ##\n                 ##########   ###   %%%%%%%%$$$$$$##\n                 ###   ####   ###                ##\n                 ###   ####   ###              ##\n                                              ## \n                 \n            '''\n    print(string)\ndef ran():\n    s=['ali','junaid','hamza','Zain','samad']\n    s.sort()\n    for i in range(0,len(s)):\n        print(\"hello to\",s[i].title(),\"and you are invited:\")\n    for i in s:\n        if i=='this':\n            s.remove(i)\n    for item in range(0,len(s)):\n        s[item]=s[item].title()\n    print(s) ```\n    \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernel-loophole%2Fpython-exe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernel-loophole%2Fpython-exe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernel-loophole%2Fpython-exe/lists"}