title: Python Script invalid syntax answer
body: <p>This is a python script i am working on, i am new to pyhton scripting, this is what we are learning in school, i need some help with it. this is the error i keep getting, i dont understand what the invalid syntax is. thank you for any help. The "import maya.cmds as cmds", this is part of the program i am working on, </p>
  
  <pre><code>        #Error: line 1: invalid syntax
          #   File "&lt;maya console&gt;", line 27
          #     transformInScene = cmds.ls(type='transform')
          #                    ^
          # SyntaxError: invalid syntax #        
  </code></pre>
  
  <p>cmds.file(new=True,force=True)</p>
  
  <pre><code>        import maya.cmds as cmds
          def changeXtransformValue(myList, percentage=1.0):
              """
              Changes the value of each transform in the scene by a percentange.
              Parameters:
              percentage - Percentange to change each transform's value. Default value is 1.
              Returns:
              Nothing.
              """
              *# The ls command is the list command. It is used to list various nodes
              # in the current scene. You can also use it to list selected nodes.*
              transformInScene = cmds.ls(type='transform')
              found = False
              for thisTransform in transformInScene:
                  if i not in ['front','persp','side','top']:
                      found = True
                      break
                  else:
                      found = False
              if found == False:
                     sphere1 = cmds.polySphere()[0]
                     cmds.xform(sphere1, t = (0.5, 0.5, 0.5)
  *#This is the line where I am having problems*
              transformInScene = cmds.ls(type='transform')
              sel =cmds.ls(sl=True)
              if sel :
                  transformInScene = sel
              # If there are no transforms in the scene, there is no point running this   script
              if not transformInScene:
                    raise RuntimeError, 'There are no transforms in the scene!'
              badAttrs = list()
              # Loop through each transform
              for thisTransform in transformInScene:
                    if thisTransform not in ['front','persp','side','top']:
                    allAttrs = cmds.listAttr(thisTransform, keyable=True, scalar=True)
                    allAttrs = [ i for i in allAttrs if i = "visibility" ]
                     print allAttrs     
                     for attr in myList:
                         if attr in allAttrs:
                             currentVal = cmds.getAttr( thisTransform + "." + attr )
                             newVal = currentVal * percentage
                             cmds.setAttr(thisTransform + "." + attr, newval)
                             print "Changed %s. %s from %s to %s" % (thisTransform,attr,currentVal,newVal)
                         else:
                             badAttrs.append(attr)
  
              if badAttrs:
                  print "These attributes $s are not valid" % str()
  
          myList = ["translateX", "translateY", "translateZ", "scaleX"]
          changeXtransformVal(myList, percentage=1.0)
  </code></pre>
  
  <p>This is part of a school project and after fixing the indent, I cant seem to find the problem</p>