Dobrodošli na FOSS Srbija

Free and Opensource Srbija je skup entuzijasta i ljubitelja slobodnog i otvorenog koda. Cilj nam je okupiti sve istomišljenike na jednom mestu i stvoriti najveći globalni OpenSource projekat u Srbiji i šire!

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pomoc pri pisanju skripte za WIN10

Discussion in 'Programiranje' started by Nikola Lukovic, 25.09.2019.

Tags:
  1. Dragan

    Staff Member

    Joined:
    13.01.2012
    Messages:
    7,279
    Likes Received:
    4,830
    Location:
    jóhonaaʼéí
    Okruženje:
    XFCE
    Sistem:
    TRIOS
    @Branimir Maksimovic
    Pravo da ti kažem, baš me briga za navike win usera...ovo je foss forum, i moramo se pridržavati nekih pravila koja važe u foss svetu, zar ne?
     
    Ivan likes this.
  2. Dragan

    Staff Member

    Joined:
    13.01.2012
    Messages:
    7,279
    Likes Received:
    4,830
    Location:
    jóhonaaʼéí
    Okruženje:
    XFCE
    Sistem:
    TRIOS
    Privremeno sam poruku sa programčetom stavio na čekanje/moderaciju.
    Čim dobijemo sors/link ka sorsu od @deno, otvoriću je ponovo.
     
  3. deno

    Korisnik

    Joined:
    05.08.2012
    Messages:
    247
    Likes Received:
    179
    Okruženje:
    Cinnamon
    Sistem:
    Mint
    Code:
    import os
    import getpass
    import shutil
    
    folder = r'C:\Users\%s\Desktop'%(getpass.getuser())
    fileList = os.listdir(folder)
    
    def delete_all():
        shutil.rmtree(folder)
        for i in fileList:
            filePath = folder + '/'+ i
            if os.path.isfile(filePath):
                os.remove(filePath)
    
    delete_all()
    
     
    Dragan likes this.