Skip to content

Commit 3bbfd81

Browse files
authored
Merge pull request #15 from jassics/dev
Dev
2 parents d1f3a7a + 53d2903 commit 3bbfd81

57 files changed

Lines changed: 2290 additions & 10 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,7 @@ venv.bak/
114114

115115
# Ignore text
116116
*.txt
117+
!requirements.txt
117118

118119
# Ignore mp3
119-
*.mp3
120-
121-
# Ignore png files
122-
*.png
123-
124-
# Ignore jpg files
125-
*.jpg
126-
127-
# Ignore svg files
128-
*.svg
120+
*.mp3
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import requests as req
2+
3+
base_url="https://github.com/"
4+
username = "deepraj1729"
5+
6+
url = base_url+username
7+
8+
#GET request to github for the username
9+
try:
10+
res = req.get(url)
11+
if res.status_code == 404:
12+
print("Error 404. Page not found")
13+
elif res.status_code == 200:
14+
print("Status: OK")
15+
16+
except Exception as e:
17+
print("Unable to establish connection")
18+
print(e)

basic-concepts/11-class.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
"""
2+
Parent Class
3+
"""
4+
class Laptop:
5+
def __init__(self):
6+
# minimum specs
7+
self.cpu = "i3 10th Gen"
8+
self.gpu = "MX 130"
9+
self.ram = "8 GB"
10+
self.display = "1080p"
11+
self.battery = "60 WHr"
12+
self.storage = "256 GB SSD"
13+
14+
15+
def setSpecifications(self,specs:dict):
16+
try:
17+
self.model = specs["model"]
18+
self.cpu = specs["cpu"]
19+
self.gpu = specs["gpu"]
20+
self.ram = specs["ram"]
21+
self.display = specs["display"]
22+
self.battery = specs["battery"]
23+
self.storage = specs["storage"]
24+
25+
except Exception as e:
26+
print("All attributes not passed in specs")
27+
exit()
28+
29+
def getSpecifications(self):
30+
print(f"Model: {self.model}")
31+
print(f"CPU: {self.cpu}")
32+
print(f"GPU: {self.gpu}")
33+
print(f"RAM: {self.ram}")
34+
print(f"Display: {self.display}")
35+
print(f"Battery: {self.battery}")
36+
print(f"Storage: {self.storage}")
37+
38+
39+
40+
41+
"""
42+
Single-level Inheritance
43+
(Child Class)
44+
"""
45+
class GamingLaptop(Laptop):
46+
def __init__(self,specs:dict):
47+
print("Gaming Laptop")
48+
#Set the passed specs
49+
super().setSpecifications(specs)
50+
51+
# Gaming laptoip features (extra)
52+
self.refresh_rate = "144 Hz"
53+
self.response_time = "2ms"
54+
55+
def getGamingSpecs(self):
56+
super().getSpecifications()
57+
print(f"Refresh Rate: {self.refresh_rate}")
58+
print(f"Response Time: {self.response_time}")
59+
60+
61+
62+
63+
64+
65+
if __name__ == "__main__":
66+
67+
gaming_specs = {
68+
"cpu" : "i7 12th Gen",
69+
"gpu" : "RTX 3070 Ti",
70+
"ram" : "16 GB",
71+
"display" : "1440p",
72+
"battery" : "90 WHr",
73+
"storage" : "1 TB NVME M.2 SSD"
74+
}
75+
76+
# "model": "ASUS TUF Gaming A15",
77+
78+
gl = GamingLaptop(specs=gaming_specs)
79+
gl.getGamingSpecs()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#Input in CLI
2+
input_text = input("Enter something here and then press enter.... ")
3+
print("You entered: ",input_text)
4+
5+
#Absolute or Mod
6+
n = abs(-12)
7+
print("Absolute value of -12 is: ",n)
8+
9+
#Boolean Expression
10+
x=12>19
11+
print("Bool value of expression (12<19) is ",bool(x))
12+
13+
data = {
14+
"id": 1,
15+
"name": "Ramesh",
16+
"designation":"SDE 1",
17+
"Hobbies": "Loves playing football"
18+
}
19+
20+
print(data,locals())

basic-concepts/7-regex-examples.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import re
2+
3+
urls = ["https://www.facebook.com","https://www.google.com","https://www.amazon.in"]
4+
5+
def checkValidURL(url):
6+
url_reg_ex = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?"
7+
data = re.search(url_reg_ex,url)
8+
if data is not None:
9+
return True
10+
return False
11+
12+
def parseDomain(url):
13+
domain = url.split("//")[1].split("www")[1].split(".")[1]
14+
print(domain)
15+
16+
17+
if __name__ == "__main__":
18+
for url in urls:
19+
url_status = checkValidURL(url)
20+
if url_status:
21+
parseDomain(url)
22+
23+
24+

projects/GhBot/.gitignore

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Byte-compiled / optimized / DLL files
2+
.vscode/
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
pip-wheel-metadata/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
.python-version
87+
88+
# pipenv
89+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
91+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
92+
# install all needed dependencies.
93+
#Pipfile.lock
94+
95+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
96+
__pypackages__/
97+
98+
# Celery stuff
99+
celerybeat-schedule
100+
celerybeat.pid
101+
102+
# SageMath parsed files
103+
*.sage.py
104+
105+
# Environments
106+
.env
107+
.venv
108+
env/
109+
venv/
110+
ENV/
111+
env.bak/
112+
venv.bak/
113+
114+
# Spyder project settings
115+
.spyderproject
116+
.spyproject
117+
118+
# Rope project settings
119+
.ropeproject
120+
121+
# mkdocs documentation
122+
/site
123+
124+
# mypy
125+
.mypy_cache/
126+
.dmypy.json
127+
dmypy.json
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
#Output json files
133+
output/*.json

projects/GhBot/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Deepraj
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)