RSS

Category Archives: Python

How to switch between python 2.x and python 3.x


It is known that Python2.x can coexist with Python3.x. But how do you switch the active version in use? Simple: go to edit system environment variables (shortcut key: Windows + Break), and set the path variable as shown in the snapshot:

image

If you replace the path from Python27 to Python34, for instance, then you are setting the active Python version from 2.7 to 3.4.

 

 
Leave a comment

Posted by on April 9, 2014 in Programming, Python

 

Tags: , , , ,

How to install pip for python in Windows


pip install might be the most frequently used module in python. However, in the past it is not easy to install that in windows, see my previous post. Now in the latest update, it is very trivial to get this done.

  • If you have installed Python 3.4, the pip is already installed, no need to do anything!
  • If you are still using Python 2.x, the simplest way is to download get_pip.py, and run this command

image

Read the rest of this entry »

 
Leave a comment

Posted by on April 9, 2014 in Programming, Python

 

Tags: , , , , ,

Getting maya path programmatically: Python and C# Code


In automating maya to do some custom job, the maya installation folder is usually needed. Though one can hard code this as, for example, path=”C:\\Program Files\\Autodesk\\Maya2014\\”, this is not the best way as users may not install maya to the default directory.

To extract the maya installation folder, one can use registry in windows platform, as shown below:

image

Given this fact, it is not very hard to get the maya root folder, either in Python or C#:

Read the rest of this entry »

 
Leave a comment

Posted by on August 17, 2013 in CAD, Python

 

Tags: , , ,

Install python setuptools (easy install) on windows


It is very easy but you need to have a look at the documentation. Below are the quick steps to install “setuptools” for python.

  • Download this ez_setup.py and save it to hardisk.
  • Open a cmd window, and type “ez_setup.py”
  • Add “C:\Python27\Scripts” to enthronement “Path” variable

image

image

That is it. Enjoy.

 
1 Comment

Posted by on August 17, 2013 in Python

 

Tags: , , , , ,