Mohd Mohtashim has Published 238 Articles

Passing Drop Down Box Data to CGI Program in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 08:06:27

492 Views

Drop Down Box is used when we have many options available but only one or two will be selected.ExampleHere is example HTML code for a form with one drop down box − Maths Physics OutputThe result of this code is the following form −Below is dropdown.py script ... Read More

Passing Radio Button Data to CGI Program in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 08:05:24

338 Views

Radio Buttons are used when only one option is required to be selected.ExampleHere is example HTML code for a form with two radio buttons − Maths Physics The result of this code is the following form −Below is radiobutton.py script to handle input given by web browser ... Read More

Passing Text Area Data to CGI Program in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 08:04:50

304 Views

TEXTAREA element is used when multiline text has to be passed to the CGI Program.ExampleHere is example HTML code for a form with a TEXTAREA box − Type your text here... The result of this code is the following form −Below is textarea.cgi script to handle input ... Read More

Passing Checkbox Data to CGI Program in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 08:02:13

569 Views

Checkboxes are used when more than one option is required to be selected.ExampleHere is example HTML code for a form with two checkboxes − Maths Physics OutputThe result of this code is the following form −Below is checkbox.cgi script to handle input given by web browser for ... Read More

Passing Information Using POST Method in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 08:00:46

633 Views

A generally more reliable method of passing information to a CGI program is the POST method. This packages the information in exactly the same way as GET methods, but instead of sending it as a text string after a ? in the URL it sends it as a separate message. ... Read More

Passing Information using GET method in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 07:59:46

2K+ Views

The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character as follows −http://www.test.com/cgi-bin/hello.py?key1=value1&key2=value2The GET method is the default method to pass information from browser to web server and it produces a long string that appears ... Read More

Regular Expression Examples in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 07:51:02

327 Views

Literal charactersSr.No.Example & Description1pythonMatches beginning of line.Character classesSr.No.Example & Description1[Pp]ythonMatch "Python" or "python"2rub[ye]Match "ruby" or "rube"3[aeiou]Match any one lowercase vowel4[0-9]Match any digit; same as [0123456789]5[a-z]Match any lowercase ASCII letter6[A-Z]Match any uppercase ASCII letter7[a-zA-Z0-9]Match any of the above8[^aeiou]Match anything other than a lowercase vowel9[^0-9]Match anything other than a digitSpecial Character ClassesSr.No.Example ... Read More

CGI Environment Variables in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 07:48:09

2K+ Views

All the CGI programs have access to the following environment variables. These variables play an important role while writing any CGI program.Sr.No.Variable Name & Description1CONTENT_TYPEThe data type of the content. Used when the client is sending attached content to the server. For example, file upload.2CONTENT_LENGTHThe length of the query information. ... Read More

Special Syntax with Parentheses in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 31-Jan-2020 07:44:14

170 Views

Sr.No.Example & Description1R(?#comment)Matches "R". All the rest is a comment2R(?i)ubyCase-insensitive while matching "uby"3R(?i:uby)Same as above4rub(?:y|le))Group only without creating \1 backreference

Regular Expression Patterns in Python

Mohd Mohtashim

Mohd Mohtashim

Updated on 30-Jan-2020 07:36:37

507 Views

Except for control characters,  (+ ? . * ^ $ ( ) [ ] { } | \), all characters match themselves. You can escape a control character by preceding it with a backslash.Following table lists the regular expression syntax that is available in Python −Sr.No.Pattern & Description1^Matches beginning of ... Read More

Advertisements