First time using python, need some help with pictures.
Posted: Wed Aug 09, 2017 3:43 am
Ok bare with me this is the first program i have written in python.
The idea of the program is to be able to scan bar-codes and have it play a corresponding video, that part works fine.
But I also want the screen to be either black or display some other picture like "please scan object" or something at all times when the videos aren't playing, basically once I start this program I don't want to see the Rasbian desktop.
And this is where I seem to be having trouble, first when I start the program the screen goes black like it should but then as soon as I scan something it closes the black picture and I have to re-scan whatever I just scanned to open the video.
Second whenever the black picture is up there is text showing what file is open etc at the bottom of the screen that I don't want there.
I don't even know if fbi is the best way to do this so any suggestions would be helpful
Thanks in advance!
The idea of the program is to be able to scan bar-codes and have it play a corresponding video, that part works fine.
But I also want the screen to be either black or display some other picture like "please scan object" or something at all times when the videos aren't playing, basically once I start this program I don't want to see the Rasbian desktop.
And this is where I seem to be having trouble, first when I start the program the screen goes black like it should but then as soon as I scan something it closes the black picture and I have to re-scan whatever I just scanned to open the video.
Second whenever the black picture is up there is text showing what file is open etc at the bottom of the screen that I don't want there.
I don't even know if fbi is the best way to do this so any suggestions would be helpful

Thanks in advance!
Code: Select all
while True:
import os
os.system("sudo fbi -d /dev/fb0 -a -T 2 -v black-screen.jpg")
name=input("Please scan object")
addressbook = open("ab.txt")
for line in addressbook:
record = line.split('|')
if record[0] == name:
found = True
break
else:
found = False
continue
if found == False:
print("Object not found")
else:
number=(record[1])
path=("/media/pi/USB DISK/Pyro Preview/videos/")
os.system("sudo killall fbi")
import sys
movie_path = ((path)+(number))
from subprocess import Popen
omxp = Popen(['omxplayer',movie_path])