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/it/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/it/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: |

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

The global forecast for the Asian markets is murky following recent volatility, with crude oil prices providing support in what has been an otherwise tough month. The European markets were down and the U.S. bourses were mixed and flat and the Asian markets figure to split the difference.The TSE finished modestly lower on Friday following losses from the financial shares and property stocks.For the day, the index sank 15.09 points or 0.49 percent to finish at 3,061.35 after trading between 3,057.84 and 3,089.78. Volume was 1.39 billion shares worth 1.30 billion Singapore dollars. There were 285 decliners and 184 gainers.

Python4Finance from it


Telegram Python4Finance
FROM USA