This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
def get_line_key(line): | |
"""Get key from line or return None if not found. | |
EG from 'VectorParameterValues[1] = \n' return 'VectorParameterValues[1]', | |
from 'ParameterName = Emissive Color' return 'ParameterName' | |
""" | |
res = re.search(r"(?P<key>[a-zA-Z\d\[\]\s]+)=", line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import logging | |
from nacl.signing import VerifyKey | |
from nacl.exceptions import BadSignatureError | |
PUBLIC_KEY = os.getenv("PUBLIC_KEY", "") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
with open("test.html", "r") as f: | |
soup = BeautifulSoup(f.read(), features="html.parser") | |
keys = soup.select("input[placeholder='Ключ']") | |
values = soup.select("input[placeholder='Значение']") | |
for k, v in zip(keys, values): | |
print(k.get("value"), "=", v.get("value"), sep="") |
OlderNewer