How to make this simple GUI in Python? - user-interface

I'm totally new with programming, but have made some scripts for extraction data from .txt files etc. Now I am making a simple script for work, but need a simple GUI so people can run use it efficiently. The script is really simple, and consists of 4 dictionaries and a list with the keys for the values that I want to print from one of the dictionaries. What I need is a GUI that looks like the one posted. There will be 4 buttons, one for each dictionary, and the user can only pick one. On the left will be the keys, and the keys transferred to the right will be put in a list, which will be used to write the values to a .txt file. This is probably really simple, but I have no idea where to start with GUI, so I hope that someone can give me some ideas. In advance, thank you :)
Exaple: https://ci.apache.org/projects/wicket/guide/6.x/img/multi-select-transfer-component.png

It's cool that you are getting into GUI programming. Try tkinter:
https://www.tutorialspoint.com/python/python_gui_programming.htm

Related

How can I edit the columns of multiple files in the same folder then overwriting it?

I am at the edge of frustration thats why my way of explain myself might be rough.
I am trying to remove a column from a tab delimited text files. I have 10 files with same pattern of names such as (written below), thats why when I use such commands like cut I get frustrated with using tab many times.
So my questions;
1) Is there a easier method of basically copying the file name for overwriting?
cut -f 1,3 oldfile.txt > oldfile.txt
btw when I do the method above, my all lines got erased for some reason.
2) Since I dont know the regular expression well enough, is there a way to go around of awk ? that language seems pretty complicated for me.
3)What is the most memory efficient method for his task? Please tell me a method then I will learn that method even its as hard as learning Chinese.
I am a unix frasturared mediocare. sorry for my bad england.
Best regards,
file name example: KKK12398801_normal_912839.txt

How to use "move..." verb to move sheets in Numbers?

I'm trying to figure out how to re-position sheets in Numbers. There is no way to insert things at specific location so I am hoping that I can find another way. The move verb drew my attention (it is in the Numbers dictionary) however there is little or no information, examples, usage scenarios or even what object types it works with.
Any insight in the context of the title?
The move in the Numbers dictionary is part of the Standard Suite, which typically works with files. I have tried using it to move text items and tables from one sheet to another, but it always fails. It is probably something they hope to provide functionality for some day.

How to split a large csv file into multiple files in GO lang?

I am a novice Go lang programmer,trying to learn Go lang features.I wanted to split a large csv file into multiple files in GO lang, each file containing the header.How do i do this? I have searched everywhere but couldnt get the right solution.Any help in this regard will be greatly appreciated.
Also please suggest me a good book for reference.
Thanking You
Depending on your shell fu this problem might be better suited for common shell utilities but you specifically mentioned go.
Let's think through the problem.
How big is this csv file? Are we talking 100 lines or is it 5G ?
If it's smallish I typically use this:
http://golang.org/pkg/io/ioutil/#ReadFile
However, this package also exists:
http://golang.org/pkg/encoding/csv/
Regardless - let's return to the abstraction of the problem. You have a header (which is the first line) and then the rest of the document.
So what we probably want to do (if ignoring csv for the moment) is to read in our file.
Then we want to split the file body by all the newlines in it.
You can use this to do so:
http://golang.org/pkg/strings/#Split
You didn't mention but do you know how many files you want to split by or would you rather split by the line count or byte count? What's the actual limitation here?
Generally it's not going to be file count but if we pretend it is we simply want to divide our line count by our expected file count to give lines/file.
Now we can take slices of the appropriate size and write the file back out via:
http://golang.org/pkg/io/ioutil/#WriteFile
A trick I use sometime to help think me threw these things is to write down our mission statement.
"I want to split a large csv file into multiple files in go"
Then I start breaking that up into pieces but take the divide/conquer approach - don't try to solve the entire problem in one go - just break it up to where you can think about it.
Also - make gratiutious use of pseudo-code until you can comfortably write the real code itself. Sometimes it helps to just write a short comment inline with how you think the code should flow and then get it down to the smallest portion that you can code and work from there.
By the way - many of the golang.org packages have example links where you can literally run in your browser the example code and cut/paste that to your own local environment.
Also, I know I'll catch some haters with this - but as for books - imo - you are going to learn a lot faster just by trying to get things working rather than reading. Action trumps passivity always. Don't be afraid to fail.
Here is a package that might help. You can set a necessary chunk size in bytes and a file will be split on an appropriate amount of chunks.

A step by step small app creation guide in Ruby

I'm looking for a step to step tutorial to make an app, not so complex in Ruby, so students can do it. By now, i have only medium-big examples that i have developed for companies some years ago,but they require extra knowledge as i used diff frameworks and libraries and i want something that can be done only with the ruby interpreter itself.
A well commented app will be good as well as i can make some step-to-step guide based on that, and yea maybe I can do one but the thing is that im running out of time, and i haven't used ruby in like 1.5-2years, so as i said im looking for something not so complex and not so big, 200 , 300, 400, or 500 lines of code is ok
Could be anything, like administration or managing purpose like idk, a script that generates word documents for certain department. A script that reads a .txt or .doc and do something with that, idk.
Thanks in advance!
It's not an app really, but it's smallish, it's Ruby, it's sort of a game, and it's fun. http://github.com/ryanb/ruby-warrior

capturing what keys were used to launch vbscript

I have an application that has 'macro' capabilities. When I map some keys on the keyboard to perform the 'macro', I can also have it launch vbscript instead.
What i'd like to try and do is within my vbscript figure out what keys were used in order to launch the script. Is it posible to do this? Could there be a way in vbscript to figure out what keys were last touched on the keyboard and then I could apply my logic.
The purpose of doing this is to keep the code in a single .vb file instead of several seperate .vb script files(one for each keyboard mapping, possible 3-4). Obviously we are looking to just maintain 1 file instead of multiple files with essentially the same code in each one.
I am leaning towards the idea that this is not possible, but i figured this would be a worthy question for the masses of StackOverflow. Thanks for the help everyone!
What you are asking for is not possible.
Can you change your VBScript to accept parameters and then call it with a different parameter based on which hotkey was selected?
I agree with aphoria, the only way to make something like this possible is if your keyboard mapping software allows you to assign a script/command with parameters/arguments. For example if you used
c:\Temp\something.vbs
then you would change this to
%WINDIR%\system32\wscript.exe c:\temp\something.vbs "Ctrl-Alt-R"
Then in your vbscript code you could collect the argument using the wscript.Arguments object collection to do actions based on what argument/parameter was passed. See the following two links for more info:
http://msdn.microsoft.com/en-us/library/z2b05k8s(VS.85).aspx
http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept04/hey0915.mspx
The one possible approach you may use is to install keylogger and read its log in your VBScript.
For example save script start time in the very beginning of the script
StartTime = Timer()
and then read one log record of your keylogger before this time.

Resources