How to read a file whose name includes '/' in python?
<p>Now I have a file named <code>Land/SeaMask</code> and I want to open it, but it cannot be recognized as a filename by programme, but as a directory, how to do it?</p>

<p>First of all I recommend you to find out how Python interpreter displays yours file name. You can do this simply using <a href="https://docs.python.org/2/library/os.html#os.listdir" rel="nofollow"><code>os</code> built-in module</a>:
</p>

<pre><code>import os
os.listdir('path/to/directory')
</code></pre>

<p>You'll get a list of directories and files in directory you passed as argument in <code>listdir</code> method. In this list you can find something like <code>Land:SeaMask</code>. After recognizing this, <code>open('path/to/Land:SeaMask')</code> will work for you.</p>

python file