-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
In this repo, I will write python related code. | ||
|
||
Squash in same branch: | ||
git reset --soft $(git merge-base master HEAD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import os | ||
|
||
def get_current_directory(): | ||
print("Current directory is: ", os.getcwd()) | ||
|
||
def driver(): | ||
print(os.getcwd()) | ||
|
||
|
||
if "__name__" == "__main__": | ||
driver() | ||
if __name__ == '__main__': | ||
get_current_directory() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
|
||
if __name__ == '__main__': | ||
try: | ||
file_path=input("enter file name: ").strip() | ||
if os.path.isfile(file_path): | ||
print("File infomration: ", os.stat(file_path)) | ||
print("Current Directory is: ", os.getcwd()) | ||
print("System logged in by: ",os.getlogin()) | ||
except Exception as e: | ||
print("Invalid file name, check if it is already exists: ",e) | ||
|