I'm having problems casting input information from an XHTML form as a different type in a CGI script using Python.
For just a simple example I'd use the XHTML code:
[HTML]<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
...
User Profile
Collapse
-
Processing an XHTML form using CGI script
-
That line.split() was what I was looking for. Thank you! -
Processing a comma-delimited text file. [solved]
I have a single text file with several lines of information with three items separated by commas. An example of a few lines:
name1, email1, password1
name2, email2, password2
name3, email3, password3
Using:
the program prints a list similar to:Code:def main(): f = open("database.txt","r") print f.readlines() main()
['name1,...
No activity results to display
Show More
Leave a comment: