Jump to content

Problem with a Workflow. Shell from Alfred works another way than normal Shell?


Butler

Recommended Posts

Hey! I have a little Problem. I wrote a little Python Script to help me with Vocabulary. It's not a big thing: I type in the keyword and the vocabulary I'm searching for, Alfred takes the query, opens  the python script via shell (detour via shell because it needs to be python3 and alfred uses the python2 interpreter), passes on the query via argv, the python script requests the page of linguee, takes the translation and passes it back to alfred. This way I do not have to start the browser everytime I search a word and alfred passes on the word I searched into a txt so I know which words I have to learn.

The problem know is, that when I evoke the script from my normal shell, it works perfectly. The argv is passed on into python, python prints the translation into the terminal, great. But when I evoke the same scripts with the same shell from alfred, python doesn't find the words. The status code is 200, the page is saved in the "soup" varible the search for soup1 and 2 doesn't work, alfred prints "loop3, none, none" so in the if...elif..else it takes the third turn.

 

I really don't understand why. It is the same shell same python script, the same python interpreter.... Why does it work in the terminal but not in alfred?

 

Thanks already for your help!

 

 

Capture d’écran 2020-11-13 à 20.41.22.pngCapture d’écran 2020-11-13 à 20.16.01.jpg

Capture d’écran 2020-11-13 à 20.18.57.pngSans titre.jpg

Edited by Butler
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...