Pycharm doesn't print

Answered
import numpy as np
from scipy import misc

def CatvsDogClassifier():
print("Loading images for training ")

X = np.zeros(750000, 80000)
Fd = open("C:\\Users\Gianluca\Desktop\kittens\dataset\\training_set\dogs", "r")
Fc = open("C:\\Users\Gianluca\Desktop\kittens\dataset\\training_set\cats", "r")
for line in Fd:
i=1
arr=np.zeros(500, 500, 3)
image = 'C:\\Users\Gianluca\Desktop\kittens\dataset\\training_set\cats\\'+line
arr = misc.imread(image)
arr=np.reshape(750000,1)
X = np.hstack((X[:, :i], arr, X[:, i:]))
print (X)
if __name__=='__main__':
CatvsDogClassifier()

I try to execute this code but nothing is printed, only the return with exitcode0. If i remove
the modules fromt the interpreter it works. Is there a way to fix this?
7 comments
Comment actions Permalink

>If i remove the modules fromt the interpreter it works.

Which modules do you mean?

You do not call the __main__ function which calls CatvsDogClassifier function, so isn't it expected then that the function isn't executed?

0
Comment actions Permalink

I updated my code because the error was not responsible for my problem. The modules are numpy and scipy. 

0
Comment actions Permalink

Please try running it from the system terminal (outside of PyCharm) using the same interpreter. Do you have the same problem?

If not, would be great to have screenshots showing successful execution in terminal and the problem when running from PyCharm.

0
Comment actions Permalink

From the terminal it works, from pycharm:

 

0
Comment actions Permalink

apart from errors in code, the print of "Loading images for training works"

0
Comment actions Permalink

You are not running the same file. That's because you copied the code and saved in a separate file?

If you add some errors in the code and run it in PyCharm, do you see the print then?

Right now, the experiment doesn't seem to be fair since you use different interpreter and there is also Permission denied error. Would be great to  have identical conditions.

0
Comment actions Permalink

Ok, I don't have the faintest idea of what happened but without any change the code now is running and producing a result.....sorry to have bothered you, I really don't get what wasn't working before.

0

Please sign in to leave a comment.