title: How to run python file with admin rights in pycharm
body: <p>I'm running this code for trying to ping a server on pycharm:</p>
  
  <pre><code>import subprocess as sp
  
  ip = "216.52.241.254"
  status,result = sp.getstatusoutput("ping -c1 -w2 " + ip)
  
  if status == 0:
      print("System " + ip + " is UP !")
  else:
      print("System " + ip + " is DOWN !")
  
  print(result)
  </code></pre>
  
  <p>However the <code>print(result)</code> line always prints <code>"Access denied. Option -c1 requires administrative privileges."</code>. I've tried running pycharm as admin but it doesn't have any affect. How can I give admin privileges to the file?</p>