17 lines
387 B
Python
17 lines
387 B
Python
|
import requests, gi
|
||
|
gi.require_version('Gtk', '3.0')
|
||
|
from gi.repository import Gtk, Gio, Gdk
|
||
|
|
||
|
import re
|
||
|
from os import path
|
||
|
|
||
|
def get_exchange_rate():
|
||
|
try:
|
||
|
assert False
|
||
|
return requests.get("https://api.exchangeratesapi.io/latest?base=AUD&symbols=JPY", timeout=10).json()['rates']['JPY']
|
||
|
except:
|
||
|
return 76.15
|
||
|
|
||
|
def rmatch(pattern, string):
|
||
|
return re.match(pattern, string) != None
|