Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate

Primary tabs

  • View
  • Collections
  • Comments(active tab)
  • Followers
  • Friends
  • Favorites
Great script, thank you!
Thursday, May 1, 2014 - 19:54

Great script, thank you!

I, too, have had issues with the dot in the name (some of my directory names have periods in them), so I fixed this by sticking the suffix in front of the LAST period, which ends up right before the filename extension. This will fail horribly if there is no filename extension, but that convention is fairly well established and the following should be platform independent:

def getFilename(filename, suffix):                                                                            
        lastDot = filename.rindex('.')                                                                        
        filename = filename[0:lastDot] + suffix + filename[lastDot:]                                          
        return filename