Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. JPeters
    J

    JPeters

    @JPeters

    0
    Reputation
    1
    Posts
    10
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    JPeters Follow

    Best posts made by JPeters

    This user hasn't posted anything yet.

    Latest posts made by JPeters

    Python writing to desktop

    Hi there,

    I've got a question, in my plugin I'm trying to create a directory on the Windows users' desktop to write files to with the following code:

    username = os.getlogin()    #Get the windows user name
    
    SavePathPackage = 'C:\\Users\\{username}\\Desktop\\TurnTableTool\\'
    
    # -----Checking if directories exist, if not create them-----#
    if (os.path.exists(SavePathPackage)):
        print("Path found on desktop")
    else:
        os.makedirs("C:\\Users\\{username}\\Desktop\\TurnTableTool")
        print("Created path on desktop")
    

    However, this throws en error:
    “winerror 5 access is denied”

    The usual fix is to run the code as admin but since this is a plugin within Cinema, that is not possible.

    Any pointers perhaps?

    posted in General Talk •