how to show all methods that i can choose in ipython notebook? - ipython

I'm new to ipython notebook. When typing a code line, it should show all methods or attributes that I can choose. However, it didn't, and I'm not sure why.
It should look like this:
Does anyone know how I can get this to work?

Type the library name
Type period symbol .
Press tab
At this point you will see drop down menu (showing all the methods)
This works for both python 2 and python 3

That should be a new feature of IPython 6.0.
But as mentioned in the official release post, is still just for command line users, and they are working to port it to all other users.

Related

Adding the run-code option to a new language in VSCode

I'm currently writing my own language and I'm at a point where I would like to publish it to the VSCode-Marketplace so people can test it.
I have written a language extension and a syntax highlighter with the Yeoman-Generator and now want to merge it with my executable file that launches the interpreter, so that a file can get interpreted after clicking the run-code button.
I now have checked multiple articles, like:
How to add a run button in visual studio code? - StackOverflow
How to define or support a code language on Visual Studio? - StackOverflow
Debugger Extension Guide - VSCode API
However, I haven't found anything useful.
Currently, the code-runner displays the following error, when clicking on run, or pressing the shortcut:
(Code language not supported or defined.)
But even after a lot of browsing Google for adding new language support to the code-runner, I found absolutely nothing helpful.
(See this page, idk what Settings/Preferences they are referring to!?)
I also was not successful with tasks, as they don't seem to connect to the run-buttom or debug-button in any way.
My question is: How can I make the run-button execute a custom bash-command, when a file in my language is opened?
Okay, I finally did it.
For anyone wondering:
You have to go to the settings and type "code-runner" into the search bar.
Scroll down a little, and you should find the code runner-executor map.
Click on the "edit in settings.json" button.
Now a .json-file should've opened. There are two possible scenarios: Either, there is a json-object called code-runner.executorMapBy... or not.
If there is none, type code-runner.executorMapByFileExtension and let autocomplete do the job.
If the json-object exists, add the file-extension and a bash command that executes your compiler/interpreter. It gets automatically executed in the directory the program-file lies in.
Now still dont know, how to include the settings in my extension, but that was already a big step. Further help is still appreciated!
There is an open source extension called code runner, you can check source code there.

List of all available commands in VSCode

Where can I find the list of all commands available in VSCode and their description?
I'm only aware of these sources:
In the official docs:
This list which only seems to include a subset of Visual Studio Code commands that you might use with vscode.commands.executeCommand API (why is this only a subset of the full list?)
This other list in the keybindings doc, which also only seems to include a subset of all commands available (I suppose those tied to a default keybinding?)
In the editor itself:
I can see a list of commands when I open the "default keybindings". Many actions are commented out with //, but interestingly I don't think this includes all the commands either (e.g. maximizeOtherEditor isn't listed)
Does VSCode have an official list of commands (commandID's) either in its documentation or in its code base? If not:
What's the closest to it?
What's a good way to navigate the code base to try to find all commands and what they do?
I believe that content of "Preferences: Default Keyboard Shortcuts (JSON)" (command ID workbench.action.openDefaultKeybindingsFile) really shows comprehensive list of all native and extensions-contributed commands VSC knows about at moment when invoked.
This file shows keys from VSC's defaults and extension manifests.
Commands with no suggested defaults are those commented out at the end of file.
Their descriptions (as seen in the Command Palette, Keyboard Shortcuts settings, extension Contributions tab and elsewhere) are supposedly in localization properties and I believe there is currently no way to see them along their respective command IDs in single convenient "localized" list. So for now the only way to read the description of command found in aforementioned JSON is pasting its ID into Keyboard Shortcuts search field. (Would be delighted to be proven wrong.)
In case someone ever fell on this and just wanted a quick-list of VSCode commands to browse through: https://gist.github.com/skfarhat/4e88ef386c93b9dceb98121d9457edbf
If you do, please note the VSCode version and commit. These may well be out of date by the time you read them.

Cannot change content of an Edit control

I am using pywinauto to open a file in some software. My code is supposed to open a specific file using the Open dialog:
import pywinauto
from pywinauto.application import Application
app = Application(backend="uia").start(cmd_line="C:\\Program Files (x86)\... etc")
app.Dialog.Close.click()
app.FORAM3.Derivative.OpenSpectrum.click()
app.FORAM3.Open.Edit.SetEditText(r"C:\\Users\... etc")
The code opens the software and clicks the "Open Spectrum" button, where it gets the standard Open dialog:
on the line app.FORAM3.Open.Edit.SetEditText("Paracetamol 4.foram") I get a pywinauto.findwindows.ElementNotFoundError which states that it could not find an element or a method called SetEditText.
I have already looked around on the internet and cannot find any solutions.
How to open an existing file using pywinauto from SourceForge says to use app.Open.Edit.SetEditText.
I tried using app.Open.Edit, removing the "FORAM3" part, and it could not find "Open".
I replaced this with app.Dialog.Edit and it gave me the original ElementNotFoundError.
I also looked at Open an existing excel workbook using pywinauto, however the answer to this question suggests opening the file within excel itself, which does not apply to me.
I even tried replacing SetEditText with TypeKeys and got AttributeError: Neither GUI element (wrapper) nor wrapper method 'TypeKeys' were found (typo?)
One answer in another question, "Open file from windows file dialog with python automatically", suggests to use pywinauto and gives the following code:
from pywinauto import application
app = application.Application().start_('notepad.exe')
app.Notepad.MenuSelect('File->Open')
# app.[window title].[control name]...
app.Open.Edit.SetText('filename.txt')
app.Open.Open.Click()
I tried again using SetText and again got the AttributeError saying that it could not find an element or method with that name.
The accepted answer for this particular question says to use ctypes. I may resort to this if I cannot find a solution in pywinauto. The question has also been suggested as a possible duplicate of Choosing a file in Python with simple Dialog so I looked at that.
The accepted answer here suggests to use Tkinter. The other two suggest easygui and Zenity. Not what I'm after. There are no mentions of pywinauto in the other answers.
I am not asking how to open a file. From the answers I've looked at I can clearly see how to do it. My question is: Why isn't it working? It's clear that my code isn't recognising any of these Methods that have been suggested, so there must be something else wrong.
I started using Inspect.exe.
Part of the hierarchy has a Pane with an empty string for a name. This could be the problem, however I've worked on other software with empty panes in. In those cases I have been able to ignore the empty panes and still use the child controls. There are also three different controls with the name "Filename" which could be an issue, however since I have referred to the Edit control, it can only be one of them. I did a quick check to see whether I had to refer to the Edit control as a child of the combo box, used the line app.Dialog.combobox.Edit.SetText, and got the same AttributeError again.
My final attempt at fixing the problem was to try a different console. I have been running my code in PyCharm and found a question on jetbrains asking if it was possible to run code from PyCharm in an external console, stating that the PyCharm console did not have the same low-level control that the windows cmd.exe has.
I ran my code in the IDLE shell, and got the same error:
I tried running the code in the regular python command prompt, and it closes with the same error. This seems enough evidence to suggest that PyCharm itself isn't the issue here.
So, to reiterate: Why doesn't python recognise any Edit control methods?
backend="uia" provides different hierarchy and different method names (sometimes). Default backend is "win32" so old Notepad examples are not always relevant for "uia" backend. Also old CamelCase methods are deprecated in 0.6.5 and they even exist in "win32" backend only. Use PEP-8 method names for "uia" backend like set_text. And upgrade by pip install -U pywinauto.

How to setup Julia in VS code?

I'm coming from a pure Windows Visual Studio programming background with little Linux experience. It seems possible to use VS Code to program in Julia, but I can't figure out how to get things set up correctly.
Does anybody have good example launch.json, tasks.json, or other files that can serve as an example to build from?
This would be a great thing to see in a detailed tutorial.
Here is how things work if you are using the Julia extension for VisualStudio Code.
The extension adds a bunch of new commands. They all start with "julia", so filtering by that string should show you everything you can do with the extension.
In terms of running Julia code, the extension offers only two options right now. First, you can execute a command to start a REPL. This will just show a default Julia prompt, and you can interact with it like you would with any other Julia REPL. The second is that there is also a command, triggered by Ctrl + Enter, to send either the current editor selection or the current editor line to this REPL.
There is currently no further integration offered by the Julia extension. We do plan to add debugger support in the future, at which point I would expect F5 to start the current file in the debugger, or something like that. But that functionality is probably a couple of months away.

IPython auto-completion emacs24 doesn't work

I'm using emacs24.0.92 with IPython 12.
I took ipython.el file from IPython repository and also tried this patch however auto-completion still does not work for me.
Can someone give any hint about it ?
That's an old question but since I was looking for it:
1- python-mode.el
A quick search lead me to this working solution: http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc5
2- jedi
You still can use the completion given by jedi.el:
http://jedi.jedidjah.ch/en/latest/
http://wikemacs.org/index.php/Python#Jedi
http://aliquote.org/memos/2013/02/11/emacs-auto-completion-for-python
Install with packages.el and call M-x jedi:setup. Now the completion fires at the third character. We still can not inspect an object with TAB like in a terminal, but with the 1st solution we can.
edit: false, it's just a matter of configuration: http://tkf.github.io/emacs-jedi/released/#configuration (use jedi:complete-on-dot to complete as soon as we enter a dot).