06-24-2015
Quote:
The less line of code the better
Quite the opposite.
Some of the concepts in python's philosophy are:
Quote:
Beautiful is better than ugly.
Simple is better than complex.
Readability counts.
A one-liner quite possible goes against any of them.
Furthermore, lines should be limited to a maximum of 79 characters long. Preferable 72.
It is true that when readability is not hindered it is possible to daisy chain methods output of an object to another method using a period. This is not the case.
Last edited by Aia; 06-24-2015 at 04:06 PM..
Reason: grammar
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How would i do if i'd want to execute a command in a python script or programme ? (1 Reply)
Discussion started by: J.P
1 Replies
2. Red Hat
Building software in most languages is a pain. Remember ant build.xml, maven2 pom files, and multi-level makefiles?
Python has a simple solution for building modules, applications, and extensions called distutils. Disutils comes as part of the Python distribution so there are no other packages... (0 Replies)
Discussion started by: Linux Bot
0 Replies
3. Shell Programming and Scripting
q = ((i + 2) * 6) >> 3
what's the meaning in python? (3 Replies)
Discussion started by: kazikamuntu
3 Replies
4. Shell Programming and Scripting
Hi list,
I have to combine two lines and adding the " - " in between.
So:
Here's sentence A
Here's Senctence B
Here's sentence A - Here's Senctence B
I know how to us SED: sed '$!N;s/\n/ /' for combining tow lines. But how do
I insert the " - " correctly?
Thanks!
Martijn
(os... (4 Replies)
Discussion started by: M474746
4 Replies
5. Shell Programming and Scripting
I am trying to generate a csv file for utilization of each project directory. there are 10 filesystem and for each filesystem there are 16 directory.
i was trying to create a script so i created two file. one is filesystem and one is project. so file looks like
cat filesystems
/app1
/app2... (10 Replies)
Discussion started by: anshu ranjan
10 Replies
6. Shell Programming and Scripting
While looping through a file, I am cutting different length of characters (based on their length) like columns and want to produce the output in a separate file with different columns being separated by a comma.
How to achieve this with an online command. I don't want to create multiple variables... (8 Replies)
Discussion started by: mady135
8 Replies
7. Shell Programming and Scripting
I am working on requirement on spreadsheet in python scripting.
I have a spreadsheet containing cell values and with background color.
I am able to read the value value but unable to get the background color of that particular cell.
Actually my requirement is to read the cell value along... (1 Reply)
Discussion started by: giridhar276
1 Replies
8. Windows & DOS: Issues & Discussions
Hi all,
I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine..
Below is the code I am trying:
#!/usr/bin/env python
import wmi
c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies
9. Programming
Hi all...
As you know I like making code backwards compatible for as many platforms as possible.
This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies
LEARN ABOUT LINUX
py3compile
PY3COMPILE(1) PY3COMPILE(1)
NAME
py3compile - byte compile Python 3 source files
SYNOPSIS
py3compile [-V [X.Y][-][A.B]] DIR_OR_FILE [-X REGEXPR]
pycompile -p PACKAGE
DESCRIPTION
Wrapper around Python standard library's py_compile module to byte-compile Python 3 files.
OPTIONS
--version
show program's version number and exit
-h, --help
show this help message and exit
-f, --force
force rebuild of byte-code files even if timestamps are up-to-date
-O byte-compile to .pyo files
-q, --quiet
be quiet
-v, --verbose
turn verbose mode on
-p PACKAGE, --package=PACKAGE
specify Debian package name whose files should be bytecompiled
-V VRANGE
force private modules to be bytecompiled with Python 3 version from given range, regardless of the default Python 3 version in the
system. If there are no other options, bytecompile all public modules for installed Python 3 versions that match given range. VER-
SION_RANGE examples:
o 3.1 version 3.1 only,
o 3.1- version 3.1 or newer,
o 3.1-3.3 version 3.1 or 3.2,
o -4.0 all supported 3.X versions
-X REGEXPR, --exclude=REGEXPR
exclude items that match given REGEXPR. You may use this option multiple times to build up a list of things to exclude
AUTHOR
Piotr Oarowski, 2012-2013
PY3COMPILE(1)