title: How to upload file from local machine to the browser using python?
body: <p>I am using python to upload a file from my local disk to the web browser for an automation work. The folder name is "docs" which is in C directory. Docs folder contains 2 files "textnex.txt" and "safe.txt" so i want "textnext.txt" to upload on a web page. Here is my python code as below:</p>
  
  <pre><code>    # os for file management
  import os
  # Build tuple of (class, file) to turn in
  submission_dir = r'C:\Users\Sonu\docs'
  dir_list = list(os.listdir(submission_dir))
  for directory in dir_list:
      file_list = list(os.listdir(os.path.join(submission_dir, 
  directory)))
      if len(file_list) != 0:
          file_tup = (directory, file_list[0])
  
  print(file_tup)
  </code></pre>
  
  <p>When i run this code it is not printing the files. I want textnex.txt to be uploaded on the web page. Have a look at the screenshot for the current result which is very weird to me. Can anyone help me here? Thanks in advance.
  <a href="https://i.stack.imgur.com/60Pm0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/60Pm0.png" alt="Its showing .anaconda and navigator. I am confused"></a></p>