Skip to content

Commit 4e413c0

Browse files
Updated README
1 parent 831558d commit 4e413c0

Some content is hidden

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

45 files changed

+404
-702
lines changed

CONTRIBUTING.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ We want your work to be readable by others; therefore, we encourage you to note
7272

7373
- Write tests to illustrate your work.
7474

75-
The following "testing" approaches are not encouraged:
75+
The following "testing" approaches are **not** encouraged:
7676

77-
```python
77+
```python*
7878
input('Enter your input:')
7979
# Or even worse...
8080
input = eval(raw_input("Enter your input: "))
@@ -97,13 +97,9 @@ We want your work to be readable by others; therefore, we encourage you to note
9797

9898
#### Other Standard While Submitting Your Work
9999

100-
- File extension for code should be `.py`.
101-
102-
- Please file your work to let others use it in the future. Here are the examples that are acceptable:
100+
- File extension for code should be `.py`. Jupiter notebook files are acceptable in machine learning algorithms.
103101

104-
- Camel cases
105-
- `-` Hyphenated names
106-
- `_` Underscore-separated names
102+
- Strictly use snake case (underscore separated) in your file name, as it will be easy to parse in future using scripts.
107103

108104
If possible, follow the standard *within* the folder you are submitting to.
109105

DIRECTORY.py

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import os
2+
3+
def getListOfFiles(dirName):
4+
# create a list of file and sub directories
5+
# names in the given directory
6+
listOfFile = os.listdir(dirName)
7+
allFiles = list()
8+
# Iterate over all the entries
9+
for entry in listOfFile:
10+
# if entry == listOfFile[len(listOfFile)-1]:
11+
# continue
12+
if entry=='.git':
13+
continue
14+
# Create full path
15+
fullPath = os.path.join(dirName, entry)
16+
entryName = entry.split('_')
17+
# print(entryName)
18+
ffname = ''
19+
try:
20+
for word in entryName:
21+
temp = word[0].upper() + word[1:]
22+
ffname = ffname + ' ' + temp
23+
# print(temp)
24+
final_fn = ffname.replace('.py', '')
25+
final_fn = final_fn.strip()
26+
print('* ['+final_fn+']('+fullPath+')')
27+
# pass
28+
except:
29+
pass
30+
# If entry is a directory then get the list of files in this directory
31+
if os.path.isdir(fullPath):
32+
print ('\n## '+entry)
33+
filesInCurrDir = getListOfFiles(fullPath)
34+
for file in filesInCurrDir:
35+
fileName = file.split('/')
36+
fileName = fileName[len(fileName)-1]
37+
38+
# print (fileName)
39+
allFiles = allFiles + filesInCurrDir
40+
else:
41+
allFiles.append(fullPath)
42+
43+
return allFiles
44+
45+
46+
dirName = './';
47+
48+
# Get the list of all files in directory tree at given path
49+
listOfFiles = getListOfFiles(dirName)
50+
# print (listOfFiles)

0 commit comments

Comments
 (0)