Monday, September 15, 2014

python environment setup-001 : pip and path configure



1  Starting from version Python 3.4, pip is already included in the regular install.

2 The Windows version is provided as an MSI package.

3 You can have multiple versions of Python on the same system without conflics.

4 only one interpreter can be the default application for Python file types.

5  It also does not automatically modify the PATH environment variable,
so that you always have control over which copy of Python is run.

my pc path :
E:\p27\;E:\p27\Lib\;

E:\devLW\Python32;

E:\devLW\Python32\Scripts;

3 download the get-pip.py

4 python get-pip.py

5 pip install virtualenv

6  virtualenv venv

e virtualenv kit provides the ability to create virtual Python environments that do not interfere with either each other, or the main Python installation. If you install virtualenv before you begin coding then you can get into the habit of using it to create completely clean Python environments for each project. This is particularly important for Web development, where each framework and application will have many dependencies.

To set up a new Python environment, change the working directory to wherever you want to store the environment, and run the virtualenv utility in your project’s directory


To use an environment, run the activate.bat batch file in the Scripts subdirectory of that environment. Your command prompt will change to show the active environment. Once you have finished working in the current virtual environment, run the deactivate.bat batch file to restore your settings to normal.

Each new environment automatically includes a copy of pip in the Scripts subdirectory, so that you can setup the third-party libraries and tools that you want to use in that environment. Put your own code within a subdirectory of the environment, however you wish. When you no longer need a particular environment, simply copy your code out of it, and then delete the main directory for the environment.

=============================
Reference list :

http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows

https://pip.pypa.io/en/latest/installing.html

http://docs.python-guide.org/en/latest/starting/install/win/




QTP VBS Excel SaveAs: how to save 2003 excel files (.xls) in the compatibility mode (2007 office Excel)



I have one qtp script and the come out result is default 2007 format .xlsx files and today I want to convert it to 2003 :


Just change the file name is xls and add number 56 or -4134 in the SaveAs codeline: see the below snippet:

          file_name=p_string&".xls"
            file_path="c:\1234\"
            new_file_location=file_path&file_name
            'obj_excel.ActiveWorkbook.SaveAs  new_file_location
           
            obj_excel.ActiveWorkbook.SaveAs  new_file_location,-4143
             

These are the main file formats in Excel 2007-2013, Note: In Excel for the Mac the values are +1

51 = xlOpenXMLWorkbook (without macro's in 2007-2013, xlsx)
52 = xlOpenXMLWorkbookMacroEnabled (with or without macro's in 2007-2013, xlsm)
50 = xlExcel12 (Excel Binary Workbook in 2007-2013 with or without macro's, xlsb)
56 = xlExcel8 (97-2003 format in Excel 2007-2013, xls)

Reference : 

http://stackoverflow.com/questions/17464698/open-an-excel-file-and-save-as-xls
http://www.rondebruin.nl/win/s5/win001.htm

Tuesday, September 2, 2014

09042014 Daily Enlgish video : Unit 4 I like your style


Unit 4
I like your style

just the shirt

where did you get it ?

I got it from the weekend market
How much did it cost ?
it cost about 12 dollars
do you like to wear jewelry ?
Do u have a pierced ear ?
Do u have a tattoo ?
yes, I do

//from the youtube video

https://www.youtube.com/watch?v=mSc5THUz4lw

Thursday, June 19, 2014

[VM-install]: "no boot files found "issue when you prepare to install the VM in the wmsphere client :

"no boot files found "issue when you prepare to install the VM in the wmsphere client :

You may encounter such issues when you intall one vm via wmshere client , pls check the belwo check points:

1 makes sure the avaible IOS format is loacted in the folder '/vmimages/..'
2 make sure set the virtual Device Node :IDE(0:0) CD/DVD Driver 1, it lets the boot program to boot form the CD/DVD

[VM]: Basic Knowledge #1 : How to export your vm to OVF ?

VMware Virtual Machine Disk File (VMDK) is a format specification for virtual machine (VM) files.

Export a Virtual Machine to OVF Format

1 Select the virtual machine and select File > Export to OVF.

2 Type a name for the OVF file and specify a directory in which to save it.

3 Click Save to start the OVF export process. The export process can take several minutes. A status bar indicates the progress of the export process.

More info on the VMware sitehttp://pubs.vmware.com/workstation-10/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-D1FEBF81-D0AA-469B-87C3-D8E8C45E4ED9.html

Monday, June 9, 2014

setProperty path for Chrome Driver

If you wanna change the Firefox driver to Chrome, you must set the system Property and tell the coder where to find the need chromedriver.
pls take notes that : you must point out the chromedriver.exe, not your system installed Chrome exe .

for example

System.setProperty("webdriver.chrome.driver","/path/chromedriver_win32/chromedriver.exe");