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

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

Python4Finance from vn


Telegram Python4Finance
FROM USA