Как правильно проверить атрибуты доступа файла? То есть доступна ли запись в файл или является ли он исполняемым?
Для этого в Python есть функция os.access()
Проверять так:
os.access(path, flag)
Функция вернёт bool в зависимости от наличия указанного флага.
Всего есть 4 флага проверки:
os.F_OK - наличие файла на диске
os.R_OK - доступ на чтение
os.W_OK - доступ на запись
os.X_OK - доступ на исполнение
Например, вместо try-except лучше делать так (пример из документации):
if os.access("myfile", os.R_OK):
with open("myfile") as fp:
return fp.read()
#basic#libs
#ALCX/USDT analysis :
#ALCX is in a downtrend, forming lower lows (LLs) and lower highs (LHs) below the 200 EMA. The price is currently facing resistance and is anticipated to decline from there, testing lower levels.
TF : 2H
Entry : $10.12
Target : $9.30
SL : $10.74
#ALCX/USDT analysis :
#ALCX is in a downtrend and trading below the 200 EMA. The price has broken down below the support zone and is now retracing back to retest the broken zone before continuing the bearish momentum. For a short entry, wait for the price to test the resistance zone.
TF : 2h
Entry : $12.10
Target : $10.51
SL : $13.20
#ALCX👈
https://www.binance.com/en/trade/ALCX_BTC
Buying Zone 630-660
👆
We are expecting a bull run in this coin in coming days
Sell
🤑730-750
🤑750-800
🤑800-850
🤑 850-900
🤑 900-1000
🚀 1000-1100
🚀 1100-1200 & above
Bullish above 600