title: How set the monitor initially off using python script
body: <p>Currently I have one project using Raspberry Pi Python language to turn on and off the monitor using a sensor.</p>
  
  <p>How can I set the monitor to sleep mode in its initial state in python language?</p>
  
  <pre><code>    # Calculate pulse length
      elapsed = stop-start
  
      # Distance pulse travelled in that time is time
      # multiplied by the speed of sound (cm/s)
      distance = elapsed * 34000
  
      # That was the distance there and back so halve the value
      distance = distance / 2
  
      print "Distance : %.1f" % distance
      if(distance &gt; 30):
          time.sleep(3)
          subprocess.call("sudo /opt/vc/bin/tvservice -o",shell=True)
  
  
          os.system('clear')
      if(distance &lt;= 30):
              subprocess.call("sudo /opt/vc/bin/tvservice -p",shell=True)
  
  
     # Reset GPIO settings
  
     GPIO.cleanup()
  </code></pre>
  
  <p>This is part of my code, but I want to set the screen off in its initial state.</p>