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

The SSE was the first modern stock exchange to open in China, with trading commencing in 1990. It has now grown to become the largest stock exchange in Asia and the third-largest in the world by market capitalization, which stood at RMB 50.6 trillion (US$7.8 trillion) as of September 2021. Stocks (both A-shares and B-shares), bonds, funds, and derivatives are traded on the exchange. The SEE has two trading boards, the Main Board and the Science and Technology Innovation Board, the latter more commonly known as the STAR Market. The Main Board mainly hosts large, well-established Chinese companies and lists both A-shares and B-shares.

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.Python4Finance from nl


Telegram Python4Finance
FROM USA