anonymous No title
Python
#!python3

'''
This script implements a simple calculator in the Today widget.

You can toggle between two different button layouts (compact/expanded) using the widget's
built-in "Show More/Less" button. This is accomplished by overriding the `ui.View.layout`
method in the `CalcView` class.
'''

import appex, ui
import console
import os

op_symbols = ('+', '\u2212', '\u00F7', '\u00D7')
operators = {'+': '+', '\u2212': '-', '\u00F7': '/', '\u00D7': '*'}

class CalcView (ui.View):
	def __init__(self, *args, **kwargs):
		super().__init__(self, *args, **kwargs)
		self.shows_result = False
		self.bounds = (0, 0, 400, 200)
		button_style = {'background_color': (0, 0, 0, 0.05), 'tint_color': 'black', 'font': ('HelveticaNeue-Light', 24), 'corner_radius': 3}
		self.number_buttons = [ui.Button(title=str(i), action=self.button_tapped, **button_style) for i in range(10)]
		self.op_buttons = [ui.Button(title=s, action=self.button_tapped, **button_style) for s in op_symbols]
		self.ac_button = ui.Button(title='AC', action=self.button_tapped, **button_style)
		self.ac_button.tint_color = 'red'
		self.add_subview(self.ac_button)
		self.c_button = ui.Button(title='C', action=self.button_tapped, **button_style)
		self.c_button.tint_color = 'red'
		self.add_subview(self.c_button)
		self.eq_button = ui.Button(title='=', action=self.button_tapped, **button_style)
		self.add_subview(self.eq_button)
		self.dot_button = ui.Button(title='.', action=self.button_tapped, **button_style)
		self.add_subview(self.dot_button)
		for b in self.number_buttons + self.op_buttons:
			self.add_subview(b)
		self.display_view = ui.View(background_color=(.54, .94, 1.0, 0.2))
		self.display_label = ui.Label(frame=self.display_view.bounds.inset(0, 8), flex='wh', text='0', alignment=ui.ALIGN_RIGHT)
		self.display_label.font = ('HelveticaNeue-Light', 32)
		self.display_view.add_subview(self.display_label)
		self.add_subview(self.display_view)
	
	def layout(self):
		compact = self.height < 150
		bw = self.width / 10 if compact else self.width / 5
		bh = self.height / 3 if compact else self.height / 5
		for i, b in enumerate(self.number_buttons):
			if compact:
				frame = ui.Rect(((i - 1) % 10) * bw, bh, bw, bh)
			else:
				frame = ui.Rect(max(i-1, 0) % 3 * bw, 3 * bh - (i-1) // 3 * bh, bw, bh)
			b.frame = frame.inset(1, 1)
		for i, b in enumerate(self.op_buttons):
			if compact:
				frame = ui.Rect((4 + i) * bw, 2 * bh, bw, bh)
			else:
				frame = ui.Rect((3 + i % 2) * bw, (2 + i//2) * bh, bw, bh)
			b.frame = frame.inset(1, 1)
		if compact:
			self.ac_button.frame = ui.Rect(0, 2 * bh, 2 * bw, bh).inset(1, 1)
			self.c_button.frame = ui.Rect(2 * bw, 2 * bh, bw, bh).inset(1, 1)
			self.eq_button.frame = ui.Rect(8 * bw, 2 * bh, 2*bw, bh).inset(1, 1)
			self.dot_button.frame = ui.Rect(3 * bw, 2 * bh, bw, bh).inset(1, 1)
		else:
			self.ac_button.frame = ui.Rect(3 * bw, bh, bw, bh).inset(1, 1)
			self.c_button.frame = ui.Rect(4 * bw, bh, bw, bh).inset(1, 1)
			self.eq_button.frame = ui.Rect(3 * bw, 4 * bh, 2*bw, bh).inset(1, 1)
			self.dot_button.frame = ui.Rect(bw, 4 * bh, bw, bh).inset(1, 1)
		self.display_view.frame = (0, 0, self.width, bh)
	
	def button_tapped(self, sender):
		t = sender.title
		label = self.display_label
		if t in '0123456789':
			if self.shows_result or label.text == '0':
				label.text = t
			else:
				label.text += t
		elif t == '.' and label.text[-1] != '.':
			label.text += t
		elif t in op_symbols:
			if label.text[-1] in op_symbols:
				label.text = label.text[:-1] + t
			else:
				label.text += t
		elif t == 'AC':
			label.text = '0'
		elif t == 'C':
			label.text = label.text[:-1]
			if len(label.text) == 0:
				label.text = '0'
		elif t == '=':
			try:
				expr = label.text
				for symbol in op_symbols:
					expr = expr.replace(symbol, operators[symbol])
				result = str(eval(expr))
				if result.endswith('.0'):
					result = result[:-2]
				label.text = result
			except (SyntaxError, ZeroDivisionError):
				label.text = 'ERROR'
			self.shows_result = True
		if t != '=':
			self.shows_result = False

def main():
	# Optimization: Don't create a new view if the widget already shows the calculator.
	widget_name = __file__ + str(os.stat(__file__).st_mtime)
	widget_view = appex.get_widget_view()
	if widget_view is None or widget_view.name != widget_name:
		widget_view = CalcView()
		widget_view.name = widget_name
		appex.set_widget_view(widget_view)

if __name__ == '__main__':
	main()
こだっく python_cavbity_PVF
Python
import numpy as np
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
pi=math.pi
Re=float(10.0)
N=20
M=50
r=1.72
T=int(1000)
dx=1.0/N
dy=1.0/N
dt=0.001
nu=np.zeros((N+2,N+2))
ou=np.zeros((N+2,N+2))
us=np.zeros((N+2,N+2))
nv=np.zeros((N+2,N+2))
ov=np.zeros((N+2,N+2))
vs=np.zeros((N+2,N+2))
pre=np.zeros((N+2,N+2))


for t in range(T):
    
    for i in range(N+2):
        ou[i][0]=-ou[i][1]
        ou[i][N+1]=2*math.sin(i*dx*pi)*math.sin(i*dx*pi)-ou[i][N-1]
        ov[0][i]=-ov[1][i]
        ov[N+1][i]=-ov[N][i]

    #u^*,v^*の計算
    for i in range(0,N):
        for j in range(1,N):
            vs[i+1][j]=ov[i+1][j]+dt*(-0.25*(ou[i][j+1]+ou[i][j]+ou[i+1][j+1]+ou[i+1][j])*(ov[i+2][j]-ov[i][j])/(2*dx)-ov[i][j]*(ov[i+1][j+1]-ov[i+1][j-1])/(2*dx))+(dt/(Re*dx*dx))*(-4*ov[i+1][j]+ov[i+2][j]+ov[i][j]+ov[i+1][j+1]+ov[i+1][j-1])
    
    for i in range(1,N):
        for j in range(0,N):
            us[i][j+1]=ou[i][j+1]+dt*(-ou[i][j+1]*(ou[i+1][j+1]-ou[i-1][j+1])/(2*dx)-0.25*(ov[i+1][j]+ov[i][j]+ov[i+1][j+1]+ov[i][j+1])*(ou[i][j+2]-ou[i][j])/(2*dx))+(dt/(Re*dx*dx))*(-4*ou[i][j+1]+ou[i+1][j+1]+ou[i-1][j+1]+ou[i][j+2]+ou[i][j])
    

 #圧力の境界条件   
    for i in range(N):
        pre[0][i+1]=pre[1][i+1]-(dx/Re)*(-ou[3][i+1]+4*ou[2][i+1]-5*ou[1][i+1]+2*ou[0][i+1])
        pre[N+1][i+1]=pre[N][i+1]-(dx/Re)*(-ou[N-2][i+1]+4*ou[N-1][i+1]-5*ou[N][i+1]+2*ou[N+1][i+1])
        pre[i+1][0]=pre[i+1][1]-(dx/Re)*(-ov[i+1][3]+4*ov[i+1][2]-5*ov[i+1][1]+2*ov[i+1][0])
        pre[i+1][N+1]=pre[i+1][N]-(dx/Re)*(-ov[i+1][N-2]+4*ov[i+1][N-1]-5*ov[i+1][N]+2*ov[i+1][N+1])
    pre[0][0]=pre[1][0]
    pre[0][N+1]=pre[0][N]
    pre[N+1][0]=pre[N][0]
    pre[N+1][N+1]=pre[N][N+1]
               #緩和法
    for k in range(M):
        for i in range(0,N):
            for j in range(0,N):
                pre[i+1][j+1]=(-Re*dx/4*dt)*(us[i+1][j+1]-us[i][j+1]+vs[i+1][j+1]-vs[i+1][j])+0.25*(pre[i+2][j+1]+pre[i][j+1]+pre[i+1][j+2]+pre[i+1][j])
            #n+1における速度の計算
    for i in range(1,N):
        for j in range(0,N):
            nv[i+1][j]=vs[i+1][j]-dt*(pre[i+1][j+1]-pre[i+1][j])/(dx)

    for i in range(0,N):
        for j in range(1,N):
            nv[i+1][j]=vs[i+1][j]-dt*(pre[i+1][j+1]-pre[i+1][j])/(dx)

    
        #古い速度と新しい速度を更新
    for i in range(0,N+2):
        for j in range(0,N+2):
             ou[i][j]=nu[i][j]
             ov[i][j]=nv[i][j]
    #print(pre[15][15])
    #print(pre[14][14])


x=np.arange(0,dx+1.0+dx,dx)
y=np.arange(0,dx+1.0+dx,dx)
X,Y=np.meshgrid(x,y,indexing='ij')

fig=plt.figure()
ax=Axes3D(fig)

ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("v")


#print(psi)
ax.plot_wireframe(X, Y, pre)
plt.show()
こだっく No title
Python
import numpy as np
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
pi=math.pi
Re=float(10.0)
N=20
M=50
r=1.72
T=int(1000)
dx=1.0/N
dy=1.0/N
dt=0.001
nu=np.zeros((N+2,N+2))
ou=np.zeros((N+2,N+2))
us=np.zeros((N+2,N+2))
nv=np.zeros((N+2,N+2))
ov=np.zeros((N+2,N+2))
vs=np.zeros((N+2,N+2))
pre=np.zeros((N+2,N+2))


for t in range(T):
    
    for i in range(N+2):
        ou[i][0]=-ou[i][1]
        ou[i][N+1]=2*math.sin(i*dx*pi)*math.sin(i*dx*pi)-ou[i][N-1]
        ov[0][i]=-ov[1][i]
        ov[N+1][i]=-ov[N][i]

    #u^*,v^*の計算
    for i in range(0,N):
        for j in range(1,N):
            vs[i+1][j]=ov[i+1][j]+dt*(-0.25*(ou[i][j+1]+ou[i][j]+ou[i+1][j+1]+ou[i+1][j])*(ov[i+2][j]-ov[i][j])/(2*dx)-ov[i][j]*(ov[i+1][j+1]-ov[i+1][j-1])/(2*dx))+(dt/(Re*dx*dx))*(-4*ov[i+1][j]+ov[i+2][j]+ov[i][j]+ov[i+1][j+1]+ov[i+1][j-1])
    
    for i in range(1,N):
        for j in range(0,N):
            us[i][j+1]=ou[i][j+1]+dt*(-ou[i][j+1]*(ou[i+1][j+1]-ou[i-1][j+1])/(2*dx)-0.25*(ov[i+1][j]+ov[i][j]+ov[i+1][j+1]+ov[i][j+1])*(ou[i][j+2]-ou[i][j])/(2*dx))+(dt/(Re*dx*dx))*(-4*ou[i][j+1]+ou[i+1][j+1]+ou[i-1][j+1]+ou[i][j+2]+ou[i][j])
    

 #圧力の境界条件   
    for i in range(N):
        pre[0][i+1]=pre[1][i+1]-(dx/Re)*(-ou[3][i+1]+4*ou[2][i+1]-5*ou[1][i+1]+2*ou[0][i+1])
        pre[N+1][i+1]=pre[N][i+1]-(dx/Re)*(-ou[N-2][i+1]+4*ou[N-1][i+1]-5*ou[N][i+1]+2*ou[N+1][i+1])
        pre[i+1][0]=pre[i+1][1]-(dx/Re)*(-ov[i+1][3]+4*ov[i+1][2]-5*ov[i+1][1]+2*ov[i+1][0])
        pre[i+1][N+1]=pre[i+1][N]-(dx/Re)*(-ov[i+1][N-2]+4*ov[i+1][N-1]-5*ov[i+1][N]+2*ov[i+1][N+1])
    pre[0][0]=pre[1][0]
    pre[0][N+1]=pre[0][N]
    pre[N+1][0]=pre[N][0]
    pre[N+1][N+1]=pre[N][N+1]
               #緩和法
    for k in range(M):
        for i in range(0,N):
            for j in range(0,N):
                pre[i+1][j+1]=(-Re*dx/4*dt)*(us[i+1][j+1]-us[i][j+1]+vs[i+1][j+1]-vs[i+1][j])+0.25*(pre[i+2][j+1]+pre[i][j+1]+pre[i+1][j+2]+pre[i+1][j])
            #n+1における速度の計算
    for i in range(1,N):
        for j in range(0,N):
            nv[i+1][j]=vs[i+1][j]-dt*(pre[i+1][j+1]-pre[i+1][j])/(dx)

    for i in range(0,N):
        for j in range(1,N):
            nv[i+1][j]=vs[i+1][j]-dt*(pre[i+1][j+1]-pre[i+1][j])/(dx)

    
        #古い速度と新しい速度を更新
    for i in range(0,N+2):
        for j in range(0,N+2):
             ou[i][j]=nu[i][j]
             ov[i][j]=nv[i][j]
    #print(pre[15][15])
    #print(pre[14][14])


x=np.arange(0,dx+1.0+dx,dx)
y=np.arange(0,dx+1.0+dx,dx)
X,Y=np.meshgrid(x,y,indexing='ij')

fig=plt.figure()
ax=Axes3D(fig)

ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("v")


#print(psi)
ax.plot_wireframe(X, Y, pre)
plt.show()
anonymous No title
Python
import numpy as np
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
pi=math.pi
Re=float(10.0)
N=20
M=50
r=1.72
T=int(1000)
dx=1.0/N
dy=1.0/N
dt=0.001
nu=np.zeros((N+1,N+1))
ou=np.zeros((N+1,N+1))
us=np.zeros((N+1,N+1))
nv=np.zeros((N+1,N+1))
ov=np.zeros((N+1,N+1))
vs=np.zeros((N+1,N+1))
pre=np.zeros((N+1,N+1))

#初期条件セッツ
for i in range(N):
    ou[i][N-1]=math.sin(pi*i*dx)*math.sin(pi*i*dx)
    nu[i][N-1]=math.sin(pi*i*dx)*math.sin(pi*i*dx)
    us[i][N-1]=math.sin(pi*i*dx)*math.sin(pi*i*dx)
    

for t in range(T):
    
    #u^*,v^*の計算
    for i in range(1,N-1):
        for j in range(1,N-1):
            vs[i][j]=ov[i][j]+dt*(-ou[i][j]*(ov[i+1][j]-ov[i-1][j])/(2*dx)-ov[i][j]*(ov[i][j+1]-ov[i][j-1])/(2*dx))+(dt/(Re*dx*dx))*(-4*ov[i][j]+ov[i+1][j]+ov[i-1][j]+ov[i][j+1]+ov[i][j-1])
            us[i][j]=ou[i][j]+dt*(-ou[i][j]*(ou[i+1][j]-ou[i-1][j])/(2*dx)-ov[i][j]*(ou[i][j+1]-ou[i][j-1])/(2*dx))+(dt/(Re*dx*dx))*(-4*ou[i][j]+ou[i+1][j]+ou[i-1][j]+ou[i][j+1]+ou[i][j-1])


    #緩和法
    for k in range(M):
        for i in range(2,N-2):  
            pre[i][1]=(-dx/(2*dt))*(us[i+1][1]-us[i-1][1]+vs[i][2]-vs[i][0])+0.25*(pre[i+2][1]+pre[i-2][1]+pre[i][3]+pre[i][1])
            pre[i][N-2]=(-dx/(2*dt))*(us[i+1][N-2]-us[i-1][N-2]+vs[i][N-1]-vs[i][N-3])+0.25*(pre[i+2][N-2]+pre[i-2][N-2]+pre[i][N-2]+pre[i][N-4])
        for j in range(2,N-2):
            pre[1][j]=(-dx/(2*dt))*(us[2][j]-us[0][j]+vs[1][j+1]-vs[1][j-1])+0.25*(pre[1+2][j]+pre[1][j]+pre[1][j+2]+pre[1][j-2])
            pre[N-2][j]=(-dx/(2*dt))*(us[N-1][j]-us[N-3][j]+vs[N-2][j+1]-vs[N-2][j-1])+0.25*(pre[N-2][j]+pre[N-4][j]+pre[N-2][j+2]+pre[N-2][j-2])
       
        pre[1][1]=(-dx/(2*dt))*(us[2][1]-us[0][1]+vs[1][2]-vs[1][0])+0.25*(pre[3][1]+pre[1][1]+pre[1][3]+pre[1][1])
        pre[N-2][1]=(-dx/(2*dt))*(us[N-1][1]-us[N-3][1]+vs[N-2][2]-vs[N-2][0])+0.25*(pre[N-2][1]+pre[N-4][1]+pre[N-2][3]+pre[N-2][1])
        pre[1][N-2]=(-dx/(2*dt))*(us[2][N-2]-us[0][N-2]+vs[1][N-1]-vs[1][N-3])+0.25*(pre[3][N-2]+pre[1][N-2]+pre[1][N-2]+pre[1][N-4])
        pre[N-2][N-2]=(-dx/(2*dt))*(us[N-1][N-2]-us[N-3][N-2]+vs[N-2][N-1]-vs[N-2][N-3])+0.25*(pre[N-2][N-2]+pre[N-4][N-2]+pre[N-2][N-2]+pre[N-2][N-4])
        
        for i in range(2,N-2):
            for j in range(2,N-2):
                    pre[i][j]=(-dx/(2*dt))*(us[i+1][j]-us[i-1][j]+vs[i][j+1]-vs[i][j-1])+0.25*(pre[i+2][j]+pre[i-2][j]+pre[i][j+2]+pre[i][j-2])
    
        for i in range(N):
            pre[0][i]=pre[1][i]-(dx/Re)*(-ou[3][i]+4*ou[2][i]-5*ou[1][i]+2*ou[0][i])
            pre[N-1][i]=pre[N-2][i]-(dx/Re)*(-ou[N-4][i]+4*ou[N-3][i]-5*ou[N-2][i]+2*ou[N-1][i])
            pre[i][0]=pre[i][1]-(dx/Re)*(-ov[i][3]+4*ov[i][2]-5*ov[i][1]+2*ov[i][0])
            pre[i][N-1]=pre[i][N-2]-(dx/Re)*(-ov[i][N-4]+4*ov[i][N-3]-5*ov[i][N-2]+2*ov[i][N-1])
         #n+1における速度の計算
    for i in range(1,N-1):
        for j in range(1,N-1):
            nu[i][j]=us[i][j]-dt*(pre[i+1][j]-pre[i-1][j])/(2*dx)
            nv[i][j]=vs[i][j]-dt*(pre[i][j+1]-pre[i][j-1])/(2*dx)


    
        #古い速度と新しい速度を更新
    for i in range(1,N-1):
        for j in range(1,N-1):
             ou[i][j]=nu[i][j]
             ov[i][j]=nv[i][j]
    print(nu[15][15])

x=np.arange(0,1.0+dx,dx)
y=np.arange(0,1.0+dx,dx)
X,Y=np.meshgrid(x,y,indexing='ij')

fig=plt.figure()
ax=Axes3D(fig)

ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("v")


#print(psi)
ax.plot_wireframe(X, Y, nv)
plt.show()
anonymous No title
Python
def exception9(a):
    a.sort()
    return a[-1] if a.count(a[0]) > a.count(a[-1]) else a[0]
anonymous No title
Python
anonymous No title
Python
anonymous No title
Python
import notification
import clipboard
import keyboard
import datetime
import calendar
import tweepy
import base64
import json
import time
import glob
import os
import sys
import re
import random
import console


"""
           ---初期設定---
   
 ①コードの貼り付けができたら自身のTwitterID入力をします。
 
      例 : ID が @Twitter_1234 の場合 
         TwitterID = "@XXXX" を
         TwitterID = "@Twitter_1234" に変更
 
 ②右上の▷を押すと、数字が出てきます、
 その数字と ①で書き込んだTwitterID の2つをDMで伝えてください。
 
 ③数字と引き換えにこちらがIDを渡しますので、AutoIDを35行目にコピーして貼り付けてください

"""

Twitter_ID = "@XXXX"

# 0000を消した後 貰ったIDを=の後にそのまま貼り付けてください
Auto_ID = 0000


"""

   ---使用設定部分---
  
   パスツイ  21:30
   ルーム番号 567
   
      の場合
     ↓↓↓↓↓↓↓↓
     
 pass_tweet_time = "30"
 room_id         = "567" 

  このように下を書き換えます。 
 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
 
"""

pass_tweet_time = "00"
room_id         = "0000" 



"""
     ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
     ⚠️以下書き換えると動作しなくなります
   ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
"""

flag     = 0
password = ""

CK = b'eGdsMlF5TlJscFNLRWh5dFMzN1g2TTdSag=='
CKS = b'azJIbWpKS1J0TExGUjBmZnQzZW5FSnBCdGY5NUY3VURGYzluQmgxblJ2bVNwazd0S24='
AT = "837597646311178240-q8vlRy0BPcIBxngYG9ynhu1cSNqCVC3"
ATS = "cnMrSYDnMiSaqHNbxesiweHI2esGDMZHS87ugHiveAsrK"

basenumber = "0123456789"

font_item = ["⓪①②③④⑤⑥⑦⑧⑨",
             "⓿❶❷❸❹❺❻❼❽❾",
             "0123456789",
             "𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡",]
             
itemlist1 = ["@[a-zA-Z0-9_]+",
             "[0-9]{1,2}:[0-5][0-9]",
             "[0-9]{1,2}時[0-59]分",
             "([0-9]|[0-2][0-9])時",
             "[0-5][0-9]分",
             "[1-9]{1,2}/[0-9]{1,2}",]
             
itemlist2 = [" "," ",]
	
message = {
	"no_update":"パスツイ取得中",
	"code_notification":"この数字と入力したTwitterIDをDMで伝えてください:",
	"copy_error":"Twitterリンクのコピー又はフルアクセスの許可をしてください",
	"pass_notfound":"パスワードが取得できませんでした",
	"waiting_passtweet":"からのパスツイ待機中... ",
	"success":"ID認証成功",
	"fail":"認証失敗:"
}

Xcode = ["\x207\x204\x208\x209\x400\x102",
         "207\x200\x208\x209\x400\x109" ,
         "207\x204\x208\x209\x400\x102" ,
         "207\x204\x208\x209\x400\x102" ,]

"""
  関数
"""
def login(CK,CKS,AT,ATS):
	CK = base64.b64decode(CK.decode())
	CKS = base64.b64decode(CKS.decode())
	auth = tweepy.OAuthHandler(str(CK).split("'")[1],str(CKS).split("'")[1])
	auth.set_access_token(AT,ATS)
	API = tweepy.API(auth)
	return API

def get_username():
	user_name = clipboard.get()
	if("https" in user_name):
		user_name = user_name.split("/")
		user_name = user_name[3].split("?")
		user_name = user_name[0]
		return user_name
	else:
		print(message["copy_error"])
		sys.exit()

def ACencrtrpt(a,b):
	c = a+","+str(b)
	c = base64.b64encode(c.encode())
	return c
	
def Test(c,d):
	if c == d:
		return True
	else:
		key = glob.glob("*.pwd")
		key = key[0].split(".")[0]
		print(message["code_notification"]+key)
		sys.exit()
		
def check():
	file = glob.glob("*.pwd")
	if not file:
		key = int(random.uniform(1,99))*int(random.uniform(99,999))
		key = str(key)
		with open(key+".pwd" , mode="w") as f:
			f.write("")
		notification.schedule(message["code_notification"]+key)
		print(message["code_notification"]+key)
		sys.exit()
	else:
		code = file[0].split(".")[0]
		return code
							
def tweet_filter(Tweettext):	
	for i in range(10):
		if(font_item[0][i] in Tweettext):
			Tweettext = Tweettext.replace(font_item[0][i],basenumber[i])
		for j in range(10):
			if(font_item[1][j] in Tweettext):
				Tweettext = Tweettext.replace(font_item[1][j],basenumber[j])
			for k in range(10):
				if(font_item[2][k] in Tweettext):
					Tweettext = Tweettext.replace(font_item[2][k],basenumber[k])
				for l in range(10):
					if(font_item[3][l] in Tweettext):
						Tweettext = Tweettext.replace(font_item[3][l],basenumber[l])		
	return Tweettext

def tweet_trim(tweet):
	tweet = tweet_filter(tweet)
	for i in itemlist1:
		tweet = re.sub(i,"",tweet)
		for j in itemlist2:
			tweet = tweet.replace(j,"")
	tweet = re.findall(r"\d+",tweet)
	return tweet
	
def get_time_now():
	now_time = datetime.datetime.now()
	now_time = str(now_time).split(" ")[1]
	now_time = now_time.split(":")
	now_time_minute = now_time[1]
	now_time_seconds = now_time[2].split(".")[0]
	return now_time_minute,now_time_seconds


API   = login(CK,CKS,AT,ATS) 

Check = check()
Check = ACencrtrpt(Check,Twitter_ID)
Test(Auto_ID,Check)

user_name = get_username()

print("@"+user_name+message["waiting_passtweet"])

if(pass_tweet_time == "00"):
	passTb = "59"
else:
	passTb = str(int(pass_tweet_time)-1)	
	
while True:
	now_time_minute , now_time_seconds = get_time_now()		
	if(now_time_minute == passTb and now_time_seconds == "58"):
		break	
	elif(now_time_minute == passTb and now_time_seconds == "59"):
		break
	elif(now_time_minute == pass_tweet_time):	
		break
	time.sleep(0.01)
	
while True:
	tweet = API.user_timeline(user_name,count = 1)
	for i in tweet:
		tweet = i.text
		tweet_time = i.created_at
		
	tweet_time = re.findall(r"\d+",str(tweet_time))
	tweet_time_minute = tweet_time[4]
	tweet_time_second = tweet_time[5]
		
	if(pass_tweet_time == "00"):
		pass_tweet_time_ = "59"
	else:
		pass_tweet_time_ = str(int(pass_tweet_time)-1)
		if(len(pass_tweet_time_) == 1):
			pass_tweet_time_ = "0" + pass_tweet_time_
	for i in range(57,60):
		if(pass_tweet_time_ == tweet_time_minute and str(i) == tweet_time_second):
			flag = 1	
	if(pass_tweet_time == tweet_time_minute):
		flag = 1
		
	if(flag == 1):
		break
	#else:
		#console.clear()
		#print(message["no_update"]+" ["+str(datetime.datetime.now()).split(" ")[1]+"]")
	time.sleep(0.01)

tweet = tweet_trim(tweet)

if(room_id in tweet):
	room_id_index = tweet.index(room_id)
	if(room_id_index == 0):
		password = str(tweet[1])
	elif(room_id_index == 1):
		password = str(tweet[0])
	elif(len(tweet) >= 1):
		password = str(tweet[0])
else:
	password = tweet[0]

keyboard.insert_text(password)
keyboard.insert_text("\n")
notification.schedule(password)
print("password:"+password)
anonymous No title
Python
import notification
import clipboard
import keyboard
import datetime
import calendar
import tweepy
import base64
import json
import time
import glob
import os
import sys
import re
import random
import console


"""
           ---初期設定---
   
 ①コードの貼り付けができたら自身のTwitterID入力をします。
 
      例 : ID が @Twitter_1234 の場合 
         TwitterID = "@XXXX" を
         TwitterID = "@Twitter_1234" に変更
 
 ②右上の▷を押すと、数字が出てきます、
 その数字と ①で書き込んだTwitterID の2つをDMで伝えてください。
 
 ③数字と引き換えにこちらがIDを渡しますので、AutoIDを35行目にコピーして貼り付けてください

"""

Twitter_ID = "@XXXX"

# 0000を消した後 貰ったIDを=の後にそのまま貼り付けてください
Auto_ID = 0000


"""

   ---使用設定部分---
  
   パスツイ  21:30
   ルーム番号 567
   
      の場合
     ↓↓↓↓↓↓↓↓
     
 pass_tweet_time = "30"
 room_id         = "567" 

  このように下を書き換えます。 
 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
 
"""

pass_tweet_time = "00"
room_id         = "0000" 



"""
     ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
     ⚠️以下書き換えると動作しなくなります
   ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
"""

flag     = 0
password = ""

CK = b'eGdsMlF5TlJscFNLRWh5dFMzN1g2TTdSag=='
CKS = b'azJIbWpKS1J0TExGUjBmZnQzZW5FSnBCdGY5NUY3VURGYzluQmgxblJ2bVNwazd0S24='
AT = "837597646311178240-q8vlRy0BPcIBxngYG9ynhu1cSNqCVC3"
ATS = "cnMrSYDnMiSaqHNbxesiweHI2esGDMZHS87ugHiveAsrK"

basenumber = "0123456789"

font_item = ["⓪①②③④⑤⑥⑦⑧⑨",
             "⓿❶❷❸❹❺❻❼❽❾",
             "0123456789",
             "𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡",]
             
itemlist1 = ["@[a-zA-Z0-9_]+",
             "[0-9]{1,2}:[0-5][0-9]",
             "[0-9]{1,2}時[0-59]分",
             "([0-9]|[0-2][0-9])時",
             "[0-5][0-9]分",
             "[1-9]{1,2}/[0-9]{1,2}",]
             
itemlist2 = [" "," ",]
	
message = {
	"no_update":"パスツイ取得中",
	"code_notification":"この数字と入力したTwitterIDをDMで伝えてください:",
	"copy_error":"Twitterリンクのコピー又はフルアクセスの許可をしてください",
	"pass_notfound":"パスワードが取得できませんでした",
	"waiting_passtweet":"からのパスツイ待機中... ",
	"success":"ID認証成功",
	"fail":"認証失敗:"
}

Xcode = ["\x207\x204\x208\x209\x400\x102",
         "207\x200\x208\x209\x400\x109" ,
         "207\x204\x208\x209\x400\x102" ,
         "207\x204\x208\x209\x400\x102" ,]

"""
  関数
"""
def login(CK,CKS,AT,ATS):
	CK = base64.b64decode(CK.decode())
	CKS = base64.b64decode(CKS.decode())
	auth = tweepy.OAuthHandler(str(CK).split("'")[1],str(CKS).split("'")[1])
	auth.set_access_token(AT,ATS)
	API = tweepy.API(auth)
	return API

def get_username():
	user_name = clipboard.get()
	if("https" in user_name):
		user_name = user_name.split("/")
		user_name = user_name[3].split("?")
		user_name = user_name[0]
		return user_name
	else:
		print(message["copy_error"])
		sys.exit()

def ACencrtrpt(a,b):
	c = a+","+str(b)
	c = base64.b64encode(c.encode())
	return c
	
def Test(c,d):
	if c == d:
		return True
	else:
		key = glob.glob("*.pwd")
		key = key[0].split(".")[0]
		print(message["code_notification"]+key)
		sys.exit()
		
def check():
	file = glob.glob("*.pwd")
	if not file:
		key = int(random.uniform(1,99))*int(random.uniform(99,999))
		key = str(key)
		with open(key+".pwd" , mode="w") as f:
			f.write("")
		notification.schedule(message["code_notification"]+key)
		print(message["code_notification"]+key)
		sys.exit()
	else:
		code = file[0].split(".")[0]
		return code
							
def tweet_filter(Tweettext):	
	for i in range(10):
		if(font_item[0][i] in Tweettext):
			Tweettext = Tweettext.replace(font_item[0][i],basenumber[i])
		for j in range(10):
			if(font_item[1][j] in Tweettext):
				Tweettext = Tweettext.replace(font_item[1][j],basenumber[j])
			for k in range(10):
				if(font_item[2][k] in Tweettext):
					Tweettext = Tweettext.replace(font_item[2][k],basenumber[k])
				for l in range(10):
					if(font_item[3][l] in Tweettext):
						Tweettext = Tweettext.replace(font_item[3][l],basenumber[l])		
	return Tweettext

def tweet_trim(tweet):
	tweet = tweet_filter(tweet)
	for i in itemlist1:
		tweet = re.sub(i,"",tweet)
		for j in itemlist2:
			tweet = tweet.replace(j,"")
	tweet = re.findall(r"\d+",tweet)
	return tweet
	
def get_time_now():
	now_time = datetime.datetime.now()
	now_time = str(now_time).split(" ")[1]
	now_time = now_time.split(":")
	now_time_minute = now_time[1]
	now_time_seconds = now_time[2].split(".")[0]
	return now_time_minute,now_time_seconds


API   = login(CK,CKS,AT,ATS) 

Check = check()
Check = ACencrtrpt(Check,Twitter_ID)
Test(Auto_ID,Check)

user_name = get_username()

print("@"+user_name+message["waiting_passtweet"])

if(pass_tweet_time == "00"):
	passTb = "59"
else:
	passTb = str(int(pass_tweet_time)-1)	
	
while True:
	now_time_minute , now_time_seconds = get_time_now()		
	if(now_time_minute == passTb and now_time_seconds == "58"):
		break	
	elif(now_time_minute == passTb and now_time_seconds == "59"):
		break
	elif(now_time_minute == pass_tweet_time):	
		break
	time.sleep(0.01)
	
while True:
	tweet = API.user_timeline(user_name,count = 1)
	for i in tweet:
		tweet = i.text
		tweet_time = i.created_at
		
	tweet_time = re.findall(r"\d+",str(tweet_time))
	tweet_time_minute = tweet_time[4]
	tweet_time_second = tweet_time[5]
		
	if(pass_tweet_time == "00"):
		pass_tweet_time_ = "59"
	else:
		pass_tweet_time_ = str(int(pass_tweet_time)-1)
		if(len(pass_tweet_time_) == 1):
			pass_tweet_time_ = "0" + pass_tweet_time_
	for i in range(57,60):
		if(pass_tweet_time_ == tweet_time_minute and str(i) == tweet_time_second):
			flag = 1	
	if(pass_tweet_time == tweet_time_minute):
		flag = 1
		
	if(flag == 1):
		break
	#else:
		#console.clear()
		#print(message["no_update"]+" ["+str(datetime.datetime.now()).split(" ")[1]+"]")
	time.sleep(0.01)

tweet = tweet_trim(tweet)

if(room_id in tweet):
	room_id_index = tweet.index(room_id)
	if(room_id_index == 0):
		password = str(tweet[1])
	elif(room_id_index == 1):
		password = str(tweet[0])
	elif(len(tweet) >= 1):
		password = str(tweet[0])
else:
	password = tweet[0]

keyboard.insert_text(password)
keyboard.insert_text("\n")
notification.schedule(password)
print("password:"+password)
anonymous No title
Python
import notification
import clipboard
import keyboard
import datetime
import calendar
import tweepy
import base64
import json
import time
import glob
import os
import sys
import re
import random
import console


"""
           ---初期設定---
   
 ①コードの貼り付けができたら自身のTwitterID入力をします。
 
      例 : ID が @Twitter_1234 の場合 
         TwitterID = "@XXXX" を
         TwitterID = "@Twitter_1234" に変更
 
 ②右上の▷を押すと、数字が出てきます、
 その数字と ①で書き込んだTwitterID の2つをDMで伝えてください。
 
 ③数字と引き換えにこちらがIDを渡しますので、AutoIDを35行目にコピーして貼り付けてください

"""

Twitter_ID = "@XXXX"

# 0000を消した後 貰ったIDを=の後にそのまま貼り付けてください
Auto_ID = 0000


"""

   ---使用設定部分---
  
   パスツイ  21:30
   ルーム番号 567
   
      の場合
     ↓↓↓↓↓↓↓↓
     
 pass_tweet_time = "30"
 room_id         = "567" 

  このように下を書き換えます。 
 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
 
"""

pass_tweet_time = "00"
room_id         = "0000" 



"""
     ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
     ⚠️以下書き換えると動作しなくなります
   ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
"""

flag     = 0
password = ""

CK = b'eGdsMlF5TlJscFNLRWh5dFMzN1g2TTdSag=='
CKS = b'azJIbWpKS1J0TExGUjBmZnQzZW5FSnBCdGY5NUY3VURGYzluQmgxblJ2bVNwazd0S24='
AT = "837597646311178240-q8vlRy0BPcIBxngYG9ynhu1cSNqCVC3"
ATS = "cnMrSYDnMiSaqHNbxesiweHI2esGDMZHS87ugHiveAsrK"

basenumber = "0123456789"

font_item = ["⓪①②③④⑤⑥⑦⑧⑨",
             "⓿❶❷❸❹❺❻❼❽❾",
             "0123456789",
             "𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡",]
             
itemlist1 = ["@[a-zA-Z0-9_]+",
             "[0-9]{1,2}:[0-5][0-9]",
             "[0-9]{1,2}時[0-59]分",
             "([0-9]|[0-2][0-9])時",
             "[0-5][0-9]分",
             "[1-9]{1,2}/[0-9]{1,2}",]
             
itemlist2 = [" "," ",]
	
message = {
	"no_update":"パスツイ取得中",
	"code_notification":"この数字と入力したTwitterIDをDMで伝えてください:",
	"copy_error":"Twitterリンクのコピー又はフルアクセスの許可をしてください",
	"pass_notfound":"パスワードが取得できませんでした",
	"waiting_passtweet":"からのパスツイ待機中... ",
	"success":"ID認証成功",
	"fail":"認証失敗:"
}

Xcode = ["\x207\x204\x208\x209\x400\x102",
         "207\x200\x208\x209\x400\x109" ,
         "207\x204\x208\x209\x400\x102" ,
         "207\x204\x208\x209\x400\x102" ,]

"""
  関数
"""
def login(CK,CKS,AT,ATS):
	CK = base64.b64decode(CK.decode())
	CKS = base64.b64decode(CKS.decode())
	auth = tweepy.OAuthHandler(str(CK).split("'")[1],str(CKS).split("'")[1])
	auth.set_access_token(AT,ATS)
	API = tweepy.API(auth)
	return API

def get_username():
	user_name = clipboard.get()
	if("https" in user_name):
		user_name = user_name.split("/")
		user_name = user_name[3].split("?")
		user_name = user_name[0]
		return user_name
	else:
		print(message["copy_error"])
		sys.exit()

def ACencrtrpt(a,b):
	c = a+","+str(b)
	c = base64.b64encode(c.encode())
	return c
	
def Test(c,d):
	if c == d:
		return True
	else:
		key = glob.glob("*.pwd")
		key = key[0].split(".")[0]
		print(message["code_notification"]+key)
		sys.exit()
		
def check():
	file = glob.glob("*.pwd")
	if not file:
		key = int(random.uniform(1,99))*int(random.uniform(99,999))
		key = str(key)
		with open(key+".pwd" , mode="w") as f:
			f.write("")
		notification.schedule(message["code_notification"]+key)
		print(message["code_notification"]+key)
		sys.exit()
	else:
		code = file[0].split(".")[0]
		return code
							
def tweet_filter(Tweettext):	
	for i in range(10):
		if(font_item[0][i] in Tweettext):
			Tweettext = Tweettext.replace(font_item[0][i],basenumber[i])
		for j in range(10):
			if(font_item[1][j] in Tweettext):
				Tweettext = Tweettext.replace(font_item[1][j],basenumber[j])
			for k in range(10):
				if(font_item[2][k] in Tweettext):
					Tweettext = Tweettext.replace(font_item[2][k],basenumber[k])
				for l in range(10):
					if(font_item[3][l] in Tweettext):
						Tweettext = Tweettext.replace(font_item[3][l],basenumber[l])		
	return Tweettext

def tweet_trim(tweet):
	tweet = tweet_filter(tweet)
	for i in itemlist1:
		tweet = re.sub(i,"",tweet)
		for j in itemlist2:
			tweet = tweet.replace(j,"")
	tweet = re.findall(r"\d+",tweet)
	return tweet
	
def get_time_now():
	now_time = datetime.datetime.now()
	now_time = str(now_time).split(" ")[1]
	now_time = now_time.split(":")
	now_time_minute = now_time[1]
	now_time_seconds = now_time[2].split(".")[0]
	return now_time_minute,now_time_seconds


API   = login(CK,CKS,AT,ATS) 

Check = check()
Check = ACencrtrpt(Check,Twitter_ID)
Test(Auto_ID,Check)

user_name = get_username()

print("@"+user_name+message["waiting_passtweet"])

if(pass_tweet_time == "00"):
	passTb = "59"
else:
	passTb = str(int(pass_tweet_time)-1)	
	
while True:
	now_time_minute , now_time_seconds = get_time_now()		
	if(now_time_minute == passTb and now_time_seconds == "58"):
		break	
	elif(now_time_minute == passTb and now_time_seconds == "59"):
		break
	elif(now_time_minute == pass_tweet_time):	
		break
	time.sleep(0.01)
	
while True:
	tweet = API.user_timeline(user_name,count = 1)
	for i in tweet:
		tweet = i.text
		tweet_time = i.created_at
		
	tweet_time = re.findall(r"\d+",str(tweet_time))
	tweet_time_minute = tweet_time[4]
	tweet_time_second = tweet_time[5]
		
	if(pass_tweet_time == "00"):
		pass_tweet_time_ = "59"
	else:
		pass_tweet_time_ = str(int(pass_tweet_time)-1)
		if(len(pass_tweet_time_) == 1):
			pass_tweet_time_ = "0" + pass_tweet_time_
	for i in range(57,60):
		if(pass_tweet_time_ == tweet_time_minute and str(i) == tweet_time_second):
			flag = 1	
	if(pass_tweet_time == tweet_time_minute):
		flag = 1
		
	if(flag == 1):
		break
	#else:
		#console.clear()
		#print(message["no_update"]+" ["+str(datetime.datetime.now()).split(" ")[1]+"]")
	time.sleep(0.01)

tweet = tweet_trim(tweet)

if(room_id in tweet):
	room_id_index = tweet.index(room_id)
	if(room_id_index == 0):
		password = str(tweet[1])
	elif(room_id_index == 1):
		password = str(tweet[0])
	elif(len(tweet) >= 1):
		password = str(tweet[0])
else:
	password = tweet[0]

keyboard.insert_text(password)
keyboard.insert_text("\n")
notification.schedule(password)
print("password:"+password)
Don't you submit code?
Submit