Skip to content

Commit ebbb090

Browse files
committed
first commit
1 parent 38fb422 commit ebbb090

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2731
-0
lines changed

Script1.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
number=23
2+
guess =int(raw_input('enter an integer : '))
3+
if guess ==number:
4+
print 'congratulations, you guessed it.'# new block starts here
5+
print "(but you do not win any prizes!)"
6+
elif guess < number:
7+
print 'no it is a little higer'
8+
else:
9+
print 'no it is a litter lower'
10+
print 'Done'

base64_decode.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import base64
2+
3+
filea = open(r'temp\test.txt','r')
4+
lines = filea.readlines()
5+
writefile=open(r'temp\test1.txt','w')
6+
for i in lines:
7+
word = i.strip()
8+
b = base64.decodestring(word)
9+
print b
10+
writefile.write(b)
11+
writefile.write('\n')
12+
writefile.close()
13+
filea.close()

base64_decode1.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import base64
2+
file_obj = open('temp/test.txt','r')
3+
s= file_obj.read()
4+
a=base64.decodestring(s)
5+
print a

berak.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
while True:
2+
s=raw_input('enter something :')
3+
if s == 'quit1':
4+
break
5+
print "length of the string is ",len(s)
6+
print"done"

continue.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
while True:
2+
s=raw_input('enter something:')
3+
if s =="quit1":
4+
break
5+
if len(s) < 3 :
6+
continue
7+
print"input is of sufficient length"

decode

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
file_obj = open('temp/tcl.txt','r')
2+
s= file_obj.read()
3+
print s

decode.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
file_obj = open('temp/test2.txt','r')
2+
s= file_obj.read()
3+
4+
open('temp/test3.txt','w').write(s)

demo1.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import urllib
2+
import sys
3+
file_obj = open('temp/test2.txt','r')
4+
s=file_obj.read()
5+
s1=s.encode("utf-8")
6+
utf8=urllib.quote(s1)
7+
print utf8

demo1.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test git hub

demo2.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PythonWin 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32.
2+
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
3+
>>>
4+
>>>
5+
>>>
6+
>>> print "hello world!"hello world!

email_to_user.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
file_obj =open('temp/email.txt','r')
2+
s =file_obj.read()
3+
user = ['']*245
4+
i=0
5+
email = s.find(r'"Email">')
6+
tcl = s.find(r'@tcl.com')
7+
while i< 200:
8+
user[i] = s[email + 8:tcl + 8]
9+
print user[i]
10+
email = s.find(r'"Email">',tcl)
11+
tcl = s.find(r'@tcl.com',email)
12+
i = i+1
13+
else:
14+
print 'find end!'

file1.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
192.168.1.1
2+
192.168.1.123
3+
192.168.1.14
4+
192.168.1.12
5+
192.168.1.11
6+
192.168.1.13
7+

file2.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
192.168.1.1
2+
192.168.1.12
3+
192.168.1.11
4+
192.168.1.13
5+

filecheck.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
file1=open('file1.txt','r')
2+
file2=open('file2.txt','r')
3+
f2=file2.read()
4+
while True:
5+
line = file1.readline()
6+
c=f2.count(line)
7+
if c == 0:
8+
print line,
9+
if line:
10+
pass
11+
else:
12+
break
13+

findeburpresp.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import base64
2+
file_obj =open('temp/test.txt','r')
3+
s =file_obj.read()
4+
user = ['']*100
5+
i=0
6+
email = s.find(r'<response base64="true"><![CDATA')
7+
tcl = s.find(r'></response>')
8+
while email != -1 and tcl != -1 and i< 100:
9+
user[i] = s[email + 32:tcl -1]
10+
# print user[i]
11+
t=base64.decodestring(user[i])
12+
s=t.read()
13+
print t
14+
open('temp/test2.txt','w').write(t)
15+
email = s.find(r'<response base64="true"><![CDATA',tcl)
16+
tcl = s.find(r'></response>',email)
17+
i = i+1
18+
else:
19+
print 'find end!'
20+
21+

findemail

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
file = file_obj.read ('temp\email.txt','r')
2+
print file

findemail.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
file_obj =open('temp/tcl.txt','r')
2+
s =file_obj.read()
3+
user = ['']*200
4+
i=0
5+
email = s.find(r'"Email">')
6+
tcl = s.find(r'@tcl.com')
7+
while i< 200:
8+
user[i] = s[email + 8:tcl + 8]
9+
print user[i]
10+
email = s.find(r'"Email">',tcl)
11+
tcl = s.find(r'@tcl.com',email)
12+
i = i+1
13+
else:
14+
print 'find end!'

for.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
for i in [1,2,3,4,5,6]:
2+
print i
3+
else :
4+
print 'the for loop is over'

func_default.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def say(message,times=8):
2+
print message *times
3+
say('hello')
4+
say('world')

func_doc.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def printmax(x,y):
2+
'''prints the maximum of two numbers.
3+
the two values must be integers.'''
4+
x=int(x)
5+
y=int(y)
6+
if x>y:
7+
print x,'is m'
8+
else:
9+
print y,'is m'
10+
printmax(3,5)
11+
12+
print printmax.__doc__
13+
help(printmax)

func_global.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def func():
2+
global x
3+
print 'x is ',x
4+
x=2
5+
print 'changed local x to',x
6+
x=50
7+
8+
func()
9+
10+
print 'value of x if ',x

func_key,py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def func(a,b=5,c=10):
2+
print 'a is', a, 'and b is', b, 'and c is',c
3+
func(3,7)
4+
func(25,c=24)
5+
func(c=50,a=100)

func_local.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
def func(x):
3+
print 'x is',x
4+
x=2
5+
print 'changed local x to',x
6+
x=50
7+
func(x)
8+
print 'x is still',x

func_param.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def printMax (a,b):
2+
if a>b:
3+
print a, "is maximum"
4+
else:
5+
print b , 'is maximum'
6+
7+
x=raw_input("enter x")
8+
y=raw_input("enter y")
9+
print 'x=',x
10+
print 'y=',y
11+
printMax (x,y)

func_return.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def maximun(x,y):
2+
if x>y:
3+
return x
4+
else:
5+
return y
6+
print maximun(2,3)

git-credential-winstore.exe

18 KB
Binary file not shown.

i

Whitespace-only changes.

mymodule.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def sayhi():
2+
print 'Hi,this is mymodule speaking.'
3+
version='0.1'

mymodule.pyc

300 Bytes
Binary file not shown.

mymodule_demo.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import mymodule
2+
mymodule.sayhi()
3+
print 'version',mymodule.version

mymodule_demo2.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from mymodule import sayhi,version
2+
sayhi()
3+
print "version",version

print_tuple.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
age=22
2+
name='swaroop'
3+
print "%s is %d years old"%(name,age)
4+
print 'way is %s playing with that python ' % name

0 commit comments

Comments
 (0)