Open ionescu77 opened 4 years ago
https://github.com/oaubert/python-vlc/issues/91
python vlc.py --version
/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'vlc.py': [Errno 2] No such file or directory
So do it like this because it is here:
find . -name vlc.py
./lib/python3.7/site-packages/vlc.py
python -m vlc --version
vlc.py: 3.0.9113 (Wed Apr 29 13:13:52 2020 3.0.9)
LibVLC version: 3.0.8 Vetinari (0x3000800)
LibVLC compiler: clang: warning: argument unused during compilation: '-mmacosx-version-min=10.7' [-Wunused-command-line-argument]
Plugin path: /Applications/VLC.app/Contents/MacOS/plugins
Python: 3.7.7 (64bit) macOS 10.15.5
La ei este un proiect demo pt python bindings care imi porneste o fereastra VLC player goala, cand apas play ma intreaba ce fisier sa aleg (file select OS window).
In python-vlc
repo este un director examples
si acolo tkvlc.py
https://raw.githubusercontent.com/oaubert/python-vlc/master/examples/tkvlc.py
Interesanta partea asta:
# import external libraries
import vlc
# import standard libraries
import sys
if sys.version_info[0] < 3:
import Tkinter as Tk
from Tkinter import ttk
from Tkinter.filedialog import askopenfilename
from Tkinter.tkMessageBox import showerror
else:
import tkinter as Tk
from tkinter import ttk
from tkinter.filedialog import askopenfilename
from tkinter.messagebox import showerror
from os.path import basename, expanduser, isfile, join as joined
from pathlib import Path
import time
_isMacOS = sys.platform.startswith('darwin')
_isWindows = sys.platform.startswith('win')
_isLinux = sys.platform.startswith('linux')
Am mai incercat o adaptare ca aici.
But it does not work.
def f4():
vlc_options = "--no-audio -f"
vlc_instance = vlc.Instance(vlc_options)
# vlc.Instance.url = filepath
found = False
# Test if url is a local file or remote
if url[:4] == 'file':
if os.path.isfile(url[7:]):
found = True
else:
print ('Error: File ', url[7:], ' Not found')
continue
else:
try:
r = requests.get(url, stream=True)
found = r.ok
except ConnectionError as e:
print('failed to get stream: {e}'.format(e=e))
continue
if found:
player = vlc_instance.media_player_new()
Media = vlc_instance.media_new(url)
Media.get_mrl()
player.set_media(Media)
if player.play() == -1:
print ("\nError playing Stream")
def run():
f4()
run()
Si a trebuit sa scot continue
, da nu am folosit niciodata chestia asta in python
python manage.py
File "manage.py", line 57
continue
^
SyntaxError: 'continue' not properly in loop
dupa aia nimic no error nada:
python manage.py
Componetele de python le-am scos din uz din proiect. Vor fi sterse curand. O sa pregatesc un readme ceva cu instructiuni cu rularea din bash.
Merci Alex
Tu ești și membru și admin la meetmetrics pe github. Ai încercat să creezi repo?
Ms
On 23. Jun 2020, at 21:57, Manolescu Mihai Alexandru notifications@github.com wrote:
Componetele de python le-am scos din uz din proiect. Vor fi sterse curand. O sa pregatesc un readme ceva cu instructiuni cu rularea din bash.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
req.txt
Test 1
chmod u+x manage.py
manage.py
It does not like thisTest 2
python manage.py
😄and repeats forever.