repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
krzem5/Python-Ascii_Img_Converter | src/main.py | <filename>src/main.py
from PIL import Image
import numpy as np
gscale1 = "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. "
gscale2 = '@%#*+=-:. '
def getAverageL(image):
im = np.array(image)
w,h = im.shape
return np.average(im.reshape(w*h))
def covertImageToAscii(fileName, cols, scale, m... |
pjcasas29/wavenet_vocoder_cqt | datasets/wavallinn.py | <reponame>pjcasas29/wavenet_vocoder_cqt
from concurrent.futures import ProcessPoolExecutor
from functools import partial
import numpy as np
import os
import audio
from nnmnkwii import preprocessing as P
from hparams import hparams
from os.path import exists, basename, splitext
import librosa
from glob import glob
fro... |
olganaumova2007/memory-card | my_memory_card.py | <filename>my_memory_card.py<gh_stars>0
#создай приложение для запоминания информации
from PyQt5.QtCore import Qt #подключаем библеотеки
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton,QLabel,QVBoxLayout,QHBoxLayout,QRadioButton,QGroupBox,QButtonGroup#подключаем библиотеки и классы
from random import shu... |
cq615/Joint-Motion-Estimation-and-Segmentation | main.py | <reponame>cq615/Joint-Motion-Estimation-and-Segmentation<filename>main.py
import os, time, h5py, sys
from models.seg_network import build_FCN_triple_branch
from dataio.dataset import *
from utils.metrics import *
from dataio.data_generator import *
from utils.visualise import *
import lasagne.layers as L
import lasagne... |
cq615/Joint-Motion-Estimation-and-Segmentation | dataio/dataset.py | <gh_stars>10-100
import os, time, h5py, sys
import nibabel as nib
import cv2
import numpy as np
from scipy import ndimage
def load_dataset(filename):
f = h5py.File(filename, 'r')
image = np.array(f['image'])
label = np.array(f['label'])
return image, label
def convert_to_1hot(label, n_class):
# ... |
cq615/Joint-Motion-Estimation-and-Segmentation | models/network.py | <filename>models/network.py
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 24 16:44:08 2018
@author: cq615
"""
import theano
import theano.tensor as T
from theano.sandbox.cuda import dnn
import lasagne
import lasagne.layers as L
from lasagne.layers.base import Layer
from lasagne.utils import as_tuple
from lasagne.lay... |
cq615/Joint-Motion-Estimation-and-Segmentation | pytorch_version/main_motion.py | import torch
import torch.optim as optim
from torch.autograd import Variable
import torch.nn as nn
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from network import *
from dataset import *
from util import *
import time
import scipy.io
import os
import matplotlib.pyplot as plt
import... |
cq615/Joint-Motion-Estimation-and-Segmentation | utils/visualise.py | <gh_stars>10-100
import numpy as np
import matplotlib.pyplot as plt
import os, sys
def mask_color_img(img, mask):
alpha = 0.5
rows, cols = img.shape
# Construct a colour image to superimpose
color_mask = np.zeros((rows, cols, 3))
color_mask[mask == 1] = [1, 0, 0] # Red block
color_mask[mask =... |
cq615/Joint-Motion-Estimation-and-Segmentation | test_prediction.py | """
Created on Mon Feb 12 17:52:19 2018
@author: cq615
"""
import os, time, h5py, sys
from models.seg_network import build_FCN_triple_branch_rnn
from dataio.dataset import *
from utils.metrics import *
from dataio.data_generator import *
from utils.visualise import *
import lasagne.layers as L
import matplotlib.pyplot... |
cq615/Joint-Motion-Estimation-and-Segmentation | pytorch_version/network.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable, grad
import numpy as np
import math
def relu():
return nn.ReLU(inplace=True)
def conv(in_channels, out_channels, kernel_size=3, stride=1, padding = 1, nonlinearity = relu):
co... |
cq615/Joint-Motion-Estimation-and-Segmentation | pytorch_version/dataset.py | <gh_stars>10-100
import torch.utils.data as data
import numpy as np
import datetime
from os import listdir
from os.path import join
from util import *
class TrainDataset(data.Dataset):
def __init__(self, data_path, transform=None):
super(TrainDataset, self).__init__()
self.data_path = data_path
... |
cq615/Joint-Motion-Estimation-and-Segmentation | utils/seg_metrics.py | <reponame>cq615/Joint-Motion-Estimation-and-Segmentation<filename>utils/seg_metrics.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 22 17:53:58 2018
@author: cq615
"""
import numpy as np, cv2
def np_categorical_dice(pred, truth, k):
# Dice overlap metric for label value k
A = (pred == k).a... |
cq615/Joint-Motion-Estimation-and-Segmentation | utils/metrics.py | <reponame>cq615/Joint-Motion-Estimation-and-Segmentation
import theano.tensor as T
def categorical_crossentropy(prediction, truth):
# prediction: label probability prediction, 4D tensor
# truth: ground truth label map, 1-hot representation, 4D tensor
return - T.mean(T.sum(truth * T.log(prediction), axis=1... |
cq615/Joint-Motion-Estimation-and-Segmentation | dataio/data_generator.py | import os, h5py,sys
import nibabel as nib, numpy as np
# A generator function using the keyword yield
def iterate_minibatches(image, label, batch_size):
assert len(image) == len(label)
for start_idx in range(0, len(image) - batch_size + 1, batch_size):
end_idx = start_idx + batch_size
idx = sli... |
cq615/Joint-Motion-Estimation-and-Segmentation | models/layers.py | import theano.tensor as T
import lasagne
from lasagne.layers import Layer
import theano
import numpy as np
from lasagne.layers import MergeLayer, Conv2DLayer
def ensure_set_name(default_name, kwargs):
"""Ensure that the parameters contain names. Be careful, kwargs need to be
passed as a dictionary here
P... |
lanewinfield/robotpornaddict | porn.py | import httplib, urllib, base64, json
from moviepy.editor import *
from pytube import YouTube
import os
import urllib
import urllib2
from bs4 import BeautifulSoup
import random
from random import randint
from twython import Twython
from gtts import gTTS
def getDescription(img):
headers = {
# Request header... |
leafwind/twitch_analysis | app/handlers/get_signin_stats_handler.py | # -*- coding: utf-8 -*-
import sqlite3
import numpy as np
import pandas as pd
import logging
import time
from datetime import datetime
import json
from collections import OrderedDict
import math
with open('config.json') as fp:
CONFIG = json.load(fp)
html_newline = '<br />'
def h1(s):
return "<h1>" + s + "</h... |
leafwind/twitch_analysis | app/main.py | from flask import Flask
from flask import request
from flask import jsonify
import logging
import requests
import json
import time
import calendar
from handlers.get_channel_stats_handler import get_stats, get_signin_ranking
from handlers.get_signin_stats_handler import get_signin_stats
application = Flask(__name__)
a... |
leafwind/twitch_analysis | app/handlers/get_channel_stats_handler.py | <gh_stars>0
# -*- coding: utf-8 -*-
import sqlite3
import numpy as np
import pandas as pd
import logging
import time
import json
from collections import OrderedDict
import math
with open('config.json') as fp:
CONFIG = json.load(fp)
html_newline = '<br />'
def h1(s):
return "<h1>" + s + "</h1>"
def h2(s):
... |
leafwind/twitch_analysis | app/twitch_utils.py | <filename>app/twitch_utils.py
import requests
USERLIST_API = "http://tmi.twitch.tv/group/user/{}/chatters"
def get_current_users(ch, user_type='all'):
url = USERLIST_API.format(ch)
r = requests.get(url).json()
if user_type == 'all':
all_users = set(sum(r['chatters'].values(), []))
return al... |
SKJNR/Face-Counting- | app.py | import cv2
# Get a reference to webcam
cap = cv2.VideoCapture(0)
# Create the haar cascade
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
while True:
ret, frame = cap.read(0)
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Detect faces in the image
faces =... |
SmileyJames/piecash | tests/test_transaction.py | <filename>tests/test_transaction.py
# coding=utf-8
from __future__ import unicode_literals
from collections import defaultdict
from datetime import datetime, date, time
from decimal import Decimal
import pytest
from piecash import Transaction, Split, GncImbalanceError, GncValidationError, Lot
from test_helper import... |
SmileyJames/piecash | piecash/core/factories.py | # coding=utf-8
from __future__ import unicode_literals
from .._common import GnucashException
from ..yahoo_client import get_latest_quote
def create_stock_accounts(cdty, broker_account, income_account=None, income_account_types="D/CL/I"):
"""Create the multiple accounts used to track a single stock, ie:
- b... |
SmileyJames/piecash | piecash/core/book.py | <filename>piecash/core/book.py
import warnings
from collections import defaultdict
from operator import attrgetter
from sqlalchemy import Column, VARCHAR, ForeignKey
from sqlalchemy.orm import relation, aliased, joinedload
from sqlalchemy.orm.base import instance_state
from sqlalchemy.orm.exc import NoResultFound
fro... |
SmileyJames/piecash | piecash/scripts/qif_export.py | <filename>piecash/scripts/qif_export.py
#!/usr/local/bin/python
"""Basic script to export QIF. Heavily untested ..."""
import sys
# https://github.com/jemmyw/Qif/blob/master/QIF_references
import click
from piecash.scripts.cli import cli
@cli.command()
@click.argument('book', type=click.Path(exists=True))
@click.o... |
SmileyJames/piecash | tests/test_commodity.py | # coding=utf-8
from __future__ import unicode_literals
from datetime import date
from decimal import Decimal
import pytest
from piecash import Price, Commodity, GnucashException
from piecash.core.commodity import GncPriceError
from test_helper import db_sqlite_uri, db_sqlite, new_book, new_book_USD, book_uri, book_b... |
Snow-dash/tag_json | main.py | <filename>main.py
#-------------------changeable var below-------------------
originPath = '' #-----where is the file,will effect the output file's location
pat=''#-----where you store the data\minecraft\tags folder in version.jar
typeli=['blocks','items','entity_types','fluids','game_events']#------what tag... |
bguta/Malcolm-x-bot | malcolm_tweet.py | import config
import malcolm_quotes as mx
import IndexReader as ir
charLim = 280
api = config.api()
def main():
stuff = ir.main()
pg = int(stuff[0])
qt = int(stuff[1])
txt = mx.getQuote(pg, qt)
# print(txt)
print("page: " + str(pg) + " Quote: " + str(qt))
tweets = shorten(txt)
if(di... |
bguta/Malcolm-x-bot | malcolm_quotes.py | <reponame>bguta/Malcolm-x-bot
import requests
from bs4 import BeautifulSoup as bs
import re
url = "http://www.azquotes.com/author/9322-Malcolm_X?p="
# p must be between 1 and 32: this is the page
# q must be between 1 and 25; this is the quote
# this method returns a quote by malcolm x from the url
def getQuote(p, ... |
bguta/Malcolm-x-bot | dailyTimer.py | <filename>dailyTimer.py
import time
import malcolm_tweet
import dropbox_ as dbx
import random
# this is the main function and scheduler
day = 86400
def main():
dbx.download("index.txt", "index.txt")
malcolm_tweet.main()
dbx.upload("index.txt", "index.txt")
def getTime():
return random.randint(day /... |
bguta/Malcolm-x-bot | IndexReader.py | <filename>IndexReader.py
import re
def look():
with open("index.txt", "r") as file:
line = file.readline()
ar = re.sub(r"\t", " ", line).split()
return ar
def write(p, q):
with open("index.txt", "w") as file:
file.write(str(p) + "\t" + str(q))
def main():
reset = False
... |
bguta/Malcolm-x-bot | config.py | # this is your twitter info
# i removied mine but you can add yours and it will do the exact same thing
import tweepy
# your info
consumer_key =
consumer_secret =
access_token =
access_token_secret =
def api():
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, acc... |
bguta/Malcolm-x-bot | dropbox_.py | """
A module to read and write dropbox files and save them using dropbox
"""
import dropbox
import os
ac = "" # add your own access key for dropbox api
dbx = dropbox.Dropbox(ac)
def upload(source, output, large=False):
"""
@param source
a file name e.g (test.txt). this is the file which is read
@pa... |
AdamIsrael/openmano | utils.py | <gh_stars>0
# -*- coding: utf-8 -*-
##
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
# This file is part of openmano
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of ... |
softlayer/ironic-inventory-integrator | ironic_inventory/common/exceptions.py | <filename>ironic_inventory/common/exceptions.py
# -*- encoding: utf-8 -*-
"""Common exceptions for the inventory manager.
"""
class ExistingMACAddress(Exception):
code = 409
message = u'A server with the MAC address %(address)s already exists.'
def __init__(self, address, message=None, **kwargs):
... |
softlayer/ironic-inventory-integrator | ironic_inventory/db/sqlalchemy/alembic/versions/4f310004f218_adding_initial_tables.py | """Adding initial tables
Revision ID: 4f310004f218
Revises:
Create Date: 2015-10-23 16:08:21.396455
"""
# revision identifiers, used by Alembic.
revision = '4f310004f218'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands aut... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/controllers/v1/server.py | # -*- encoding: utf-8 -*-
import pecan
from pecan import rest
from wsme import types as wtypes
from ironic_inventory.api.controllers.base import ApiBase
from ironic_inventory.api.controllers.root import wsme_expose
from ironic_inventory.db import api as dbapi
from ironic_inventory.objects.server import ServerFields
... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/controllers/v1/reservation.py | from pecan import rest
from wsme import types as wtpes
from ironic_inventory.api.controllers.base import ApiBase
class Reservation(ApiBase):
"""API repersentation of a reservation."""
id = wtpes.IntegerType
|
softlayer/ironic-inventory-integrator | ironic_inventory/common/paths.py | # -*- encoding: utf-8 -*-
"""Common application path definitions and helper methods."""
import os
from oslo_config import cfg
path_opts = [
cfg.StrOpt('pybasedir',
default=os.path.abspath(os.path.join(os.path.dirname(__file__),
'../')),
... |
softlayer/ironic-inventory-integrator | ironic_inventory/tests/db/__init__.py | <reponame>softlayer/ironic-inventory-integrator
__author__ = 'chaustin'
|
softlayer/ironic-inventory-integrator | ironic_inventory/cmd/dbsync.py | # -*- encoding: utf-8 -*-
import sys
from oslo_config import cfg
# from ironic_inventory.common import service
# from ironic_inventory.db import migration
CONF = cfg.CONF
class DBCommand(object):
pass
def main():
valid_commands = {
'upgrade', 'downgrade', 'revision', 'version', 'stamp',
'c... |
softlayer/ironic-inventory-integrator | ironic_inventory/db/sqlalchemy/base.py | <gh_stars>1-10
# -*- encoding: utf-8 -*-
"""Base definitions for SQLAlchemy and db specific configurations."""
from oslo_config import cfg
from oslo_db import options as db_options
from oslo_db.sqlalchemy import models as oslo_models
from sqlalchemy.ext.declarative import declarative_base
from ironic_inventory.common... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/controllers/root.py | # -*- encoding: utf-8 -*-
"""
Root controller for web api.
"""
from pecan import rest
from wsme import types as wtpes
from ironic_inventory.api.controllers.base import wsme_expose
class Version(object):
"""The version's ID"""
id = wtpes.text
@staticmethod
def get_default(id):
version = Ve... |
softlayer/ironic-inventory-integrator | ironic_inventory/db/sqlalchemy/models.py | <reponame>softlayer/ironic-inventory-integrator
# -*- encoding: utf-8 -*-
"""
SQLAlchemy models for bare metal inventory management.
"""
from sqlalchemy import Column, Integer, String, Boolean, schema
from sqlalchemy import ForeignKey, orm
from ironic_inventory.db.sqlalchemy.base import DeclarativeBaseImpl
from iron... |
softlayer/ironic-inventory-integrator | ironic_inventory/tests/test_units.py | from unittest import TestCase
|
softlayer/ironic-inventory-integrator | ironic_inventory/db/sqlalchemy/migration.py | # -*- encoding: utf-8 -*-
"""Database setup and migration commands."""
from oslo_config import cfg
from stevedore import driver
_IMPL = None
def get_backend():
global _IMPL
if not _IMPL:
cfg.CONF.import_opt('backend', 'oslo_db.options', group='database')
_IMPL = driver.DriverManager("ironic... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/controllers/v1/__init__.py | from ironic_inventory.api.controllers.v1 import server
|
softlayer/ironic-inventory-integrator | ironic_inventory/db/sqlalchemy/api.py | # -*- encoding: utf-8 -*-
"""API/Interface to the SQLAlchemy backend.
"""
import copy
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import session as db_session
from oslo_log import log
from sqlalchemy.orm import exc as sqla_exc
from ironic_inventory.common import excepti... |
softlayer/ironic-inventory-integrator | ironic_inventory/db/api.py | # -*- encoding: utf-8 -*-
"""Database API for CRUD on inventory servers.
"""
import abc
import six
from oslo_config import cfg
from oslo_db import api as db_api
_BACKEND_MAPPING = {'sqlalchemy': 'ironic_inventory.db.sqlalchemy.api'}
IMPL = db_api.DBAPI.from_config(cfg.CONF, backend_mapping=_BACKEND_MAPPING, lazy=... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/config.py | <filename>ironic_inventory/api/config.py
# -*- encoding: utf-8 -*-
# Server Specific Configurations
server = {
'port': '8090',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ironic_inventory.api.controllers.root.RootController',
'modules': ['ironic_inventory.api'],
'static... |
softlayer/ironic-inventory-integrator | ironic_inventory/objects/server.py | <gh_stars>1-10
"""A definition of the fields describing a server used in lieu of defining remotable
objects"""
ServerFields = frozenset(['id', 'uuid', 'name', 'cpu_count',
'local_drive_capacity', 'psu_capacity', 'psu_size',
'memory_mb', 'cpu_architecture', 'ipmi_pass... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/hooks.py | # -*- encoding: utf-8 -*-
"""Pecan request hooks."""
from pecan import hooks
from ironic_inventory.db import api as dbapi
class SqlAlchemyHook(hooks.PecanHook):
def before(self, state):
state.request.dbapi = dbapi.get_instance()
|
softlayer/ironic-inventory-integrator | ironic_inventory/api/app.py | <reponame>softlayer/ironic-inventory-integrator
import pecan
from pecan import make_app
from ironic_inventory.api import config
def get_pecan_config():
"""Load the pecan configuration file and return the config object"""
config_file = config.__file__.replace('.pyc', '.py')
return pecan.configuration.con... |
softlayer/ironic-inventory-integrator | ironic_inventory/api/controllers/base.py | <reponame>softlayer/ironic-inventory-integrator
from wsme import types as wtypes
from wsmeext import pecan as wsme_pecan
__author__ = 'chaustin'
class ApiBase(wtypes.Base):
"""A Base Object for handling serialization of objects from request
"""
def as_dict(self):
return {field: getattr(self, fie... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex013.py | <reponame>GabrielMazzuchello/Curso-Em-Video
s = float(input('qual erá o salario do funcionario? R$'))
aul = s * 15 / 100
print('o salario do funcionari que andes custava R${:.2f} agora com 15% de aumento custará R${:.2f}'.format(s, (s+aul)))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex045_GAME Pedra Papel e Tesoura.py | <filename>Exercicios/ex045_GAME Pedra Papel e Tesoura.py
from random import randint
from time import sleep
itens = ('Pedra', 'Papel', 'Tesoura') # lista de itens
computador = randint(0, 2) # o computador esta sorteando entre 0, 1 ou 2..
print(''' Suas opções
[0] Pedra
[1] Papel
[2] Tesoura''')
player = int(inpu... |
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex005.py | <reponame>GabrielMazzuchello/Curso-Em-Video
A = float(input('Informe um valor numerico: '))
B = float(input('Informe outro valor numerico: '))
auxiliar = B
B = A
A = auxiliar
print('o valor de A-{} e de B-{} '.format(A, B))
|
GabrielMazzuchello/Curso-Em-Video | Aulas/aula08a.py | <gh_stars>1-10
from math import sqrt
numero1 = float(input('digite um numero'))
raiz = sqrt(numero1)
print('a raiz de {} é {:.2f}'.format(numero1, raiz))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex028.py | from random import randint
numeroescolhido = randint(0, 5)
escolha = int(input('Adivinhe o numero que o computador escolheu entre 0 e 5: '))
if numeroescolhido == escolha:
print('parabens você acertou')
else:
print('Que pena você errou, Boa Sorte na proxima ')
print('O numero era {}'.format(numeroescolhido)... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex005.py | n1 = int(input('Digite um numero:'))
cores = {'amarelo': '\033[33m',
'limpa': '\033[m',
'vermelha': '\033[31m'}
print('analisando o valor {}{}{} o seu antecesor é {}{}{} e seu sucessor é {}{}{}'.format(cores['amarelo'], n1, cores['limpa'],
... |
GabrielMazzuchello/Curso-Em-Video | Aulas/test.py | import math
def raiz():
try:
numero1 = float(input('Informe o numero para descobrir sua raiz: '))
resultado = math.sqrt(numero1)
return resultado
except ValueError:
print('Somente numeros')
def porcentagem():
try:
numero1 = float(input('Informe a porcentagem: '))
... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex047_Contagem de pares.py | <filename>Exercicios/ex047_Contagem de pares.py
from colorama import Fore
from colorama import Style
vetinpar = []
vetpar = []
for c in range(1, 51):
if c % 2 == 0:
vetinpar.append(c)
else:
vetpar.append(c)
print('Os numeros ímpares são: {}{}{}'.format(Fore.LIGHTRED_EX, vetinpar, Style.RESET_... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex049_Tabuada v.2.0.py | <filename>Exercicios/ex049_Tabuada v.2.0.py
class cor:
BLACK = '\033[30m'
RED = '\033[91m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
BLUE = '\033[94m'
PURPLE = '\033[95m'
CYAN = '\033[96m'
GRAY = '\33[37m'
WHITE = '\033[97m'
CLEAR = '\033[m'
numero = int(input('Informe o numero da... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex003.py | <gh_stars>1-10
n1 = int(input('digite um numero:'))
n2 = int(input('digite outro:'))
s = n1 + n2
cores = {'limpa': '\033[m',
'vermelho': '\033[0;31m',
'amarelo': '\033[0;33m'}
print('a soma entre {}{}{} e {}{}{} corresponde {}{}'.format(cores['amarelo'], n1, cores['limpa'], cores['amarelo'], n2,
... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex012.py | v = float(input('qual e o valor do seu produto? R$:'))
d = v / 100 * 5
print('o valor do produto de R$:{} agora com 5% de desconto ficou R$:{:.2f}'.format(v, (v-d)))
|
GabrielMazzuchello/Curso-Em-Video | Aulas/aula07.py | <reponame>GabrielMazzuchello/Curso-Em-Video<gh_stars>1-10
n1 = int(input('Digite um valor: '))
n2 = int(input('Digite outro valor: '))
s = n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
po = n1 ** n2
print('A soma de {} e {} é de {} a multiplicação é {} e a divisão {:.3f}'.format(n1, n2, s, m, d), end=' ')
print('A divi... |
GabrielMazzuchello/Curso-Em-Video | Aulas/aula011a.py | print('\033[0;31;40mOlá, Mundo!\033[m')
print('\033[7;97mOlá, Mundo!\033[m')
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex015.py | <reponame>GabrielMazzuchello/Curso-Em-Video<filename>Exercicios/ex015.py<gh_stars>1-10
di = int(input('quantos dias o carro foi alugado?'))
km = float(input('quantos km o carro percorreu?'))
total = (km * 0.15) + (di * 60)
print('o aluguel do carro custou R${:.2f}'.format(total))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex031_Custo Da Viagem.py | <reponame>GabrielMazzuchello/Curso-Em-Video<gh_stars>1-10
distancia = float(input('informe a distancia da sua viagem (km)'))
if distancia > 200:
print('O valor de sua viagem custara R$:{:.2f}'.format(distancia*0.45))
else:
print('O valor de sua viagem custará R$:{:.2f}'.format(distancia*0.50))
|
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex013.py | <reponame>GabrielMazzuchello/Curso-Em-Video<filename>SATC_exercicios/ex013.py
vetcustos = []
vetprecos = []
for i in range(3):
vetcustos.append(float(input('Informe o custo de um produto: ')))
vetprecos.append(float(input('Informe o preço da vendo do produto: ')))
if vetcustos[i] == vetprecos[i]:
... |
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex015_Trabalho Modulo III.py | <filename>SATC_exercicios/ex015_Trabalho Modulo III.py
vetpessoas = []
# vetor de pessoas
def removerpaciente():
# função para remover os pacientes
for i in range(len(vetpessoas)):
print('Há pessoa da posição {}{}{} é {}{}{}'.format('\033[35m', i, '\033[m', '\033[31m', vetpessoas[i],
... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex030.py | numero = int(input('Informe um número INTEIRO: '))
if numero % 2 == 0:
print('O numero {} e par'.format(numero))
else:
print('O numero {} e inpar'.format(numero))
|
GabrielMazzuchello/Curso-Em-Video | Aulas/aula010.py | <filename>Aulas/aula010.py
nota1 = float(input('digite a primeira nota: '))
nota2 = float(input('Digite a segunda nota: '))
media = (nota1 + nota2)/2
if media >= 6:
print('Sua media é exelente!! {} '.format('\U0001F496'))
else:
print('Sua media é ruin ESTUDE MAIS {} '.format('\U0001F4A2'))
# o codigo ->\U0001F4... |
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex014.py | <gh_stars>1-10
# Desenvolva uma calculadora que possua um menu, tratamento de erro caso o usuario escolha uma operação invalida e utilize funções na mesma
def calculadora(numero1, numero2, operacao):
if operacao == '+':
print(numero1 + numero2)
elif operacao == '-':
print(numero1 - numero2)
... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex023.py | <gh_stars>1-10
numero = int(input('Digite um numero: '))
u = numero // 1 % 10
d = numero // 10 % 10
c = numero // 100 % 10
m = numero // 1000 % 10
print('Analisando o numero: {}'.format(numero))
print('Unidade(s): {}'.format(u))
print('Desena(s): {}'.format(d))
print('Centena(s): {}'.format(c))
print('Milhar(es): {}'... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex027.py | <filename>Exercicios/ex027.py
nome = str(input('Digite seu nome completo :')).strip()
nome1 = nome.split()
print('prazer em conheser(lo)!!')
print('Seu primeiro nome é {}'.format(nome1[0]))
print('Seu ultimo nome é {}'.format(nome1[len(nome1)-1]))
|
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex003.py | nome = str(input('Informe o seu nome: '))
salario = float(input('Informe seu salário fixo: '))
vendas = float(input('informe o total de vendas: '))
newsalario = salario + (salario * 15 / 100)
print('Olá, {} seu salário fixo é R$:{:.2f} e o seu salário final desse mes é R$:{:.2f}'.format(nome, salario, newsalario))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex018.py | from math import radians, sin, cos, tan
angulo = float(input('Digite o valor do angulo desejado: '))
print('')
seno = sin(radians(angulo))
print('o seno do angulo {}° É> {:.2f}'.format(angulo, seno))
cosseno = cos(radians(angulo))
print('O cosseno do angulo {}° É> {:.2f}'.format(angulo, cosseno))
tangente = tan(radia... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex020.py | from random import shuffle
nome1 = input('Primeiro nome:')
nome2 = input('Segundo nome:')
nome3 = input('Terceiro nome:')
nome4 = input('Quarto nome:')
lista = [nome1, nome2, nome3, nome4]
shuffle(lista)
print("")
print('A ordem de apresentação do trabalho será:')
print(lista)
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex021.py | import pygame
pygame.mixer.init()
pygame.mixer.music.load('ex021.mp3')
pygame.mixer.music.play()
input('=====Iniciado...=====')
|
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex010.py | <reponame>GabrielMazzuchello/Curso-Em-Video
numero1 = float(input('Informe o primeiro numero: '))
numero2 = float(input('Informe o segundo numero: '))
if numero1 > numero2:
print('O numero {} é maior'.format(numero1))
else:
print('numero {} e maior'.format(numero2))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex010.py | <filename>Exercicios/ex010.py
n1 = float(input('Quantos reais voce tem na carteira? R$'))
print('Com R${} voce pode comprar U${:.2f} '.format(n1, (n1/5.20)))
|
GabrielMazzuchello/Curso-Em-Video | Aulas/aula09a.py | <filename>Aulas/aula09a.py
frase = 'Curso em Video Python'
dividido = frase.split()
print(dividido[0])
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex041_Classificando Atletas.py | <reponame>GabrielMazzuchello/Curso-Em-Video<gh_stars>1-10
from datetime import date
nascimento = int(input('Informe o ano de nacimento: '))
ano = date.today().year
idade = ano - nascimento
print('')
print('A idade do atleta é {} ano(S)'.format(idade))
if idade <= 9:
print('A categoria do atleta é MIRIM')
elif idad... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex046_Contagem regressiva.py | <reponame>GabrielMazzuchello/Curso-Em-Video<filename>Exercicios/ex046_Contagem regressiva.py<gh_stars>1-10
from time import sleep
print('Contagem regressiva para o lançamento dos fogos de artificios!!\n')
for c in range(10, -1, -1):
print('Contagem regreciva: {}'.format(c))
sleep(1)
print('\nEstourando os fogos... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex026.py | frase = str(input('Digite uma frase ')).strip()
print('Aparece {} vezes a letra A'.format(frase.upper().count('A')))
print('A primeira letra A apareseu na posição {}'.format(frase.find('A')+1))
print('A ultima letra A apareceu na posição {}'.format(frase.rfind('A')+1))
|
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex007.py | cores = {'vermelho': '\033[31m',
'limpa': '\033[m',
'verde': '\033[34m'}
preco = float(input('informe o valor do seu produto:'))
parcela = int(input('Informe em quantas vezes quer parcelar:'))
print('')
vetparcela = []
for i in range(parcela):
vetparcela.append(preco / parcela)
print('O valor d... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex056_Analisador completo.py | somaidade = 0
mediaidade = 0
idadevelho = 0
nomevelho = ''
mulhernova = 0
for p in range(1, 5):
print('------ {}° PESSOA ------')
nome = str(input('Informe seu nome: ')).strip()
idade = int(input('Informe sua idade: '))
sexo = str(input('informe seu Sexo [M/F]')).strip()
somaidade += idade
i... |
GabrielMazzuchello/Curso-Em-Video | SATC_exercicios/ex004.py | <filename>SATC_exercicios/ex004.py
nome = str(input('Informe o nome do aluno: '))
nota1 = float(input('Informe a 1° nota: '))
nota2 = float(input('Informe a 2° nota: '))
nota3 = float(input('Informe a 3° nota: '))
media = (nota1 + nota2 + nota3) / 3
print('A media do aluno: {} é de {:.2f}'.format(nome, media))
|
GabrielMazzuchello/Curso-Em-Video | Aulas/aula013.py | <filename>Aulas/aula013.py
s = 0
for c in range(1, 5):
num = int(input('Informe um numero: '))
s += num
print('\nA soma total dos numeros foi de {}'.format(s))
|
GabrielMazzuchello/Curso-Em-Video | Aulas/arquivo de cores.py | class cor:
BLACK = '\033[30m'
RED = '\033[91m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
BLUE = '\033[94m'
PURPLE = '\033[95m'
CYAN = '\033[96m'
GRAY = '\33[37m'
WHITE = '\033[97m'
CLEAR = '\033[m' |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex054_Grupo da Maioridade.py | from datetime import date
nascimento = []
for c in range(7):
nascimento.append(int(input('Informe o ano que nasceu há {}° pessoa: '.format(c+1))))
for c in range(len(nascimento)):
anoatual = date.today().year
idade = anoatual - nascimento[c]
if idade >= 18:
print('\nVocê é MAIOR de idade! -->... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex050_Soma dos pares.py | soma = 0
for c in range(1, 7):
numero = float(input('Informe o {}° número: '.format(c)))
if numero % 2 == 0:
soma = numero + soma
print('A soma dos números pares digitados é : {}'.format(soma))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex009.py | <reponame>GabrielMazzuchello/Curso-Em-Video
n1 = int(input('Digite o numero para ver sua tabuada:'))
print('_' * 13)
print(' {} X 1 = {:2}'.format(n1, (n1 * 1)))
print(' {} X 2 = {:2}'.format(n1, (n1 * 2)))
print(' {} X 3 = {:2}'.format(n1, (n1 * 3)))
print(' {} X 4 = {:2}'.format(n1, (n1 * 4)))
print(' {} X 5 = {... |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex017.py | <filename>Exercicios/ex017.py
from math import hypot
catetoadijacente = float(input('determine o cateto adijacente: '))
catetooposto = float(input('derermine o cateto oposto: '))
hipotenusa = hypot(catetoadijacente, catetooposto)
print('a hipotenusa mede {:.2f}'.format(hipotenusa)32) |
GabrielMazzuchello/Curso-Em-Video | Aulas/aula08b.py | <reponame>GabrielMazzuchello/Curso-Em-Video
import emoji
print(emoji.emojize('olá,mundo :smiling_imp:', use_aliases=True))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex014.py | g = float(input('informe os graus °C'))
print('a temperatura {}°C corresponde a {}°F'.format(g, (g * 9/5) + 32))
print('e tam bem corresponde ha {}°K'.format(g+273.15))
|
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex007.py | <reponame>GabrielMazzuchello/Curso-Em-Video<filename>Exercicios/ex007.py
n1 = float(input('qual é a primeira nota do aluno?'))
n2 = float(input('qual e a segunda nota do aluno?'))
print('a media entre {} e {} corresponde ha {}'.format(n1, n2, ((n1+n2)/2))) |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex016.py | <gh_stars>1-10
import math
numero1 = float(input('digite um numero: '))
print('o numero {} tem a parte inteira de {}'.format(numero1, (math.trunc(numero1)))) |
GabrielMazzuchello/Curso-Em-Video | Exercicios/ex001.py | <gh_stars>1-10
nome = input ('qual e seu nome? ')
print('E um prazer em te conhecer {}{}{}'.format('\033[0;31m', nome, '\033[m'))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.