Skip to content

Commit 498b1e3

Browse files
Merge pull request geekcomputers#106 from VishvajitP/master
PEP8 changes
2 parents bd1fef4 + 48db475 commit 498b1e3

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import pprint
22

3-
inputFile = input('File Name: ')
3+
inputFile = input('File Name: ')
44

5-
count = { }
5+
count = {}
66
with open(inputFile, 'r') as info:
7-
readFile = info.read()
8-
for character in readFile.upper():
9-
count.setdefault(character, 0)
10-
count[character] = count[character]+1
11-
7+
readFile = info.read()
8+
for character in readFile.upper():
9+
count.setdefault(character, 0)
10+
count[character] = count[character] + 1
11+
1212
value = pprint.pformat(count)
1313
print(value)

daily_checks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,37 @@
1919

2020
from time import strftime # Load just the strftime Module from Time
2121

22+
2223
def clear_screen(): # Function to clear the screen
2324
if os.name == "posix": # Unix/Linux/MacOS/BSD/etc
2425
os.system('clear') # Clear the Screen
2526
elif os.name in ("nt", "dos", "ce"): # DOS/Windows
2627
os.system('CLS') # Clear the Screen
2728

29+
2830
def print_docs(): # Function to print the daily checks automatically
2931
print ("Printing Daily Check Sheets:")
3032
# The command below passes the command line string to open word, open the document, print it then close word down
3133
subprocess.Popen(["C:\\Program Files (x86)\Microsoft Office\Office14\winword.exe", "P:\\\\Documentation\\Daily Docs\\Back office Daily Checks.doc", "/mFilePrintDefault", "/mFileExit"]).communicate()
3234

35+
3336
def putty_sessions(): # Function to load the putty sessions I need
3437
for server in open(conffilename): # Open the file server_list.txt, loop through reading each line - 1.1 -Changed - 1.3 Changed name to use variable conffilename
3538
subprocess.Popen(('putty -load '+server)) # Open the PuTTY sessions - 1.1
3639

40+
3741
def rdp_sessions():
3842
print ("Loading RDP Sessions:")
3943
subprocess.Popen("mstsc eclr.rdp") # Open up a terminal session connection and load the euroclear session
4044

45+
4146
def euroclear_docs():
4247
# The command below opens IE and loads the Euroclear password document
4348
subprocess.Popen('"C:\\Program Files\\Internet Explorer\\iexplore.exe"' '"file://fs1\pub_b\Pub_Admin\Documentation\Settlements_Files\PWD\Eclr.doc"')
4449

4550
# End of the functions
4651

52+
4753
# Start of the Main Program
4854
def main():
4955
filename = sys.argv[0] # Create the variable filename
@@ -61,5 +67,6 @@ def main():
6167
rdp_sessions() # Call the rdp_sessions function
6268
euroclear_docs() # Call the euroclear_docs function
6369

70+
6471
if __name__ == "__main__":
6572
main()

movie_details

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import mechanize
22
import urllib2
3-
from bs4 import BeautifulSoup
3+
from bs4 import BeautifulSoup
44

55
# Create a Browser
66
browser = mechanize.Browser()
@@ -13,7 +13,8 @@ browser.addheaders = [('User-agent',
1313

1414
movie_title = raw_input("Enter movie title: ")
1515

16-
movie_types = ['feature', 'tv_movie', 'tv_series', 'tv_episode', 'tv_special', 'mini_series', 'documentary', 'game', 'short', 'video']
16+
movie_types = ('feature', 'tv_movie', 'tv_series', 'tv_episode', 'tv_special',
17+
'mini_series', 'documentary', 'game', 'short', 'video')
1718

1819
# Navigate
1920
browser.open('http://www.imdb.com/search/title')
@@ -40,7 +41,7 @@ for div in soup.findAll('h3', {'class': 'lister-item-header'}, limit=1):
4041
page = urllib2.urlopen(hht)
4142
soup2 = BeautifulSoup(page.read(),'html.parser')
4243
find = soup2.find
43-
44+
4445
print("Title: " + find(itemprop='name').get_text().strip())
4546
print("Duration: " + find(itemprop='duration').get_text().strip())
4647
print("Director: " + find(itemprop='director').get_text().strip())

0 commit comments

Comments
 (0)