Как правильно проверить атрибуты доступа файла? То есть доступна ли запись в файл или является ли он исполняемым?
Для этого в 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
#MBL/USDT analysis :
#MBL is currently consolidating above the support zone. The price is expected to test this zone again before moving towards the swing high. It is recommended to wait for a pullback to enter a long position.
TF : 1D
Entry : $0.002672
Target : $0.003095
SL : $0.002527
#MBL/USDT analysis :
#MBL is in an uptrend, forming higher highs (HHs) and higher lows (HLs) above the 200 EMA. The price has recently bounced back from a support zone after retracement to it. It is expected that the price will sustain its bullish momentum and test the previous swing high.
TF : 1H
Entry : $0.00256
Target : $0.00265
SL : $0.00251
#MBL/USDT analysis :
#MBL is in a downtrend, trading below the 200 EMA. The price is expected to experience a pullback and will continue its downward momentum. Wait for the price to reject from the resistance zone for short entry.
TF : 15min
Entry : $0.00211
Target : $0.00190
SL : $0.00220
Falling wedges detected on #KMD & #MBL by CoinLegs algorithm 📉
Bullish reversal ahead? Now imagine never missing this unique combo setup or dozens of other patterns again 💫
Our platform tracks every asset, all timeframes so you get alerts first 🛎️
www.coinlegs.com