This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import colors | |
screen_width = 800 | |
screen_height = 600 | |
background_image = 'images/background.jpg' | |
frame_rate = 90 | |
row_count = 6 | |
brick_width = 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import sys | |
from collections import defaultdict | |
class Game: | |
def __init__(self, caption, width, height, back_image_filename, frame_rate): | |
self.background_image = pygame.image.load(back_image_filename) | |
self.frame_rate = frame_rate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygame.rect import Rect | |
class GameObject: | |
def __init__(self, x, y, w, h, speed=(0,0)): | |
self.bounds = Rect(x, y, w, h) | |
self.speed = speed | |
@property | |
def left(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import config as c | |
from game_object import GameObject | |
class Paddle(GameObject): | |
def __init__(self, x, y, w, h, color, offset): | |
GameObject.__init__(self, x, y, w, h) | |
self.color = color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
class TextObject: | |
def __init__(self, x, y, text_func, color, font_name, font_size): | |
self.pos = (x, y) | |
self.text_func = text_func | |
self.color = color | |
self.font = pygame.font.SysFont(font_name, font_size) | |
self.bounds = self.get_surface(text_func()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#inputting the information | |
news_header = input("Введите название для новости: ") | |
news_text = input("Введите текст новости: ") | |
news_header = news_header.upper() | |
text_in_quotes = '"%s"' % news_header | |
number_of_symbols = len(news_text) | |
#Outputting the information | |
print(current_date.rjust(50)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ls_news(message): | |
if message.text == "Новости": | |
bot.send_message(message.chat.id, 'Тут будут отображаться новости LoudSound', reply_markup=keyboard) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telebot | |
from telebot import types | |
import config | |
from ls_news import * | |
bot = telebot.TeleBot(config.token) | |
@bot.message_handler(commands=['start']) | |
def start(message): | |
sent = bot.send_message(message.chat.id, 'Добро пожаловать в самый громкий магазин России - LoudSound\n\nНапишите мне что-нибудь') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
##var | |
config.plugins.NewYear.delay | |
except NameError: | |
#var_exists = False | |
config.plugins.NewYear.delay.value_exists = False | |
weather_city = 1123200 | |
open('/media/hdd/ClockToText_log.txt', 'a').write(str(weather_city)+'\n') | |
else: | |
#var_exists = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
class Sys(tk.Tk, object): | |
def __init__(self): | |
super(Sys, self).__init__() | |
self.action_space = ['up_power1', 'down_power1', 'up_power2', 'down_power2'] | |
self.n_actions = len(self.action_space) | |
self.n_features = 2 | |
self.title('SYSTEM') | |
self.geometry('{0}x{1}'.format(500, 500)) # dimentions |