Skip to content

Commit fa72abc

Browse files
committed
add 0004&0005
1 parent 07771d2 commit fa72abc

File tree

14 files changed

+69
-0
lines changed

14 files changed

+69
-0
lines changed

llluiop/0004/calcwords.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin.env python
2+
3+
import sys
4+
5+
6+
def CalcWords():
7+
nums = 0
8+
f = open("english.txt", 'r')
9+
10+
lines = f.readlines()
11+
for line in lines:
12+
for word in line.split():
13+
nums += 1
14+
15+
return nums
16+
17+
18+
if __name__ == '__main__':
19+
#print CalcWords()
20+
print len([x for lines in open('english.txt', 'r').readlines() for x in lines.split()])

llluiop/0004/english.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Now that the city is back in the hands of terrorists, officials are "extremely concerned about massacres that we think will be committed by ISIS," said Haimour, the Anbar governor's spokesman.
2+
3+
"On the first day that ISIS took over the city, they executed a 3-year-old girl whose father was fighting against ISIS. And he later died in battle," he told CNN.
4+
5+
ISIS has a grim track record of ruthlessly slaughtering opponents it captures.
6+
7+
"Anybody who supported the government will probably be executed within the next 24 hours," said Baer. "Their families will be driven out. It will be a bloodbath over the next couple of days. All the soldiers who were captured will be executed."
8+
9+
A flood of residents has been pouring out of Ramadi toward safer parts of Anbar and Baghdad in recent days.
10+
11+
"We are witnessing a humanitarian crisis," said Haimour, estimating that as many as 8,000 people had left the city Sunday.
12+
13+
As civilians fled, the heavy fighting continued.
14+
15+
Officials estimate that more than 500 people have been killed in the most recent clashes in Ramadi, he said, noting that some pockets of resistance against ISIS remained inside the city.
16+
17+

llluiop/0004/english.txt~

Whitespace-only changes.

llluiop/0005/changeResolution.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env python
2+
3+
from __future__ import division
4+
import os
5+
import Image
6+
7+
8+
resolution_IP4 = (800, 600)
9+
10+
def ChgResolution(image):
11+
img = Image.open(image)
12+
ratio = max(img.size[0]/resolution_IP4[0], img.size[1]/resolution_IP4[1])
13+
if ratio > 1:
14+
imgNew = img.resize(( int(img.size[0]/ratio), int(img.size[1]/ratio) ))
15+
imgNew.save(os.path.split(image)[-1])
16+
17+
18+
19+
def ImageFiles(path):
20+
if os.path.exists(path):
21+
for file in os.listdir(path):
22+
if 'jpg' in file:
23+
yield os.path.join(path, file)
24+
25+
def main():
26+
for image in ImageFiles("images"):
27+
ChgResolution(image)
28+
29+
30+
31+
if __name__ == "__main__":
32+
main()

llluiop/0005/images/1.jpg

49.4 KB
Loading

llluiop/0005/images/2.jpg

40.3 KB
Loading

llluiop/0005/images/3.jpg

10.6 KB
Loading

llluiop/0005/images/4.jpg

7.59 KB
Loading

llluiop/0005/images/5.jpg

12.2 KB
Loading

llluiop/0005/images/bak/1.jpg

49.4 KB
Loading

0 commit comments

Comments
 (0)