Telegram Group & Telegram Channel
خواندن همه فایل های داخل یک پوشه

فرض کنید، اطلاعات کلیه سهام شرکت ها را در قالب فایل های csv در یک پوشه ذخیره کرده اید. در صورتی که بخواهید همه فایل ها را با هم باز کنید و یک عمل روی آنها انجام بدهید لازم است از کتابخانه os کمک بگیرید. دستورات زیر محتوای تمام فایل های پوشه جاری را نمایش می دهد.

import os
try:
for file in os.listdir():
if os.path.isfile(file):
fin = open(file)
print (fin.read())
fin.close()
except:
print ('Error')

پایتون برای مالی در تلگرام
https://www.tg-me.com/joinchat-AAAAAFGMkouqbsb86Vfzug
پایتون برای مالی در بله
https://ble.im/jp/Python4Finance/com.python4finance
1



tg-me.com/python4finance/339
Create:
Last Update:

خواندن همه فایل های داخل یک پوشه

فرض کنید، اطلاعات کلیه سهام شرکت ها را در قالب فایل های csv در یک پوشه ذخیره کرده اید. در صورتی که بخواهید همه فایل ها را با هم باز کنید و یک عمل روی آنها انجام بدهید لازم است از کتابخانه os کمک بگیرید. دستورات زیر محتوای تمام فایل های پوشه جاری را نمایش می دهد.

import os
try:
for file in os.listdir():
if os.path.isfile(file):
fin = open(file)
print (fin.read())
fin.close()
except:
print ('Error')

پایتون برای مالی در تلگرام
https://www.tg-me.com/joinchat-AAAAAFGMkouqbsb86Vfzug
پایتون برای مالی در بله
https://ble.im/jp/Python4Finance/com.python4finance

BY Python4Finance


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python4finance/339

View MORE
Open in Telegram


Python4Finance Telegram | DID YOU KNOW?

Date: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

Python4Finance from jp


Telegram Python4Finance
FROM USA