Regex in python python hunter
PythonHunter
by
3y ago
Regular Expressions is a powerful concept if understood clearly you can save your valuable time to extract out the particular text from huge string or paragraph. It is wildly pronounced as regex, it can help you to automate the boring stuff, like searching particular text form log files, python used this same concept in web scrapping. Below are some common examples to understand the regex. Method names will help you to have an idea that what exactly the regex is intended to do. if you don't understand any regex or want to create your own regex with your requirements then you can comment be ..read more
Visit website
Fallback tag in xslt by pran sukh on python hunter blog.
PythonHunter
by
3y ago
Fallback: As the name is self explanatory to use something as an alternative if the primary thing does not work well. In xslt the fallback tag works as an alternative tag if any given tag does not work or is not supported by xslt processor.  Note: This fallback will always work in not supported tags, so run time exception will not occur. Data.xml 1 2 3 4 5 6 7 8 91011121314 <?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="XSL.xsl"?><records><record><name>Adam Barr</name><address>222 Cherry</address><phone>555-7 ..read more
Visit website
Calling xslt template with param tag by pran sukh on Python Hunter
PythonHunter
by
3y ago
In XSLT we may need to use same template for different xml data tags, and also there might be a situation where we need to send some special instructions to template tag to act upon give condition or value and produce/process the xml data. Data.xml 1 2 3 4 5 6 7 8 91011121314 <?xml version='1.0'?><?xml-stylesheet type="text/xsl" href="XSLT.xsl"?><lists><ol><li>the</li><li>cat</li><ol><li>sat</li><li>on</li><li>the</li></ol><li>mat</li></ol></lists> XSLT.xsl ..read more
Visit website
XML, XSLT info by pran sukh on Python Hunter blog.
PythonHunter
by
3y ago
What is XML? Many computer systems contain data in incompatible formats. Exchanging data between incompatible systems (or upgraded systems) is a time-consuming task for web developers. Large amounts of data must be converted, and incompatible data is often lost. XML stores data in plain text format. This provides a software- and hardware-independent way of storing, transporting, and sharing data. XML also makes it easier to expand or upgrade to new operating systems, new applications, or new browsers, without losing data. With XML, data can be available to all kinds of "reading machines" lik ..read more
Visit website
XSLT apply import tag by pran sukh on python hunter blog
PythonHunter
by
3y ago
Modular Programming is good attitude of best programmer. We often need to keep our code in modular approach so that is would be easy to maintain  and update or remove dead code and also it ease the process of bug tracking. XML and XSL processors provide freedom to import multiple imports to process the same XML document. In the following XML data we have data from collage where student's and teacher's data is given. But we want to process the same XML data with different XSL files. Here in this example we want to show the teacher data in red background ..read more
Visit website
XSLT applyTemeplate tag by pran sukh on Python Hunter.
PythonHunter
by
3y ago
XSLT is used for presenting XML data in well structured way and in eye appealing sense. In XSLT we can define different templates and maintain criteria for XSLT processor to parse the XML data in and apply different template for different XML tags. Lets examine following example XML DATA. 1 2 3 4 5 6 7 8 910 <student id="1" eCode="e1"><firstName>Python 1</firstName><lastName>Hunert 1</lastName><dob><day>01</day><month>Jan</month><year>1991</year></dob><course>Programmer</course></student&g ..read more
Visit website
Classes and inheritance in python on python hunter by Pran Sukh.
PythonHunter
by
3y ago
Class inheritance is powerful concept of Object Oriented Programming. In this post some basic examples will consolidate the concept on inheritance.  Single Inheritance:- 1 2 3 4 5 6 7 8 9101112 class Parents:def methodParents(self):print("methodParents")class Child(Parents):def methodChild(self):print("methodChild")obj = Child()obj.methodChild()obj.methodParents() Multiple Inheritance:-  1 2 3 4 5 6 7 8 9101112131415161718192021222324 class GrandParents:def GrandParentsMethod(self):print("Grand Parents are providing ethics")class Parents():def ParentsMe ..read more
Visit website
Set in python on Python hunter blog by pran sukh
PythonHunter
by
3y ago
The set can contain elements or members of anything: numbers, characters, words, names, letters of the alphabet, even other sets and tuples. Sets are usually denoted with capital letters. Set is a data type in python and can hold any number of elements and any type of data in it. Even set data type is similar to other data types in python like list and tuple still there are some differences. Only unique object will be inserted as set element, duplicate or repeated elements will be removed from set object. Set object can not have list and dictionary object as element but we can ..read more
Visit website
Python Hunter, Deep copy and Shallow copy by pran sukh
PythonHunter
by
3y ago
In any programming language the copy concept is assigning the value of variable to other variable. But python shows strange behavior when this concept is implemented, follow the examples below.      123456789 list1 = list()list1 = ["Python","Hunter"]list2 = list1print(list1)print(list2)list2 [1] = "Lover"print(list1)print(list2) In the above code the list1 created and initialized and list1 is passed to list2. but when when we change any element in list2 it will will affect the list1 too. execute the script and observe the output. Explanation:-&nb ..read more
Visit website
Dictionary on Python Hunter by Pran Sukh
PythonHunter
by
3y ago
We have learned about list in previous blogs, list can contain dictionary object vice versa. Both has the ability to change their size at run time. list and dictionary can grow and shrink according to elements at run time. But what is the actual difference b/w these two? Read below.  One is that elements from list object contains elements in linear manner but the dictionary object contains elements as key and value pair.   Elements from list object are fetched with element's location but in dictionary the elements is fetched with key. Last but not the least that list is an o ..read more
Visit website

Follow PythonHunter on FeedSpot

Continue with Google
Continue with Apple
OR