Hardware Reference
In-Depth Information
It's possible to download iles from the command line in Linux without using a web browser.
There are two main programs to choose from: either curl or wget . Both provide similar
functionality, so deciding which one to use comes down to personal preference and/or
availability. wget is used for the examples in this chapter.
simplejson
Clicking the http://cheeseshop.python.org/pypi/simplejson link redirects you
to http://pypi.python.org/pypi/simplejson .
Note that the version numbers may be different as the library is updated, in which case, you
should replace simplejson-3.3.0.tar.gz with whatever ilename you have downloaded.
From a terminal, type the following (all on one line) to download the code:
wget http://pypi.python.org/packages/source/s/simplejson/
simplejson-3.3.0.tar.gz
he tar.gz ile extension tells you that the ile is zipped to save space and is a tar archive. A
tar archive is often used in Linux as it provides a convenient way to package multiple iles
and preserve ile permissions and other attributes. It is possible to unzip the ile and then
untar a ile as separate operations, but because so many tar archives are compressed, it is
possible to do it in a single action. To unzip and untar the compressed archive, type the fol-
lowing on the command line:
tar xvf simplejson-3.0.7.tar.gz
As the command executes, it lists the iles as they are expanded (unpacked) from the archive.
Using tar
You can create your own zipped archives by typing the following:
tar czvf <archivename.tar.gz> <list of files and directories>
Tar has many different options, but in most cases czvf , xvf or tvf will be suficient. t , c
and x mean test (list the contents of an archive), compress and expand an archive, respec-
tively. v indicates that tar should be verbose and list the iles as it expands them. f is used
to specify the ilename of the archive.
 
Search WWH ::




Custom Search