Showing posts with label python 64 bit. Show all posts
Showing posts with label python 64 bit. Show all posts

Wednesday, November 30, 2011

Python String replace

I came across a point where the incoming user string had to be replaced with something i desire . Considering the simplicity of the activity i expected python to have some user defined function . might be a simple thing , but really useful...

replace( old , new, [max count]).
if you have the below
Code :
sample = "this is a test string"
print sample.replace("test" , "long test")
the result will look like this
"this is a long test string"
you dont have to import any library in specific.
the "max" from the syntax constitutes to the number of times the string has to be replaced.

Saturday, July 9, 2011

Active state python

There are quite a few sites where python downloads available.
one such is activestate python. you can download the different versions of python available for download. be sure you are downloading the version that suits your operating system and needs.


brief note : active state supplies executable for lot of scripting languages. the above url is for python.

Also, if you are first time user of python , i strongly recommend using one of the editors for python. i have used activate state python komodo ide ( trial version) . looks powerful and simple.
it supports a lot of scripting languages too. i have also used editplus , pythonwin, eclipse too.
i don't have a preference , it just helps you find flaws with your syntax and easy to check the definitions for the files that you are importing .


if you want more information about other ide just drop me a email. i will reply.

Note : i have windows7 (64 bit) and python64 bit did not go well with it , so just download 32 bit python , it works for both 64 bit and 32 bit operating systems as well.