from Sharepoint import connections
cat /proc/partitions
Покажет все разделы❯ cat /proc/partitions
major minor #blocks name
259 0 500107608 nvme0n1
259 1 266240 nvme0n1p1
259 2 16384 nvme0n1p2
259 3 126545920 nvme0n1p3
259 4 819200 nvme0n1p4
259 5 263787520 nvme0n1p5
259 6 108670976 nvme0n1p6
7 0 309596 loop0
7 1 64968 loop1
7 2 54536 loop2
~
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes com‐
mands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the
shell is started to inhibit this behavior.
When an interactive login shell exits, or a non-interactive login shell executes the exit builtin command, bash reads and executes commands
from the file ~/.bash_logout, if it exists.
When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This
may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of
~/.bashrc.
POOL = redis.ConnectionPool(host='localhost', port=6379, db=1)
# r = redis.StrictRedis(connection_pool=POOL)
def set_value(key, value):
with redis.StrictRedis(connection_pool=POOL) as redis_client:
redis_client.set(key, value)
def get_value(key):
with redis.StrictRedis(connection_pool=POOL) as redis_client:
return redis_client.get(key)
my_socket = None # переменная, в которую положим открытый сокет
my_socket = socket.connect(....) # переменная c открытым сокетом
my_socket.close() # закрыли сокет
my_socket = None # На всякий случай занулили переменную, чтобы сборщик мусора почистил неиспользуемые объекты
## прошло каке-то время
my_socket = socket.connect(....) # опять положили в переменную новый открытый сокет
my_socket.close() # закрыли еще один новый сокет
my_socket = None # опять почистили (хотя это можно и не делать по идее, но лучше так)
....
class XXXX:
socket = None
....
def begin_test(self, blablabla):
self.socket = socket.connect(......)
.....
def close_socket(self, blablabla):
if is self.socket:
self.socket.close()
self.socket = None
И вывод ошибки бы...