Working with different projects in eclipse - python

I program in conjunction Eclipse(4 javascript) & PyDev.
For example in one project, I opened 5 tabs with different files. Now I need to work with another project, but I do not want to then return to the previous draft to look over all the necessary files and open them again, with close existing ones. How easy is it to switch to a different project to see if there was something open, so it stays?

What I understand is, that you want to stay focused on the work you are doing at the moment. And you have different contexts you want to switch between. There are at least three options to go with:
Use different workspaces (with the same Eclipse installation). This is useful if there is no overlap between the 2, so each workspace represents a different kind of work and context to do.
To do that, define 2 workspaces, and a shortcut or shell file to start the 2 eclipse instances for them. In windows these 2 may look:
start-ecl1: c:\eclipse\eclipse.exe -vm <jdk> -data ws1
start-ecl2: c:\eclipse\eclipse.exe -vm <jdk> -data ws2
Use different windows inside the same workspace. So you share the same directory (== workspace), but divide your work be the physikcal window. You have only one Eclipse running, but are able to switch between the 2 contexts by switching between the windows.
To do that, select from the e.g. package explorer view the menu entry Open in new window.
As a variation of this, you can use instead different working sets for different contexts. For doing that, do the following steps:
In the package explorer, open the "Select Working Set" dialog.
Create there a new working set, and define which projects should be visible in that working set.
Give it a name, and select the working set then.
As a result, only the projects you have selected are visible in the package explorer.
However, the editors that are open from not visible projects are kept open, so this goes not as far as the next option, using Mylyn.
Use Mylyn and tasks to define the task at hand. The context will be built by Mylyn on the fly, and when you switch the tasks, Mylyn will switch the context (open editors, views, ...) for you.
To get started with Mylyn, have a look at the videos at Mylyn get started
My personal opinion is that the last one is the most elaborate, the first one is good if the projects have nothing to do with each other. The second one is easiest to use.

Mylyn is what you are looking for. If you search the internet there's a lot of tutorials available.
One of my favorite is http://www.vogella.de/articles/Mylyn/article.html
Its basically an eclipse plug-in installed by default to some eclipse packages. If you dont have one you can install using this update site http://download.eclipse.org/mylyn/releases/latest
Hope it helps :)

Related

Navigate through as400 using python

I want to automate some tasks within as400 (I think it's referred to as IBM i). I managed to get some stuff done using autohotkey and directly navigating through the interface. This works alright but is far from optimal.
I wish to do some more advanced stuff now using python, the problem is, I don't know where to begin.
My first goal would be to be able to navigate the as400 window through python, once I am there, I feel confident that I can work out the rest.
I tried to look into some resources but I don't really understand them like https://www.itjungle.com/2019/06/10/guru-getting-started-with-python-on-ibm-i/.
If you are thinking in terms of "navigating the window" (i.e. going to a screen, pressing a function key, entering some text, choosing a menu option, etc.) then running Python (or anything else) directly on the IBM i isn't going to work.
Theoretically, you could use Python on your PC to interface with TN5250J or EHLLAPI, which would give you more capabilities than AutoHotkey; but this is rarely done, and there aren't any turnkey solutions for doing this in Python.
If you want to leverage Python on your IBM i then you'll need to think in terms of working directly with the files and other objects (as you would do with CL, RPG, or COBOL), or with the database (as you would do with SQL).

How to verify if two systems are in sync

I have a requirement to test two applications (via automation using Python).
The requirement is for example we have a system called “www.abc.com”
where we develop and merge code in every 2 weeks and then we create a another system called “www.xyz.com” ( basically it is backup to the first system ), everytime we do a release and add/edit in the main system, we update in our back up system.
Now the question is i need to tests both the system, after every release (every 2 weeks) to see if they both are in sync (identical).
how do i fire a python automation test script (multiple tests) to check if for example databases, servers, UI, front end, check if code base are same in both systems? can i do that if yes any help and advice , please suggest so that i can implement possible solutions .
There are several ways you could approach this:
Assuming you are using some sort of source control you could write a script to make sure that the repo is up to date and then report back the results. See here and here. This probably won't cover the data in your databases, but there are numerous ways to back database backups and it will depend what programs you are using.
Another or additional way you might check is to write a script to gather a list of hashes or checksums of all the files you care about in both systems and then compare the list for differences.

How best to enable non-programmers to run a Python program

I have written a Python script which models an academic problem which I wish to publish. I will put the source on Github and some academics that just happen to know Python may get my source and play with it themselves. However there are probably more academics that may be interested in the model but that are not python programmers and I would like them to be able to run my model too. Even though they are not programmers they could at least try out editing the values of some of the parameters to see how that affects the results. So now my question is how could I arrange for a non-python programmer to run a Python program as easily (for them) as possible. I would guess that my options may be...
google colab
an online python compiler like this one
compiling the program into an exe (and letting the user set parameters via a config file)
something else?
So now a couple of complications that makes my problem trickier.
The output of the program is graphical and uses matplotlib. As I understand it, the utilities that turn python scripts into exe files struggle or fail altogether when it comes to matplotlib.
The source is split into two separate files, one small neat file which contains the model and the user might like to have a good look at it and get the gist of it even if they're not really a python programmer. And a separate large ugly file which just handles the graphics - an academic would have no interest in this and I'd like to spare them the gory details.
EDIT: I did ask a related question here - but that was all about programmers that won't mind doing things like installing python and using pip... this question is in relation to non-programmers who would not be comfortable doing things like that.
Colab can handle the 2 problems, but you may need to adapt some code.
Matplotlib interface: Colab can display plots just fine. But you may want user to interact with slider, checkbox, dropdown menu. Then, you need to use Colab's own Form UI, or pywidgets. See an example here
2 separate python files: you can convert one of them to a notebook. Then import the other. Or you can create a new notebook that import both files. Here's an example.

How do I write a script that configures an applications settings for me?

I need help on how to write a script that configures an applications (VLC) settings to my needs without having to do it manually myself. The reason for this is because I will eventually need to start this application on boot with the correct settings already configured.
Steps I need done in the script.
1) I need to open the application.
2) Open the “Open Network Stream…” tab (Can be done with Ctrl+N).
3) Type a string of characters “String of characters”
4) Push “Enter” twice on the keyboard.
I’ve checked various websites across the internet and could not find any information regarding this. I am sure it’s possible but I am new to writing scripts and not too experienced. Are commands like the steps above possible to be completed in a script?
Note: Using Linux based OS (Raspbian).
Thank you.
Do whichever changes you want manually once on an arbitrary system, then make a copy of the application's configuration files (in this case ~/.config/vlc)
When you want to replicate the settings on a different machine, simply copy the settings to the same location.

How do I embed an Ipython Notebook in an iframe (new)

I have successfully achieved this using the method documented at Run IPython Notebook in Iframe from another Domain . However, this required editing the user config file. I was really hoping to be able to set this up via the command-line instead (for reasons).
http://ipython.org/ipython-doc/1/config/overview.html indicates that configuration via the command line is possible. However, all the examples are for simple true/false value assignment. To set the server up to allow embedding, it is necessary to set a value inside a dictionary. I can't work out how to pass a dictionary in through the command-line.
Another acceptable option would be a configuration overrides file.
Some people will wonder -- why all this trouble!?!
First of all, this isn't for production. I'm trying to support non-developers by writing a web-based application which integrates Ipython notebooks within it using iframes. Despite being on the same machine, it appears that the different port number used is enough to mean that I can't do simple iframe embedding without setting the x-frame insecurity bit.
Being able to do this via the command line lets me set the behaviour in the launch script rather than having to bundle a special configuration file inside my app, and also write an installer.
I really hope I've make the question clear enough! Thanks for any and all suggestions and help!
Looking over the IPython source for the loaders, it seems like it will execute whatever python code you put on the right hand side. I've not tested it, but based on the link you provided, you can probably pass something like
--NotebookApp.webapp_settings=dict('headers'=dict('X-Frame-Options'='ALLOW-FROM https://example.com/'))

Categories

Resources