17
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

「素人が見たらすごいことしてるような」スクリプトを作った

Posted at

素人にはすごいことしてる感を出すスクリプト

pythonのpipインストールしてるだけのなのに、たまたま通りかかったIT部門じゃない人がインストール画面のログを見て「すごいですね」と言われました。インストールしてるだけで「この人、すごい…」感を出せるのならいいじゃないか(?)と思い作りました。

必要なもの

「tqdm」のpipインストールが必要です。

pip install tqdm # windows
pip3 install tqdm # mac

スクリプト

こちらをコピペしてください。
インストールしてるように見えます。ただ延々と表示してるだけです。
文字のランダム生成はこちらを参考にさせていただきました。

nankaSugoi.py
import sys
import time
import random,string
from tqdm import tqdm


def dummyInfo():
    names = ["Mario Speedwagon","Petey Cruiser","Anna Sthesia",
             "Paul Molive","Anna Mull","Gail Forcewind","Paige Turner",
             "Bob Frapples","Walter Melon","Nick R. Bocker","Barb Ackue",
             "Buck Kinnear","Greta Life","Ira Membrit","Shonda Leer","Brock Lee",
             "Maya Didas","Rick O'Shea","Pete Sariya","Monty Carlo",
             "Sal Monella","Sue Vaneer","Cliff Hanger","Barb Dwyer",
             "Terry Aki","Cory Ander","Robin Banks","Jimmy Changa",
             "Barry Wine","Wilma Mumduya","Buster Hyman","Poppa Cherry",
             "Zack Lee",]

    selectName = random.randrange(len(names)-1)
    infos = ['---------------------------------------------------------',
            f"Author:{names[selectName]}",
             "Author-email:None",
             'Licence:MPLv2.0, MIT Licences',
             'Location:/opt/homebrew/lib/python3.9/site-packages',
            '----------------------------------------------------------',

    ]
    [print(info) for info in infos]



def dummyProcess1():
    wasteList = [str(random.random()) for i in range(20)]
    wasteNum = ''.join(wasteList)
    print(wasteNum)

def dummyProcess2():
    n = int(random.random() * 1000)
    randlst = [random.choice(string.ascii_letters + string.digits) for i in range(n)]
    print(''.join(randlst))

def dummyProcess3():
    for i in tqdm(range(100)):
        time.sleep(0.5)
    
    n = int(random.random() * 10)
    versionList = [str(int(random.random() * 10)) for i in range(3) ]
    unknownVesion = ".".join(versionList)
    packageList = [random.choice(string.ascii_letters + string.digits) for i in range(n)]
    unknownPackage = "".join(packageList)
    print(f"Installing collected packages:{unknownPackage}")
    print(f"Successfully installed {unknownPackage}-{unknownVesion}")



while True:
    dummyProcess1()
    dummyProcess2()
    dummyProcess3()
    dummyInfo()
    time.sleep(0.5)

実行結果

結果はこのようになります。location情報がmac環境のため、windows環境の方は本番で利用する場合は注意が必要です。

0.033007063471058310.041427946074763520.45379367800683910.45488724828379190.58231611308227560.9886660838077040.20100753155607120.95525954940235970.74772621949818970.73795634934648390.472850159692825070.77129102048127240.85839207303459660.172162271213770150.096160154986350440.0125061664174830330.195266262815886220.6888011073679410.7876322513778090.356363507465957
xSDh8hcIhUWvMhJHjXeJF4Xw5puFvzcwnt7wSHxy3M6rINRdRAKxgC5jLBPxELdpZYD1zoimPIvNS0dmlivTGZQEoLiOZGYnBwGN3qVbF9BJ3jeDnae4P2XiDtfshdgdlR6Iuc1MfcnuVoXUZaup9AQ4TzLrWjMJAMsCvSkoi2074m5uaOXFtp2HmnWg7Xe86cNHyMEnmRkbE1HITmCi4k2QiqQyMDOV2M5ZBBDhai0fnelnjWjuqFCrwJytzxV8CEQASRJcOdq4qFKQM2NvBRdymlCJA0ZONZXPG6G4N7WGu6Dhh7HwSqu5VRQk14yvyT0WWIPdoxsnR0oJZthPUFfOk4AcIe0QMO3EtsCjwi3bwIWIpKTLTeOpR9ZqOBbHUx8f6fVPbY1rx
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:50<00:00,  1.98it/s]
Installing collected packages:zx
Successfully installed zx-7.0.7
---------------------------------------------------------
Author:Barry Wine
Author-email:None
Licence:MPLv2.0, MIT Licences
Location:/opt/homebrew/lib/python3.9/site-packages
----------------------------------------------------------
0.87730393835564780.0246480182604265070.76594047907792710.69311871872175670.483937217217010.260149798076099950.0120631837588712760.80920929712740950.28052099431128420.294931119733130.55434396740770720.210654531386738180.48907605942792210.87852464075999850.494010190022285860.63229059291790920.15761835480171870.093891412939926310.82070381745188950.12859893670862055
9hFKzJQIa4rHrNB5JA4gRCDEWbkVU4mlNsXERN7F7JnAf0hlkjbrG3LiLZpU8eFfm1nYyxPGRfGafrogNB0IqVFkmBLCLfedk1Fxqg2JszhLoys8ECSuIBxQLvusJU2iE56hSlz2F7Sgn7IY9LleXudw55qmfFLyMBuYROkNKJOAN9XXJKnDQ1CDdqHb6yejl28HuUZBAPJuYx67y9DJqgi3ZIf51TiFeVeVRmdLvuVhyDRh2bkigGBSh7c4QTMQg01TaYEpNNAUfiKhJSRpMtjzlT5sDa1YJItrYYHspVXQ3vUhH5DsrdGZ02Q50UgajGNCIKZjjYbgZVUlkunkkHTvFSkDynTqSe65pINBQHu6aqZcQX1tjowyhYsiKYCkWYxlaRvFcwUkuiFgnA5dGwzONXGnyWmU0uuYHP9VJ5BEkuCKqnUKk9l2UgOL68Hq4JyUnx0JSFtxJGCmVFTprZZrUKv0y1Ckbm4FqmwMQkxh2xau9sEs5RZJGuMbgcejTOwDkFRWFFYFjPq
 52%|███████████████████████████████████████████████████████████▎                                                      | 52/100 [00:26<00:24,  1.98it/s]

the 無意味

17
8
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?