How To Open A Custom File Extension as .txt Using Python
<p>I'm making a code that will create a new form of file extension (in this case .aobj, which will be used to help me make games easier).  I tried using the code below (this is using Python)</p>

<pre><code>print "Starting..."
info = []
part1 = open('temporary.aobj', 'r')
part2 = part1.readlines()
for line in part2:
   info.append(line)
print info
</code></pre>

<p>Instead of this printing out what's actually in the file when i used notepad, it shows this:</p>

<pre><code>Starting...
[[...], [...], [...]]
</code></pre>

<p>I'm guessing this is because it doesn't recognize the file format, but how can i fix this? </p>

<p>You are printing info, which is an object somewhat similar to nested list. </p>

<pre><code>a = [[1,2],[3,4]]
print (a)
</code></pre>

<p>This prints<br>
[[1, 2], [3, 4]]</p>

<pre><code>for i in a:
    print(i)
</code></pre>

<p>This prints <br>
[1, 2]
[3, 4]</p>

<pre><code>for i in a:
    for j in i:
            print(j,end=' ')
    print()
</code></pre>

<p>This prints<br>
1 2<br>
3 4 </p>

<p>Which is what you seem to want.
So, instead of printing the info object as is, do something like this-</p>

<pre><code>for line in info:
    for word in line:
            print(word,end=' ')
    print()
</code></pre>

<p>PS: My codes are for Python3. There shouldn't be many differences for Python2.</p>

python file