Links

Search This Blog

January 30, 2020

Getting the extension of a file

#last extension

filename = "google.com.py.txt.exe.zip.html"
filename2 = "www.google.com/index.phps"

def get_last_ext(filename):
    filenameb = filename[::-1]
    try:
        only_last_ext = (filenameb[:filenameb.index('.')])[::-1]
    except:
        only_last_ext = ""
    return only_last_ext

def get_last_ext2(filename):
    if '.' in filename:
        return filename[filename.index('.')+1:].split('.')[-1]
    return ""

print get_last_ext(filename)
print get_last_ext2(filename2)

January 14, 2020

MMBN3B - My Fldr1

MMBN3B

Legend:

I - ID

M - MegaChip

S - Selected

T - Type: [F]ire, [W]ater, [G]rass, Neutral[.]

-||- - Same as previous

----------------------------------------------

Fldr1

No. ChipName T I MB   Times

01. HiCannon . J 24MB
02. -||-     . K -||-
03. -||-     . L -||-
04. Sword    . L 10MB
05. WideSwrd . L 16MB
06. LongSwrd . L 24MB
07. RndmMetr F V 28MB X2
08. MetaGel1 W B 18MB
09. -||-     W C -||-
10. -||-     W D -||-
11. Mine     . R 16MB X3
12. Snake    G R 20MB
13. AreaGrab . L 15MB X2
14. -||-     . * -||-
15. Recov200 . V 65MB
16. Geddon1  . * 10MB
17. CopyDmg  . * 18MB
18. Invis    . * 11MB X4
19. AntiDmg  . M 45MB S
20. FullCust . * 10MB M
21. Atk+30   . * 50MB M
22. RollV3   . R 34MB M
23. GutsManV2. G 41MB M