title: trying to write COPIED data in a text file in python
body: <p>I have copied the data from a file, and I am trying to paste it to file guru99.txt, but it is not writing to the file. Below is the piece of code. Can anyone please help me, I want to paste the copied data in txt file which I have opened?</p>
  
  <pre><code>import win32api
  import win32com.client
  import pyautogui
  shell = win32com.client.Dispatch("WScript.Shell")
  win32api.Sleep(5000)
  pyautogui.moveTo(17, 213) #moving cursor to a location on software to select data
  win32api.Sleep(2000)
  pyautogui.click()   #selecting data
  win32api.Sleep(2000)
  pyautogui.hotkey('ctrl', 'c') #copying data
  win32api.Sleep(2000)
  file_text= open("guru99.txt","w+") #making new txt file to paste copied data
  file_text.write(pyautogui.hotkey('ctrl', 'v')) #pasting data using write fn, which is giving error
  win32api.Sleep(2000)
  file_text.close()
  </code></pre>