I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Monday, 24 June 2013

python useful packages in combination with command line

I have been playing with python lately and discovered at least two small utility pacages providing useful features in combination with the commandline. For this reason I created two aliases:

alias openurl='python3 -m webbrowser -t'
alias webshare='python -m SimpleHTTPServer'

The first one opens a web page at the url given as a parameter, if the url does not have a protocol, e.g. http, then the command will interpret it as a local file. The second one starts a webserver for the directory where the command is called. Then you can provide in that way a simple mean of letting someone download local files.

Sunday, 24 June 2012

Python and Templating

For many purposes, it is useful to use templating engines. Looking for emgines I found the following site: http://wiki.python.de/Template-Engines.

That said it is a good question for me to know the aspects a template engine should have. Here are a few features I should look forward to:

  • expression's language
  • method chaining
  • macros
  • includes

Of course the more a language has features, the more complex can be the design or templating languages for developers. Moreover, the features may allow unwanted actions, therefore, it is important to make sure that these unwanted actions are limited.

Tuesday, 27 April 2010

Learning Python 3.0

I am learning python 3.0. There are a few reasons for this. For instance, there is a suggestion from the 'Pragmatic Programmer' book I bought lately. This other thing is that it would make it easier to cooperate with my brother and to perform more useful stuff for and with him. I am also using Mark Lutz: Learning Python (Fourth Edition from Oreilly).

So I installed pyhton 3.0 on my machine.

$> ./configure
$> su
$> make altinstall
And here it is:
$ /usr/local/bin/python3.0
Python 3.0 (r30:67503, Apr 27 2010, 01:32:05)
[GCC 4.4.3 20100127 (Red Hat 4.4.3-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

I will probably need to make a few tests that everything works.