Programming :: GTK / Glade Use C - Bash - Pascal Or Settle For Python?
Dec 17, 2010
I have searched the net for guides on GTK/Glade and have learned that I have to install Glade in order to experiment with it. It also appears that it only works for Perl. I would primarily like to use C ,Bash , Pascal or settle for Python if possible. Can anyone offer some general info on this topic?
I am working with ubuntu (linux) and have to create a graphical user interface. The GUI is a 2-D plot that have to plot a point. The point ( x and y co-ordinates) are not hardcoded, and are coming from another file (another piece of code written in c / python). I was thinking to use Glade with c/python to create this. But, I am not sure how to start with this.
I have a bash script that I want to import in to Python, mainly just to see if I can or not. However in the script I do use some piping of commands into sed to trim it down to what I need. When I tried doing it with the os.system() call, it didn't work. The exact error is
Ive been learning bash over the past 6 months or so and have written a few scripts etc and i have just downloaded julius to execute my scripts and a few commands with speech recognition, the example script that comes with julius to execute commands is written in python and the example works fine when executed but i would like to further extend and customize it but i dont know anything about python, so ideally i would like to translate it to bash as that is what i am learning/using at the minute and would like to learn/use one language at a time, translating it as i think im a little out of my league, i look at the script and sort of understand how it works but i dont know anything about python and my knowledge of bash is limited for use of translating languages.
the python script is:
Code: #! /usr/bin/python -u # How to use it: # julius -quiet -input mic -C julian.jconf 2>/dev/null | ./command.py import sys
I was wondering what are the main difference with these two languages? I mean besides just the syntax, only recently started looking at pascal. I find the syntax of Pascal nicer than C. So under the hood so to speak what are the differences? Also why do i see many look down at Pascal? Since C and C++ now are in more use than pascal, im guessing it offers something that Pascal and Object Pascal cant?
After upgrading my media computer earlier today, I tried to run Samba config (system-config-samba) and it crashed. Running again in terminal I got the following error:-
Code: import mainWindow File "/usr/share/system-config-samba/mainWindow.py", line 30, in <module> import gtk.glade ImportError: No module named glade Ths was fixed by installing (via Synaptic):-
I wrote the Automatik widget (you can find it at :http://kde-look.org/content/show.php...&PHPSESSID=caeTo improve it, I would like to add this one-line script into a text sensor :
top -b -n 1 | head -12 | tail -6 | sed '/top/d' | awk '{ printf "%-12.12s %-4s %-4s %-3s " , $12,$9,$10,$2}'
On ubuntu i just compiled my first program using lazarus and i can open it in terminal fine but if i double click the file simply marked 'hello' nothing happens.
How one could determine (for use in a Bash or Python script) which device (eg /dev/sda1, /dev/hda1... etc) a ramfs was loaded from when booting from a USB drive.
I have a RIPLinux/Tinycore live USB disk that automatically needs to run a script that is stored on the same USB drive but not part of the RIPLinux/Tinycore image. (Please note that I do not want to put this script into the RIPLinux image.) I therefore would like to remix the RIPLinux/Tinycore ISO to automatically run this script once it has started up. After RIP linux has booted I would like to automatically mount the USB drive that RIPLinux/Tinycore was booted from. I need help detecting which device this is.
this is my first time here: I've been programming GUI software in C# in MonoDev for some time now. I just noticed that I can use my favorite language, C, with Glade to do the same thing. I've been going through some tutorials with a little frustration with them. Some seem to be written for older Glade versions.
The latest example had me save my Glade project to a "tutorial.glade" file. Then run it through a 'gtk-builder-convert' utility. Problem: the utility program returns errors indicating the the tutorial.glade file was written badly, that there is supposed to be a <glade-interface> tag that is missing.
I have created a glade file which so far have two regions in it:
1) On the right division is a toggle button which calls a C script when enabled.
2) I have a drawing area, in which I would like to plot a point (X-Y scatter plot). The plot should be generated dynamically using a C script. I am not sure how the integration between the two is possible for a drawing area.
In glade what properties of drawing area should I set? eg.expose event, realize etc. I was thinking of using cairo for generating the plot.
I am calling a bash shell script from a python script trying to pass several arguments to the bash script with no succes can this be done? I have researched (google) with no clear indication of how to achieve this. Using "os.system"
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess >>> help(subprocess) ... [pages of stuff to read] ...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
I am working on a small project for making a small configuration tool for ubuntu 9.10 for new linux users, that make their system working easily without knowledge of the linux commands.I created a gui in glade and loaded the gui with my python program to show up, now i wish to have some python codes that can launch a gnome terminal (and also pass some linux commands to it) on the click of a button contained in the glade file.
I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x
I want to display something in my text view widget in glade using c code. that's all right. now I need to attach a save button beneath the text view.so that on click the text view content should save as a txt file..
I do not know how to write either PYTHON or Bash Shell Scripting. I am to learn one for Linux Administration purpose. Which one will you recommend for a Linux Admin/Eng environment?
Problem occured yesterday and has added 3 mins to my boot time. all i can say about it is that it occured after a yum update and then a crash while using wine. i navigated to the file but really cant say much about it. however the pci call there makes me wonder if it is related to the post below.
I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":
I am trying to install ubuntu 11.04 to my laptop, currently I have 10.10 installed and working. When I try to boot the computer from USB for installation, I get (after waiting a few minutes):
[Code]...
I am currently using windows 7 and ubuntu as dual boot. I didnt have this problem when I was installing 10.10. I am not sure but I think I upgraded my BIOS after my 10.10 installation, so that might be related. I didnt change anything else related to hardware since.
I am not sure what other information I should provide, Also note that given error message might not be 100% correct as I have typed it from a photo.