ctx.voice.client
def parseTxn(txn):
scriptLen = int(txn[41*2:42*2], 16)
return scriptLen
tx = {3: "01000000000101881af1640424935b4f0c54c6fe9f5acd9750aa3b9bda50909a5b8f5da69ced8b0200000000fdffffff0bc7670403000000001976a9146460c7b1069f32a7e5382266b364220f3f824ec688ac80234300000000001976a91485f4f96f3f991a3770face96abc0ca59965220fb88ac4b601800000000001976a9147bf1438d53b8d0a115203375b8a5f9ddcc0c520f88ac113c00000000000017a914742ce9c25e8bd7a30053ee164ca455bf6bd5a6f587a0860100000000001976a914ecd84afa213d4edb6ecb21542ce519ce3618bdaf88ac9e212a000000000017a91431e83e8b275717a102025822f7fab06b3c6f7ff987b01e0400000000001976a9140a5d69037c194b6aec0535825eb6ba508d97570d88ac20505300000000001976a914955db0cde749821c6f99934cc5c1232c636cf97d88ac30570500000000001976a91404139abd0c8f9cd51a8756c69379041fa14ed91488ac80e66a39000000001600145c1e9c33747070609ed2610a374eea857e427e68a08601000000000017a9140a3c23a5197a790e61b806ce702d4dec2ed4700b87024730440220381776b6b7d25f90bb8f078a213464fc2d6ae5834e3f79cb9032e5dd8f89f5ae02207bd3d9b5680241b0951ad61f4b041c5ee0698d5673e78fe54224ca753a8eb2cc012102109171217733e1afa913cb3e13d4582693045df2467e818ab1eba5ae2391f785c13f0a00", 2: "0100000001ce1d31f342c1a8dea718ddbdacf4285a004826c879867b7f6a9afeb011d9944e090000006b4830450221008b3a30c3d59008b78fec7eadc57027e0d0d44c4863185e694c35e5f6dc1644a302206d40aab141fd115863a37ae84b6c415257fcdde4932fe6577fd5a4fde44ecd8d0121027abfc94d794e730a0998d3340a8d1709a7dda03c91afcb2502f9d1f1df8472e2ffffffff0f2f5721000000000017a914c954e25aa374e93f1cc688417f21a4ac573e4d6687f8f90300000000001976a91480ba4af478403cfbb84c3c741fd8872ed555ea6688accc031700000000001976a9146849026a6f88d2c30c853414f28a77fd654459f888ac38ef0401000000001976a9147f7452e58e78013a41e6c6a0254312c2204c010688ac302da2640000000017a914c9ae29c3b57bfdef6b2383881d910bb83a8de18f876cbcda010000000017a91443d3f240383f6927066d16e8f180c52d1d5fb5b8875300c9010000000017a9140c34fe0b3a7e6c47a5783bb57c919f697dea806387c0655200000000001976a914e35d5358209d7df82b256fb8a655da7225cc94ec88ac08b51500000000001976a91423166c8d8c53449d801c434f239dbc03151e24bd88ac705ff913000000001976a9142c3ee08ff583a18456546e16c3bab9d104f63a2988ac00c419270000000017a914237531266f96a2663cc1a4aeda7369055d287f1187b85808000000000017a91446d12ed7fe791f40096aad6f5b2eef6c3f0fdd488780c4600f0000000017a914ec3d0f813cda478bce976ef40cb778825b7a244a8730c11d00000000001976a9148014429be1d95ee7f1a6cb07acf5fcfee9d9f34d88ac42d96bdd000000001976a914a193a02eabdbe2348aee081e1447fcdd867429a288ac00000000", 1: "01000000011575f1aacac4f66f9cfecd6ea1ef272e8cb5ce33f5ae97d1fcf02cec774a82e0070000008b48304502204117f9f3173b915d03be6170d7af520bfa78d9d9fd35c829d974d3aaead09ae90221008a032016f639b730779945f7b5bedb3701a0645c1752c1b27fccc617019f172b014104ef09f65a570580ae9e33bea461b5d27bef90e521020f924c599a0d918f84c2781eb29f21d8985aefb919e1feccde73bea07edea0cd04b15e7c88a19e80df2dd0ffffffff01a7730100000000001976a91498dccb66b17e1efb1f0d2bba0446502f2625444488ac00000000"}
for key in tx.keys():
print(f'tx{key} scriptLen = {parseTxn(tx[key])}')
high = int(input('Введите высоту пирамидки:')) # h высота
symbol = input('Введите символ(ы):') # s символ
length = len(symbol) # дополнительные пробелы если символов > 1
space = ' ' * length
for i in range(high): # i = 0, 1, 2, 3 и т.д.
left = high - 1 - i
line = (symbol + space) * (i + 1)
print(f'{left * space}{line}')
import tkinter as tk
import sqlite3
from tkinter import ttk
class Main(tk.Frame):
def __init__(self, root):
super().__init__(root)
self.db = db
self.init_main()
def init_main(self):
lbl_main = tk.Label(text='TXT', fg='#336B87', font=('Modern', 220), bg='#2A3132')
btn_database_workers = tk.Button(padx=7, pady=2, text='', bg='#336B87',
activebackground='#336B87',
compound=tk.TOP, font=('Ubuntu', 72), bd=10, command=self.open_database)
lbl_main.pack()
btn_database_workers.pack()
lbl_main.place(x=5, y=-45)
btn_database_workers.place(x=750, y=45)
def open_database(self):
Child()
class Child(tk.Toplevel):
def __init__(self):
super().__init__(root)
self.init_child()
self.db = db
self.db.cur = self.db.conn.cursor()
self.view = app
self.view_records()
def retrieve_input(self):
entry1_text = self.entry1.get(1.0, tk.END)
entry2_text = self.entry2.get(1.0, tk.END)
self.records(entry1_text, entry2_text)
def init_child(self):
self.title('Child')
self.geometry('950x400')
self['bg'] = '#2A3132'
self.resizable(False, False)
self.entry1 = tk.Text(self, height=2, width=11, font=('Ubuntu', 15), bd=5)
self.entry1.pack()
self.entry1.place(x=3, y=180)
self.entry2 = tk.Text(self, height=2, width=11, font=('Ubuntu', 15), bd=5)
self.entry2.pack()
self.entry2.place(x=3, y=245)
self.tree = ttk.Treeview(self, column=('clm1', 'clm2', 'clm3'), show='headings')
self.tree.heading('#1', text='ID')
self.tree.heading('#2', text='Name')
self.tree.heading('#3', text='IP')
self.tree.pack()
delete_btn = tk.Button(self, text='Delete', padx=25, pady=10, font=('Ubuntu', 15),
bd=8, bg='#336B87', command=self.delete_records)
delete_btn.pack()
delete_btn.place(x=0, y=0)
add_btn = tk.Button(self, text='Add', padx=36, pady=10, font=('Ubuntu', 15), bd=8, bg='#336B87',
command=lambda: self.retrieve_input())
add_btn.pack()
add_btn.place(x=0, y=75)
def records(self, name, ip):
self.db.insert_data(str(name), str(ip))
self.view_records()
def view_records(self):
self.db.cur.execute('''SELECT * FROM tbl''')
[self.tree.delete(i) for i in self.tree.get_children()]
[self.tree.insert('', 'end', values=row) for row in self.db.cur.fetchall()]
def delete_records(self):
for selection_item in self.tree.selection():
self.db.cur.execute('''DELETE FROM tbl WHERE id=?''', (self.tree.set(selection_item, '#1'),))
self.db.conn.commit()
self.view_records()
class DB:
def __init__(self):
self.conn = sqlite3.connect('oop_test.db')
self.cur = self.conn.cursor()
self.cur.execute(
'''CREATE TABLE IF NOT EXISTS tbl(id INTEGER PRIMARY KEY,name TEXT ,ip TEXT)''')
self.conn.commit()
def insert_data(self, name, ip):
self.cur.execute('''INSERT INTO tbl(name, ip) VALUES (?, ?)''', (name, ip))
self.conn.commit()
if __name__ == '__main__':
root = tk.Tk()
db = DB()
app = Main(root)
app.pack()
x = root.winfo_screenwidth()
y = root.winfo_screenheight()
root.geometry('{}x{}'.format(int(x * 0.8), int(y * 0.8)))
root['bg'] = '#2A3132'
root.title('Main')
root.state('zoomed')
root.mainloop()
english_words = ['Cat', 'Dog', 'Parrot']
russian_words = ['Кошка', 'Собака', 'Попугай']
for id, russian in enumerate(russian_words):
english = english_words[id]
print(f'Русское: {russian} / Английское {english}')
def wait_new_file(path_to_watch):
print('Ждем появления файла в папке сохранения')
before = dict ([(f, None) for f in os.listdir (path_to_watch)])
result = True
while result:
time.sleep (10)
after = dict ([(f, None) for f in os.listdir (path_to_watch)])
added = [f for f in after if not f in before]
removed = [f for f in before if not f in after]
if added:
print("Добавлено: ", ", ".join (added))
result = False
if removed: print("Удалено: ", ", ".join (removed))
before = after
return added
writer = pd.ExcelWriter(fullpathtosave)
df.to_excel(writer,'Sheet1',index=False)
writer.save()
from testpackage.subtestpackage.subtestmodule import subtestfunc, Subtestclass, anotherfunc
a = subtestfunc()
b = Subtestclass()
c = anotherfunc()
from testpackage.subtestpackage import subtestmodule as sm
a = sm.subtestfunc()
b = sm.Subtestclass()
c = sm.anotherfunc()