Python module will not run correctly from command prompt - eclipse

This goes out to anyone who is well versed in the Eclipse IDE and or PyDev perspective plug-in who is willing to offer some technical support.
I am trying to write a python module that must take in arguments from the command prompt with sys.argv function calls. Rather than printing out the correct output when I enter E:\ ... \src>program.py arg1 arg2, all that happens is a new command line (E:\ ... \src>) is output and the Eclipse IDE window flashes orange without any code in my python module actually being executed. Also, if I close the Eclipse IDE and try to run program.py, it will just open Eclipse again and open my program in a new tab.
I'm confused as to why it is not working now when just last week it was working perfectly while testing another program that took in arguments from the command prompt by sys.argv function calls. My question for everyone is whether or not you are aware of any settings that may have been altered by updates, etc. that could cause this problem; or has anybody out there ever run into this problem and figured out how to resolve it? I have already checked my PATH variable, so that is not the problem :-(. Any help you can provide would be greatly appreciated ... thank you.
OS: Windows 8.1 Pro / Eclipse ver.: Kepler (4.3) / Python ver.: 3.3.2

I answered my own question in the comment above. I just had to wait to post an answer due to the fact that I just created a stackoverflow account yesterday.

Related

Why do no programs run in visual studio code?

I recently got a new computer and reinstalled visual studio code but I haven't been able to run any of my files. The error has occurred with both python and C++, so I feel as though it is the IDE that is the problem. I have looked online and there are no straight answers as I have tried following some solutions which have resulted in different errors.
The error above comes up when I run (F5) a simple line of code in c++. Does anyone have a solution?
Thanks, Jacob
[EDIT]
For my python files to work I have to manually select 'Python: current file' but for c++ files they still have the same error.
First step, uninstall python from this machine.
Second, reinstall and make sure that you check the box "add to path".
It's pretty easy to miss as it's a small box, and I missed it my first time installing python earlier in the year. Here's the box you may have missed while installing.
It could be your extensions.
I had a similar error message and simply updated all of my extensions and then my SDK. I was then able to run my code within the IDE. I was using VSCode for c++ and also updated my GCC compiler along with the extensions.
Also look into your computer's environment variables, if you have changed the %PATH variables it may be affecting your ability to run/compile programs.

How can I enable file path autocompletion in the IPython console in PyCharm?

Note: The suboptimal autocompletion (not necessarily of file paths only, but autocompletion in general) is a known issue, and there seems to be no generic quality solution yet. Please see the researched links below.
Path autocompletion in the IPython console in PyCharm does not work well:
c:/U<TAB>
should autocomplete to:
cd c:/Users/
on my machine; instead, the best it manages is:
cd c:/UserWarning
which is plain wrong. IPython in the Anaconda prompt, however, behaves as it should.
My strong assumption (supported by a link, below) is that this is due to PyCharm not using the standard IPython configuration files.
I'm aware of the console starting script in PyCharm:
Settings->Build, Execution, Deployment->Console->Python console
and I've successfully used it to activate a simple magic command I've written.
So here my question: is there a code configuration snippet that could be inserted there, and that could just enable file path autocompletion? Or a pointer to a general description on how IPython configuration files "work", that would enable me to figure it out myself? That is, I imagine, the most doable hack that would solve the problem for the time being.
Alternatively, any experiences with writing your own autocompletion using the following libraries:
IPython.core.completer
IPython.core.completerlib
?
Is that doable? How much work can that be?
Thanks in advance!
My SW-Setup:
I use:
PyCharm Community Edition 2017.2.1
Anaconda 2 (Python 2.7), version 4.3.22 which contains
IPython 5.1.0
on Windows 7 Professional N
Links supporting claims in the question(s) above - just two, due to lack of StackOverflow-"reputation" :(
1) Autocompletion in IPython console in PyCharm not working as it should
JetBrains (creators of PyCharm) knows about this since, at least, two years (please Google it under "PyCharm Console tab completion" or similar, I'm allowed to add just a limited number of links here), and seems to have started working on it, but never finished it.
The discussion states " this is only the initial step to getting full IPython tab completions": https://youtrack.jetbrains.com/issue/PY-9345, but the issue is closed since October 2016.
On StackOverflow there are three questions with similar wording, but not one substantial answer (no, using Ctrl+Space instead of Tab does not solve anything). Again, I can't add more links here.
_2) PyCharm not using ipython_config.py to configure IPython Console:_
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206603035-Which-ipython-config-py-is-used-to-configure-IPython-for-Python-Console-
See the comment by JetBrains at the end of the page.

pydev remote debugging blocks when running to completion

I'm following these instructions to remotely debug a python script http://pydev.org/manual_adv_remote_debugger.html
Using breakpoints and stepping work without a problem, but after resuming the script (without any other further breakpoints) the script executes the remaining instructions, and then hangs instead of exiting normally. Even closing the server from pydev does not help, I have to Ctrl+Break the script
I am sure I've done this a while ago with an older eclipse+pydev, and the script resumed and exited normally (and it's very important for me not to mess the rest of the execution).
I've tried this with both Eclipse Luna and Liclipse pydev_4.0.0.201504132356, pydev_4.0.0.201504092214 on Windows 7 x64, same behaviour
Is this an intended behavior or a bug? How could I make pydev let the script end normally?
I can't reproduce this here... please report that as a bug adding details on how to reproduce it (i.e.: ideally, create a project on github and add a step-by-step on how to reproduce it so that it can be fixed... without being able to reproduce it properly, it may be pretty hard to fix).
Also, please give details on the OS and Python version used in the report (https://sw-brainwy.rhcloud.com/tracker/PyDev/)

Error message failure and crash when using pydev embedded jython interpreter

I have a strange problem when using Pydev on my work machine (others at work have the same issue). It does not occur when I do this at home, which makes me think it's something to do with the environment at work. We are running Windows 7.
I am using Pydev 3.9.2 but the same thing happens with earlier versions. It occurs with all versions of Eclipse after 3.7. The problem is this. When I create a jython console (the one running in the Eclipse VM), the error output doesn't work. If I type an invalid python command, there is no output on the console. It just appears that the command worked. If I type a command such as "print 100", the output prints as you would expect.
The second problem is that if I hit the red square which is supposed to remove the console window, Eclipse crashes. There are no errors or any indication of what is going wrong.
I have tried different versons of eclipse, different versions of Pydev, different machines and it doesnt make any difference.
Has anyone seen this? I've tried everything I can think of to debug this issue so any help is appreciated.
thanks,
brian
Unfortunately those quirks are expected...
The internal console in Eclipse is mostly a developers SDK for experimenting with Eclipse itself and is not meant as a general shell (you should configure an interpreter and use it for that).
I don't have plans on improving on that situation (there's already a multi-year backlog on PyDev and this isn't really critical), but if you'd be willing to spend some time and fix those issues, pull requests would be definitely welcome -- see: http://pydev.org/manual.html for details on getting the code and setting up the environment.

How do I run a .py module in Aptana?

Every time I try to run a .py module it just opens in Firefox.
I'm running Aptana in OS X 10.6
If you installed and configured PyDev, it should work.
Make sure you use the correct "Run" command. Prefer "Run as Python module", avoid "Run on Server".
If that doesn't help, edit your question and give an exact example what you do (which menus/buttons you click, etc).
See: http://pydev.org/manual_101_run.html for details on running a Python module (make sure you read the whole getting started: http://pydev.org/manual_101_root.html which should help you in getting your environment setup and gives some tips to properly use PyDev).
I used a same workspace for both python and java , and met the same problem.
If I change a new workspace, the Run As works. So i think there is something wrong with workspace settings.