title: os.rename() using user input variables?
body: <p>I am trying to rename a folder, the folder was created by requesting a user input and sub folders created within, to rename the parent directory (asset_name) I am using <code>filedialog.askdirectory()</code> but I keep getting stuck with the error</p>
  
  <pre><code>TypeError: Can't convert 'StringVar' object to str implicitly
  </code></pre>
  
  <p>I have read all the documentation I can find on <code>os.rename()</code> and it always refers to ("path","path") rather than variables, I have tried working the line backward to alleviate the error but to no avail, I'll post the whole error here:</p>
  
  <pre><code>Exception in Tkinter callback
  Traceback (most recent call last):
    File "C:\Python33\lib\tkinter\__init__.py", line 1475, in __call__
      return self.func(*args)
     File "&lt;module1&gt;", line 59, in fldrRename
  TypeError: Can't convert 'StringVar' object to str implicitly
  </code></pre>
  
  <p>this is the code:</p>
  
  <pre><code>import tkinter as tk
  from tkinter import *
  from tkinter import ttk
  from tkinter import tix
  from tkinter.constants import *
  from tkinter import filedialog
  import os, sys
  import itertools
  import getpass
  
  
  root = Tk()
  root.title("WRT Project Manager")
  
  path = ("P://Projects_2013//")
  
  mainframe = ttk.Frame(root, padding="12 12 12 12")
  mainframe.grid(column=0, row=0, sticky=(N, W, E, S))
  mainframe.columnconfigure(0, weight=1)
  mainframe.rowconfigure(0, weight=1)
  
  
  prjtnm= StringVar()
  Dirlist= StringVar()
  in2 = StringVar()
  in3 = StringVar()
  assetVar = StringVar()
  dirlst = StringVar()
  fldr = StringVar()
  currentproject = StringVar()
  
  #get a list of all the directories
  def dirlist():
      from tkinter.filedialog import askdirectory
      dirlist = path
      if dirlist:
      path.set(dirlist)
  
  
  # create project folder and sub directories
  def genAsset():
      asset_name = assetVar.get()
      os.chdir("P:\\Projects_2013")
      dirs = [[asset_name],
              ["fldr1", "fldr2", "fldr3", "fldr4", "fldr5", "fldr6"]]
      for item in itertools.product(*dirs):
              os.makedirs(os.path.join(*item))
  
  #choose an existing project directory
  def sel_Browse():
      fldr = filedialog.askdirectory()
      currentproject = fldr
      prjtnm.delete(0, END)
      prjtnm.insert(0, fldr)
  
  
  #rename a folder 'completed-'
  def fldrRename():
      newname = ("completed- "+ currentproject)
      os.chdir("P:\\Projects_2013")
      os.rename(currentproject,newname)
  
  
  
  ttk.Label(mainframe, text="User =").grid(column=1, row=1, sticky=E)
  ttk.Label(mainframe,text=getpass.getuser()).grid(column=2, row=1, sticky=W)
  ttk.Label(mainframe, text="Project directory path is P:/Projects_2013/").grid(column=3, row=1, sticky=W)
  ttk.Label(mainframe, text="Enter NEW project name:").grid(column=2, row=2, sticky=E, pady=15)
  ttk.Entry(mainframe, textvariable= assetVar, width=50).grid(column=3, row=2, sticky=(W,E))
  ttk.Button(mainframe, text="Create Folders", command=genAsset).grid(column=5, row=2, sticky=E, padx=10)
  ttk.Label (mainframe, text='Select an existing project:').grid(column=2,row=3, sticky=E)
  ttk.Button(mainframe, text="Browse", command=sel_Browse).grid(row=3,column=5, sticky=E, padx=10)
  prjtnm = Entry(mainframe, width=50)
  prjtnm.grid(row=3,column=3)
  ttk.Button(mainframe, text="Close", command=fldrRename).grid(row=4,column=3, padx=10)
  ttk.Label(mainframe, text="Select Date").grid(column=1, row=6, sticky=W)
  in3_entry = ttk.Entry(mainframe, width=20, textvariable=in3)
  in3_entry.grid(column=2, row=6, sticky=(W, E))
  
  root.mainloop()
  </code></pre>