myfile = 'bot_users.ini'
word = '76561198985130944'
cash = 500
f = open(myfile, 'r+', encoding="utf-8")#открыл файл
lines = f.read().strip().split("\n")
for line in lines:#читаю строки
if word in line:#ищу слово word = 76561198985130944 в строках
lines.remove(line)
new_list = line.split(' ')#создаю список из строки
print(new_list)#для проверки вывожу на экран
#присваиваю значения
steamid = new_list[0]
name = new_list[8]
bank = new_list[5]
newbank = int(bank) + cash#создаю (задаю) новое значение newbank
lines.append(" ".join(new_list).replace(bank, str(newbank)))
print('New Bank: {}'.format(newbank))#проверка значения newbank
print('>>>>>>>>Found: {}\nSteamid: {}\nName: {}\nBank: {}'.format(word, steamid, name, bank))
f.truncate(0)
f.write("\n".join(lines))
f.close()
client = ScraperAPIClient('34hg32423g5h42j345234gj6776k')
result = client.get(url = 'http://httpbin.org/ip', headers = {"X-MyHeader": "123", "Cookie": "aep_usuc_f=isfm=y&site=rus&c_tp=RUB&isb=y®ion=RU&b_locale=ru_RU"})
exp = input("Please input a math expression:\n")
print(f"result of you expression is {eval(exp)}")
SELECT `right_answer` FROM music WHERE id = 3;
arr = None
arr[0]
import multiprocessing
import time
def func(number):
for i in range(1, 10):
time.sleep(0.01)
print('Processing ' + str(number) + ': prints ' + str(number*i))
# list of all processes, so that they can be killed afterwards
all_processes = []
for i in range(0, 3):
process = multiprocessing.Process(target=func, args=(i,))
process.start()
all_processes.append(process)
# kill all processes after 0.03s
time.sleep(0.03)
for process in all_processes:
process.terminate()
from kivy.app import App
from kivy.uix.textinput import TextInput
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.config import Config
from random import choice
Config.set('graphics', 'resizable', '1')
Config.set('graphics', 'width', '350')
Config.set('graphics', 'height', '150')
class PassGenApp(App):
txt1 = TextInput()
txt2 = TextInput()
chars = '+-/*!&$#?=@<>%^:;""_~()abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
def generate(self):
print(["".join([choice(self.chars) for i in range(int(self.txt2.text))]) for passcount in range(int(self.txt1.text))])
def build(self, **kwargs):
bl = BoxLayout(orientation='vertical')
gl = GridLayout(cols=2)
bl.add_widget(Label(text=''))
gl.add_widget(Label(text='PassNum:'))
gl.add_widget(self.txt1)
gl.add_widget(Label(text='PassLength:'))
gl.add_widget(self.txt2)
gl.add_widget(Button(text='Generate'))
gl.add_widget(bl)
return gl
if __name__ =='__main__':
PassGenApp().run()
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
python3 не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
pyinstaller --onefile --add-data "logo.jpg;logo.jpg" main.py
pyinstaller --onefile --add-data "imgs\logo.jpg;imgs\logo.jpg" main.py