Example1:
```
# -*- coding: utf-8 -*-
#
import os
#python2.X
a = raw_input("enter your name : ")
print "hell0"+a
os.system("pause")
#python3
#a = input("input:")
#print ("name"+ a)
```
# -*- coding: utf-8 -*-
#
import os
#python2.X
a = raw_input("enter your name : ")
print "hell0"+a
os.system("pause")
#python3
#a = input("input:")
#print ("name"+ a)
```
#python 2
import sys
substring = raw_input("enter your string (Ex:20180810): ")
count =0
for line in open('POD_RDKB_10Year.txt'):
#if ("") in line:
if substring in line:
line = line.strip()
count +=1
print (line)
if count==0:
print ("string not found")
```
```
# python3
import sys
substring = input ("enter your string (Ex:20180810):: ")
count =0
for line in open('POD_RDKB_10Year.txt'):
#if ("") in line:
if substring in line:
line = line.strip()
count +=1
print (line)
if count==0:
print ("string not found")
```
Output
```
# -*- coding: utf-8 -*-
#
import sys
string = "Hello Agnosticdev, I love Tutorials"
substring = "Agnosticdev"
# Straight forward approach for Python 2.7 and Python 3.6
# Executes the conditional statement when the substring is found
if substring in string:
print ("Your substring was found!")
# Alternative Approach
# Use the find method in Python 2.7 or Python 3.6
if string.find(substring) is not -1:
print("Python found the substring!")
else:
print("Python did NOT find the substring!")
```
``` #support python2 and 3 def find(substr, infile, outfile): with open(infile) as a, open(outfile, 'w') as b: for line in a: if substr in line: b.write(line + '\n') print(line + '\n') # Example usage: find('20181109', 'POD_RDKB_10Year.txt', 'b.txt') ```
#git config --global user.name "YOUR NAME"
your email:#git config --global user.email "YOUR EMAIL ADDRESS"
#git config user.name
sample: git clone http//github.com/xxxxx/ooooo.
X: your username
0:your repository name
# under Linux utility, create a directory
mkdir GITHUB
# clone repository from server to local and download it. Test is repository
git clone http//github.com/chenchih/test
#go to test and create a file
touch 123456.txt
git commit -m "add file "
git push
#create new folder
mkdir testfolder
#also create folder in gitserver
add 'testfolder'
#commit it
git commit -am "Add testfolder"
git push
delete Folder#delete new folder
rm -rf testfolder
#also delete folder in gitserver
git rm -rf 'testfolder'
#commit it
git commit -m "Removed folder from repository"
git push
# go into folder directory
cd testfolder
git add *
git commit -m "with the message"
git push
# mkdir /rhel7-repo/ # mount /dev/cdrom /rhel7-repo/ # cd /rhel7-repo/
# cat unixarena-rhel7.repo [rhel7_dvd] gpgcheck = 0 enabled = 1 baseurl = file:///rhel7-repo name = unixarena-repo
[root@UnixArena-RHEL7 yum.repos.d]# yum clean all
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: rhel7_dvd
Cleaning up everything
# mkdir /dvd/ # mount -0 loop /dev/cdrom /dvd # cd /dvd/
#cd /dvd/
#cat .discinfo
xxxxxx.xxx
Red Hat Enterprise Linux 6.0
i386
1
Modify broexperts.repo# vi /etc/yum.repos.d/broexperts.repo
[broexperts]
mediaid=XXXXXXX.XXXX
name=Local Media Repo
baseurl=file:///dvd/
enabled=1
gpgcheck=0
3. save and exit