... 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. ...
danny staple
orionrobots@...
Sep 19, 2005 8:06 am
107
Addendum to the Python doc problem at http://www.python.org/doc/2.4.1/lib/module-os.path.html I was working on a program where i needed to split a path into...
Perl and Python Documentations Xah Lee, 20050921 Perl's documentation has come of age: http://perldoc.perl.org/ Python people really need to learn: • ample...
Lambda in Python 3000 Xah Lee, 200509 On Guido van Rossum's website: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 dated 20050826, he muses with the...
http://xahlee.org/perl-python/python_3000.html addendum, 20051001 here i will try to illuminate some miscellaneous things regarding the lambda in Python issue....
The following script takes a directory and print all the sizes of html files, counting the sizes of inline images. This script is useful in making sure that...
Perl-Python-a-Day: Sort a List Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To...
continued from sorting in Python at http://xahlee.org/perl-python/sort_list.html ... Sorting in Perl In Perl, to sort a list, do like this: @li=(1,9,2,3); @li2...
Addendum: Since Python 2.4 (released 2005-03), there's also a sorted() function, which returns the result instead of modifing the list in-place. ☄...
Split File Fullpath Into Parts Xah Lee, 20051016 Often, we are given a file fullpath and we need to split it into the directory name and file name. The file...
One-Liner Loop in Functional Style Xah Lee, 200510 Today we show a example of a loop done as a one-liner of Functional Programing style. Suppose you have a...
Examples of Quality Documentation Xah Lee, 200512 I had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ Although Pretty Home Page is...
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a...
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations http://xahlee.org/UnixResource_dir/writ/notations.html A side note: the...
What is Expressiveness in a Computer Language Xah Lee, 200502. In languages human or computer, there's a notion of expressiveness. English for example, is very...
I have a website of photo gallery. It consists of many HTML pages with inline images. There are about 400 of photos and images. However, the site lacks a...
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's...
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there’s often the choices of tabs or spaces for code indentation. There...
The Condition of Industrial Programers Xah Lee, 2006-05 Before i stepped into the computing industry, my first industrial programing experience is at Wolfram...
my perl and python tutorial http://xahlee.org/perl-python/index.html is now available for download for offline reading. Download link at the bottom. Xah ∑...