title: FileNotFoundError: [Errno 2] in python 3
body: <p>This script makes a github repo from command line
  I have a file not found error. I cannot seem to solve it. any help is appreciated.</p>
  
  <p>tried exception errors</p>
  
  <p>Script:</p>
  
  <pre><code>import sys, os, subprocess, os.path
  
  class git_script:
      def __init__(self, dir_path):
          self.dir_path = dir_path
  
      def git_func(self):
          os.mkdir(dir_path)
          os.chdir(dir_path)
          os.system('git init &amp;&amp; touch README.md &amp;&amp; git add &amp;&amp; git commit -m "Initial Commit" ')
          os.system("curl --user thisisshub https://api.github.com/orgs/orgname/repos -d {'name':'newreponame'}")
          os.system('git push -u origin master')
  
  dir_path = os.path.join("~/Downloads/Projects/" , input('Repository name: '))
  final_path = git_script(dir_path)
  final_path.git_func()
  
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>$ python some.py                                                                                                 1 ↵
  Repository name: automation
  Traceback (most recent call last):
    File "some.py", line 16, in &lt;module&gt;
      final_path.git_func()
    File "some.py", line 8, in git_func
      os.mkdir(dir_path)
  FileNotFoundError: [Errno 2] No such file or directory: '~/Downloads/Projects/automation'
  
  </code></pre>