Getting PyScripter Portable to work with IPython - python

How can I set PyScripter up to work with IPython as the "embedded" interpreter rather than the plain Python one?
I am using portable python.
I've tried for a few hours with no success.
I imagined it's just a C/L parameter.
But that doesn't seem the case.
Help much appreciated.

I don't know if this will work but you could try the following in the embedded interpreter:
>>> from IPython import embed
>>> embed()

I don't think that this is possible as PyScripter does this based on a specified Python engine. For portable installation these settings are used and this is also what Portable Python shortcut
PyScripter-Portable.exe
does to set up the environment and configure Python engine to be used.

Related

How to disable the builtin Python Interactive window support in VSCode?

I am mainly using IPython and I feel more comfortable in using a classic IPython REPL than the VSCode builtin Python Interactive window, therefore I would like to disable it, but I have no idea how.
I checked the VSCode documentation but I couldn't find any instructions on how to disable it.
At the moment I am using the ipython extension and I am very happy with that.
As stated in the document, it is precisely because of the use of "#%%".
So it wakes up the Jupyter code cells in vcscode.

Python help and autocompletion functions in Windows 10

I am new to python and I have installed it. I have got the basic program running. However I write program in notepad and then run it from command prompt.
Now I am using numpy and similar libraries and I would like to get help on what a function does, what it expects or maybe type a name of function and get auto completions like in MATLAB or
similar IDEs, how can I do this, which tool/editor I can use?
i use VS code with a python module installed https://code.visualstudio.com/

How to I force MS Visual Code to use python 2.7

I have been running Visual Studio code on the Mac for about 2 years now and I'm running into issues that I haven't seen before. I have not personally run any updates for Code for quite a while. lets say late November.
1) A message at the lower right of my Work space that says
The macOS system install of Python is not recommended,
some functionality in the extension will be limited.
Install another version of Python for the best
experience.
Unfortunately I can't update to Python 3.x and it shouldn't be up to Code to force me to update. Is there a way to turn this message off?
2) Related to above is that some classes or language keywords (JSONUtils, #unittest, requests, def) are no longer being recognized. Some constants that I have created and a variable defined to store a class.
sc = SomeClass()
This will be recognized at definition but later during usage it will not be recognized.
sc.SomeMethod( 1, 2, 3 )
sc won't be recognized. None of this is making sense to me as it is not a pure pattern. Everything is probably the same issue. Need to point Code to python 2.7.
This is a bug in VS Code. A new future version will have an ignore button.
VS Code Issue 4448
I still can't comment, so here it is an an answer instead...
This looks like a duplicate of How can I change python version in Visual Studio Code?
The short version that worked for me:
CTRL+SHIFT+P to open command palette
Choose "Python: Select Interpreter"
Point VS Code to the Python interpreter you wish to use.

Need Python guide on Windows

I am trying to set up Python on Windows 7. I haven't used this language before so it seems strange to me.
I've downloaded lastest Python release 3.2.2 from official site and upadate path variable.
However I still can't even run simplest program ever like this :
print 'Hello, world!'
It says that there is a syntax error and the last character ' is highlighted with red.
I don't know if my path variable has been set properly. Here is where I installed Python :
C:\Software\Python32
So I added such a variable : var name = PYTHONPATH , var value = C:\Software\Python32\Lib
Is there something with auto-completion and with errors/warnings details ( which line, hint what can be wrong ), for example like Eclipse or NetBeans OR should I use this installed Python IDLE GUI for delevoping or stuff like NotePad++ ?
Actually what is this Python shell for ? - I know that I can type in some arithmetic operations here and I will get results, but is it used for something more advanced ? ( Is it used when I am writting something bigger ? )
Could someone describe simple way to write and execute a program ( or script I a total beginner so I don't really know what it is going on here ) ?
In Python 3.2 you have to use print in the below manner. The parentheses are mandatory. (print became a function in Python 3)
print('Hello World')
As Venk stated, the print statement in Python 2.x has been replaced with print() in 3.x, so your statement should read
print('Hello World')
Since you're new, here some things you should know about Python versions:
Python currently comes in two flavors: Python 2.x and Python 3.x.
Python 2.x has been in development since the late '90s, so most existing codebases, frameworks, and libraries are written in this flavor of Python. Each successive version is backwards compatible, so, for example, all code written in Python 2.4 can be run with Python 2.4+. Its current revision is 2.7.2, which was released last year.
Python 3.x is considered the "future" of Python, and purposefully breaks a lot of the conventions, such as the print statement, in favor of a clearer, more explicit language. Most libraries are working to port over to Python 3.x, but since there are extensive changes in the structure of the language, most library maintainers have not yet been able to release a Python 3.x compatible version with the full features of the Python 2.x version of the library.
If you're developing now, you should learn Python 2.x; otherwise, it's recommended you learn Python 3.x.
To answer your other questions:
Python's native IDLE is an excellent IDE, but if you're looking for something more advanced, you may want to try out Eclipse's PyDev extension or PyCharm. I personally prefer PyCharm, since it doesn't keep giving me errors when I'm importing/using nonstandard Python libraries/frameworks.
In addition, Python's shell is used to interpret Python scripts (in the background) and for interactive interpreting (i.e., quick and dirty testing), and can execute code you type into it. The latter, however, is not recommended, as a single syntax error in multiple lines of code can force you to retype all the lines to fix a single bug.
Furthermore, all Python scripts end in .py, so if you can see the file extensions, you can convert a text file into a Python script, and run from shell by typing python path/to/file.py. Note, however, that you still have to write a valid Python script, or it will not run.
I suggest A Byte of Python. It'll take you through install, REPL, syntax, and the std library.
The python shell is for entering code interactively.
Try the following: http://docs.python.org/tutorial/
I've been using Python on Windows 7 for 3 years now, and I strongly recommend Notepad++ as your editor/interpreter. It is ideal for people who want to play around with the language and are learning. Notepad++ can be customized for almost any language and is free for Windows. Follow this link
and take a look at how to conveniently use Notepad++ to execute Python scripts.

Python documentation in Eclipse

Is there a way to integrate standard Python documentation into Eclipse? So it will be possible to press F1 on an API function and get its description in the Help view of Eclipse.
I use PyDev.
Thanks.
I've had the same problem, so I kinda made an Eclipse plugin for that purpose.
Or download from Sourceforge
PyDev, nor Eclipse, does not provide integrated on-line help for the Python documentation. Unlike with Java, Python API source code documenting has several competing documentation standards and implementing support for them would be difficult.
However if the function under the cursor can be resolved its docstring is shown in a pop-up note.
http://www.python.org/dev/peps/pep-0257/
Also because Python is dynamic language, as opposite to static languages like Java, you rarely can resolve functions to their source in code development time.
Using Python console debugger you can use the help() command when the application is being run
>>> help(obj.myfuction)
None that I know of, but that would be very useful in pydev. You should suggest it in the eclipse pydev forum ,or code it yourself! If I was still a CS student I'd help..
Zeal - https://zealdocs.org/
Although I do not see how to integrate it in Eclipse, it is pretty useful next to it on your desktop. And it is not only Python docs, but may more. A real life saving stuff this Zeal docs!
Just a footnote: I do not use Eclipse that much as I switched to PyCharm and Jupyther.

Categories