What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-22 21:56:03
telegram bot python
import re from flask import Flask, request import telegram from telebot.credentials import bot_token, bot_user_name,URL global bot global TOKEN TOKEN = bot_token bot = telegram.Bot(token=TOKEN) app = Flask(__name__) @app.route('/{}'.format(TOKEN), met... Add solution -
Other 2022-01-22 19:36:19
web scraping print all p and h2 tags
import requests from bs4 import BeautifulSoup url = 'https://www.python.org/' reqs = requests.get(url) soup = BeautifulSoup(reqs.text, 'lxml') print("List of all the h1, h2, h3 :") for heading in soup.find_all(["h1", "h2", &q... Add solution -
Other 2022-01-22 08:01:08
alterning format when reading from a text file
with open("videos.txt") as f: lines = [l.strip() for l in f.readlines()] available_videos = "" for line in lines: title, video, tags = [x.strip() for x in line.split("|")] available_videos += f"{title} ({vid... Add solution -
Python 2021-11-15 22:36:16
write xor decrypt python
def xor_crypt_string(data, key = 'awesomepassword', encode = False, decode = False): from itertools import izip, cycle import base64 if decode: data = base64.decodestring(data) xored = ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(d... Add solution