title: write and read csv file python
body: <p>I have a <code>text</code> file containing words with non-English alphabets and I want to open it, do some preprocess and finally save it as a <code>.csv</code> file, and use it some where else.</p>
  <p>The code to read and store file:</p>
  <pre><code>with open('file.txt', encoding=&quot;utf-8&quot;) as f:
      train = f.read().splitlines() 
  </code></pre>
  <p>Then creating a dataframe, and the code to store it:</p>
  <pre><code>df.to_csv('file.csv', index=True, encoding=&quot;utf-8&quot;)
  </code></pre>
  <p>util now every thing seems ok, but when I try to open the <code>file.csv</code> with this code:</p>
  <pre><code>train = pd.read_csv('file.csv', encoding=&quot;utf-8&quot;)
  </code></pre>
  <p>I face this :</p>
  <blockquote>
  <p>Process finished with exit code -1073740940 (0xC0000374)</p>
  </blockquote>
  <p>without going to next lines.</p>
  <p>Also when I try to open it with ISO-8859-1 encoding, it is ok; but when I try to print the head of that <code>.csv</code> it just print some question marks(<code>'?'</code>)</p>
  <p>Is anyone knows what is going wrong?</p>