《不知道怎么运行和想要文件的同学可私信我 打包发给你》
from time import*
from random import*
from huoyanlib.c import*
from time import sleep
from huoyanlib.c import *
import pygame,sys,os
from time import *
import pygame,sys,time
from PIL import Image,ImageEnhance
from os import system
from huoyanlib.c import*;from huoyanlib.print import*;from huoyanlib.print_logo import*;from time import*;from random import*
import os
from huoyanlib.print import *
import pygame,sys
import tkinter,time
from pygame.locals import *
from random import randint
from pygame.locals import *
from sys import exit
from tkinter import*
import tkinter
import pygame,sys
import os
import tkinter as tk
import random
import webbrowser
from tkinter import messagebox
from tkinter.scrolledtext import ScrolledText
from os import system
from tkinter.ttk import Treeview
from tkinter import messagebox
import pyperclip
import sys
import webbrowser
from tkinter.ttk import *
from tkinter import *
import tkinter as tk
import random
import string
import math
from math import *
from time import *
import os,sys,keyword
from tkinter import messagebox,PhotoImage
from tkinter import*
from datetime import datetime
import webbrowser
from cefpython3 import cefpython as cef
import platform
from tkinter.ttk import OptionMenu
import urllib
import requests,time,random,json,struct
import socket
import sys
import pygame,sys
from tkinter import *
from tkinter import messagebox
import webbrowser
import time
import requests
import os
import random,socket
import random,socket,mail
from time import*
import pygame,sys,time,os,tkinter
from random import randint
global pixels,pixelsSize
from time import*
from random import*
from sys import *
from huoyanlib.c import *
from huoyanlib.print import*
from huoyanlib.print_logo import*
from tkinter import*
from tkinter import messagebox
from xes import*
def l():
pygame.init()
display = [1200,1000]#屏幕大小,方便调用
screen = pygame.display.set_mode(tuple(display))
pygame.display.set_caption("自制像素画")
logo = pygame.image.load('log.png')
pygame.display.set_icon(logo)
pixelsSize = [200,100,50,25,20]#所有像素的大小,与选择哪一个(初始200)
pixSizeNum = 0
pixels = {}#醉醉重要的变量,存储像素颜色以及坐标 例:(0,0):(255,255,255)
pixelsRects = []#用来存储像素Rect的列表,参数在上面
keydown = False#键盘是否按下
lastKeydown = 0#上一次按下的按键编号
whileNum = 0#循环次数
mbdown = False#鼠标是否按下
justPixels = (0,0)#刚才控制的像素坐标
Nowpixels = (0,0)#现在绘制的像素块
NowpixelsColor = (000,000,000)#当前绘制的像素块的颜色
NowpixelsPos = (0,0)#刚才绘制的像素坐标,这个是用在侧边栏里的
funclock = False#功能区的鼠标单机锁,避免出现一点多变
mesRect = pygame.Rect(1000,515,85,30)#杂色层文字矩形
pxaddRect = pygame.Rect(1100,515,85,30)#放大像素文字矩形
pxdecRect = pygame.Rect(1000,560,85,30)#缩小像素文字矩形
agaRect = pygame.Rect(1100,560,85,30)#反色文字矩形
blkRect = pygame.Rect(1000,605,85,30)#黑色文字矩形
witRect = pygame.Rect(1100,605,85,30)#白色文字矩形
dloadRect = pygame.Rect(1000,650,85,30)#下载文字矩形
uloadRect = pygame.Rect(1100,650,85,30)#上传文字矩形
def pixelsAppend():#最重要的变量的爸爸,负责创建以及重置
global pixels,pixSizeNum#全局
pixels = {}#重置
pixelS = pixelsSize[pixSizeNum] * pixelsSize[pixSizeNum]#下一行代码要用,这里算的是像素面积
top = 0#下面循环用的像素坐标初始轴
left = 0#同上,y
while True:#循环 语法:pixels[(0,0)] = (255,255,255)
if left >= 1000:#如x大于=屏幕x,就还原且top加一,换行
left = 0
top = top + pixelsSize[pixSizeNum]
pixels[(top,left)] = (255,255,255)#这个坐标的键值是全白
if top >= 1000 - pixelsSize[pixSizeNum] and left >= 1000 - pixelsSize[pixSizeNum]:#如果这个坐标接触了边缘,就Break
break
left = left + pixelsSize[pixSizeNum]#left加上pix大小
def rectsAppend():#重置列表
global pixels,pixelsRects,pixelsSize,pixSizeNum#全局
pixelsRects = []
for a in pixels:#便利列表
pixelsRects.append(pygame.Rect(a[0],a[1],pixelsSize[pixSizeNum],pixelsSize[pixSizeNum]))
def drawPixels():#绘制像素
global pixelsRects,pixels,pixelsSize,pixSizeNum#全局
RectsNum = 0#后面绘制第几个矩形
for a in pixels:#循环绘制
pygame.draw.rect(screen,pixels[a],pixelsRects[RectsNum],0)#屏幕,颜色,矩形,填充(0)
RectsNum = RectsNum + 1
pygame.draw.rect(screen,(178,45,68),pygame.Rect(0,0,995,995),10)#屏幕,颜色,矩形,填充(0)
def pixelsReset():
pixelsAppend()#颜色:坐标初始化
rectsAppend()#像素矩形初始化
def changePixels(keyType):#更改像素块大小,type = True - 放大,反之缩小
#pixelsSize = [200,100,50,25]
global pixelsSize,pixSizeNum#全局
if keyType == True:#判断
pixSizeNum = pixSizeNum + 1#把像素大小列表的索引值加一,所索引的数值就越大
if pixSizeNum > 4 :#如果索引值大于4(out of the range),那么变成0
pixSizeNum = 0
else:#上面复制过来的,不做注释
pixSizeNum = pixSizeNum - 1 #把像素大小列表的索引值减一,所索引的数值就越大
if pixSizeNum < 0 :#如果索引值小于0(out of the range),那么变成最后面辣个
pixSizeNum = 4
pixelsReset()
print(pixSizeNum)
#下面的是涵盖一切的函数,直接调用下面的,包含上面的所有
def changeAllColor(color):#切换所有颜色,参数是color(0,0,0)/(255,255,255)
global pixels#全局像素存储字典
for a in pixels:
pixels[a]= color
def mess():#制作杂色层
global pixels
for a in pixels:
if randint(0,1) == 0:
pixels[a] = (0,0,0)
else:
pixels[a] = (255,255,255)
def download():#储存文件
global pixels
root = tkinter.Tk()
root.geometry('500x100')
e1 = tkinter.Entry()
e1.pack()
def load():
global pixels
f=open(e1.get(),"w")
f.write(str(pixels))
f.close()
os.system('start explorer '+ e1.get())
root.destroy()
b1 = tkinter.Button(root, text="保存", command=load)
b1.pack()
l1 = tkinter.Label(root,text = '请输入*:/***/***/***.txt的路径格式,输入错误将无法保存',width=100, height=1)
l1.pack()
l2 = tkinter.Label(root,text = '此功能保存的是像素画的文字格式,导入它可以还原像素画',width=100, height=1)
l2.pack()
root.mainloop()
def upload():#上传文件
global pixels,pixelsSize,pixSizeNum
root = tkinter.Tk()
root.geometry('500x120')
e1 = tkinter.Entry()
e1.pack()
def load():
global pixels,pixelsSize,pixSizeNum
with open(e1.get(), 'r') as f:
a = eval(f.read())
b = len(a) ** 0.5
pixelsSizea = 1000 / b#像素大小
pixSizeNum = pixelsSize.index(int(pixelsSizea))
pixels = a
rectsAppend()
drawPixels()
pygame.display.update()
root.destroy()
b1 = tkinter.Button(root, text="上传", command=load)
b1.pack()
l1 = tkinter.Label(root,text = '请输入*:/***/***/***.txt的路径格式,输入错误将无法上传',width=100, height=1)
l1.pack()
l2 = tkinter.Label(root,text = '此功能上传的是像素画的文字格式,可以还原像素画',width=100, height=1)
l2.pack()
l2 = tkinter.Label(root,text = '点击“上传”后如没有在画布上看到变化,则说明您输入的路径有问题',width=100, height=1)
l2.pack()
pygame.display.update()
root.mainloop()
def judge():#判断鼠标落点以及调整像素颜色以及退出以及功能
global pixels,mbdown,justPixels,Nowpixels,mbpos,NowpixelsColor,NowpixelsPos,mesRect,pxaddRect,funclock
for event in pygame.event.get():#日常操作
if event.type == pygame.QUIT:#退出
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
mbdown = True
funclock = True#功能区的鼠标单击锁,避免出现点一下变两下情况
if mbdown == True:
pixelsRectNum = 0#马上索引的碰撞rect的序号
for a in pixels:#便利所有像素块的坐标
if pixelsRects[pixelsRectNum].collidepoint(pygame.mouse.get_pos()) and pixelsRects[pixelsRectNum] != justPixels:#如果鼠标点击且和介个rect碰撞,比挨个检测坐标简单多了
#判断成功,开始更改
if pixels[a] == (000,000,000):#老功夫了,直接来一套反向判断
pixels[a] = (255,255,255)
elif pixels[a] == (255,255,255):
pixels[a] = (000,000,000)
NowpixelsColor = pixels[a]
Nowpixels = pixelsRects[pixelsRectNum]#现在绘制的像素块
justPixels = pixelsRects[pixelsRectNum]
NowpixelsPos = a
pixelsRectNum = pixelsRectNum + 1
#修改结束,绘制rect
drawPixels()
if mbdown == True:#功能模块
if mesRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与杂色层文字边框碰撞
mess()
funclock = False
elif pxaddRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与放大文字边框碰撞
changePixels(False)#调用更改像素块大小函数,参数为Fasle(缩小
pixelsReset()
funclock = False
elif pxdecRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与缩小文字边框碰撞
changePixels(True)
pixelsReset()
funclock = False
elif agaRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与反色文字边框碰撞
for a in pixels:#遍历
if pixels[a] == (000,000,000):#如果这个颜色是白,就黑
pixels[a] = (255,255,255)
elif pixels[a] == (255,255,255):#是黑,就白
pixels[a] = (000,000,000)
funclock = False
elif blkRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与黑色文字边框碰撞
changeAllColor((00,00,00))#调用函数,参数全黑
funclock = False
elif witRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与白色文字边框碰撞
changeAllColor((255,255,255))#调用函数,参数全白
funclock = False
elif dloadRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与下载文字边框碰撞
download()#调用函数
funclock = False
elif uloadRect.collidepoint(pygame.mouse.get_pos()) and funclock == True:#与下载文字边框碰撞
upload()#调用函数
funclock = False
if event.type == pygame.MOUSEBUTTONUP:
mbdown = False
def sidebar():#绘制侧边栏
global NowpixelsPos,NowpixelsColor
myFont = pygame.font.Font("Mojang-Bold-1.ttf",18)
TxtPos = (1005,265)
NowpixelsColorInt = NowpixelsColor[0],NowpixelsColor[1],NowpixelsColor[2]#颜色显示
NowpixelsColorTxt = myFont.render(str(NowpixelsColorInt),True,(255,203,110))
funcTxt = pygame.font.Font("DZ.TTF",40).render(("功能区"),True,(255,203,110))#功能区
mousePosTxt = pygame.font.Font("Mojang-Bold-1.ttf",22).render(str(pygame.mouse.get_pos()),True,(255,203,110))#渲染鼠标所在坐标文字
myFont = pygame.font.Font("Mojang-Bold-1.ttf",25)#这两行是渲染位置显示
NowpixelsPosTxt = myFont.render(str(NowpixelsPos),True,(255,203,110))
pygame.draw.rect(screen,(178,45,68),pygame.Rect(1000,0,200,1000),0)#绘制背景,屏幕,颜色,矩形,填充(0)
pygame.draw.rect(screen,NowpixelsColor,pygame.Rect(1053,103,96,96),0)#这是当前颜色
pygame.draw.rect(screen,(255,203,110),pygame.Rect(1050,100,100,100),4)#这是当前颜色栏的边框
screen.blit(NowpixelsColorTxt,TxtPos)#绘制像素颜色
screen.blit(NowpixelsPosTxt,(1005,325))#绘制像素坐标
screen.blit(mousePosTxt,(1005,395))#鼠标坐标
screen.blit(funcTxt,(1030,450))#绘制功能区标题
########功能区代码#########
mesTxt = pygame.font.Font("DZ.ttf",25).render(("杂色层"),True,(178,45,68))#杂色层文字
pygame.draw.rect(screen,(255,203,110),mesRect,0)#绘制杂色层文字边框
screen.blit(mesTxt,(1005,511))#绘制杂色层文字
pxaddTxt = pygame.font.Font("DZ.ttf",25).render(("放大px"),True,(178,45,68))#放大文字
pygame.draw.rect(screen,(255,203,110),pxaddRect,0)#放大文字边框
screen.blit(pxaddTxt,(1105,511))#绘制放大文字
pxdecTxt = pygame.font.Font("DZ.ttf",25).render(("缩小px"),True,(178,45,68))#缩小文字
pygame.draw.rect(screen,(255,203,110),pxdecRect,0)#缩小文字边框
screen.blit(pxdecTxt,(1005,556))#绘制缩小文字
agaTxt = pygame.font.Font("DZ.ttf",25).render(("反色层"),True,(178,45,68))
pygame.draw.rect(screen,(255,203,110),agaRect,0)
screen.blit(agaTxt,(1105,556))
blkTxt = pygame.font.Font("DZ.ttf",25).render(("黑色层"),True,(0,0,0))
pygame.draw.rect(screen,(255,203,110),blkRect,0)
screen.blit(blkTxt,(1005,601))
witTxt = pygame.font.Font("DZ.ttf",25).render(("白色层"),True,(255,255,255))
pygame.draw.rect(screen,(255,203,110),witRect,0)
screen.blit(witTxt,(1105,601))
dloadTxt = pygame.font.Font("DZ.ttf",25).render(("下载"),True,(178,45,68))
pygame.draw.rect(screen,(255,203,110),dloadRect,0)
screen.blit(dloadTxt,(1015,646))
uloadTxt = pygame.font.Font("DZ.ttf",25).render(("上传"),True,(178,45,68))
pygame.draw.rect(screen,(255,203,110),uloadRect,0)
screen.blit(uloadTxt,(1115,646))
pixelsReset()
while True:
judge()
drawPixels()
sidebar()
pygame.display.update()
if whileNum % 100 == 0:#当循环这么多次后,按键历史重置
lastKeydown = 0
justPixels = (0,0)
whileNum = whileNum + 1#循环次数加一
def b():
def Num():
clean(1.5)
num=[
"1 ","2 ","3 ","4 ",
"5 ","6 ","7 ","8 ",
"9 ","10","11","12",
"13","14","15"," "
]
for i1 in range(len(num)):
a1=choice(num)
num.remove(a1)
num.append(a1)
ctrl=1
while True:
# for f in range(1):#测试专用
clear()
if num==["1 ","2 ","3 ","4 ","5 ","6 ","7 ","8 ","9 ","10","11","12","13","14","15"," "]:
print("\033[92m你成功了!\033[0m")
sleep(2)
break
print("------------")
for i in range(len(num)):
print("\033[96m"+num[i]+"\033[0m|",end="")
if i%4==3:
print("\n------------")
a=input("\n输入(w/上 s/下 a/左 d/右):")
clean(1.5)
for j in range(len(num)):
if num[j]==" ":
break
if a=="w":
if j>11:
print("\033[93m输入不正确哦~\033[0m")
sleep(2)
continue
n1=num[j+4]
num[j]=n1
num[j+4]=" "
elif a=="s":
if j<4:
print("\033[93m输入不正确哦~\033[0m")
sleep(2)
continue
n1=num[j-4]
num[j]=n1
num[j-4]=" "
elif a=="a":
if j%4==3:
print("\033[93m输入不正确哦~\033[0m")
sleep(2)
continue
n1=num[j+1]
num[j]=n1
num[j+1]=" "
elif a=="d":
if j%4==0:
print("\033[93m输入不正确哦~\033[0m")
sleep(2)
continue
n1=num[j-1]
num[j]=n1
num[j-1]=" "
else:
print("\033[91m输入不正确哦~\033[0m")
sleep(2)
Num()
def y():
import os
os.system('python -m pip install --upgrade huoyanlib')
import huoyanlib
print('在huoyanlib这个——')
print('又懒又蠢又二又没用还好吃懒做游手好闲的作者拖更n个月后,huoyanlib终于迎来了2.0.0版本的更新!')
print('下面是最新的教程,修改很多哦')
import huoyanlib.c
huoyanlib.c.clean(7)
print("1.c模块\n引用方法:import huoyanlib.c 或 from huoyanlib.c import *")
print("函数:\n (1) clean(time):在等待time秒后清屏")
print(" (2) clear():直接清屏")
huoyanlib.c.clean(10)
print("2.print模块\n引用方法:import huoyanlib.print 或 from huoyanlib.print import *")
print("函数:\n h_print(text):逐字输出text里的内容")
huoyanlib.c.clean(8)
print("3.print_logo模块\n引用方法:import huoyanlib.print_logo 或 from huoyanlib.print_logo import *")
print("函数:\n logo(text):通过特殊字符将要输出的字符染色,用来打印工作室的logo再好不过了(详情请在import huoyanlib.print_logo 后 运行 help(huoyanlib.print_logo))")
huoyanlib.c.clean(17)
print("4.spark_word模块\n引用方法:import huoyanlib.spark_word 或 from huoyanlib.spark_word import *")
print("函数:\n spark(word, time_of_spark):将word这段话闪烁time_of_spark秒")
huoyanlib.c.clean(7)
print("下面要介绍的就是最重点的——request子模块!")
print("request子模块中还有许多“孙”模块,下面我来一一介绍")
huoyanlib.c.clean(5)
print("1.get_news模块\n引用方法:import huoyanlib.request.get_news 或 from huoyanlib.request.get_news import *")
print("函数:\n get_news():这是一个偏娱乐性的函数,大家可以自己引用一下玩一玩")
huoyanlib.c.clean(6)
print("2.xes模块\n引用方法: import huoyanlib.request.xes 或 from huoyanlib.request.xes import *")
time.sleep(1)
print("这个模块里有两个类——XesWork和XesUserSpace")
time.sleep(1)
print("我们先来看XesWork")
time.sleep(1)
print("""XesWork类里有17个函数(听着就可怕……)
myxes = XesWork(作品id(int类型))(这是实例化,别告诉我你不知道类的实例是什么)
1.myxes.get_name():获取作品名称
2.myxes.get_description():获取作品介绍
3.myxes.get_likes():获取作品赞数
4.myxes.get_unlikes():获取作品踩数
5.myxes.get_favorites():获取作品收藏数
6.myxes.get_adapt_numbers():获取作品被改编数
7.myxes.download_icon():把作品封面下载到桌面
8.myxes.get_author_name():获取作者姓名
9.myxes.get_author_id():获取作者id
10.myxes.get_work_tags():返回一个列表,包含该作品所有的标签
11.myxes.get_hot():获取该作品热度值
12.myxes.get_views():获取该作品被浏览次数
13.myxes.get_first_published_time():获取该作品第一次发布的时间
14.myxes.get_latest_modified_time():获取该作品最后一次修改的时间
15.myxes.get_latest_updated_time():获取该作品最后一次更新的时间
16.myxes.get_created_time():获取该作品被创建的时间
17.myxes.is_hidden_code():获取该作品是否隐藏了源码
""")
print("输入OK来翻页")
while True:
a = input()
if a == "ok" or a == "OK":
huoyanlib.c.clear()
break
print("接下来我们来看看XesUserSpace")
time.sleep(1)
print("""这个类里有14个函数,我们来一一看一下
userspace = XesUserSpace(作者id)
1.download_user_head():下载作者的头像
2.get_fans_number():获取这个人的粉丝数量
3.get_follows_number():获取这个人的关注数量
4.is_follow():获取你有没有关注他
5.get_realname():获取这个人的真名
6.get_sign():获取这个人的个性签名
7.get_number_of_works():获取这个人的作品总数(包括没发布的)
8.get_number_of_likes():获取这个人的总赞数
9.get_number_of_views():获取这个人作品的总浏览量
10.get_adapted_number():获取这个人作品的总被改编量
11.get_favorites():获取这个人作品的总被收藏量
12.get_first_eight_fans():获取这个人的粉丝信息(名字和id)
13.get_first_eight_favourites():获取这个人的前八个收藏作品id、作品名、作者id和作者名
14.get_representative_work():获取这个人的代表作名字
""")
print("输入OK来翻页")
while True:
a = input()
if a == "ok" or a == "OK":
huoyanlib.c.clear()
break
print("注意事项:xes模块中的两个类因为是爬虫,有时间访问限制,有可能会发生错误,请见谅")
huoyanlib.c.clean(5)
print("教程结束了!")
def zcl():
print("""
Hello,推一下AMT聊天室
AMT桌面PC端下载(仅限Windows):\033[33mhttps://amt.asunc.cn/\033[m
AMT Python端(Mac和Windows通用):\033[33mhttps://code.xueersi.com/home/project/detail?lang=code&pid=9807491&version=offline&form=python&langType=python\033[0m
注意:Python端和桌面PC端聊天信息互不相同!!!
注册链接:\033[32mhttps://code.xueersi.com/home/project/detail?lang=code&pid=15032195&version=offline&form=python&langType=python\033[0m""")
def zwl():
pygame.init()
pygame.mixer.init()
pygame.display.set_caption("huoyanlogo")
screen = pygame.display.set_mode((500, 250))
imgNameList = ["fier.png","fier2.png","fier3.png"]
imgList = []
pygame.mixer.music.load("su.mp3")
pygame.mixer.music.play(-1)
for d in imgNameList:
img = Image.open(d)
img1 = ImageEnhance.Brightness(img)
img2 = img1.enhance(1.1)
img3 = ImageEnhance.Color(img2)
img4 = img3.enhance(1.2)
newName = "0"+d
img4.save(newName)
img5 = pygame.image.load(newName)
imgList.append(img5)
num = 0
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
screen.fill((0, 0, 0))
imgShow = imgList[num]
screen.blit(imgShow, (0, 0))
#补在此全代码,实现自动换图
#=======================================
num = num+1
#==================================
if num > len(imgList) - 1:
num = 0
if num == 3:
screen.fill((0, 0, 0))
screen = pygame.display.set_mode((1000, 1000))
f = pygame.image.load("fier4.png")
screen.blit(f,(0,0))
time.sleep(1)
pygame.display.update()
window=tk.Tk()
root = tk.Frame()
window.title("火焰工作室--智能浏览器3.0")
window.iconbitmap('huoyan.ico')
root.configure(bg="#FCF492",relief="groove")
for zzz in range(8):
window.rowconfigure(1,weight=zzz)
window.columnconfigure(1,weight=0)
window.columnconfigure(1,weight=1)
label1 = tk.Label(root,text="模式如下",fg="white",bg="blue",font=("楷体", 25),height=2)
button1 = tk.Button(root,text="李展鸣:像素画",command=l,width=25,height=1,fg="#00FFFF",bg="#FEF5AA",font=("楷体", 25))
button2 = tk.Button(root,text="wdd:火焰电脑4.2.5",command=b,width=25,height=1,fg="#FF00F6",bg="#FEF5AA",font=("楷体", 25))
button3 = tk.Button(root,text="lrq:火焰lib更新使用说明",command=y,width=25,height=1,fg="#00FA9A",bg="#FEF5AA",font=("楷体", 25))
button4 = tk.Button(root,text="苦逼的hy聊天室",command=zcl,width=25,height=1,fg="#00FA9A",bg="#FEF5AA",font=("楷体", 25))
button5 = tk.Button(root,text="fhh:hy宣传片",command=zwl,width=25,height=1,fg="#00FA9A",bg="#FEF5AA",font=("楷体", 25))
label1.grid(row=0,column=0)
label1.grid(row=0,column=0)
button1.grid(row=1,column=0)
button2.grid(row=2,column=0)
button3.grid(row=3,column=0)
button4.grid(row=4,column=0)
button5.grid(row=5,column=0)
root.pack(fill=BOTH,expand=True,padx=10,pady=10)
root.mainloop()
print("喜欢的童鞋记得三连啊!/疯狂暗示")