woringng on things
This commit is contained in:
parent
c994e2b501
commit
64f4e2fa2a
|
@ -29,6 +29,7 @@ imgs = []
|
||||||
# Picking the image folder
|
# Picking the image folder
|
||||||
|
|
||||||
def explor_file():
|
def explor_file():
|
||||||
|
|
||||||
global file_location
|
global file_location
|
||||||
no_label.configure(text="")
|
no_label.configure(text="")
|
||||||
file_location = filedialog.askdirectory(initialdir= '/', title="Select Folder")
|
file_location = filedialog.askdirectory(initialdir= '/', title="Select Folder")
|
||||||
|
|
BIN
PyGame/practice/gameprac/bg2.png
Normal file
BIN
PyGame/practice/gameprac/bg2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 174 KiB |
54
PyGame/practice/gameprac/hybrid.py
Normal file
54
PyGame/practice/gameprac/hybrid.py
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
# https://www.youtube.com/watch?v=f4coFYbYQzw&list=PLjcN1EyupaQkAQyBCYKyf1jt1M1PiRJEp
|
||||||
|
import os
|
||||||
|
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
|
||||||
|
import pygame
|
||||||
|
from pygame.locals import *
|
||||||
|
import random
|
||||||
|
|
||||||
|
|
||||||
|
WIDTH = 600
|
||||||
|
HEIGHT = 800
|
||||||
|
WINDOW_SIZE = (WIDTH, HEIGHT)
|
||||||
|
FPS = 60
|
||||||
|
|
||||||
|
# load background image
|
||||||
|
bg = pygame.image.load("PyGame\practice\gameprac\img")
|
||||||
|
|
||||||
|
def draw_bg():
|
||||||
|
screen.blit(bg, 0, 0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
WHITE = (255, 255, 255)
|
||||||
|
BLACK = (0, 0, 0)
|
||||||
|
RED = (255, 0, 0)
|
||||||
|
GREEN = (0, 255, 0)
|
||||||
|
BLUE = (0, 0, 255)
|
||||||
|
|
||||||
|
pygame.init()
|
||||||
|
pygame.mixer.init()
|
||||||
|
screen = pygame.display.set_mode(WINDOW_SIZE)
|
||||||
|
pygame.display.set_caption("Spave Invaders")
|
||||||
|
clock = pygame.time.Clock()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
running = True
|
||||||
|
while running:
|
||||||
|
#draw background
|
||||||
|
draw_bg()
|
||||||
|
|
||||||
|
# event handlers
|
||||||
|
clock.tick(FPS)
|
||||||
|
for event in pygame.event.get():
|
||||||
|
if event.type == pygame.QUIT:
|
||||||
|
running = False
|
||||||
|
|
||||||
|
|
||||||
|
screen.fill(BLACK)
|
||||||
|
|
||||||
|
pygame.display.flip()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pygame.quit()
|
BIN
PyGame/practice/gameprac/img/bg.png
Normal file
BIN
PyGame/practice/gameprac/img/bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 174 KiB |
|
@ -1,3 +1,4 @@
|
||||||
|
# stuck on colisions https://www.youtube.com/watch?v=33g62PpFwsE
|
||||||
import os
|
import os
|
||||||
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
|
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
|
||||||
import pygame
|
import pygame
|
||||||
|
@ -84,6 +85,10 @@ while running:
|
||||||
|
|
||||||
all_sprites.update()
|
all_sprites.update()
|
||||||
|
|
||||||
|
hits = pygame.sprite.collide_rect(PLayer, Mob, False)
|
||||||
|
if hits:
|
||||||
|
running = False
|
||||||
|
|
||||||
screen.fill(BLACK)
|
screen.fill(BLACK)
|
||||||
all_sprites.draw(screen)
|
all_sprites.draw(screen)
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
|
|
9
pyplex/apiconfig-default.py
Normal file
9
pyplex/apiconfig-default.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
baseurl = 'http://plex.host.ip:port'
|
||||||
|
token = 'yourplexapikey'
|
||||||
|
mediafolder_linux = '/videos/'
|
||||||
|
mediafolder_windows = 'F:\\'
|
||||||
|
libraryname = 'Movies'
|
||||||
|
colmap = {
|
||||||
|
'Drama': 'Drama',
|
||||||
|
'SciFi': 'Sci-Fi'
|
||||||
|
}
|
2827
pyplex/movielist.csv
Normal file
2827
pyplex/movielist.csv
Normal file
File diff suppressed because it is too large
Load Diff
41
pyplex/sub.py
Normal file
41
pyplex/sub.py
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
import csv
|
||||||
|
import sys
|
||||||
|
from plexapi.server import PlexServer
|
||||||
|
|
||||||
|
try:
|
||||||
|
import apiconfig
|
||||||
|
except:
|
||||||
|
print("Error!")
|
||||||
|
print(" \"apiconfig.py\" seems to be missing!")
|
||||||
|
print(" Have you copied the default config to \"apiconfig.py\" and made appropriate edits?")
|
||||||
|
print()
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
raw_file = open("movielist.csv", "w", newline='')
|
||||||
|
csv_file = csv.writer(raw_file)
|
||||||
|
csv_file.writerow(["Movie Name","Year", "View Count", "English Subtitles"])
|
||||||
|
|
||||||
|
plex = PlexServer(apiconfig.baseurl, apiconfig.token)
|
||||||
|
movies = plex.library.section(apiconfig.libraryname).all()
|
||||||
|
count = 0
|
||||||
|
print("Searching for english subtitles...", end='', flush=True)
|
||||||
|
for video in movies:
|
||||||
|
has_eng_sub = False
|
||||||
|
if len(video.subtitleStreams()) > 0:
|
||||||
|
for sub in video.subtitleStreams():
|
||||||
|
if isinstance(sub.languageCode, str) and sub.languageCode.lower() == "eng":
|
||||||
|
has_eng_sub = True
|
||||||
|
|
||||||
|
#if has_eng_sub:
|
||||||
|
# print(f"{video.title} ({video.year}) has english subtitle")
|
||||||
|
csv_file.writerow([video.title, video.year, video.viewCount, ("Yes" if has_eng_sub else "No")])
|
||||||
|
count += 1
|
||||||
|
if count % 10 == 0:
|
||||||
|
print(".", end='', flush=True)
|
||||||
|
if count % 100 == 0:
|
||||||
|
print(count, end='', flush=True)
|
||||||
|
#if count > 200:
|
||||||
|
# print()
|
||||||
|
# sys.exit()
|
||||||
|
|
||||||
|
raw_file.close()
|
Loading…
Reference in New Issue
Block a user