Как правильно проверить атрибуты доступа файла? То есть доступна ли запись в файл или является ли он исполняемым?
Для этого в 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
#GLMR/USDT analysis :
#GLMR is in downtrend trading below 200ema. Price has broken down below support zone it is expected to continue declining. For short entry wait for the price to test the resistance zone.
TF : 2h
Entry : $0.1186
Target : $0.0940
SL : $0.1332
#GLMR/USDT analysis :
#GLMR has broken below the 200 EMA and is currently consolidating sideways near the 200 EMA. The price is expected to reverse from there and continue its bearish momentum to test the previous swing low.
TF : 1h
Entry : $0.1547
Target : $0.1415
SL : $0.1635
#GLMR👈
Call given here
Hit 1474
All Target done ✅
142% safe profit in spot
If you invested 1 btc it's now 2.42 btc now 🤑🤑
Signal before pump @ low level
Always trade with us for max profit 😊🤑💃Chk pinned to join👀
We are best pump tracker 🤑
#GLMR👈
https://www.binance.com/en/trade/GLMR_BTC
Buying Zone 610-630
Coin on the brink of 🚀
Buy in parts 👈strictly follow for max profits as its 🚀
Sell
🤑 660-700
🤑 700-750
🤑 750-800
🚀 800- 750 & above
Bullish above -600