Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python URL call using xdg Linux command

I have been trying to get this simple url call Linux command to run as a python script. However, I keep getting an error for too many arguments in the system() module. Is there is easy fix still using this technique?

import sys
import os
g = str(input('enter search '))
os.system('xdg-open https://',g)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

format the command as a single string instead of 2 parameters

import sys 
import os

search = str(input('enter search')) 
os.system(f'xdg-open https://{search}')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading