Welcome, Guest
You have to register before you can post on our site.
Search Forums
Forum Statistics
 Members: 6
 Latest member: Diviera
 Forum threads: 5
 Forum posts: 6

Full Statistics
Online Users
There are currently 13 online users.
 0 Member(s) | 12 Guest(s)
Google

Countdown timer 00:00:00, change framerate and startseconds for your needs.


:framerate=30;startseconds=10; startcounter=startseconds*framerate;hours=floor((startcounter-time)/framerate/60/60)%60;minutes=floor((startcounter-time)/framerate/60)%60; seconds=floor((startcounter-time)/framerate)%60; return Text(string.format("%02.f",hours)..":"..string.format("%02.f",minutes)..":"..string.format("%02.f",seconds));

Countdown timer 00:00

:framerate=30;startseconds=10; startcounter=startseconds*framerate;minutes=floor((startcounter-time)/framerate/60)%60; seconds=floor((startcounter-time)/framerate)%60; return Text(string.format("%02.f",minutes)..":"..string.format("%02.f",seconds));

If you don't have ffmpeg added to path, just copy ffmpeg.exe to folder where you have video files.

[dir]
 |- ffmpeg.exe
 |- video01.mp4
 |- video02.mp4
 |- video03.mp4

Extract to .ogg:

for %v in (*.mp4) do ffmpeg -i "%v" -vn -acodec libvorbis "%v.ogg"

Extract to .mp3:

for %v in (*.mp4) do ffmpeg -i "%v" -vn -acodec libmp3lame "%v.mp3"

EDIT:
Do not read this uber noob solutions bellow! I used it before I find out simple and user friendly Jinja. Greate tutorial about it is here.


To use mustache templating language with Python we need chevron.

pip install chevron

If you get some red errors try this:
pip install --user chevron

If you still get red errors, sorry I'm a NOOB.

Next, add chevron.exe to PATH, like pip message suggest.

Example template file (diviera.txt):
<title>{{title}}</title>
This is {{name}}!

Python code:
import chevron

strings = {'title': 'Fantastic title',
            'name':'Sparta'}

with open('diviera.txt', 'r') as f:
    fillup = chevron.render(f, strings)    

with open('diviera_final.txt', 'w') as nf:
    nf.write(fillup)

Translate two leter code of US State name to full name.

def StateFullName(stateShortName):
    states = {'AK':'Alaska',
                'AL':'Alabama',
                'AR':'Arkansas',
                'AZ':'Arizona',
                'CA':'California',
                'CO':'Colorado',
                'CT':'Connecticut',
                'DE':'Delaware',
                'FL':'Florida',
                'GA':'Georgia',
                'HI':'Hawaii',
                'IA':'Iowa',
                'ID':'Idaho',
                'IL':'Illinois',
                'IN':'Indiana',
                'KS':'Kansas',
                'KY':'Kentucky',
                'LA':'Louisiana',
                'MA':'Massachusetts',
                'MD':'Maryland',
                'ME':'Maine',
                'MI':'Michigan',
                'MN':'Minnesota',
                'MO':'Missouri',
                'MS':'Mississippi',
                'MT':'Montana',
                'NC':'North Carolina',
                'ND':'North Dakota',
                'NE':'Nebraska',
                'NH':'New Hampshire',
                'NJ':'New Jersey',
                'NM':'New Mexico',
                'NV':'Nevada',
                'NY':'New York',
                'OH':'Ohio',
                'OK':'Oklahoma',
                'OR':'Oregon',
                'PA':'Pennsylvania',
                'RI':'Rhode Island',
                'SC':'South Carolina',
                'SD':'South Dakota',
                'TN':'Tennessee',
                'TX':'Texas',
                'UT':'Utah',
                'VA':'Virginia',
                'VT':'Vermont',
                'WA':'Washington',
                'WI':'Wisconsin',
                'WV':'West Virginia',
                'WY':'Wyoming',              
                    }
    if stateShortName.upper() in states:
        return states[stateShortName.upper()]
    else:
        return 'unknow'

This is the simplest way to send some notifications on smartphone by python script. No install extra module is needed.

First find and add BotFather on Telegram and send /newbot message. Follow instructions. Save new token from BotFather. 
[Image: ea9561af_tn.png]


Next, find and add IDBot and send /getid message. 
[Image: 03e0570c_tn.png]

import  urllib.request

token = '_PUT_YOUR_TOKEN_HERE_'
chatID = '_PUT_YOUR_CHATID_HERE_'

message = 'Diviera.com - place where PRO get heart attack'.replace(' ','%20')
urlMessage = 'https://api.telegram.org/bot' + token + '/sendMessage?chat_id=' + chatID + '&text=' + message

sendIt = urllib.request.urlopen(urlMessage)

print(sendIt.read())