i've updated the previous find & replace code. in the following page http://xahlee.org/perl-python/findreplace_regex.html is a code that does find & replace of...
20050415 split a line by regex Here's another example of using regex. I have a file that is translation of Chinese lyrics. It is formatted like this: ...
Unicode chars can be included in regex patterns directly. Just make sure your string starts with ur. For example: re.search(ur'苦',mystring,re.U). Unicode can...
long story short, here's a complete rewrite of Python's re module doc http://xahlee.org/perl-python/python_re-write/lib/module-re.html This documentation...
Notes on rewriting the Python documentation Xah Lee, 200505. In 2005, i started to learn Python by reading its official documentation. In the process, i find...
HTML Problems in Python Doc I don't know what kind of system is used to generate the Python docs, but it is quite unpleasant to work with manually, as there...
Today we'll be writing a function called Range. The Perl documentation is as follows. Perl & Python & Java Solutions will be posted in 48 hours. Perl-Python...
Here's the Perl solution to the Range problem. ... # perl # http://xahlee.org/tree/tree.html # Xah Lee, 2005-05 #_____ Range _____ _____ _____ _____ =pod ...
The following is a new section of the article “What are OOP's Jargons and Complexities” at http://xahlee.org/Periodic_dosage_dir/t2/oop.html ... The Rise...
The following is a new section of the article “What are OOP's Jargons and Complexities” at http://xahlee.org/Periodic_dosage_dir/t2/oop.html ... The Rise...
The following is a new section of the article “What are OOP's Jargons and Complexities” at http://xahlee.org/Periodic_dosage_dir/t2/oop.html ... the Rise...
The following is a new section of the article “What are OOP's Jargons and Complexities” at http://xahlee.org/Periodic_dosage_dir/t2/oop.html ... The Rise...
the belated Java solution to previous Range exercise. import java.util.List; import java.util.ArrayList; import java.lang.Math; class math { public static List...
Here's the next tree functions exercise in Python, Perl, Java. The problem is to write a function named Table. Wolfram Research's Table function documentation...
The Perl solution is posted. It is a bit long. See http://xahlee.org/tree/Table.html the code is pasted below. It uses several auxiliary functions. #! perl #...
My opinion on this is that coders dont like writing docs. And open source is mostly unheard of outside the developer/geek community. Technical writers are...
danny staple
orionrobots@...
Aug 30, 2005 4:53 pm
97
On Python's Documentation Xah Lee, 20050831 I'm very sorry to say, that the Python doc is one of the worst possible in the industry. I'm very sick of Perl and...
... You could shorten the Perl unix calls by using the backtick operator: `gzip x.txt` `gzip -d x.txt.gz` And for the same behaviour as the Python module,...
danny staple
orionrobots@...
Sep 2, 2005 3:55 pm
100
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in...
Here's a example script that performs a simple task. The task is: suppose you a bunch of files named access_log.1.gz access_log.2.gz access_log.3.gz these are...
200509: Making System Calls (with unix and Python 2.4) To make a system call, use: subprocess.Popen([r"gzip","-d", "x.txt.gz"]).wait() The subprocess module is...
Hi there, You could save recompressing an intermediate file on a unix system by changing your input to the gzip commnad to include the -c option This will then...
danny staple
orionrobots@...
Sep 9, 2005 10:56 pm
104
The official documentation for Python is http://docs.python.org/ The doc is downloadable. However, this official documentation is very lousy. A excellent quick...
... Umm nearly - but the exceptions should be as follows: * If the last slash is repeated, and it is not the first set of slashes, it treated as single slash. ...