Python Forum
How can I work this codes in Windows?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I work this codes in Windows?
#5
(Jul-06-2019, 09:29 PM)snippsat Wrote: Test to see if it work.
output = subprocess.run(['mkvpropedit', moive_to_edit, '--edit', 'info', '--set', f'title={movie_title}'], capture_output=True)
print(output.stdout.decode())

Thank you, this is work; my codes:

#!/usr/bin python3
# -*- coding: utf-8 -*-

import os
import subprocess
import re

neredebu=r'K:\İnenler\filmler\mkvler'
mkvpeexe=r'C:\Program Files\MKVToolNix\mkvpropedit.exe'
tname="netmanyağı"

for kokdizin, altdizinler, dosyalar in os.walk(neredebu):
    for dosya in dosyalar:
        if dosya.endswith('.mkv'):
            #dosya = os.sep.join([kokdizin, dosya])
            
            isim=re.findall('([\w\d.]*)\.[\d]{4}\.',dosya)[0]
            isim=isim.replace(".", " ")
            yil=re.split('[\w\d.]*\.([\d]{4})\.',dosya)[1]
            title=isim+" - "+yil+" _ netmanyağı"
            
            dosyayolu=kokdizin
            dosyatam=dosyayolu+"\\"+dosya
            
            print(isim)
            print(yil)
            print(title)
            print(dosyayolu)
            print(dosyatam)
            print(dosya)
            
            output = subprocess.run([mkvpeexe, dosyatam, '--edit', 'info', '--set', 'title={}'.format(title)], capture_output=True)
            print(output.stdout.decode())
            
            output = subprocess.run([mkvpeexe, dosyatam, '--edit','track:a1','--set','name={}'.format(tname)], capture_output=True)
            print(output.stdout.decode())

#!/usr/bin python3
Edit to for Windows:
#!C:\Program Files\Python37-32\python.exe
Reply


Messages In This Thread
How can I work this codes in Windows? - by herace - Jul-06-2019, 02:35 PM
RE: How can I work this codes in Windows? - by herace - Jul-07-2019, 06:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Windows 10 PowerShell doesn't work Amy 3 3,963 Apr-27-2021, 01:33 PM
Last Post: jefsummers
  Can not get tkinter to work in Windows 10 via python 3.9 idris03 1 2,356 Nov-03-2020, 03:22 AM
Last Post: deanhystad
  Update setup.py to work on Windows #3 Toolman 2 2,421 May-19-2020, 02:21 PM
Last Post: Toolman
  Code works in IDLE, appears to work in CMD, but won't produce files in CMD/Windows ChrisPy33 3 3,275 Jun-12-2019, 05:56 AM
Last Post: ChrisPy33
  Codes does not work NatalieG 3 2,412 Nov-29-2018, 08:05 PM
Last Post: NatalieG
  Python files made on linux don't work on windows sylas 2 3,298 Oct-10-2018, 05:34 AM
Last Post: sylas
  Discord Bot doesnt work when opened with windows himdipie 0 2,250 Apr-15-2018, 04:48 PM
Last Post: himdipie

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020