Programming :: Python And Curses : Unable To Getch() For A Curses.KEY Event
Nov 8, 2010
When I getch() a key event (UP arrow key), the getch() function return a string of characters that I cannot compare with curses.KEY_UP constant. Here is the code I use :
while True:
w = gb.scrn.getch()
c = chr(w)
otp = 'touche:'+str(w)+' '+str(c)+"
[Code]...
It seems like getch() return three distincts bytes while I would retrieve it with a single ord() instruction in python like describes in curses/python documentation.
I am trying to compile a program for my assignment at school that uses curses.I have installed libncurses5-dev, and curses.h is now in /usr/include, but I am getting all these errors(it compiles fine at school).
Code: grcunning@grcunning-desktop:~/school/cs474/assign7$ gcc -o proj7 proj7.c /tmp/cc2ZFXrs.o: In function `main':
i have installed suse 11.3 and c and c++ programs are running fine but when i try to execute any code with curses.h header included error is shown that curses.h not found what can i do?
Just something I've been curious about. I've been messing a fair bit with some of my own scripts, and in some cases, getting sent an IM would be useful to let me know when a task is done. the ability to set account information in a text file.It'd be okay if I can designate only a single recipient, or set recipients in the config file at the very least, jabber support.Be able to be controlled via standard shell commands - for example I should be able to pipe a message output into the program for example.
I need to make a simple GUI or even commandline based theme switcher for my JWM slackware 13-current setup.Basically, to change themes I just use a cp command from menu.However, the more themes, the bigger the menu gets and so it would be nice to have a app/script something that will allow me to click on theme I want and when I hit "apply" it cp's the theme for me.
I'm reviving an aging Thinkpad X22 by installing Debian and running only in text mode. I've installed wicd to control the wireless network connections. When I run wicd-curses from the cli, it finds the network and I'm able to obtain an IP address. The wireless ESSID that I'm connecting to is encrypted with WPA. I can't seem to figure out how to input the encryption password so I can connect.
I have a Database using C programming and text based screen using curses. When I run the program and select "add a customer". The startcontract and endcontract variable does not appear. Also, when I add a name, it does not display what I have written down. All that appears is some jargon which I don't know how to fix it.
I am unable to install matplotlib. I already have installed latest libfreetype and libfreetype-dev.But it still errors out on freetype, I am running Debian testing on my machine. Python is latest 3.5.b3 compiled from source and in virtual env , running the command :
pip install matplotlib
...... freetype: no [Requires freetype2 2.3 or later. Found ...] png: yes [version 1.2.50] ..... .....
* The following required packages can not be built: * freetype ....
Full error log here: [URL]....
I do not understand why requirement is not marked for compilation even though found.
I'm unable to configure the apache2 with python support. I have done the configuration in the following method, but unable to start the python cgi support: I have installed the libapache2-mod-python it has installed python.load in the mods-available directory. In the apache2/sites-available/default file, I have added the following lines.
[code]...
when I request for a python script in the py folder. I get a 404 Not found error.
I'm using mq_notify to be notified about events on a message queue. But my registered notifier function is not being called. I'm pasting my code snippet below:
I am trying to write an app that will perform some actions when a network interface is unplugged. Is there a way to get the OS to signal me when a network interface is unplugged. I have looked at DBus but can't figure it out.
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'm working on an application which generates random shapes when clicking on a window. I designed the window using Motif. I want to invoke the ButtonPress Event .
I know how to deal with a mouse click event like so:
Code:
But was happens when I am dealing with mouse dragging? Will my implementation of mouseDragged() get called for every pixel moved? So I just getX() and getY() like with a mouse click?
Also, in order to know when mouse dragging stops and starts, do I also have to put code in mousePressed and mouseReleased?
I'd like to use a perl script to update a fields in mysql database when pianobar (command line pandora radio player) starts a new song. Pianobar has the ability to run a script based on events, I'd like to take advantage of and use perl toparse the artist,song,album and update the corresponding fields. Then later retrieve them and display them with php/html. I am by no means proficient with perl. I started to use bash, but it looks like perl will be much more efficient and and less time consuming.
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 haven't been able to determine what exactly Python OpenSSL and what it does. Google searching has not yielded me anything I can understand. In a terminal window (using RHEL 4.8 AS) typing
Code: rpm -qi pyOpenSSL yields information pertaining to the version of Python OpenSSL on my server. Can you explain what Python OpenSSL is in simple terms?
I have a python script I wrote a while ago and now I would like to call that script from inside C. I know how to do one command from C, but how would you execute an entire script from C, and passing arguments? Like:
I have decided to learn python as it seems to be powerful not just for web development (like php) but also a clean powerful language for other puposes.
Q: Can someone suggest a tutorial or book, on learning python (beginner to intermediate) which has as its focus for learning, web development?
In order of preference: 1. Comprehensive, 2. Online, 3. Free
I'm trying to install some virtual machines to a dedi using KVM. So far everything seems to be working, I tested the KVM install with virsh -c qemu:///system list and it responded, however, I'm trying to now install the script for generating new vps's python-virtinst but putty is returning this error:
I want to be able to create an RPM that will install python 2.7.1 along with sqlite 3.7.3, MySQL-Python-1.2.3 on a CentOS 5.5 x86_64 host(s) in a directory (e.g. /opt/python2.7). Once that's done, I want to be able to alias the new python binary in .bash_profile so that my developers can begin using it.
I understand 2.7.1 can't be installed on a CentOS host but I've done the above using a shell script successfully. If you search hard enough, I posted my script on line . However, I need to create the RPM for political reasons. Besides placing the source file(s) in the SOURCES directory, what do I need to do in the spec to be able to successfully create an RPM installer?
Please be gentle with me. I've been drinking the Windows cool-aid for most of my IT career so, this is one of my first attempts of becoming a better DevOps Admin.