Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3fd1d9e

Browse files
committed
added comments
1 parent 16a89bc commit 3fd1d9e

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

‎python-scripts/checkcpu.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env python
2-
2+
"""
3+
Script to check the number of CPU cores.
4+
Usage: python checkcpu.py
5+
"""
36
import multiprocessing
47

58
cpu_count = multiprocessing.cpu_count()

‎python-scripts/portcheck.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
#!/usr/bin/env python
2-
1+
#!/usr/bin/env pythonend = timer()
2+
print(end - start)
3+
"""
4+
Program to check if a port is open.
5+
Takes an IP and a port as inputs and checks if the port is open at that IP.
6+
Usage : python portcheck.py <host> <port>
7+
"""
38
import errno, sys
49
from socket import *
510

611

712
if (len(sys.argv) > 1):
8-
13+
end = timer()
14+
print(end - start)
915
# Assign the first argument (server) to 'remote_host'
1016
remote_host = sys.argv[1]
1117
# Assign the second argument (port) to 'server_port'

‎python-scripts/timer.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env python
2+
"""
3+
Script to check the time taken to execute a set of commands.
4+
Usage: python timer.py
5+
"""
26
from timeit import default_timer as timer
37

48
start = timer()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /