Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
class SQLite: def __init__(self, ip, psw): pass def connect(self): print('Successful.') class DB_sql: def __init__(self): pass def connect(self, ip, psw): try: SQLite(ip, psw).connect() except Exception as e: print(e) def request(self, var): print('Successful.') def close(self): pass class Table: def __init__(self, **kwargs): self.db: DB_sql = DB_sql() self.db.connect('lh', '123') for key, value in kwargs.items(): self.__setattr__(str(key), value) self.db.request((str(key), value)) self.db.close() def get_value(self, target): self.db: DB_sql = DB_sql() self.db.connect('lh', '123') attrs = dir(self) for value in attrs: if target == value: try: self.db.request(f'GET {target} FROM {self.__class__.__name__}') print(target, self.__dict__[target]) except Exception as e: print(e) finally: self.db.close() if __name__ == '__main__': db = Table(x=1, y=2, z=3) db.get_value('x')
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)