Formatting
This commit is contained in:
parent
0a64bb27ba
commit
b25f464a04
|
@ -158,3 +158,6 @@ cython_debug/
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
# sqlite.db
|
||||||
|
*.db
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""bcrypt_test.py
|
"""bcrypt_test_db.py
|
||||||
This module provides utilities for user authentication, including functions to
|
This module provides utilities for user authentication, including functions to
|
||||||
store hashed passwords, create new users, and authenticate existing users using
|
store hashed passwords, create new users, and authenticate existing users using
|
||||||
bcrypt for password hashing and a sqlite database to store user data.
|
bcrypt for password hashing and a sqlite database to store user data.
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""
|
"""email_example.py
|
||||||
|
----------------
|
||||||
This module sends an email with the contents of a specified text file as the
|
This module sends an email with the contents of a specified text file as the
|
||||||
body. The "smtplib" and "email.message" modules are used to construct and send
|
body. The "smtplib" and "email.message" modules are used to construct and send
|
||||||
the email.
|
the email.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""pyqt_tabs.py
|
||||||
|
----------------
|
||||||
This module contains a Python script utilizing the PyQt5 library to create a
|
This module contains a Python script utilizing the PyQt5 library to create a
|
||||||
basic graphical user interface (GUI) application. The application showcases a
|
basic graphical user interface (GUI) application. The application showcases a
|
||||||
tabbed window with two tabs, each containing a grid of numbers. The first tab
|
tabbed window with two tabs, each containing a grid of numbers. The first tab
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""rand_char.py
|
||||||
|
----------------
|
||||||
Generate and Print Random Unicode Characters
|
Generate and Print Random Unicode Characters
|
||||||
|
|
||||||
This module generates a string of random Unicode characters, specifically
|
This module generates a string of random Unicode characters, specifically
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env
|
#!/usr/bin/env
|
||||||
"""
|
"""creatures.py
|
||||||
|
----------------
|
||||||
This module implements a simple console application to manage a list of creatures.
|
This module implements a simple console application to manage a list of creatures.
|
||||||
It provides functionalities to add a creature to the list, lookup creatures with
|
It provides functionalities to add a creature to the list, lookup creatures with
|
||||||
autocomplete support (press tab to auto-complete creature names), and quit the
|
autocomplete support (press tab to auto-complete creature names), and quit the
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""mtg.py
|
||||||
|
----------------
|
||||||
This module defines a command-line interface (CLI) application which allows
|
This module defines a command-line interface (CLI) application which allows
|
||||||
users to interact with a predefined list of completion options, specifically,
|
users to interact with a predefined list of completion options, specifically,
|
||||||
card names from the "Alara Reborn" set.
|
card names from the "Alara Reborn" set.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""crypto_server.py
|
"""generate_server_keys.py
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
This module contains utilities for generating and storing server keys and
|
This module contains utilities for generating and storing server keys and
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""secure_client.py
|
||||||
|
----------------
|
||||||
A module to establish a non-verifying SSL connection with a server and to
|
A module to establish a non-verifying SSL connection with a server and to
|
||||||
send/receive messages through a secure socket.
|
send/receive messages through a secure socket.
|
||||||
|
|
||||||
|
@ -21,10 +22,10 @@ def main(server_address: str, server_port: int):
|
||||||
context = SSLContext(PROTOCOL_TLS_CLIENT)
|
context = SSLContext(PROTOCOL_TLS_CLIENT)
|
||||||
context.check_hostname = False
|
context.check_hostname = False
|
||||||
context.verify_mode = CERT_NONE
|
context.verify_mode = CERT_NONE
|
||||||
unsecure_socket: socket = create_connection(
|
unsecure_socket: socket = create_connection((server_address, server_port))
|
||||||
(server_address, server_port)
|
secure_socket = context.wrap_socket(
|
||||||
)
|
unsecure_socket
|
||||||
secure_socket = context.wrap_socket(unsecure_socket) #, server_hostname="localhost")
|
) # , server_hostname="localhost")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
message = input()
|
message = input()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""secure_server.py
|
||||||
|
----------------
|
||||||
This module facilitates creating an asynchronous SSL server that echoes
|
This module facilitates creating an asynchronous SSL server that echoes
|
||||||
received messages. The server operates using SSL certificates stored in
|
received messages. The server operates using SSL certificates stored in
|
||||||
the "server_keys" directory.
|
the "server_keys" directory.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
# /usr/bin/env python3
|
||||||
set_get_attr_example.py
|
"""set_get_attr_example.py
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
This module contains a class named `Number` which implements special attribute
|
This module contains a class named `Number` which implements special attribute
|
||||||
|
@ -32,6 +32,7 @@ Note:
|
||||||
but the `_number` value is printed instead of raising an AttributeError.
|
but the `_number` value is printed instead of raising an AttributeError.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Number:
|
class Number:
|
||||||
def __init__(self, number):
|
def __init__(self, number):
|
||||||
self._number = number
|
self._number = number
|
||||||
|
@ -66,6 +67,7 @@ class Number:
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return self._number
|
return self._number
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
number = Number(5)
|
number = Number(5)
|
||||||
print(number.num)
|
print(number.num)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""thread_pool.py
|
||||||
|
----------------
|
||||||
This module demonstrates the use of asyncio to handle asynchronous and blocking
|
This module demonstrates the use of asyncio to handle asynchronous and blocking
|
||||||
functions in Python. The module contains three functions: a blocking function
|
functions in Python. The module contains three functions: a blocking function
|
||||||
that simulates a long-running process with `time.sleep`, an asynchronous
|
that simulates a long-running process with `time.sleep`, an asynchronous
|
||||||
|
|
Loading…
Reference in New Issue