User:Emily/Prototyping/Trimester 03/05

From XPUB & Lens-Based wiki
< User:Emily
Revision as of 12:24, 19 June 2015 by Emily (talk | contribs) (Created page with "Page Link: http://pzwart1.wdka.hro.nl/~yuzhen/p_js/ Steps: :Python words sorting (import sys, re, json) -- to create json file - sys.stdin.read() '''read file via < in comm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Page Link: http://pzwart1.wdka.hro.nl/~yuzhen/p_js/

Steps:

Python words sorting (import sys, re, json) -- to create json file
- sys.stdin.read() read file via < in command line
- find words, using regular expression, (r"\b(\w+)\b"
- sorting, there are .sort module in python
- print json.dumps(output, indent=2)
Python make html (import json, random)
var = open("filename.json")
data = json.load(var)
var.write()
var.close()

var = open ("filename.html", "w")
I made page reload via meta ...to view different result