Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Subindo os arquivos em Python
  • Loading branch information
klebera-santos authored Jan 11, 2023
0 parents commit b0ed542
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Login_teste.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from getpass import getpass
from inspect import EndOfBlock
from tkinter import END

print("Crie seu usuário e senha!!!!")
username = input("Crie com seu usuário: ")
password = getpass("Crie com sua senha: ")

valida_user = input("Digite o seu usuário: ")
valida_pass_user = getpass("Digite a sua senha: ")



if ('valida_user' == 'username' and 'valida_pass_user' == 'password'):
print("Usuário Logado com Sucesso!")
elif ('validar_user' == 'username' and 'valida_pass_user' != 'password'):
print("Senha Incorreta")
else: 'valida_user' != 'username' and 'valida_pass_user' != 'password'
print("Usuário ou senha incorretos")


'''
elif valida_user != username:
print("Usuário incorreto")
else:
valida_user = input("Digite o seu usuário:")
END
'''
''' elif
'valida_pass_user' != 'password':
print("Senha incorreta")
elif 'valida_user' == 'username' and 'valida_pass_user' == 'password':
print("Usuário logado com Sucesso")
else:
print("Usuário e Senha incorretos")
'''

'''
Realizando a soma no Python
print(2*5)
'''
21 changes: 21 additions & 0 deletions Tabuada.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
print("Bem vindo a Tabuada")
num_base = int(input("Digite um numero base "))
num_cont = 1
ref_saida = " * "
ref_saida2 = " = "

for num_cont in range(11):
resultado = num_base * num_cont
print (resultado)

#print (num_base + " * " + "2 " + "= " + num_base * 2)
#print (num_base + " * " + "3 " + "= " + num_base * 3)
#print (num_base + " * " + "4 " + "= " + num_base * 4)
#print (num_base + " * " + "5 " + "= " + num_base * 5)
#print (num_base + " * " + "6 " + "= " + num_base * 6)
#print (num_base + " * " + "7 " + "= " + num_base * 7)
#print (num_base + " * " + "8 " + "= " + num_base * 8)
#print (num_base + " * " + "9 " + "= " + num_base * 9)
#print (num_base + " * " + "10 " + "= " + num_base * 10)


14 changes: 14 additions & 0 deletions hello_word.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# First things, first. Import the wxPython package.
import wx

# Next, create an application object.
app = wx.App()

# Then a frame.
frm = wx.Frame(None, title="Hello World")

# Show it.
frm.Show()

# Start the event loop.
app.MainLoop()
106 changes: 106 additions & 0 deletions hello_world2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#import wx; a=wx.App(); wx.Frame(None, title="Hello World").Show(); a.MainLoop()

#!/usr/bin/env python
"""
Hello World, but with more meat.
"""

import wx

class HelloFrame(wx.Frame):
"""
A Frame that says Hello World
"""

def __init__(self, *args, **kw):
# ensure the parent's __init__ is called
super(HelloFrame, self).__init__(*args, **kw)

# create a panel in the frame
pnl = wx.Panel(self)

# put some text with a larger bold font on it
st = wx.StaticText(pnl, label="Hello World!")
font = st.GetFont()
font.PointSize += 10
font = font.Bold()
st.SetFont(font)

# and create a sizer to manage the layout of child widgets
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(st, wx.SizerFlags().Border(wx.TOP|wx.LEFT, 25))
pnl.SetSizer(sizer)

# create a menu bar
self.makeMenuBar()

# and a status bar
self.CreateStatusBar()
self.SetStatusText("Welcome to wxPython!")


def makeMenuBar(self):
"""
A menu bar is composed of menus, which are composed of menu items.
This method builds a set of menus and binds handlers to be called
when the menu item is selected.
"""

# Make a file menu with Hello and Exit items
fileMenu = wx.Menu()
# The "\t..." syntax defines an accelerator key that also triggers
# the same event
helloItem = fileMenu.Append(-1, "&Hello...\tCtrl-H",
"Help string shown in status bar for this menu item")
fileMenu.AppendSeparator()
# When using a stock ID we don't need to specify the menu item's
# label
exitItem = fileMenu.Append(wx.ID_EXIT)

# Now a help menu for the about item
helpMenu = wx.Menu()
aboutItem = helpMenu.Append(wx.ID_ABOUT)

# Make the menu bar and add the two menus to it. The '&' defines
# that the next letter is the "mnemonic" for the menu item. On the
# platforms that support it those letters are underlined and can be
# triggered from the keyboard.
menuBar = wx.MenuBar()
menuBar.Append(fileMenu, "&File")
menuBar.Append(helpMenu, "&Help")

# Give the menu bar to the frame
self.SetMenuBar(menuBar)

# Finally, associate a handler function with the EVT_MENU event for
# each of the menu items. That means that when that menu item is
# activated then the associated handler function will be called.
self.Bind(wx.EVT_MENU, self.OnHello, helloItem)
self.Bind(wx.EVT_MENU, self.OnExit, exitItem)
self.Bind(wx.EVT_MENU, self.OnAbout, aboutItem)


def OnExit(self, event):
"""Close the frame, terminating the application."""
self.Close(True)


def OnHello(self, event):
"""Say hello to the user."""
wx.MessageBox("Hello again from wxPython")


def OnAbout(self, event):
"""Display an About Dialog"""
wx.MessageBox("This is a wxPython Hello World sample",
"About Hello World 2",
wx.OK|wx.ICON_INFORMATION)


if __name__ == '__main__':
# When this module is run (not imported) then create the app, the
# frame, show it, and start the event loop.
app = wx.App()
frm = HelloFrame(None, title='Hello World 2')
frm.Show()
app.MainLoop()
14 changes: 14 additions & 0 deletions interface_grafica.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from tkinter import *
class Application:
def __init__(self, master=None):
self.widget1 = Frame(master)
self.widget1.pack()
self.msg = Label(self.widget1, text="Primeiro widget")
self.msg.pack ()
root = Tk()
Application(root)
root.mainloop()

texto_resposta.grid(column=0, row=2, padx=10, pady=10)

janela.mainloop()
11 changes: 11 additions & 0 deletions login2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
usuario = input("Qual o usuário?" ).strip()

usuario1 = usuario == "Kleber"
usuario2 = usuario == "Re"
usuario3 = usuario == "Gui"
usuario4 = usuario == "Ana"

if(usuario1 or usuario2 or usuario3 or usuario4):
print(f"Seja bem-vindo {usuario}!")
else:
print("Usuario não encontrado!")
20 changes: 20 additions & 0 deletions mapas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


import folium

#Criando o mapa
mapa = folium.Map(
location = [-23.550093493433984, -46.6341472592547],
tiles='Stamen Terrain', #estilo do mapa
zoom_start=16
)

#Adicion o marcardor no mapa
folium.Marker(
[-23.550093493433984, -46.6341472592547],
popup='<i>Praça da Sé</i>',
tooltip='Click aqui!'
).add_to(mapa)

#Salva html do mapa #
mapa.save(r'.\mapa.html')
37 changes: 37 additions & 0 deletions numero_extenso.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

#Instalando o pacote
from gettext import install

"""
en(English, default)
am(Amharic)
ar(Arabic)
cz(Czech)
de (German)
dk(Danish)
it(Lithuanian)
lv(Latvian)
no(Norwegian)
pl(Polish)
pt(Portuguese)
pt_br(Portuguese - Brazilian)
"""


#!pip -q install num2words #type: ignore

#Importando o pacote
from num2words import num2words

#Coletando o número do usuário
#Neste exemplo usaremos o número
numero = int(input('Digite um número: '))

#Utilizando a função num2words para gerar o número por extenso
num_pt_br = num2words(numero, lang = 'pt-br')
num_en = num2words(numero, lang = 'en')

#Imprimindo o resultado na tela
print(f'Em Portugues: {num_pt_br}')
print(f'Em Ingles: {num_en}')
16 changes: 16 additions & 0 deletions numeros_ao_quadrado.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lista vazia para armazenar os resultados
quadrados = []

#Loop pelo range de números.

#for i in range(1,11):
# quadrados.append(i * i)

#print(quadrados)

###
#Forma mais expert de fazer

quadrados = [i * i for i in range(1,11)]

print(quadrados)
9 changes: 9 additions & 0 deletions teste_func.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
count = 1

def func():
global count
for i in (1, 2, 3):
count += 1

func()
print(count)
17 changes: 17 additions & 0 deletions teste_musica.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pytube import YouTube
import movie.py.editor as mp
import re
import os

#Digite o link do video e o local que deseja salvar o mp3 #
link = input("Digite o link do video que deseja baixar:")
path = input("Digite o diretorio que deseja salvar o arquivo:")
yt = YouTube(link)

#Começa o Download #
print("Baixando ...")
ys = yt.streams.filter(only_audio=True).first().download(path)
print("Download Completo")

#Converte mp4 para mp3#

24 changes: 24 additions & 0 deletions testeloglog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from getpass import getpass

def validauser():
print("Validando o usuário")
valida_user = input("Digite o seu usuário: ")
valida_pass_user = getpass("Digite a sua senha: ")

print("Crie seu usuário e senha!!!!")
username = input("Crie com seu usuário: ")
password = getpass("Crie com sua senha: ")
print("Usuário inserido com sucesso!!!")



if valida_user == username:
print("Usuário correto")
elseif
print("Usuário Incorreto")

'''
Realizando a soma no Python
print(2*5)
'''

0 comments on commit b0ed542

Please sign in to comment.