When I write to a text file in python 3.5.1 the text file is blank
<p>I'm writing to a text file but the final content is blank. Can anyone help.</p>

<pre><code>def main():
    types = input('What is the device type? Phone or Tablet')
    save = open('type.txt', 'w')
    save.write(types)
    save.close
    if types == 'phone':
        import Type1
    elif types == 'tablet':
        import Type2
    else:
        main()

main()
</code></pre>

<p>I've tried what I could but I'm not an expert on python.</p>