Python IMVU Snippets

DataMine
by DataMine · 3 posts
6 years ago in Python
Posted 6 years ago · Author
In an effort to get a basic understanding of Python I'm going to write code to perform basic tasks related to IMVU that I already know how to do in other languages.

Below I am going to share a few code snippets with you that you can learn from. Each piece of code is fully functional on its own and can be saved to a file and ran via the python console. As long as you have python installed you should be able to run them.

Requirements:
1) Python
2) Python IDE/Text Editor (I'm using Notepad++)


Open your IMVU cache folder
Code
import subprocess, os

if os.getenv('APPDATA') is not None:
   subprocess.Popen('explorer "' + os.getenv('APPDATA') + '\IMVU\HttpCache\"')


Basic cache cleaner
This is a basic cache cleaner, it goes through your cache folder deleting all of the files and folders.
Code
import os, shutil

cachePath = os.path.join(os.getenv('APPDATA') + '\\IMVU\\HttpCache\\')

if os.path.exists(cachePath):
   print cachePath
   for cacheFile in os.listdir(cachePath):
      cacheFilePath = os.path.join(cachePath, cacheFile)
      try:
         if os.path.isfile(cacheFilePath):
            os.unlink(cacheFilePath)
         elif os.path.isdir(cacheFilePath): shutil.rmtree(cacheFilePath)
      except Exception as e:
         print(e)
else:
   print 'IMVU Cache Folder Not Found'

raw_input()


Basic cache cleaner v2
This is another basic cache cleaner. Except instead of going through the cache folders and files it just deletes the entire cache folder at once and then replaces it with an empty folder
Code
import os, shutil

cachePath = os.path.join(os.getenv('APPDATA') + '\\IMVU\\HttpCache\\')

if os.path.exists(cachePath):
   print cachePath
   try:
      if os.path.isdir(cachePath):
         shutil.rmtree(cachePath)
         os.makedirs(cachePath)
   except Exception as e:
      print(e)
else:
   print 'IMVU Cache Folder Not Found'

raw_input()
Posted 6 years ago
imvu lags for me from this
Posted 2 years ago
I coded this in delphi cause from explorer it took ages and even trying to de-install imvu client takes centuries.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT
Select a forum Protection     Help & Support     Introductions     Mafia News     IMVU News General Discussion     IMVU Lounge        IMVU Series / Roleplaying        Social Games     Mafia Market     Mafia Tools        Premium IMVU Tools        Off Topic Tools     Off Topic     Contests Creator Corner     Graphics Design        Photoshop        GIMP     Basic Creator Help     Catalog And Product Showcase     3D Meshing        3Ds Max        Sketchup        Blender Gangsters with Connections     White Hat Activities        Google Hacking        Trackers Programming Corner     Coding        Python        .Net (C#, VB, etc)        Flash        JAVA        Autoit        Batch        HTML & CSS        Javascript        PHP        Other        IMVU Homepage Codes           General           About me Panel           Messages Panel           Special Someone Panel           Visitors Panel           New Products Panel           Rankings Panel           Wishlist Panel           My Badges Panel           Outfits Panel           Url Panel           Groups Panel           Slideshow Panel           My Room Panel           Sandbox panel           Layouts     Help & Requests Free Credits     Approved Methods     Submit Methods Free Money     Approved Methods     Submit Methods Adult Corner     Get Mafia AP Here     AP Lounge        AP Social Games        Casual Dating Tips     IMVU Slave Market & Escorts