I am trying to learn more about displaying graphics with Python 2.7.9 and one post on StackOverflow directed me to wand, but nowhere can I find how to install wand. 'sudo apt-get install wand' fails with 'Unable to locate package wand'.
http://docs.wand-py.org/en/0.4.4/ says to install using '$ sudo apt-get install libmagickwand-dev' but any sample programs end in error with "no module named wand."
What I am trying to do is to flash a number on the console screen that is readable from across the room. I am making an Easter Egg hunt game in Python which is mostly finished, but the numbers on the screen from print ("5") are just too small. My thought was to just use Photoshop to make an image of the number then something like wand to display it instead of printing it to the screen.
So if Wand isn't the correct answer, suggestions would be appreciated. If wand will work for my game display, how do I get it?
Thanks
You can also try pygame if you are doing game display. I tried it and it is very simple to learn. It is normally already downloaded on most python interpreters but if you for some reason do not have pygame, then go here; it teaches well and can help installing:
https://inventwithpython.com/pygame/chapter1.html
Related
I'm trying to run this program remotely via SSH, but since it has a GUI, I get the error: "Could not connect to any X display."
I don't need the GUI, since I made some adaptions and want to experiment with it. I'm very new to programming, especially in C++.
So far, I tried to solve the problem, by removing/commenting the lines related to the uvcvideoproducer in the main.cpp and compiling it again, but it's still looking for a display and doesn't start via SSH.
When I entered the command "export DISPLAY=:0" in the command line first, then trying to run the programm, I get the output: "No protocol specified
qt.qpa.screen: QXcbConnection: Could not connect to display :0
Could not connect to any X display."
I really don't know where to continue from here in order to solve the issue I'm having.
Thanks a lot, in advance for any help! It's very appreciated!
Thanks for your responses!
The thing about ssh -X is, my colleague said, it's sometimes not even working between different distributions, and I'm even using Windows to connect to Ubuntu Server on a Raspberry Pi. So sorry for not adding this important information into my original post.
I actually solved my problem by using the Xvfb library in order to simulate a display.
The only things I had to do are first installing it:
sudo apt-get install xvfb
And then run the program via the xvfb command:
xvfb-run -a --server-args='-screen 0, 160x120x16' ./GetThermal
I could also use a simulated display in the size of 1024x768x16 and probably many more formats, I just didn't notice any performance difference, when I was running it.
I am trying to use Berkley's AI pacman projects.
Specifically this project.
A little bit about me: I'm on Windows 10 using cygwin as my terminal. I have both python and python3 installed as well as both versions of Tkinter and tkinter respectively. This project uses python 2.7. Trying to run the main project using the python pacman.py results in a long trace with the error being '_tkinter.TclError: no display name and no $DISPLAY environment variable'.
Calling echo $DISPLAY outputs an empty string.
I believe this is the most relevant file:
http://ai.berkeley.edu/projects/release/search/v1/001/docs/graphicsUtils.html
I understand this is a relatively specific and difficult issue, but any advice would be greatly appreciated. Thank you in advance!
Edit: I have installed xwin and the relevant packages. I am able to start a server in one terminal with startxwin and then I try to run the same command in another terminal but arrive at the same issue. I believe my problem is that I cannot establish the xwin server as my $DISPLAY.
I'm a reasonably experienced Excel developer and recently watched a couple of video demos of xlwings. I decided to learn more, but I'm finding it very difficult getting started. Do I need Python or other programs installed on my PC before installing xlwings? Are there VBA references I need to set up in advance? Any clues you can provide to this rank beginner will be deeply appreciated.
xlwings is a Python package and hence you need a Python installation to get started. Have a look at dependencies listed under http://docs.xlwings.org/en/stable/installation.html. Note that the Anaconda distribution gets you started most easily as it is a single-click installer that already comes with xlwings and all the dependencies preinstalled.
I am using spyder with python to plot some images with matplotlib. When I generate a figure it is not showed on top of the windows, but hidden.
How can I get the figures on top?
I have this problem in Windows and Linux.
This is the code:
plt.figure(0)
plt.imshow(img)
Thanks for your help !
I had the same problem, with Spyder 3.3.2, (python 3.7) and QT5 backend.
The answer in this older query says you may use a trick with TkAgg backend. (at least, the trick does not work with my QT5 backend)
So I switched the backend in Spyder preferences (Tools==> Preferences ==> Ipython ==> Graphis ==> backend).
and now, my windows already comes on top without any other tricks...
Unfortunately there is no way to do what you're asking for because Matplotlib doesn't have the functionality to make it possible. See this issue for more details.
This has been bugging me for a while and I've discovered an answer in an older query
Basically, make window "always on top", then undo that so that other windows can then come on top again.
Code to add after your plot:
#Put figure window on top of all other windows
fig.canvas.manager.window.attributes('-topmost', 1)
#After placing figure window on top, allow other windows to be on top of it later
fig.canvas.manager.window.attributes('-topmost', 0)
I met the same problem yesterday. but I found that if you open the Ipython qtconsole at the same time, the figure window will turn out
I'm try to see if/how it is possible to make a windows(or even mac/linux for that matter) application that will post process everything that is on the screen. If possible I would like to be able to use glsl shaders to perform things like color inversion and sobel filtering to everything on screen. Does anyone know how this can be done?
The Compiz compositor for linux looks like it can do what you want. It includes many post processing effects already (as included plugins) and allows you to add your own through custom plugins. It looks like these plugins can use GLSL pixel shaders.
According to this site, the following commands should set up the CompizConfig Settings Manager on Ubuntu 13.04
sudo apt-get install synaptic
sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
Hopefully this provides a helpful starting point for your project!
Disclaimer: I have not actually used Compiz. I'm basing my description off of what I can find online.