Python

So how's that make you a pro? Use the following

import os

while 1:
os.system( "eject /dev/scd0" )


and


{grey@igbuntu:~/bin} cat vbox_detect.py
#!/usr/bin/python

vbox_mac = "08:00:27"
mac_file = '/sys/class/net/eth0/address'
infile = open(mac_file, "r")
line = infile.readline()
if line.startswith(vbox_mac):
print 'Running inside vbox'
 
Coincidentally, I have a small Python problem you could try to fix...
I'm creating my first Python game, but I've run across a problem. The game makes you feed Apple's logo to Steve Jobs' head. The problem is that I have to give the apple to the exact x,y coordinate to win. It's a really small location. I want to have a bigger win area. Maybe a win area as a rectangle around his mouth. Here's the code I have so far for the win. It works so far with my code so I won't show you the whole thing. Currently, the apple follows your mouse's position, so that's what pos is for. By the way, I'm using pygame.
PHP:
win = 420,300 
#skips some lines you don't need to see, including the while loop 
    if pos == win: 
      print("Win!")
Here's a screenshot of the game so far.
 

Attachments

  • attachment.jpg
    attachment.jpg
    81.6 KB · Views: 2
Back
Top Bottom