# -*- coding: utf-8 -*-
"""
Created on Thu Oct 10 02:10:06 2019

@author: Faradars-pc2
"""

esme_file = 'data2w.txt'

try:
    with open(esme_file) as f:
        mohtaviat = f.read()
except FileNotFoundError:
    print('file moshakhas shode vojud nadarad.')
else:
    kalamat = mohtaviat.split()
    tedad_kalamat = len(kalamat)
    print(f'file {esme_file} daraye {tedad_kalamat} kalame mibashad')         
