Click here to Skip to main content
15,889,216 members

eceramanan - Professional Profile



Summary

    Blog RSS
43
Author
10
Authority
4
Debator
44
Editor
1
Enquirer
92
Organiser
464
Participant
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralIntro to Python Pin
eceramanan27-May-11 2:02
eceramanan27-May-11 2:02 
• What is Python?
• Why Python?
• Native Data types
• Container Data Types
• Everything is an Object
• Control Structures
• Functions and Procedures
• Classes and Instances
• Modules and packages
• Exceptions
• File Objects
• Tips and Tricks

What is Python?
• Python is an interpreted and high-level programming language
• A Dynamically typed OO language
• Design philosophy emphasizes code readability
• No compilation = Fast Edit–Test–Debug cycle
• Extensible in C or C++

Why Python?
• Clear and elegant syntax - easy to learn and use
• Dynamic interpreted Language
• Rapid Application development
• Access to system calls
• Efficient built-in data structures
• Vast standard libraries
• Flexible – OO or functional
• Platform independent
• Free, Open Source
• Heavily used in Quartz …. J

How to start Python
• Install python from python.org/download
• Launch python interpreter:
• Type python in system console
• Or In windows : start menu > run > python
• This will bring up the python interpreter. Now type:
• print 'Hello'
• type: exit() to exit from python interpreter

Data Types
• Bool True/False
• Numbers pi = 3.14159, age = 25
• Character string 'sample' , ''Double can be used''
• List [1,2,3]
• Dictionaries { 'name' : 'biswa', 'city:'HYD'}
• Objects my_instance = MyClass('foo',10)
• Modules import myfile

Numbers
• Integers:
–my_int = 4
–print my_int/3
• Long:
–2**10 1267650600228229401496703205376L
• Floating point:
–my_float = 2.0
–20/my_float 10.0

String
• str = 'hello friends! Welcome to python'
• 'hello' + 'world' 'helloworld' # concatenation
• 'hello' * 3 'hellohellohello' # repetition
• len('hello') 5 # size
• 'll' in 'hello' True # Test if 'll' is a substring
• Convert other types to string : str()
pi = 3.14159
print 'Hi! i am pi, my value is :' + str(pi)
>> Hi! i am pi, my value is : 3.14159
• print 'I can\'t escape!' I can't escape!
• print '''triple quotes
can contain
Multi line strings'''

– triple quotes
can contain
Multi line strings
• raw strings :
print r'I can escape /n' I can escape /n

String slicing
• string[start:end] Elements of the string starting from start and extending up to but not including end element.
• s = 'Hello'
• s[0] 'H'
• s[-1] 'o'
• s[1:4] 'ell'
• s[1:] 'ello' # from 1 till the end
• s[:4] 'Hell' # from begining till 3 [but not 4]
• s[:] 'Hello' #from beginning to end
• s[:-3] 'He' # from beginning going up to but not # including 3rd last element
• s[-3:] 'llo' #from 3rd last element to end

String methods
– 'aabbcc'.find('b') 2
– 'aabb'.find('cd') -1
– 'aba'.replace('a','c') 'cbc’
– 'aabaab'.count(‘a') 4
– 'name,age,sex'.split(',') ['name' , 'age' , 'sex' ]
– ';'.join( ['a' , 'b’ , ‘c' , 'd' ] 'a;b;c;d’

List
• Sequence of elements - mutable
• Can contain heterogeneous data
• E.g-
li = [1, 'two',3, 'four', 5]
li[3] 'four'
len(li) 5
li.append('a')
li [1, 'two',3, 'four', 5 , 'a' ]
li[1:3] ['two’,3]
List methods
• Adding Elements to a List
– list.append(elem)
– list.insert(index, elem)
– list.extend(list2)
– list*n / n *list
li = [2,4,5,9]
li.append(10) #now li = [2,4,5,9,10]
li.insert(2,'new')
li [2, 4, 'new', 5, 9, 10]
li.extend([1,3,5])
li [2, 4, 'new', 5, 9, 10, 1, 3, 5]
[2,4,6] + [1,3,5] [2,4,6,1,3,5]
L = [1,2] * 5 [1,2,1,2,1,2,1,2,1,2]
L += [3]*5 [1,2,1,2,1,2,1,2,1,2,3,3,3,3,3]
GeneralASP.Net 4.0 concept links [modified] Pin
eceramanan11-Jan-11 21:00
eceramanan11-Jan-11 21:00 
GeneralGeneral [modified] Pin
eceramanan14-Sep-10 20:04
eceramanan14-Sep-10 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.