Call a shell command in Python?

0 votes
Is it possible to execute a shell command from within a python script?
Jun 21, 2018 in Python by nightshade
• 870 points
25 views

1 answer to this question.

0 votes

Try this -

os.system("commands and arguments")
answered Jun 21, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

Is it possible to run a function in Python using the command line?

Suppose your file name is demo.py and ...READ MORE

answered Jun 26 in Python by Neel
• 3,010 points
46 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,810 points
128 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,420 points
91 views
+4 votes
7 answers

Splitting a List into chunks in Python

Here's a generator that yields the chunks ...READ MORE

answered Apr 13, 2018 in Python by Nietzsche's daemon
• 4,260 points
4,912 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 221 views
+4 votes
6 answers
0 votes
1 answer

Creating a matrix in Python

You can create arrays of any number ...READ MORE

answered Jun 19, 2018 in Python by Hamartia's Mask
• 1,580 points
36 views
0 votes
1 answer

Remove duplicate elements in a list

Here is the code for this - list(set((list_of_numbers) For ...READ MORE

answered May 11, 2018 in Python by Hamartia's Mask
• 1,580 points
23 views