Skip to content

Instantly share code, notes, and snippets.

@hedihadi
hedihadi / upload_currencies.py
Last active January 7, 2022 18:28
تایبەت بە خۆت دروست بکە API ئەم سکرێپتە دراوە جیهانیەکان بۆ دینار دەگۆڕێت، تەنها پێویستی بە نرخی دۆلار هەیە، تکایە ئەگەر سکرێپتەکەت بەکارهێنا
import json
from urllib.request import Request, urlopen
import re
import datetime
import time
''''''''''''''''''''''''''''''''''''
'''calculate the currency prices from exchangeratesapi'''
''''''''''''''''''''''''''''''''''''
@hedihadi
hedihadi / fixSRTWithExtraLines.py
Created September 26, 2021 13:37
this python script will fix SRT files that has extra lines in them
def fixSubtitleWithExtraLines(filePath):
oldSTR=[]
with open(filePath, "r") as f:
oldSTR=f.readlines()
newSTR=[]
for element in oldSTR:
'''remove all the line breaks'''
if element !="\n" :
newSTR.append(element)