noob questions

Answered

help,I am noob I have PyCharm IDE and I cant use it as calculator,I am reading/learning from book on internet,and it encourages to do excersises,one of which is to use Python as calculator.They say if you type 1 + 1 it should show result 2.But when I run such code it shows in console "Process finished with exit code 0" no matter what calculation I type..... I have no idea what is going on,please help!

 

second question is,in the book I am learning from it says that its by default running in "interactive mode" but it can switch to "script mode"... how can I switch PyCharm with Python 3.5 to that "script mode"? what it even does? what its for?

20 comments

I think the instructions you saw talked about the interactive interpreter. If you are running a Python script, make sure you do print(1+1)

If you want "interactive mode" in PyCharm, click the "Python Console" button near the bottom.

1

thank you very much for swift reply Paul Everitt!

so if I understand it correctly,PyCharm runs in script mode by default and it will not work like calculator if I dont use the PRINT statement.So the problem was that I was thinking I was in interactive mode,but in truth I was in script mode

 

for Python to work like calculator I need to by in interactive mode,which can be accesed in PyCharm by clicking on Python Console

again,big thanks,now I can return to learning

0

Yes, your analysis is correct. Feel free to ask any other questions.

0

I have big problem,I instaled Python Tools For Visual Studio,I didnt liked it so I uninstaled it.Problem is all my PyCharm saves now have this Visual Studio icon attached to them and when I click on it it doesnt do anything,I cant open my saves!

I tried doing "open in program" to assign it to the PyCharm icon but when I click on it,it just open PyCharm and theres only code that was there when I closed it last time so still cant open the saves.I have no idea what to do,please help

0

In general you don't want to open the file directly. Instead, have a concept of a PyCharm "project"..basically, a directory with a file. Here is a screencast with an introduction to projects.

1

I just updated my PyCharm and it opens the saves directly when I click them! did you made the new update so it does it like I expected originaly?

0

Error:Cannot start process, the working directory 'C:\Users\neodym\Desktop\EQ saves SRS only\Wav Desktop opener.py' is not a directory

 

I just tried to open CONSOLE so I can try some code in interactive mode,I dont remember doing anything with any directory,how can I make it go away so I can use console?

0

Correct, it thinks your path is a directory, when instead it is a file. Try opening 'C:\Users\neodym\Desktop\EQ saves SRS only' in PyCharm (the directory) so it can make a project.

1

thats amazing! thank you!

I have two questions

1. what do you mean "it thinks your path is directory,when istead it is a file",directory = is my save folder right? the "EQ saves SRS only is folder I have on my desktop.

2. I tried started PyCharm first so I can open the saves from there,there was some kind of make new project window with some multiple paths shown on left,I dont remember what I clicked but it started PyCharm and console finaly ran,but now I have horrible problem.When I open my save and change the code it overwrites the save without me explicitly saving it!

it looks like this,I open the save,I cut the code and paste it into console,then I close the PyCharm.I click on the save again and to my terror the entire code is gone! what should I do to make it stop? 

0

Let's simplify things and get it working, then see if you can adapt to your style.

  • Make a directory, e.g. project_1, somewhere that you regularly store your things
  • Use Windows Explorer to move the file Wav Desktop opener.py into that directory
  • In PyCharm, open that directory (which makes a PyCharm "project")
  • In the PyCharm window, follow along with the video I mention above to open the Wav Desktop opener.py file

 

1

I deleted all my save/directories/folders/projects and created single new folder,where I started one new project.I made two saves ( new python files ) just to test if it is behaving correctly and immediately console isnt avaliable again

C:\Users\neodym\Anaconda3\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2\helpers\pydev\pydevconsole.py" 64342 64343
Couldn't connect to console process.
Process finished with exit code 1

 

 

I opened and closed it,and now console works but the save overwriting is there again.Anything I do to code is permanent when I close the PyCharm,I watched videos 1/8 and 2/8 but there is nothing about this automatic overwriting

0

Yes, PyCharm auto-saves files. You can disable this if you'd like.

1

you say I can turn it off,I reed that link you posted,looked into the settings and I cant completly turn the autosave,it will ALWAYS autosave when I close the PyCharm

quote from your link "Note that those are optional autosave triggers, and you cannot turn off autosave completely."

 

I absolutely hate that auto save,whats worst you cant turn it off.It is so natural to me to make a mess and then just restart it by closing and opening the save again

I love everything about PyCharm except this autosave,if you could make new update that would allow to completly turn off that auto save I would be so grateful

0

I'd like to try and recreate your problem. Are you using Anaconda? If so, which version, and which version of PyCharm and Windows?

0

Windows 7 64bit      PyCharm Community Edition 2016.2 with latest updates       I am using the newest Anaconda3 64bit,I instaled it about three weeks back,the newest version at that time

 

I am little confused,is there really a problem? In the link you posted about autosave,its explicitly stated its impossible to completly turn off the auto save feature,so obviously this is not bug or technical difficulty,its just the way this program was designed

"

Tuning the autosave behavior

The following options are available for tuning the autosave behavior (File | Settings | Appearance and Behavior | System Settings):

  • Save files on frame deactivation (i.e. on switching from PyCharm to a different application)
  • Save files automatically if application is idle for N seconds

Note that those are optional autosave triggers, and you cannot turn off autosave completely."

0

In all the time that I've used autosave, I've yet to encounter a place where it was a problem and needed to be turned off. Thus, I thought I'd try to diagnose the problem you are having and see if I can recreate it.

0

I think this is misunderstanding,there is no bug or technical problem with autosave,I would not even call it problem,I just dont like being forced to have autosave permanently on,I wish there was option in settings to completly turn it off.If you could make update with such option avaliable in setting menu I would be extremly grateful

0

I see, in that case, if you'd like to request a feature for disabling autosave, you can comment on this ticket that previously discussed such a request.

0

You have no permissions to view this page

Try to log in again, go to issues page (logged in as 'Max Trevor'), or contact your system administrator.

Back

 

cant read your link

 

I expect it is some thread where some person had similiar request as I do but since its not an option it must have been concluded that having freedom to turn autosave off is undesirable for some to me unimaginable reason.

I know that after I made many changes to the code I can just go step by step Undo them till I get all the way back and then close without overwriting my save,but that is so annoying inneficient slow way to do things,but whats worst,if I forget to manualy "Undo" it to the way it was immediately after oppening the save and I just straight up close it,it will overwrite,permanently destroying the save.

is there better way to do it?

0

ok,I did some research online,so its like this ( correct me if I am wrong) 

1.PyCharm autosaves l very often becose to run or debug code it needs to be saved

2.Also if you click Local History > Show History,ALL versions of that save will be forever avaliable to go back to so my issue with "save overwritting" when closing PyCharm is not a issue becose nothing is really overwritten and I can go back to that point anytime I want

 

0

Please sign in to leave a comment.