Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save the results of each function into a variable in python: returns None #19

Open
Roiinbarr opened this issue Jan 27, 2021 · 4 comments

Comments

@Roiinbarr
Copy link

I wish to save the result of each function into a new variable in python but the functions returns only a print and None object.
I cannot save it into a new variable in my code script.

For example I used the mysp.mysppaus() and the return is:
[]
number_of_pauses= 73

I would like to save it into a variable or get it into a dictionary with key = number_of_pauses and value = 73.

I am using python 3.7.4 on windows.

Thanks.

@kelseymour
Copy link

To do this I had to modify the function from the myprosody.py file and delete the print statements in the function. Also added a return statement for the number I needed, and added pass after except. Might work for you too!

@Roiinbarr
Copy link
Author

Thanks for your response @kelseymour I will definitely will do so. The thing is when you want to run a process on the cloud using this library functions you would have to install it to the environment using pip and then we return to the original functions of the library. Would love to know if you have any idea how to solve it.

@agmicha
Copy link

agmicha commented May 5, 2021

Up! I have the same case like @Roiinbarr

@aegoff
Copy link

aegoff commented Jul 27, 2021

It would be great if this module addressed this concern, but for anyone else who has this question, this stackoverflow post helped me work around it: https://stackoverflow.com/questions/22822267/how-to-capture-print-output-of-another-module?noredirect=1&lq=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants