from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
import random
class TutorialApp(App):
def generator_engine(self, instance):
chars = '+-/*!&$#?=@<>%^:;()abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
number = 1
length = 10
for n in range(number):
password = ''
for i in range(length):
password += random.choice(chars)
print(password)
def build(self):
root_widget = BoxLayout(orientation='vertical')
output_label = Label(text='',
size_hint_y=.5,
)
generate_button = Button(text='Generate!',
on_press=self.generator_engine,
size_hint_y=.5)
clear_button = Button(text='Clear',
size_hint_y=.5)
root_widget.add_widget(output_label)
root_widget.add_widget(generate_button)
root_widget.add_widget(clear_button)
return root_widget
if __name__ == "__main__":
TutorialApp().run()
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
import random
class TutorialApp(App):
def generator_engine(self, instance):
chars = '+-/*!&$#?=@<>%^:;()abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
number = 1
length = 10
for n in range(number):
password = ''
for i in range(length):
password += random.choice(chars)
print(password)
def build(self):
root_widget = BoxLayout(orientation='vertical')
output_label = Label(text='',
size_hint_y=.5,
)
generate_button = Button(text='Generate!',
on_press=self.generator_engine,
size_hint_y=.5)
clear_button = Button(text='Clear',
size_hint_y=.5)
def generated_password(instance):
output_label.text += instance.text
generate_button.bind(on_press=generated_password)
root_widget.add_widget(output_label)
root_widget.add_widget(generate_button)
root_widget.add_widget(clear_button)
return root_widget
if __name__ == "__main__":
TutorialApp().run()
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
import random
class TutorialApp(App):
def generator_engine(self, instance):
chars = '+-/*!&$#?=@<>%^:;()abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
number = 1
length = 10
for n in range(number):
password = ''
for i in range(length):
password += random.choice(chars)
print(password)
def build(self):
root_widget = BoxLayout(orientation='vertical')
output_label = Label(text='',
size_hint_y=.5,
)
generate_button = Button(text='Generate!',
on_press=self.generator_engine,
size_hint_y=.5)
#output_label.text += .text
clear_button = Button(text='Clear',
size_hint_y=.5)
root_widget.add_widget(output_label)
root_widget.add_widget(generate_button)
root_widget.add_widget(clear_button)
return root_widget
if __name__ == "__main__":
TutorialApp().run()
import requests
from bs4 import BeautifulSoup
import openpyxl
import os
# Parser
url = 'https://pythonworld.ru/osnovy/sintaksis-yazyka-python.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
Parsed = soup.find('h2').text
# excelWriter
# create a new Excell file
filename = 'save.xlsx'
if os.path.exists(filename):
xlsfile = openpyxl.load_workbook(filename)
else:
xlsfile = openpyxl.Workbook()
xlsfile.sheetnames
sheet = xlsfile['Sheet']
#add data
data = [Parsed]
max_rows = sheet.max_row
for row, (data) in enumerate(data, start=1):
sheet['A{}'.format(row+max_rows)].value = data
#save
xlsfile.save('save.xlsx')
print(Parsed)