How to make a python file execute commands in cmd?

Asked

Viewed 2,738 times

5

For example:

netsh wlan show profile

This command of cmd shows the wifi networks already connected, at least once to my notebook!

How can I run this command using python 3?

  • 1

    Hello @rafael, Welcome to Sopt, before you start a look at our [Tour]. I edited your question if you think I changed the direction, or for any other reason you can reverse the edition by accessing the revisions =D

1 answer

7


Just use the library os

As in the example below:

import os
os.system('netsh wlan show profile')
  • 1

    Thanks man! I’m still new to programming!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.