FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Python_Basics/python_programs/sort_file.py at master · learnbyexample/Python_Basics · GitHub
This repository was archived by the owner on Dec 29, 2020. It is now read-only.
learnbyexample
/
Python_Basics
Public archive
Notifications
You must be signed in to change notification settings
Fork
196
Star
614
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Python_Basics
/
python_programs
/
sort_file.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (10 loc) · 397 Bytes
Breadcrumbs
Python_Basics
/
python_programs
/
sort_file.py
Copy path
File metadata and controls
13 lines (10 loc) · 397 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python3
import
argparse
,
subprocess
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-f'
,
'--file'
,
help
=
"file to be sorted"
,
required
=
True
)
parser
.
add_argument
(
'-u'
,
help
=
"sort uniquely"
,
action
=
"store_true"
)
args
=
parser
.
parse_args
()
if
args
.
u
:
subprocess
.
call
([
'sort'
,
'-u'
,
args
.
file
,
'-o'
,
args
.
file
])
else
:
subprocess
.
call
([
'sort'
,
args
.
file
,
'-o'
,
args
.
file
])
Back
|
FazBrowse Home
|
New Git URL