TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jinsy David
NA
46
6.2k
Hey guys, I'm just editing a little code (landscape-sysinfo) that I fo
Mar 4 2021 5:55 AM
Hey guys, I'm just editing a little code (landscape-sysinfo) that I found on the internet. I'm using python 3.9.2. I would like to get the number of users logged into the system (original code uses python-utmp and I cannot use it because I am running the script on my rasp with Arch Linux aarch64). Use the code: import subprocess users = subprocess.Popen ('users', stdout = subprocess.PIPE) userslogged = subprocess.check_output (('wc -w'), stdin = users.stdout) Only userslogged returns "b'2\n'" instead of just "2". Basically I'm running a "users | wc -w" to get the number of instances of users online. How do I get the clean result "2" instead of "b'2\n'"?
Reply
Answers (
1
)
Can any one tell me why there's an error in my if statement code
I want to upload image for my model. Through postman and browsable API