How to get computer name

P

pitarda

How do I get the computer name in python?

I've been looking over the internet, and couldn't find anything.

Thanks!

Bud
 
T

Tim Heaney

pitarda said:
How do I get the computer name in python?

You can use the os module to get it from your environment.
'calvin.watterson'

Depending on your operating system, the environment variable you need
might have a different name. For example, I think in Windows you
might try

You can see all of the environment variables currently available with

I hope this helps,

Tim
 
P

pitarda

Thanks! :)

Though,... I think once I saw something like: getComputerByName but
can't find it anymore,...

:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top