Since my python knowledge is limimted, I've challenged myself to learn as much as possible to help me with my carrere. I'm currently trying to convert a shell script to python, just to give myself a task. There is one section of the script that I'm having issues converting and that is this line:
which basically checks the checksum of "image.iso" against a textfile called SHA256, which contains the correct checksum.
A sample of "SHA256" is below (ignore the same checksum everywhere, it's just for example purposes):
So far, I'm down to this python script:
but I'm stuck as to how I should go about picking up the correct line from the "SHA256" file and then compare the hash (I guess I can do it with "if variable in" or something.
The following find command works on the Korn Shell command line:
find . \( ! -name . -prune \) -type f -name "*.txt" -mtime +100
In the particular directory I'm in, the above find will list correctly the three text files that exist that haven't been modified in over 100 days:
... (3 Replies)
Hi all,
Iam trying to sort the contents of the file based on the position of the file.
Example:
$cat sample.txt
0101020060731 ## Header record
1c1 Berger Awc ANP20070201301 4000.50
1c2 Bose W G ANP20070201609 6000.70
1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
Hi Guru's,
I need to create 3 files with the contents "ABC" using single command.
Iam using:
echo "ABC" > file1.txt file2.txt file3.txt
the above command is not working. pls help me...
With Regards / Ganapati (4 Replies)
Hi,
I don't know hot to make this command work:
ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"
It should return the list of file .txt
It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
I have many Gaussian output files, which contain a string start from "HF=" but follws the different values. I'm trying to get this exact string from these txt files.
example 1,
2.524075,-0.563322,-1.285286\H,0,-2.544438,-0.678834,1.199166\H,0,2.18
... (7 Replies)
I have a file that I ran the dos2unix utility on, it cleans up pretty well, but I noticed an occasional ^M leftover, (actual characters) these may or may not be strays from my original dos file. Either way, I want to get rid of the ^ and any character that may follow. ^M ^C or whatever.
How do I... (6 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Create a Shell script that looks for all text files in your home directory (including subdirectories).
List... (3 Replies)
Hi all.
I have a .txt file that I need to sort it
My file is like:
1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO)
2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies
LEARN ABOUT DEBIAN
python-config
PYTHON-CONFIG(1) General Commands Manual PYTHON-CONFIG(1)NAME
python-config - output build options for python C/C++ extensions or embedding
SYNOPSIS
python-config [ --prefix ] [ --exec-prefix ] [ --includes ] [ --libs ] [ --cflags ] [ --ldflags ] [ --extension-suffix ] [ --configdir ] [
--help ]
DESCRIPTION
python-config helps compiling and linking programs, which embed the Python interpreter, or extension modules that can be loaded dynamically
(at run time) into the interpreter.
OPTIONS --cflags
print the C compiler flags.
--ldflags
print the flags that should be passed to the linker.
--includes
similar to --cflags but only with -I options (path to python header files).
--libs similar to --ldflags but only with -l options (used libraries).
--prefix
prints the prefix (base directory) under which python can be found.
--exec-prefix
print the prefix used for executable program directories (such as bin, sbin, etc).
--extension-suffix
print suffix used for extension modules (including the _d modified for debug builds).
--configdir
prints the path to the configuration directory under which the Makefile, etc. can be found).
--help print the usage message.
EXAMPLES
To build the singe-file c program prog against the python library, use
gcc $(python-config --cflags --ldflags) progr.cpp -o progr.cpp
The same in a makefile:
CFLAGS+=$(shell python-config --cflags)
LDFLAGS+=$(shell python-config --ldflags)
all: progr
To build a dynamically loadable python module, use
gcc $(python-config --cflags --ldflags) -shared -fPIC progr.cpp -o progr.so
SEE ALSO
python (1)
http://docs.python.org/extending/extending.html
/usr/share/doc/python/faq/extending.html
AUTHORS
This manual page was written by Johann Felix Soden <johfel@gmx.de> for the Debian project (and may be used by others).
November 27, 2011 PYTHON-CONFIG(1)