Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

PHP vs Python vs Ruby

Monday, February 1, 2016

Read more ...

Python for System administrator [OS Functions]

Friday, May 9, 2014

Intro


The OS Module in Python provides a good way to use the operation system functionality.
The functions provided allows to interface with the underlying OS that Python is running on (Windows, Mac or Linux).

Os Functions


♦ Executing a shell command : os.system()
♦ Get the status of a file: os.stat()
♦ Get the users environment: os.environ()
♦ Move to a different direcoty: os.chdir()
♦ Get current working directory: os.getcwd()
♦ Get the group Id of the current process: os.getgid()
♦ Get the current process's user id: os.getuid()
♦ Get the real process ID of the current process: os.getpid()
♦ Get the name of the user logged: os.getlogin()
Check read permissions: os.getaccess()
♦ Change the mode of path to numeric mode: os.chmod()
♦ Change the owner and group id: os.chown()
♦ Set the current numeric unmask: os.umask(mask)
♦ Get the size of a file: os.getsize()
♦ Get the current environment: os.getenviron()
♦ Return informations about the operating system: os.uname()
♦ Delete the file path: os.remove(path)
♦ Remove the directory path: os.rmdir(path)
♦ Print out all directories, sub-directories and files: os.walk()
♦ Check if a path exists: os.path.exists()
♦ Get load average: os.getloadavg()



Read more ...

Django CHEAT SHEET [1.5]

Sunday, April 20, 2014

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Developed by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.


open the picture in a new tab to enlarge





Read more ...

A collection of Python "Must Reads"

Monday, March 31, 2014



Python Style:


Python Classes:




Posts:
Read more ...

Python vs Ruby

Monday, March 31, 2014

Ruby is a dynamic, reflective, object-oriented general-purpose programming language which was designed and developed in the mid-1990s. Compared to Python, which treats code readability above everything else, the philosophy behind Ruby is that programmers should have the flexibility, freedom and power to write concise and compact code.

The most important difference between Python and Ruby is that the philosophy of Python requires almost everything explicitly defined by a programmer while Ruby allows the programmer to write code with implicit behaviour inherited from other components. For example, in Ruby, the self in instance methods is implicitly defined while Python requires self to be the first argument declared into an instance method.


In the example code above, the class Hello contains two instance methods hello() and call_hello(). Notice that Ruby's definition of call_hello() simply calls the hello() method without referring to self.hello() like Python's definition does.

source: http://www.pythoncentral.io/

Read more ...