- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Rajendra Dharmkar has Published 453 Articles
Rajendra Dharmkar
290 Views
Nested Character Class SubtractionSince we can use the full character class syntax within the subtracted character class, we can subtract a class from the class being subtracted. [0-9-[0-7-[0-3]]] first subtracts 0-3 from 0-7, yielding [0-9-[4-7]], or [0-38-9], which matches any character in the string 012389.The class subtraction is always the ... Read More
Rajendra Dharmkar
406 Views
A character class followed by operators like '?', '*' or '+' are called repeating character classes.If you repeat a character class by using the '?', '*' or '+' operators, you will repeat the entire character class, and not just the character that it matched. The regex '[0-9]+' can match '579' ... Read More
Rajendra Dharmkar
842 Views
We come across negated character classes in Python regular expressions. An regex of ‘[abdfgh]’ matches any single character which is one of ‘a’, ‘b’, ‘d’, ’f’, ’g’ or ‘h’. This is termed a character class.An regex of ‘[^abdfgh]’ will match any single character which is NOT one of ‘a’, ‘b’, ‘d’, ... Read More
Rajendra Dharmkar
247 Views
If we run simple scripts like hello.py, its output is written on the STDOUT file, i.e., screen. There is one important and extra feature available which is the first line to be printed Content-type:text/html\r\r. This line is sent back to the browser and it specifies the content type to be displayed ... Read More
Rajendra Dharmkar
378 Views
Using Cookies in CGIHTTP protocol is a stateless protocol. For a commercial website, it is required to maintain session information among different pages. For example, one user registration ends after completing many pages. How to maintain user's session information across all the web pages?In many situations, using cookies is the ... Read More
Rajendra Dharmkar
405 Views
The function time.time() returns the time in seconds since the epoch, i.e., the point where the time starts.For Unix, the epoch is January 1, 1970. For Windows, the epoch is January 1, 1601.time.time() is used for benchmarking on Windows. time.time() behaves the same on both UNIX and Windows but time.clock() ... Read More
Rajendra Dharmkar
274 Views
Use time.clock() for timing/benchmarking if you need to choose between time and clock in Python.time() returns the the seconds since the epoch, in UTC, as a floating point number on all platforms. On Unix time.clock() measures the amount of CPU time that has been used by the current process, so ... Read More
Rajendra Dharmkar
127 Views
An timestamp is an offset value between a point in time line and the epoch, it's nothing to do with timezone. When it's converted to a human readable string like '%Y-%m-%d %H:%M:%S' that doesn't include any timezone information, python assumes that you want to use local timezone setting.datetime.timestamp() on a ... Read More
Rajendra Dharmkar
482 Views
The __del__() method is a known as a destructor method. It is called when an object is garbage collected which happens after all references to the object have been deleted.In a simple case this could be right after you delete a variable like del x or, if x is a ... Read More
Rajendra Dharmkar
158 Views
It is not possible to run Python in any modern browser because none contain a python interpreter. Javascript is the only language which runs in a browser without plugins like Flash or ActiveX.One way to write Python code that will run in the browser is to use a "transpiler". This ... Read More