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

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

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"

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())