Monthly Archives: March 2015

Missing variable is: CMAKE_CXX_COMPILER_ENV_VAR

CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER

Fix: yum install make

python popen skip first line


for i in list(os.popen('ps -elF'))[1:]:
print i,
....:

4 S root 1 0 0 80 0 – 2937 wait 1928 2 07:48 ? 00:00:00 /bin/bash
4 S root 14 0 0 80 0 – 2937 n_tty_ 2212 3 08:47 ? 00:00:00 bash
4 S root 301 1 0 80 0 – 54176 pipe_w 24864 2 17:17 ? 00:00:00 /usr/bin/python /usr/bin/ipython
0 Z root 308 301 0 80 0 – 0 exit 0 0 17:19 ? 00:00:00
0 Z root 309 301 0 80 0 – 0 exit 0 3 17:20 ? 00:00:00
0 R root 319 301 0 80 0 – 4939 – 2064 3 17:51 ? 00:00:00 ps -elF

python copytree ignore some files

def ignore_function(ignore):
def _ignore_(path, names):
ignored_names = []
if ignore in names:
ignored_names.append(ignore)
return set(ignored_names)
return _ignore_

try:
shutil.copytree(src, dest, ignore=ignore_function('specificfile.file'))
except OSError as e:
if e.errno == errno.ENOTDIR:
shutil.copy(src, dst)
else:
print('Directory not copied. Error: %s' % e)

"""
ignore=ignore_patterns('*.py', '*.sh', 'specificfile.file')) <- you can use some patterns """