Web Development
int64 0
1
| Data Science and Machine Learning
int64 0
1
| Question
stringlengths 35
6.31k
| is_accepted
bool 2
classes | Q_Id
int64 5.14k
40.5M
| Score
float64 -1
1.2
| Other
int64 0
1
| Database and SQL
int64 0
1
| Users Score
int64 -6
163
| Answer
stringlengths 19
4.91k
| Python Basics and Environment
int64 0
1
| ViewCount
int64 12
475k
| System Administration and DevOps
int64 0
1
| Q_Score
int64 0
346
| CreationDate
stringlengths 23
23
| Tags
stringlengths 6
68
| Title
stringlengths 12
138
| Networking and APIs
int64 0
1
| Available Count
int64 1
31
| AnswerCount
int64 1
35
| A_Id
int64 5.3k
72.3M
| GUI and Desktop Applications
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | I have created a pygame based environment. In that I am importing a spherical ball blender based obj file. Using pykinect, I am trying to mould the object with inputs from a kinect for Xbox 360 camera.
All is working ok.
However I wish to export the end product 3D moulded object and save it in a .dae, .obj and .stl formats. Currently by recording the end coordinates of the boundary of the 3D object trying to mimic it to export, but this is a very cumbersome process.
Can someone suggest what could be done to be able to save the deformed file in the desired 3D formats? | true | 37,939,412 | 1.2 | 0 | 0 | 0 | If you are 'just' moving the locations of vertices (which is what moulding sounds like) then you can 'just' replace that block of the .obj etc file. You should be able to figure out where to cut and insert by looking at some files (I've done this with .obj but not the others so this may be harder than I suggest!)
However you should really fix the normals which you can do by taking cross products of face edges. Also uv coordinates would need fixing if you use those and that's quite a bit harder. | 0 | 380 | 0 | 0 | 2016-06-21T08:37:00.000 | python,numpy,pygame,blender,pykinect | How to export 3D files from python(pygame) | 0 | 1 | 1 | 37,956,343 | 1 |
0 | 0 | When using python and pygame: after loading the screen with the background image and blitting new objects (Text, circles, rectangles, etc.), is there a way to save the modified screen so as to be recalled later in the program? Specifically, I am setting the background and blitting new objects and would like to save the screen image with all of the blits in intact so it can be used later in the program as a new background upon which sprites can be manipulated. Any suggestions welcomed! | false | 37,976,237 | 0 | 0 | 0 | 0 | Blitting works both ways, meaning you can blit something onto the display screen, but you can also blit the screen onto another surface. So simply make a new surface the same size of your display surface and blit the screen onto that surface for later use. | 0 | 271 | 0 | 1 | 2016-06-22T18:59:00.000 | python,background,pygame,screen,sprite | saving modified screens in python/pygame for later use | 0 | 1 | 2 | 37,977,559 | 1 |
0 | 0 | I wrote a PySide application that should run on python2.7, on window,Linux and Docker container. The application contains Qtooltip and specific eventFilter that catches HoverEnter\HoverLeave.
The application works well on windows 10 and ubuntu 14.04 desktop but when trying to run it inside Ubuntu 14.04 container both features didn't work well:
The tooltip - It would seem that the text is covered by other tooltip text or totally black.
The eventFilter - The application can't get the hover event (didn't appear).
The main difference that I saw was that when running on Ubuntu desktop, some GTk libraries are loaded to the python process (according to the maps files).
I tried reproduce the problem by installing everything on Ubuntu server (without Gtk), and got the same effect as inside the container.
Even after installing Gtk on the server, still no change.
I think that I might have missed some dependencies, but can't find any documentation on the issue.
Thanks in advance, | false | 37,993,285 | 0 | 0 | 0 | 0 | Ok, after several days of trying figure that this is what was needed:
For the tooltip problem:
Adding WA_AlwaysShowToolTips
Change the stylesheet show that the transparent feature will work only for the QPushButton background and not the entire widget.
For the event problem:
Add the attribute: WA_Hover
Everything worked as should be after that | 0 | 70 | 1 | 0 | 2016-06-23T13:37:00.000 | python-2.7,docker,ubuntu-14.04,pyside | Pyside fail to show tooltip and specific events in Linux | 0 | 1 | 1 | 38,057,871 | 1 |
0 | 0 | Is it possible to orient a tk.Button or ttk.Button vertically? Smething like orienting a tk.Scrollbar in a way self.scrlbr = tk.Scrollbar(master, orient = vertical)?
Have tried tk.Button(*args).pack(fill = tk.Y), but it does not provide desired effect - button still gets horizontally oriented.
Found nothing in man pages, but maybe there is some not-staightforward way? | false | 38,008,389 | 0 | 0 | 0 | 0 | I found an answer that is a bit easier.
for example lets say you have 4 horizontal ttk.buttons, and you wish to place a vertical ttk.button next to them lets call our new button config.
Using the grid method for the buttons, the first vertical button is at col=0, row=0
second at col=0, row=1 etc
Create a button with with=4 text=C\no\nn\nf\ni\ng\n, grid at col=1, row=0, rowspan=4,
There you have it. Simple and easy using standard tkinter. | 0 | 3,538 | 0 | 5 | 2016-06-24T07:55:00.000 | python,button,tkinter | Is it possible to have a vertical-oriented button in tkinter? | 0 | 1 | 2 | 68,547,819 | 1 |
0 | 0 | After setting limited width size,strings which is too long get truncated in the dropdown of wxcombobox.
self.namelist = wx.ComboBox(self, -1, "", size=(270,-1))
Is there any way to make the combobox dropdown scrolls horizontally.So that we can see long strings.? | true | 38,009,583 | 1.2 | 0 | 0 | 0 | No, but you can use wx.combo.ComboCtrl instead which lets you implement the drop-down window yourself, and then you can make it do whatever you want. It's not a perfect emulation of the wx.ComboBox, and fairly complex compared to the wx.ComboBox, so it may not be worth it to you for just adding horizontal scrolling. You can see examples in the wxPython demo. | 0 | 217 | 0 | 0 | 2016-06-24T09:09:00.000 | wxpython,wxwidgets | Can we set horizontal scrollbar for wxcombobox? | 0 | 1 | 1 | 38,017,758 | 1 |
0 | 0 | I recently formatted my hard drive and got rid of Windows and went to Linux. I had a program that used to work fine before the reformat but isn't working fine now.
I believe it was written for 3.4 and not 2.7 since I used import tkinter and not import Tkinter. In either case the program won't run now that I have made the switch over. In 2.7 it does nothing...it acts like it has run through the code and then stops and gives me back the cursor when it should be popping up a t/Tkinter window displaying a graph. In 3.4 I get the error saying numpy isn't installed.
When I apt-cache policy python-numpy it comes up showing it 1:1.8.2 is installed. When I do the same for scipy it shows 0.13.3 is installed. Seeing from other websites when I check for cython it shows 0.20.1+git90-gee6e38e is installed. When I check for tk it comes up 8.6.0 is installed.
I'm a bit lost. Why I do get the error code saying numpy isn't found when I got to run the program yet it is installed. What do I have to do to get this program back up and running again. | true | 38,013,224 | 1.2 | 0 | 0 | 2 | If you use Ubuntu then you have 2 versions of python executables - python and python3. So I think you need to install dependencies for python3 version by sudo pip3 install numpy or sudo apt-get install python3-numpy if it exists in repos. | 1 | 520 | 0 | 2 | 2016-06-24T12:14:00.000 | python,numpy | Install python dependencies not working | 0 | 1 | 2 | 38,013,321 | 1 |
0 | 0 | I'm now practicing with Gtk by developing a file manager application similar to Thunar, and I simply can't figure out how to make the IconView items flow vertically instead of horizontally, like in Thunar or Nautilus' Compact View mode, as well as in Windows Explorer's List View Mode. Should I use TreeView istead?
I'm practicing in Haskell bindings, the Gtk2Hs, but I'm also familiar with native C library and Python bindings (PyGtk), so explanations using these languages are also acceptable. | true | 38,103,354 | 1.2 | 0 | 0 | 0 | It finally seems that IconView has not such a feature right now, as Thunar uses its own control from libexo, while Caja/Nautilus use their own controls from other libraries. | 0 | 113 | 0 | 1 | 2016-06-29T15:01:00.000 | python,listview,gtk,pygtk,gtk2hs | How to make GtkListView items flow from top to bottom, like in Thunar or Nautilus Compact View Mode? | 0 | 1 | 1 | 40,487,030 | 1 |
0 | 0 | I want to make a browser with Python GTK and Webkit for education purposes. I have GTK and it works, but I can't find how to get webkit for Mac OS X. I tried brew, pip3, easy_install. And I'm not sure if PyQT webkit port is the same as webkit. | false | 38,120,223 | 0 | 0 | 0 | 0 | For GTK3
brew install pygobject3
Otherwise
brew install pygobject | 0 | 2,977 | 0 | 3 | 2016-06-30T10:17:00.000 | linux,macos,python-3.x,webkit,gtk | How to get Webkit for Mac OS X | 0 | 1 | 2 | 48,846,011 | 1 |
0 | 0 | I am using Qpython3 on my Android tablet. I have a Python script for a talking alarm clock that I would like to run in the background and then go off at the time the user sets. The problem is, once I set the console running in the background, I can't figure out how to get back to it to stop the script (i.e. get the message to stop repeating). | true | 38,278,626 | 1.2 | 0 | 0 | 1 | Open the "qpython3" app then touch "Console" and in the top left corner touch "No. 1" or "No. 2" or ... then select your background running scripts and by touching "X" sing you can kill them. | 1 | 1,123 | 0 | 0 | 2016-07-09T05:16:00.000 | android,qpython,qpython3 | How do I stop a script that is running in the background in Qpython3? | 0 | 1 | 1 | 38,304,956 | 1 |
0 | 0 | After the installation of Kivy 1.9.1 on Windows using the commands of Kivy installation tutorials, I can't run the program using "kivy ***.py". I don't know how to set up the environment variables, and I can't find it on the official websites.
Kivy: 1.9.1
Python: 3.4.4
Windows 10
Please HELP!
Thanks | false | 38,301,047 | 0.099668 | 0 | 0 | 1 | Make sure you're running the command from the folder where the *.py file is located, "kivy *.py" should run from there. | 1 | 662 | 0 | 0 | 2016-07-11T07:09:00.000 | python,environment-variables,kivy | How to run kivy after 1.9.1 on windows? | 0 | 1 | 2 | 38,301,272 | 1 |
0 | 0 | I am creating a GUI for an application, modeled off of one I have seen. This other application uses diamond-shaped radiobutton indicators from Python Tkinter, and I can't seem to find out how to use a diamond-shaped radiobutton in my program. All of my attempts at creating a radiobutton result in a circular shaped radioubtton. And thoughts? I'm running my GUI on Redhat and Windows, same problem for both. | false | 38,356,263 | -0.291313 | 0 | 0 | -3 | The forms toolkit offers precisely the components that it offers. If you are not happy with round radio buttons, then code in OSF/Motif, which offers diamond-shaped radio buttons. Either that, or you could hack the internals of the widget (sorry, "control": I am so accustomed to professional [= UNIX] terminology). The round button is probably represented as a pixmap somewhere: just overwrite that in place, lickety-split, with your own two-tone pixmap that effects a rough diamond shape. | 0 | 494 | 0 | 0 | 2016-07-13T15:44:00.000 | python,tkinter | Diamond Shaped Radiobuttons in Python Tkinter | 0 | 1 | 2 | 38,357,614 | 1 |
0 | 0 | I'm using Gtk.Fixed and a viewport putting images that, sometimes, overlaps. How can I set the z-index like in html? | false | 38,419,662 | 0.197375 | 0 | 0 | 2 | Gtk.Fixed doesn't support setting the z-order. It's not meant for overlapping widgets, so the z-order is arbitrary and probably depends on what order the widgets were added in.
It's not clear from your question what your intention is; if you are purposely overlapping widgets, use Gtk.Overlay instead. If you are not intending to overlap them, then you should use a more versatile container such as Gtk.Grid which will take the widgets' sizes into account. | 0 | 611 | 0 | 1 | 2016-07-17T09:14:00.000 | python,gtk3,pygobject | PyGObject: Gtk.Fixed Z-order | 0 | 2 | 2 | 38,427,465 | 1 |
0 | 0 | I'm using Gtk.Fixed and a viewport putting images that, sometimes, overlaps. How can I set the z-index like in html? | true | 38,419,662 | 1.2 | 0 | 0 | 1 | Like ptomato said, I had to use the Gtk.Overlay. I used an overlay with 3 Gtk.Layout, like layers and it works fine. | 0 | 611 | 0 | 1 | 2016-07-17T09:14:00.000 | python,gtk3,pygobject | PyGObject: Gtk.Fixed Z-order | 0 | 2 | 2 | 38,430,240 | 1 |
0 | 0 | What module must I use and where is the documentation for it? I think it is possible because I could to make a GUI using mobile basic on Nokia. | false | 38,480,676 | 0 | 0 | 0 | 0 | you can use we app gui or qsla4AApp, i recomended to use qsla4AApp | 0 | 3,521 | 0 | 0 | 2016-07-20T11:58:00.000 | user-interface,qpython | How to make GUI using QPython 3? | 0 | 1 | 1 | 67,756,714 | 1 |
0 | 0 | I'm writing an app in Python with the PySide library. I have a QTableWidget that gets updated about every second. The thing is, I want to be able to change the data manually, and I thought that if I could find out whether or not the user is changing the data in the cell, then I could just prevent the program from updating this cell. Otherwise I get "kicked out" of the cell at each update.
Is this a good idea? Should I try something else and why?
How can I achieve my goal?
Many thanks
EDIT :
I know there exists an itemChanged signal, but what I'd really like to know is if there is a way to tell when the user is writing a new value in the cell, in order not to kick them out while editing. | true | 38,484,452 | 1.2 | 0 | 0 | 2 | In Qt Document:
void QTableWidget::itemChanged(QTableWidgetItem * item)
This signal is emitted whenever the data of item has changed.
Hope this will help you.
Edit:
QTableWidget uses a default itemdelegate(QItemDelegate instance) which has createEditor method and closeEditor signal.
You can reimplement createEditor which means edit starts, and connect the signal closeEditor which means the edit ends.
This may be the correct way. | 0 | 1,437 | 0 | 2 | 2016-07-20T14:44:00.000 | python,qt,pyqt,pyside | How to tell when a QTableWidgetItem is being modified | 0 | 1 | 2 | 38,486,018 | 1 |
0 | 0 | I found this great module on within and downloaded it as a zip file. Once I extracted the zip file, i put the two modules inside the file(setup and the main one) on the module folder including an extra read me file I needed to run. I tried installing the setup file but I couldn't install it because the console couldn't find it. So I did some research and I tried using pip to install it as well, but that didn't work. So I was wondering if any of you could give me the steps to install it manually and with pip (keep in mind that the setup.py file needs to be installed in order for the main module to work).
Thanks! | false | 38,598,880 | 0.066568 | 0 | 0 | 1 | Extract the zip file to the site-packages folder.
Find the qpyplus folder in that Lib/python3.2/site-packages extract here that's it.Now you can directly use your module from REPL terminal by importing it. | 1 | 51,897 | 0 | 14 | 2016-07-26T20:00:00.000 | python,module,qpython,qpython3 | How do I install modules on qpython3 (Android port of python) | 0 | 1 | 3 | 39,323,863 | 1 |
0 | 0 | What is the general method for 'doing something' after a period of user inactivity in tkinter? In my case the 'do something' will be to go to the start screen (tk.frame) that is already instantiated. | false | 38,600,625 | 0 | 0 | 0 | 0 | I will admit that I have no experience in this, but maybe a sort of watchdog timer could work? A timer would count up to your desired time, but anytime an element is activated it would reset the counter. This concept is used in micro-controllers a lot but I'm not sure how you would apply it to python. | 0 | 844 | 0 | 0 | 2016-07-26T22:04:00.000 | python-3.x,tkinter | do something after a period of gui user inactivity tkinter | 0 | 1 | 2 | 38,600,746 | 1 |
0 | 0 | I've been trying this for a bit and haven't found a solution that works for me
I have a wx.scrolledcanvas that I'm trying to save to an image, however when i use the answers I've found they all save only the visible portion of the canvas, and not the full canvas. Is there any way to save the entirety of the scrolled canvas to a file?
Thanks | true | 38,670,168 | 1.2 | 0 | 0 | 1 | Refactor your code such that what you are drawing in your EVT_PAINT handler can be called passing it the wx.DC to be drawn upon, and then call that from your paint handler with the wx.PaintDC or whatever you are currently using. When you want to save it to an image call the same code passing a wx.MemoryDC with a wx.Bitmap selected into it. When it's done the bitmap will have the same contents as the window, and you can then save it to a file or whatever you need to do with it. | 0 | 224 | 0 | 0 | 2016-07-30T03:48:00.000 | python,wxpython | Saving wxPython scrolledcanvas contents to image | 0 | 1 | 1 | 38,679,469 | 1 |
0 | 0 | I'm trying to import everything from nodebox.graphics into my python 3.5 code but I get errors:
ImportError: No module named 'bezier'
To mention, this module exists in nodebox/graphics. As I searched in python documentations, I have to add the nodebox and pyglet folders into the directory of my code but that did not work.
I also didn't succeed in adding them to system directories.
How can I solve the problem and run my code properly?
P.S. I'm currently using ubuntu 16.04 if it matters. | true | 38,671,739 | 1.2 | 1 | 0 | 1 | I had the same error. Placing all the .py files except (and this is important) the __init__.py file in the main libraries folder fixed it for me. The final path should look like ~/lib/python3.5/site-packages/bezier.py | 0 | 730 | 0 | 0 | 2016-07-30T08:00:00.000 | linux,python-3.x,pyglet,nodebox | use nodebox as a module for python 3.5 | 0 | 1 | 1 | 42,557,054 | 1 |
0 | 1 | What is the difference between Kivy Camera and opencv ? I am asking this because in Kivy Camera the image gets adjusted according to frame size but in opencv this does not happen. Also I am not able to do motion detection in kivy camera whereas I found a great tutorial for motion detection on opencv. If someone can clarify the difference it would be appreciated ! Thanks :) | false | 38,774,748 | 0 | 0 | 0 | 0 | opencv is a computer vision framework (hence the c-v) which can interact with device cameras. Kivy is a cross-platform development tool which can interact with device cameras. It makes sense that there are good motion detection tutorials for opencv but not kivy camera, since this isnt really what kivy is for. | 0 | 386 | 0 | 0 | 2016-08-04T18:23:00.000 | python,opencv,camera,kivy,motion-detection | Difference between Kivy camera and opencv camera | 0 | 1 | 1 | 38,774,932 | 1 |
0 | 0 | I am building a GUI tkinter python3 application and attempting to compile it with py2app. For some reason when I try to launch the .app bundle in the dist folder it gives me this error:
A main script could not be located in the Resources folder
I was wondering why it is doing this, as it is rather frustrating, and I can not find anything about it anywhere. I copied my .py file into the resources folder (Networking.py). Previous to this error I also found an error in the Info.plist. In the key where it states the runtime executable, I found it was trying to get python2.7, which I have updated and am no longer using. I changed it to my current version, which the path for looks like this:
/Library/Frameworks/Python.framework/Versions/3.6/Python
It may be worth noting that it had a strange path previously, which did not look like a proper path to me. It was @executable_path/../Frameworks/Python.framework/Versions/2.7/PythonI removed this completely... Was this wrong? I have no idea about anything about XML, which is what it seemed to be...
Also when compiling this happened:
error: [Errno 1] Operation not permitted: '/Users/Ember/dist/Networking.app/Contents/MacOS/Networking'
Any help would be highly appreciated! Thanks!
EDIT
I actually figured out: a bit of a stupid mistake, but since I'm using python 3.x I have to type in python3 before doing it. | false | 38,803,437 | 0 | 0 | 0 | 0 | I actually figured out: a bit of a stupid mistake, but since I'm using python 3.x I have to type in python3 before doing it. | 0 | 1,292 | 0 | 0 | 2016-08-06T10:51:00.000 | python,user-interface,tkinter,py2app | Py2app: A main script could not be located in the Resources folder | 0 | 1 | 3 | 39,405,027 | 1 |
0 | 0 | I will compile form designed by qt designer in eric6, but show "Could not start pyuic5, Ensure that it is in the search path." But actually the PATH of pyuic5.exe has been in the system PATH, and also the pyuic5.exe can be run by typing pyuic5 in the cmd of window7 .
The envirement is python3.5+qt5.7+pyqt5.7+eric6.
Why I could not compile form in eric6? How can fix the error? | false | 38,807,068 | 0 | 0 | 0 | 0 | Had the exact same issue. Looks like Eric wants pyuic5.bat (somewhere in the path)
I created such a batch file with the following contents, and it worked
@"pyuic5.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
PS: In my setup these files are both located in a folder:
C:\Python35-32\Scripts | 1 | 974 | 0 | 0 | 2016-08-06T17:41:00.000 | python,qt,python-3.x,pyqt5 | Compile form in eric6, but show "Could not start pyuic5, Ensure that it is in the search path." | 0 | 1 | 1 | 40,221,119 | 1 |
0 | 0 | I'm trying to make my python program run on other systems without python installation. I made use of tkinter to create a gui, after creating an exe file with pyinstaller it throws a fatal error "Failed to run script". I've checked my code several times and it works well. I don't know what's wrong. | false | 38,838,772 | 0 | 0 | 0 | 0 | The error is very generic and at this point, it may not be possible to find the actual error what preventing the execution.
In order to get actual error please exclude '--windowed' or '--noconsole' parameters during installation and then execute with 'pyinstaller -filename.py --onefile'. Then on execution it will show exact error instead of 'Fatal error! Failed to execute script'. Then you can proceed accordingly. | 1 | 6,275 | 0 | 0 | 2016-08-08T21:26:00.000 | python,user-interface,exe,pyinstaller | Fatal error! failed to execute script when creating executable file | 0 | 1 | 2 | 67,105,487 | 1 |
0 | 0 | I am using QPython on my Samsung Android V. I am studying from the book Think Python. The topic is about Adding New Functions such as: def print_lyrics:
print ("I am a lumberjack and I work all day."
Etc.
But when I attempt to run it I get an error saying, File "", line 1 error.
1. I looked on Google but could not find the exact answer for this particular problem. I was about to look for a new app and delete QPython because I've been stuck for two days on this lesson. But I came here first.
2. I tried different methods of doing this program function with no luck.
3. I'm wondering if it just isn't available on the app, or am I failing to understand what I am doing wrong, or missing?
Thanks for your help. | false | 38,866,665 | 0 | 0 | 0 | 0 | I am editing my last answer:
I was mistaken when I read the text and the error was my fault.
Be sure and read thoroughly to avoid mistakes. | 0 | 474 | 0 | 0 | 2016-08-10T07:19:00.000 | syntax-error,stdin,qpython | File "", line 1 error In QPython When Running def Function | 0 | 1 | 1 | 38,874,758 | 1 |
0 | 0 | I need to show an icon on Gio.MenuItem with set_icon() method. But set_icon() expects to receive a GIcon object.
How to create a GIcon object? | true | 38,927,339 | 1.2 | 0 | 0 | 2 | Gio.Icon is just an interface. It is implemented by Gio.ThemedIcon, Gio.FileIcon, Gio.BytesIcon, etc. So you would would use those. | 0 | 90 | 0 | 1 | 2016-08-12T22:38:00.000 | python-3.x,gtk3,pygobject | How to instantiate GIcon | 0 | 1 | 1 | 38,931,286 | 1 |
0 | 0 | Using python2.7 Tkinter for executing Tcl.
The Tcl code has package require Tcl 8.5, while the tclsh loads Tcl 8.4 by default.
Causes: version conflict for package "Tcl": have 8.4, need 8.5
I have libtcl8.5.so installed at a custom location.
Tried adding it to LD_LIBRARY_PATH, TCL_LIBRARY, TCLLIBPATH. Nothing worked. It's like the tclsh completely ignores the envs. | false | 38,965,457 | 0 | 0 | 0 | 0 | What worked eventually:
tcl = Tkinter.tcl()
tcl.eval('package forget Tcl')
tcl.eval('package provide Tcl 8.5')
tcl.eval('package require Tcl')
8.5
Success! | 1 | 761 | 0 | 0 | 2016-08-16T01:42:00.000 | python,tcl,version | Python Tkinter: version conflict for package "Tcl": have 8.4, need 8.5 | 0 | 1 | 1 | 38,965,465 | 1 |
0 | 0 | I am creating a Windows program that so far has a .bat file calling a .pyw file, and I need functions from Java and C++. How can I do this?(I don't mind creating a new batch or python file, and I already have the header file for the C++ section and a .jar file for my java components. (For Java I use Eclipse Java Mars, and it's Java 8u101)) Thanks!!! | false | 38,968,007 | 0.099668 | 1 | 0 | 1 | You can load C++ function and execute it from Python like BasicWolf explained in his answer. For Java, Jython might be a good approach. But then there's a problem - you will need to be dependent on Jython which is not up to date with the latest versions of Python. You will face compatibility issues with different libraries too.
I would recommend compiling your C++ and Java functions to create individual binaries out of them. Then execute these binaries from within Python, passing the arguments as command line parameters. This way you can keep using CPython. You can interoperate with programs written in any language. | 0 | 455 | 0 | 2 | 2016-08-16T06:30:00.000 | java,python,c++,python-2.7,batch-file | How do you call C++ and\or Java functions from Python 2.7? | 0 | 1 | 2 | 38,968,156 | 1 |
0 | 0 | I am trying to determine if something is possible. I haven't written any code for this specifically yet.
Using wxPython I would like to set up a text box (possibly a staticText) with primarily un-editable text. However I need certain parts, individual words, to be editable similar to PDF document with added text boxes.
The ultimate goal is to visually display an XML file and allow a user to directly edit only element text and nothing else in-situ. I have a couple of other ways of doing this but they are very much sub-optimal.
Thanks for any input/direction/help. | false | 39,021,144 | 0 | 0 | 0 | 0 | That's a nice idea, but wx' text boxes are either entirely read only, or editable.
I think the way to go for it is to query your position inside the text box for each cursor movement, and toggle the text box state readonly/editable according to you current position, current selection, etc..
It looks like a tough task, though... :-) | 0 | 12 | 0 | 1 | 2016-08-18T14:41:00.000 | python,xml,text,wxwidgets | Trying to determine if a specific behavior is allowed in wxPython text | 0 | 1 | 1 | 39,021,238 | 1 |
0 | 0 | Is there a way to set a fixed width of a QHBoxLayout?
For example, when I have two small widgets in it that take up little space and I don't want the two to split over the entire screen width when I full screen the app. The widgets already have their widths set to their minimumSizeHint() widths. | false | 39,023,221 | 0 | 0 | 0 | 0 | Admission: I don't use PyQT, but I use Qt in C++. I believe it would work the same.
The trick here, is to as you run QHBoxLayout::addWidget(), you define a stretch factor (greater than zero) to the widgets you want to stretch. You define a zero-stretch factor (the default) to the ones you want to stay small.
Have you run QWidget::setMaximumWidth() on the smallish widgets? That would also be useful, perhaps. | 0 | 903 | 0 | 0 | 2016-08-18T16:26:00.000 | python,layout,pyqt4,spacing | PyQt4 GUI Box Layout Fixed Width | 0 | 1 | 2 | 39,023,363 | 1 |
0 | 0 | Python and xlwings in same folder. comtypes folder in xlwings folder
can't find module named 'com types'
The xlwings documentation says to install with pip. This puts xlwings in the C:\Python27 folder. WinPython ends up in the Downloads/WinPython-64bit-3.4.4-3Qtr5/ (1.37GB, btw) moved the xlwings to the WinPython installed folder.
This is way too difficult. Is there a straightforward way to set all this up so I can run a python script and get import xlwings as xw to work? | false | 39,069,794 | 0 | 0 | 0 | 0 | maybe this would work better:
click on the "WinPython Command Prompt" icon of your WinPython distribution
in the opening DOS windows, type:
pip install xlwings | 1 | 256 | 0 | 1 | 2016-08-21T23:43:00.000 | python,xlwings,comtypes | win 10 WinPython Script import xlwings get errors | 0 | 1 | 1 | 39,083,271 | 1 |
0 | 0 | How can i disable Alt+Tab combination, especially tab on my Tkinter App.
I disabled Alt and F4 with - return "break" - but i can't disable Tab key with it. | false | 39,110,800 | 0 | 0 | 0 | 0 | Tkinter provides no option for this. Alt-tab is intercepted before tkinter ever sees it. If you want to do this, you'll have to find some platform-specific hooks. | 0 | 1,869 | 0 | 0 | 2016-08-23T21:16:00.000 | python,python-3.x,tkinter | Disable Alt+Tab Combination on Tkinter App | 0 | 1 | 2 | 39,112,160 | 1 |
0 | 0 | I'm looking to add an image in the background of a Text widget in tkinter, but as far as I'm concerned, that is not possible. So, to work around this, I'm wondering if it is possible to make the background of a Text widget transparent.
Thanks in advance. | false | 39,197,579 | 0 | 0 | 0 | 0 | It is anyway not possible to do so (without canvas), but if you really need it here's a hack:
Go to paint
Open the image you want and type in the text on it in whatever colour or font you want
Set this image as your background in the frame that you want
You can then add whatever buttons you want and place them wherever you want.
I know this is inconvenient but sometimes useful. | 0 | 1,618 | 0 | 2 | 2016-08-29T02:03:00.000 | python,tkinter,widget,transparent,python-3.5 | Make the background of 'Text' widget in tkinter transparent | 0 | 2 | 2 | 42,109,832 | 1 |
0 | 0 | I'm looking to add an image in the background of a Text widget in tkinter, but as far as I'm concerned, that is not possible. So, to work around this, I'm wondering if it is possible to make the background of a Text widget transparent.
Thanks in advance. | true | 39,197,579 | 1.2 | 0 | 0 | 1 | No, it is not possible to make the background of the text widget transparent. | 0 | 1,618 | 0 | 2 | 2016-08-29T02:03:00.000 | python,tkinter,widget,transparent,python-3.5 | Make the background of 'Text' widget in tkinter transparent | 0 | 2 | 2 | 39,197,855 | 1 |
0 | 0 | I am building a wxpython project, I have a list of elements that are a class instances. Each of this elements has an attribute title. In a ListBox I want to display only the titles, and when the title selected, after we GetSelection from listbox, the instance should be returned and not just the title. Is this achievable ?
Note: Searching for the string is out of question because names(titles) may be recurring.
Thank you. | false | 39,257,126 | 0.197375 | 0 | 0 | 1 | Put your instances in a list
Use GetSelection to retrieve the index of the item you selected from the listbox
Get the corresponding instance from that index in the list | 0 | 38 | 0 | 0 | 2016-08-31T19:01:00.000 | python,listbox,wxpython | WxPython, How to fill ListBox with class attributes | 0 | 1 | 1 | 39,257,327 | 1 |
0 | 0 | I am developing a wxpython project where I am drawing a diagram on to a panel that I need to be able to zoom in/out to this diagram(a directed acyclic graph in my case). I will achieve this by mouse scroll when the cursor is on the panel, however that is not a part of my question. I need an advice from an experienced person about the method I am using for zooming. So far I thought as doing,
There are lines, rectangles and texts inside rectangles within this diagram. So maybe I could increase/decrease their length/size with the chosen mouse event. But it is hard to keep it balanced because rectangles are connected with lines their angles should not change, and texts inside the rectanges should stay in the middle of them.
Other method I thought of doing is to search for a built-in zoom method. Which I heard about something like Scale. However I have some questions about this method. Will this work on vector drawings(like mine) rather than images. And will it be scaling only the panel I chose and not the whole screen ? After I hear your advice about this, I will look deeper into this, but now I am a bit clueless.
Sorry if my question is too theoretical. But I felt I needed help in the area. Thanks in advance.
Note: Zooming not necessarily applied by scrolling.
Note2: My research also led me to FloatCanvas. Is this suitable to my needs ? | false | 39,334,441 | 0.197375 | 0 | 0 | 1 | Yes, from your description FloatCanvas would certainly meet your needs.
Another possibility to consider would be the wx.GraphicsContext and related classes. It is vector-based (instead of raster) and supports the use of a transformation matrix which would make zooming, rotating, etc. very easy. However, the actual drawing and management of the shapes and such would probably require more work for you than using FloatCanvas. | 0 | 686 | 0 | 1 | 2016-09-05T16:20:00.000 | python,wxpython,zooming | WxPython zooming technique | 0 | 1 | 1 | 39,335,812 | 1 |
0 | 0 | I would like to know where does tkinter load his fonts from.
Is it from /usr/share/fonts or does it have a specific folder ?
thanks | true | 39,336,204 | 1.2 | 0 | 0 | 0 | So as Bryan said, tkinter gets the fonts from the standard font locations of the OS. Putting fonts there will permit to tkinter to be able to load them.
Thanks Bryan | 0 | 67 | 0 | 2 | 2016-09-05T18:50:00.000 | python,python-3.x,tkinter | Where does tkinter load his fonts from? | 0 | 1 | 1 | 39,337,845 | 1 |
0 | 0 | I have added 2 LinearRegionItems to a pyqtgraph plot. When I move the boundary of 1 over the other, the boundary never overlaps the other.
I would like to know how to allow overlapping. This is a functionality that I need, where I am selecting different regions of the data plot to be used later on. | false | 39,337,545 | 0 | 0 | 0 | 0 | Sorry, there was a bug in my code which was handling the case where a part of one LinearRegionItem overlapped with another LinearRegionItem.
Now I see that one linearRegionItem can lie on top of another one.
Consider this solved | 0 | 78 | 0 | 1 | 2016-09-05T20:48:00.000 | python,pyqtgraph | How to get 2 or more LinearRegionItem to overlap each other | 0 | 1 | 1 | 39,413,892 | 1 |
0 | 0 | I'm looking to create a lot of .fla files automatically but I'm not sure where to start.
This is for an internal tool for a cartoon studio, they work with Flash CC, each file Flash is a scene for an episode (scene1, scene 2, scene 3 ...) and in each file, we have a .flv from the scene, a .wav, a .jpg, and a specific template (folder and layers organisations and few stuff like a safe frame etc)
Every external elements are in external folders
a folder with .flv
a folder with .wav
a folder with .jpg
And everything is named incrementially like this "video_sc1, video_sc2" "sound_sc1, sound_sc2" etc.
So, is there a possibility to create a lot of .fla file (the same amount as detected in the .flv folder, for example) with all the "corresponding" stuff inside ?
And finally obtaining something like this "animfile_sc01.fla, animfile_sc02.fla ..." without doing all this manually (very boring and time-consuming)
I do some python, and very very little .jsfl, so, I'm not sure about the faisability of my project ( I use flash mainly for animation and graphics, not so much for coding).
Do you have any hint or tip to show me ?
Thanks !
(ps: my english is not perfect, but I can explain better if needed) | false | 39,371,700 | 0 | 0 | 0 | 0 | I've got the same issue.
I suggest you see the structure of a fla.
to do that take one of you fla and save it from animate into a .xfl
It's basically a folder what inside all the library and the content visible.
If you open the DOMDocument.xml you'll see the XML structure of your fla.
If you use visual basic or other software you may be able to "recreate2 a DOMDocument.xml and all the other folder and the rebuild the fla.
It's a b it long g and tricky..but it may works | 0 | 223 | 0 | 1 | 2016-09-07T13:48:00.000 | python,flash,actionscript,jsfl | Automatically creating hundreds of .fla files, who gather external ressources | 0 | 1 | 2 | 41,182,630 | 1 |
0 | 0 | I'm trying reproduce the game "Snake" in pygame, using the pygame.blit function, instead of pygame.draw. My question is how to make an image follow another image. I mean, make the snake's body photo follow your head. In the current state of my program the head moves on its own. | true | 39,380,527 | 1.2 | 0 | 0 | 0 | Keep positions of snake segments on list (first segment is head).
Later new position of head insert before first segment (and remove last segment).
Use this list to blit snake segments. | 1 | 42 | 0 | 0 | 2016-09-07T23:40:00.000 | python | Pygame: how to blit an image that follows another image | 0 | 1 | 1 | 39,380,622 | 1 |
0 | 0 | Alright, so I managed to use PyInstaller to build a homework assignment I made with Pygame. Cool. The executable works fine and everything.
Problem is, alongside the executable, there is so much clutter. So many files, like pyds and dlls accompany the exe in the same directory, making it look so ugly.
Now, I know that these files are important; the modules I used, such as Pygame, need them to work. Still, how do I make PyInstaller build my game, so that it puts the clutter into its own folder? I could just manually make a folder and move the files in there, but it stops the exe from working.
If this info would help any, I used Python 3.4.3 and am on Windows. | false | 39,419,108 | 0.197375 | 0 | 0 | 2 | Not trying to dig up this old question, but this was at the top of my Google search so it may be for others as well.
If you intend to distribute the program in some kind of folder, you can always just mark everything unnecessary as hidden in Windows, and it will remain hidden even if you compress or extract it.
For a program that I designed to be very user friendly, I just selected each file and folder that was not necessary to the user and hid them. If the user has show hidden files on (rarely default), they aren't likely to be intimidated by the mess of files that pyinstaller creates. | 1 | 4,472 | 0 | 2 | 2016-09-09T20:15:00.000 | python,build,pygame,pyinstaller | How to remove clutter from PyInstaller one-folder build? | 0 | 1 | 2 | 68,652,885 | 1 |
0 | 0 | Let's say I need to make use of keypress events. The easiest solution I have so far is the Tkinter module (testing for cross platforms after the code is done).
However, I suck at programming GUI so I am starting with a CLI first. Am I able to use Tkinter.bind() in CLI mode?
I am on Python 2.7 | true | 39,482,074 | 1.2 | 0 | 0 | 0 | No, you are not able to use Tkinter's bind method for a CLI program. | 0 | 35 | 0 | 0 | 2016-09-14T03:28:00.000 | python-2.7,tkinter,keypress | Can Tkinter keypress modules be used when in CLI | 0 | 1 | 1 | 39,488,864 | 1 |
0 | 0 | I'd like to add QLineEdit/checkbox/button in 2 layouts. So no matter which one I press in which ever window they both do the same thing, update each other as I type and so on.
Is it possible or do I need to create second set of controls and then signal link each other?
Regards
Dariusz | true | 39,506,856 | 1.2 | 0 | 0 | 1 | A widget can only exist in one place at a time. You will need to link the two unfortunately. Do yourself a favor and do it properly via a model.
If it were possible for a widget to exist in multiple places, this would lead to a whole lot of problems: cyclic trees, multiple parents, etc. | 0 | 284 | 0 | 1 | 2016-09-15T08:54:00.000 | python,pyqt,pyqt4 | PyQt display 1 widget in 2 layouts? | 0 | 1 | 1 | 39,506,951 | 1 |
0 | 0 | I'm trying to run a Kivy python file on Komodo IDE (for Mac) but its giving me this error
import kivy
ImportError: No module named kivy although if I drag-drop the file on the Kivy app its running normally,
any ideas ?, thanks | false | 39,532,034 | 0 | 0 | 0 | 0 | This only works for Komodo code intelligence. Run time is still limited to PYTHONPATH. To run a script that's using Kivy, even in your command line, the kivy source has to be on your PYTHONPATH.
You can add items to your PYTHONPATH in Komodo using Edit > Preferences > Environment then create a New environmental variable to append the kivy installation location to your $PYTHONPATH, ie $PYTHONPATH:install/location/kivy.
If you don't mind having it in your system though, I'd just do what @tuan333 suggest above, install it using pip, then make sure you're using THAT Python interpreter in Komodo. | 0 | 141 | 0 | 1 | 2016-09-16T12:53:00.000 | python,python-3.x,kivy,komodo,kivy-language | Can't run kivy file on Komodo | 0 | 1 | 2 | 39,537,143 | 1 |
0 | 0 | I've been making a small game for a homework assignment using Pygame with Livewires. I've been trying to debug it, but to no success; I can't get a look at the variables I want to look at before the main loop is executed. Though I can press F10 to skip over the main loop, that just stops the Autos and Watches window from working; apparently they can only records vars when the game is paused by the debugger.
Is there a way for me to use the debugger to look at the vars in runtime? Because no matter what I do while the debugger is paused, I can't look at the data inside the game objects I want to take a look in | true | 39,538,259 | 1.2 | 0 | 0 | 0 | Thanks to Jack Zhai's suggestion, I figured it out.
When the breakpoint is hit, unpause the debugger (shortcut: F5)
Play to the point in the game you want to debug.
Repause the debugger using Break All (shortcut: Ctrl-Alt-Break)
Press F10 a few times; this makes it go a few more steps in the main livewires loop.
In the autos window, there is an entry that contains the a list of the game's objects. Look through it, until you find the one(s) you're looking for. In my case, the list of the objects was self._objects. The object I was looking for was the second, which in other words, was self._objects[1].
The dropdown arrows of the object(s) you're looking for show the object's members. If you want to look at the object's properties in a less cumbersome way, use the Interactive Debugger to assign that object to a variable. That way, you can look at its values through typing objectNameHere.objectValueHere into the interactive debug console.
In my case, I had to type in player = self._objects[1] to get it assigned, then could see the player's x position by then entering player.x into the debug console.
--
I know this answer might only work for my specific problem, so if anyone else has a better one, please post it for others' sake. | 1 | 1,009 | 0 | 1 | 2016-09-16T18:45:00.000 | python,visual-studio,debugging,pygame,livewires | How to debug Pygame application with Visual Studio during runtime | 0 | 1 | 1 | 39,582,747 | 1 |
0 | 0 | I want to dynamically create and delete pages in a notebook. In the main class I successfully create and add pages with a button. The pages are a separate class of course, and have a button inside.
I know I can put the button outside the notebook and delete them from the main class but I want to use page's own button to self destruct the whole page as it won't be needed any more.
Sorry I don't post any code but I'm posting from my cellphone. Also it seems to be a question not so specific to need a minimal working example. | false | 39,540,563 | 0 | 0 | 0 | 0 | As you've guessed, care needs to be taken when destroying UI objects from their own event handlers. Not only is the current event handler still active, but there may be other pending events that are still in the queue, and if the target object has been destroyed when they are delivered then you can get a crash.
The best thing to do is to defer the destruction until after the current and possible pending event handlers have been completed and there is nothing waiting to be done on the UI object except for the destruction that you want to do. And the best way to do that is to use wx.CallAfter. It will call a function with parameters that you give it the next time the the event loop empties, so implicitly there is not anything else waiting to be done or sent to the UI object in question.
In your case it would be safe to do things like immediately remove the page from the notebook, and hide the page window. Then use wx.CallAfter to call some function (perhaps in the notebook class) which calls the page window's Destroy method and does any other cleanup that is necessary. The reason I suggest splitting these two sets of tasks is not because it will take a long time for the function to be called, but in some cases it may be long enough to flicker momentarily in a transitory state, so the appearance is less smooth for the users. | 0 | 224 | 0 | 0 | 2016-09-16T21:49:00.000 | python,wxpython,wxnotebook | Self delete page in wx.Notebook | 0 | 1 | 1 | 39,541,649 | 1 |
0 | 0 | I want to make a kivy app for the raspberry pi that can use a touch screen. I was able to get the demos to work with the touchscreen with just "python ~/kivy/examples/demo/showcase/main.py". The issue comes when I need to start the app with "sudo python main.py", the touchscreen then ceases to work.
The app I am trying to write uses the rpi_ws281x library for controlling addressable leds which HAS to be run as root. Is there a way to run the kivy app as root while still enabling the touchscreen functionality?
If there isn't, is there a way to send data from the kivy app to say a script which is running sudo that controls the leds?
I've looked a lot of places but no one seems to have had this problem before (or they could work around it by changing the privileges of other directories where they were accessing the sudo protected content). Any help is greatly appreciated! | false | 39,542,539 | 0.664037 | 1 | 0 | 4 | Well apparently I didn't look hard enough. The solution is to copy "~/.kivy/config.ini" to "/root/.kivy/config.ini"
So the commands are
"sudo cp ~/.kivy/config.ini /root/.kivy/config.ini"
And then everything works happily together! | 0 | 989 | 0 | 1 | 2016-09-17T03:22:00.000 | python,raspberry-pi,kivy,led | Run Kivy app as root user with touch screen on raspberry pi | 0 | 1 | 1 | 39,542,558 | 1 |
0 | 0 | this is my first question. What I would like to achieve is in a normal window for the text-based game to be running, however I would also like to have a pygame window running as well that shows a map that updates. Thank you in advance. | false | 39,543,888 | 0 | 0 | 0 | 0 | The only way to have the text entries separate to the pygame window is to use someVar = input("A string") so the text input is in the python shell or the command window/Linux terminal and then have pygame reference that var. | 1 | 400 | 0 | 0 | 2016-09-17T07:06:00.000 | python,pygame | Python/Pygame: Can you run a program whilst having a Pygame window that can still update? | 0 | 1 | 4 | 39,551,714 | 1 |
0 | 0 | I have been installing PyautoGui on my WIN10 PC. But I am getting the following error, i have been getting a lot of errors jut to get this far.
i have been reinstalling python so its destination folder is in C:\Python instead of C:\Users\Home\AppData\Local\Programs\Python\Python35-32 mabye thats why ? How do i fix this ?
C:\Python\Scripts>pip.exe install pyautogui Collecting pyautogui
Using cached PyAutoGUI-0.9.33.zip Collecting pymsgbox (from pyautogui)
Using cached PyMsgBox-1.0.3.zip Collecting PyTweening>=1.0.1 (from
pyautogui) Using cached PyTweening-1.0.3.zip Collecting Pillow (from
pyautogui) Using cached Pillow-3.3.1-cp35-cp35m-win32.whl Collecting
pyscreeze (from pyautogui) Using cached PyScreeze-0.1.8.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\setup.py",
line 6, in
version=import('pyscreeze').version,
File "c:\users\home\appdata\local\temp\pip-build-kxm3249e\pyscreeze\pyscreeze__init__.py",
line 21, in
from PIL import Image
ImportError: No module named 'PIL'
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\ | false | 39,544,944 | 0.066568 | 0 | 0 | 2 | I encountered the same error message as you did. This workaround worked for me. Try these steps in order...
Install PyScreeze 0.1.7.
Update PyScreeze to 0.1.8.
Install PyAutoGui.
I hope this helps. | 1 | 10,149 | 0 | 3 | 2016-09-17T09:03:00.000 | python,pip,pyautogui | Installing PyAutoGUI Error in pip.exe install pyautogui | 0 | 3 | 6 | 39,563,987 | 1 |
0 | 0 | I have been installing PyautoGui on my WIN10 PC. But I am getting the following error, i have been getting a lot of errors jut to get this far.
i have been reinstalling python so its destination folder is in C:\Python instead of C:\Users\Home\AppData\Local\Programs\Python\Python35-32 mabye thats why ? How do i fix this ?
C:\Python\Scripts>pip.exe install pyautogui Collecting pyautogui
Using cached PyAutoGUI-0.9.33.zip Collecting pymsgbox (from pyautogui)
Using cached PyMsgBox-1.0.3.zip Collecting PyTweening>=1.0.1 (from
pyautogui) Using cached PyTweening-1.0.3.zip Collecting Pillow (from
pyautogui) Using cached Pillow-3.3.1-cp35-cp35m-win32.whl Collecting
pyscreeze (from pyautogui) Using cached PyScreeze-0.1.8.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\setup.py",
line 6, in
version=import('pyscreeze').version,
File "c:\users\home\appdata\local\temp\pip-build-kxm3249e\pyscreeze\pyscreeze__init__.py",
line 21, in
from PIL import Image
ImportError: No module named 'PIL'
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\ | false | 39,544,944 | 0.033321 | 0 | 0 | 1 | I'm happy to report that this installation error has been fixed as of version 0.9.34. All you have to do is install or update PyAutoGUI from PyPI. | 1 | 10,149 | 0 | 3 | 2016-09-17T09:03:00.000 | python,pip,pyautogui | Installing PyAutoGUI Error in pip.exe install pyautogui | 0 | 3 | 6 | 42,882,370 | 1 |
0 | 0 | I have been installing PyautoGui on my WIN10 PC. But I am getting the following error, i have been getting a lot of errors jut to get this far.
i have been reinstalling python so its destination folder is in C:\Python instead of C:\Users\Home\AppData\Local\Programs\Python\Python35-32 mabye thats why ? How do i fix this ?
C:\Python\Scripts>pip.exe install pyautogui Collecting pyautogui
Using cached PyAutoGUI-0.9.33.zip Collecting pymsgbox (from pyautogui)
Using cached PyMsgBox-1.0.3.zip Collecting PyTweening>=1.0.1 (from
pyautogui) Using cached PyTweening-1.0.3.zip Collecting Pillow (from
pyautogui) Using cached Pillow-3.3.1-cp35-cp35m-win32.whl Collecting
pyscreeze (from pyautogui) Using cached PyScreeze-0.1.8.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\setup.py",
line 6, in
version=import('pyscreeze').version,
File "c:\users\home\appdata\local\temp\pip-build-kxm3249e\pyscreeze\pyscreeze__init__.py",
line 21, in
from PIL import Image
ImportError: No module named 'PIL'
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\ | false | 39,544,944 | 0.066568 | 0 | 0 | 2 | Instead of letting PyautoGUI get all the packages for you.
Install all of them individually. Then, run the pip install --upgrade _packageName_
Then run pip install pyautogui.
Hope this helps. | 1 | 10,149 | 0 | 3 | 2016-09-17T09:03:00.000 | python,pip,pyautogui | Installing PyAutoGUI Error in pip.exe install pyautogui | 0 | 3 | 6 | 40,112,934 | 1 |
0 | 1 | I'm working on a project that involves creating CUDA kernels in Python. Numba works quite well (what these guys have accomplished is quite incredible), and so does PyCUDA.
My problem is that I want to call a C device function from my Python generated kernel. I couldn't find a way to accomplish this. Numba can call CFFI modules but only in CPU code. In PyCUDA I can add my C device functions to the SourceModule, but I couldn't figure out how to include functions that already exist in another library.
Is there a way to accomplish this? | true | 39,555,235 | 1.2 | 0 | 0 | 2 | As far as I am aware, this isn't possible in either language. Neither exposes the necessary toolchain controls for separate compilation or APIs to do runtime linking of device code. | 0 | 604 | 0 | 2 | 2016-09-18T07:38:00.000 | python,cuda,cython,numba,pycuda | Calling a C++ CUDA device function from a Python kernel | 0 | 1 | 1 | 39,557,406 | 1 |
0 | 0 | I am a complete newbie to python transiting from C++.
While learning C++, I was explained that header files tells about the working of the function or define them to the compiler so that it understands what means what i.e., iostream contains the definition of cin (nd much more) so that the compiler knows that it is a keyword and understands its function.
However, python and java do not need header files.
So basically how does the compiler understands the actual meaning/function of 'print' or 'input' in python????? | true | 39,576,478 | 1.2 | 1 | 0 | 4 | Header files in C/C++ are a "copy paste" mechanism. The included header file is literally written into the file while preprocessing (copy pasting the source code together).
After that is done, the compiler transaltes the source code. The linker then connects the function calls.
That is somewhat outdated and error prone -> can be really frustrating as well when sth doesnt work as expected.
Newer languages have module systems, which are nicer (import simply does it). | 1 | 2,209 | 0 | 2 | 2016-09-19T15:08:00.000 | python | Why Python and java does not need any header file whereas C and C++ needs them | 0 | 3 | 3 | 39,576,570 | 1 |
0 | 0 | I am a complete newbie to python transiting from C++.
While learning C++, I was explained that header files tells about the working of the function or define them to the compiler so that it understands what means what i.e., iostream contains the definition of cin (nd much more) so that the compiler knows that it is a keyword and understands its function.
However, python and java do not need header files.
So basically how does the compiler understands the actual meaning/function of 'print' or 'input' in python????? | false | 39,576,478 | 0.066568 | 1 | 0 | 1 | In Java and Python we use a similar keyword called import to add a package and use the methods in it. But in advanced languages like Java and Python few packages are imported by default.
e.g. in Java java.lang.* is imported by default. | 1 | 2,209 | 0 | 2 | 2016-09-19T15:08:00.000 | python | Why Python and java does not need any header file whereas C and C++ needs them | 0 | 3 | 3 | 39,576,943 | 1 |
0 | 0 | I am a complete newbie to python transiting from C++.
While learning C++, I was explained that header files tells about the working of the function or define them to the compiler so that it understands what means what i.e., iostream contains the definition of cin (nd much more) so that the compiler knows that it is a keyword and understands its function.
However, python and java do not need header files.
So basically how does the compiler understands the actual meaning/function of 'print' or 'input' in python????? | false | 39,576,478 | -0.066568 | 1 | 0 | -1 | Java and Python have import which is similar to include.
Some inbuilt functions are built in and hence does not require any imports. | 1 | 2,209 | 0 | 2 | 2016-09-19T15:08:00.000 | python | Why Python and java does not need any header file whereas C and C++ needs them | 0 | 3 | 3 | 39,576,524 | 1 |
0 | 0 | Is it possible to create a user interface without the help of python framework (like tinker or pygame) and use only vanilla python code? If yes, how?
Can you briefly explain how python framework works?
Is the code of different python framework different?
If the computer did not have the framework installed, will the program still runnable if the program uses a framework?
Thanks very much | false | 39,654,954 | 0.099668 | 0 | 0 | 1 | Yes, after all tinker and pygame are just python classes packaged as modules.
Python frameworks are a bunch of pre-tested and reusable modules that allow you to use and extend upon so you don't have to reinvent the wheel.
Yes, frameworks will have differences in usability and code.
The computer will always need the dependencies, though you can package these in various ways aka create a package that has all your dependencies for the program to run. | 1 | 4,330 | 0 | 2 | 2016-09-23T07:21:00.000 | python,user-interface,frameworks | Making GUI with only python without framework? | 0 | 1 | 2 | 39,655,710 | 1 |
0 | 0 | I have an image editor created in tkinter. However, I would add a floating widgets that exist in PyQt. Is there any way to run integrated tkinter with PyQt? | false | 39,679,473 | 0 | 0 | 0 | 0 | No, there is no way to combine widgets from PyQt and Tkinter in a single app. At least, not without resorting to running each toolkit in a separate thread or process. You can't embed the widgets of one into the widgets of the other. | 0 | 367 | 0 | 1 | 2016-09-24T18:09:00.000 | python,tkinter,pyqt,pyqt4 | Using widgets intregrated. PyQT with Tkinter | 0 | 2 | 2 | 39,681,979 | 1 |
0 | 0 | I have an image editor created in tkinter. However, I would add a floating widgets that exist in PyQt. Is there any way to run integrated tkinter with PyQt? | false | 39,679,473 | 0.099668 | 0 | 0 | 1 | I make a workaround that solved the problem. I used python subprocess for call the PyQT instance and the option QtCore.Qt.WindowStaysOnTopHint for app running on top of tkinter. It´s work.
but the best solution is to create a thread in python and call PyQt in this thread. In this case it is possible to pass an instance of tk for PyQt and make communication between the two. It´s work too. It´s fine. | 0 | 367 | 0 | 1 | 2016-09-24T18:09:00.000 | python,tkinter,pyqt,pyqt4 | Using widgets intregrated. PyQT with Tkinter | 0 | 2 | 2 | 39,689,904 | 1 |
1 | 0 | I have a model called widgetManager and 2 widget models called emailWidget and TextWidget. Now a single instance of widgetManager can have multiple instances of emailWidget and TextWidget. How can this be achieved with the following in mind
Till now i only have two but there can be more in future
The order of widget is very important
I have tried with adding two many-many relations in widgetManager but that seems impractical and not the best way to go around because if first condition.
What i have in mind is maybe i can somehow make a base widget class and extend all the widgets from that class but i am not sure about that. Would be super helpful if someone can point me in the right direction. Thanks in advance. | true | 39,691,679 | 1.2 | 0 | 0 | 1 | If I understood your description correctly, you want a relationship where there can be many emailWidget or TextWidget for one instance of widgetManager.
What you can do in this case is add a ForeignKey field for widgetManager to emailWidget and TextWidget. This way, you can have many instances of the widgets while they refer to the same manager.
I think you may have confused inheritance with model relationships when you said you want to extend widgets from a base class. Perhaps I'm wrong?
Not sure what you mean't about order of the widget being important either.. | 0 | 27 | 0 | 0 | 2016-09-25T20:46:00.000 | python,django,django-models | Proper model defination in django for a widget manager | 0 | 1 | 1 | 39,692,799 | 1 |
0 | 0 | I'm currently using PyGame to build games on python, however exporting becomes rather difficult as Py2Exe and Py2App are almost the only ways to do so and are not very effective. I tried to using the wonderful exporting mechanic in Processing (in Python mode), but this opened a Pandora's box of problems.
How do you import modules in Processing.py ? I read that if the module is in the form of a PY file it is simply to be located in the same folder as the sketch. But some modules, like PyGame, are more complex and require an installer or a wheel (WHL file, which is installed through PIP).
During some testing, I tried to export a simple one-line program ( print('a') ) but the 'application.windows64' folder was missing an EXE file. I'm not an expert, but I think that might be a problem :)
Thanks in advance! | true | 39,713,752 | 1.2 | 0 | 0 | 2 | processing.py is not compatible with CPython (native python), nor with any c-language modules. | 1 | 218 | 0 | 1 | 2016-09-26T23:12:00.000 | python,python-3.x,export,processing | Importing Complex Modules into Processing.py | 0 | 1 | 1 | 40,960,287 | 1 |
0 | 0 | tkMessageBox.askyesno('Title', 'Message', icon=tkMessageBox.WARNING) on OS X just gives me the rocket icon.
I know there is some weirdness with OS X and tkMessageBox icons because tkMessageBox.showerror() just shows the rocket icon, but tkMessageBox.showwarning shows a yellow triangle (with a small rocket in the corner)
Is this is a bug?
Is there some workaround to get a warning triangle and Yes/No buttons without having to resort to making my own message box window from scratch? | false | 39,756,822 | 0.197375 | 0 | 0 | 2 | You can use icon='warning' instead of icon=tkMessageBox.WARNING
I just tried that on Windows. Sorry I don't have OSX to test | 0 | 1,338 | 0 | 4 | 2016-09-28T20:12:00.000 | python,macos,tkinter,tkmessagebox | Why can't I change the icon on a tkMessagebox.askyesno() on OS X? | 0 | 1 | 2 | 69,845,490 | 1 |
0 | 0 | I'm making a program on the Raspberry Pi with a touchscreen display.
I'm using Python Tkinter that has two entry widgets and one on screen keypad. I want to use the same keypad for entering data on both entry widgets.
Can anyone tell me how can i check if an entry is selected? Similar like clicking on the Entry using the mouse and the cursor appears. How can I know that in Python Tkinter?
Thank you. | true | 39,768,925 | 1.2 | 0 | 0 | 2 | There is always a widget with the keyboard focus. You can query that with the focus_get method of the root window. It will return whatever widget has keyboard focus. That is the window that should receive input from your keypad. | 0 | 1,831 | 0 | 1 | 2016-09-29T11:23:00.000 | python,tkinter,raspberry-pi,touchscreen,raspberry-pi3 | Check if Entry widget is selected | 0 | 1 | 2 | 39,770,561 | 1 |
0 | 0 | I finish a GTK interface with GTK3.18,and it works well,but when i change to GTK3.14 version,the interface turn out to be very bad,the size and the colore of the widgets is changed,and i find there is no enough information about the GTK3.14 version. | false | 39,855,273 | 0.197375 | 0 | 0 | 1 | The CSS 'api' was basically undocumented and unstable before 3.20 so there isn't really any reasonable way to support all versions before it unless you make a separate theme for each version. | 0 | 48 | 0 | 0 | 2016-10-04T14:44:00.000 | python,css,gtk | what's the difference between GTK 3.14 and 3.18 on the css load | 0 | 1 | 1 | 39,872,085 | 1 |
0 | 0 | So i'm programming python program that uses wxPython for UI, with wx.TreeCtrl widget for selecting pictures(.png) on selected directory. I would like to add hover on treectrl item that works like tooltip, but instead of text it shows bitmap picture.
Is there something that already allows this, or would i have to create something with wxWidgets?
I am not too familiar with wxWidgets, so if i have to create something like that how hard would it be, lot of code is already using the treectrl, so it needs to be able to work same way.
So how would i have to go about doing this? And if there might be something i might be missing id be happy to know. | true | 39,891,681 | 1.2 | 0 | 0 | 1 | Take a look at the wx.lib.agw.supertooltip module. It should help you to create a tooltip-like window that displays custom rich content.
As for triggering the display of the tooltip, you can catch mouse events for the tree widget (be sure to call Skip so the tree widget can see the events too) and reset a timer each time the mouse moves. If the timer expires because the mouse hasn't been moved in that long then you can use tree.HitTest to find the item that the cursor is on and then show the appropriate image for that item. | 0 | 160 | 0 | 0 | 2016-10-06T08:54:00.000 | python,bitmap,wxpython | wxpython treectrl show bitmap picture on hover | 0 | 1 | 1 | 39,901,257 | 1 |
0 | 0 | I have written a simple application and deployed it on Sony Xperia Z and Galaxy Prime devices. On both it's really very hard (I've got to click many times before it reacts) to:
put focus on a TextInput
select a ToggleButton
click a Button
etc.
The same time a ScrollView (that is the container for the mentioned widgets) works perfectly smooth. And when run on desktop then it's alright.
I use kivy 1.9.1, python 2.7, build on Ubuntu 16 using buildozer. Don't know what else could I say... (Let me know, please)
Have you experienced such an issue? | true | 39,925,847 | 1.2 | 0 | 0 | 3 | You should update to kivy 1.9.2-dev, the problem is fixed there. In buildozer.spec file, write requirement kivy==master. | 0 | 77 | 0 | 0 | 2016-10-07T21:09:00.000 | android,python,kivy | Kivy - hard to select Widgets | 0 | 1 | 1 | 39,929,515 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0 | 0 | 0 | 0 | just go on cmd and type pip intall Tk interface,
i thinks this is the full true name of tkinter module | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 68,200,579 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0 | 0 | 0 | 0 | I had to install python3-tk manually before it worked (via apt-get) | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 52,298,239 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.014285 | 0 | 0 | 1 | This just has to do with the version changes
python 2.x: import tkinter as tk
python 3.x: import Tkinter as tk | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 67,446,536 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.028564 | 0 | 0 | 2 | On a MacBook use brew install python-tk
The error will be sorted out. | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 67,346,820 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.028564 | 0 | 0 | 2 | import Tkinter as tk
Python 3 changed tkinter (from python 2.7) to Tkinter | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 66,579,584 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.028564 | 0 | 0 | 2 | to find your package run:
sudo yum search python|grep tk
mine was:
yum install python3-tkinter.x86_64 | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 55,162,847 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0 | 0 | 0 | 0 | pip shown
Could not find a version that satisfies the requirement python--tkinter (from versions: )
No matching distribution found for python--tkinter
You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the python -m pip install --upgrade pip command. | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 55,540,040 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.014285 | 0 | 0 | 1 | import Tkinter as tk
Notice the T. This was changed in python 3.x | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 67,800,600 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.042831 | 0 | 0 | 3 | Follow this guide to install "tkinter". However now with Python version 3.1 onwards, it is part of the standard python distribution.
You can also install it using sudo apt-get install python3-tk-dbg, if you are in virtualenv. (Same can be done for normal installation, not just virtualenv) | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 52,841,363 | 1 |
0 | 0 | I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:)
No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem? | false | 39,928,710 | 0.014285 | 0 | 0 | 1 | I was able to fix this on Amazon Linux 2 with python2.7 by running this sudo yum install python-tools -y command. | 1 | 98,413 | 0 | 41 | 2016-10-08T04:33:00.000 | python,tkinter,module | Why is there no tkinter distribution found? | 0 | 10 | 14 | 62,074,234 | 1 |
0 | 0 | I've made an app using the Kivy cross-platform tool and I built the apk file using python-for-android. I want to store a secret-key locally in the application but since the apk file can be disassembled, How can I make sure my secret-key is safe? | false | 39,939,523 | 0.099668 | 0 | 0 | 1 | You can't secure it because after, p4a compiles it into private.mp3.
You can rename that file from private.mp3 to private.tar.gz and still get access to all the codes and information. | 0 | 353 | 0 | 0 | 2016-10-09T02:52:00.000 | android,python,security,kivy | Securing android application made by kivy | 0 | 2 | 2 | 61,085,242 | 1 |
0 | 0 | I've made an app using the Kivy cross-platform tool and I built the apk file using python-for-android. I want to store a secret-key locally in the application but since the apk file can be disassembled, How can I make sure my secret-key is safe? | true | 39,939,523 | 1.2 | 0 | 0 | 0 | After dissembling my apk file, I figured out that python-for-android stores all of its stuff including the python installation and the project itself in a binary file named private.mp3 so the source is not fully open and I might be good to go. | 0 | 353 | 0 | 0 | 2016-10-09T02:52:00.000 | android,python,security,kivy | Securing android application made by kivy | 0 | 2 | 2 | 40,034,392 | 1 |
0 | 0 | I want to compare two screenshots containing text. Basically both the screenshots contains some pretty formatted text. I want to compare if the same formatting being reflected in both the pictures as well as same text appearing at same location in both images.
How I am doing it right now is -
Apply bilateral filters to remove the underlines of text.
Apply threshold with value 180 as min value and clear them out
Apply Gaussian blur on the image to remove the unfilled space between the characters.
Apply threshold again with value 250 as min value.
Compute contours in the images
Draw rectangle bounding box around contours
use O(n^2) algo to find out max overlapped rectangle and compare text within it.
However the problem is the contours appearing in both the images are different, i.e. in one of the image number of contours are 38 while other contains 53. I want to have a generic solution and don't want to depend upon the image content. However one thing for sure is the image is containing a well formatted text.
Thanks | false | 40,019,315 | 0 | 0 | 0 | 0 | I'm not sure to understand what do you want exactly but to get bounding box around word in image, i could do this :
Apply processing to get good a thresholding : only text, background in black, text in white. This step depends on the type and quality of your image.
Compute the sum of each line. The sum should be different from 0 where there is text and all lines in the space between each line should be null (you can set a threshold on this value if there is some noise). You can find the top/bottom line for each text line
For each text line found in step 2, compute the sum of each columns. Same than step two, columns with word should be different from 0. You can find all spaces between words and letters. Remove all spaces which are too small to be a space between two words.
Congratulation you have the top/bottom line and first/last columns of each words. | 0 | 1,329 | 0 | 0 | 2016-10-13T11:07:00.000 | python,opencv,image-processing | putting bounding box around text in a image | 0 | 1 | 1 | 40,022,760 | 1 |
0 | 0 | I am creating a graphical interface with glade that contents a treeview.
I want to have a button that is initially enabled by doing a simple click on a row of the treeview.
I am using row-activated, but when I activate a row for the first time I have to double click the row.
Which signal should I use to detect the click to activate the row with a single click? | false | 40,033,539 | 0.099668 | 0 | 0 | 1 | I know this is an old question, but for future reference, for Python3 and Gtk3 what worked for me was:
myTree.set_property('activate-on-single-click', True) | 0 | 721 | 0 | 2 | 2016-10-14T01:30:00.000 | python,signals,glade | Tree view row activated with ONE click | 0 | 1 | 2 | 57,244,185 | 1 |
0 | 0 | I am new to kivy. I want to know if there is a way to create a textinput with autocomplete functionality, that lets you select from a dictionary with 200 items.
Similar to the select2 that you have in HTML/CSS | false | 40,066,446 | 0.379949 | 0 | 0 | 2 | You can implement it yourself, just bind the on_text event and change the suggestion_text property. you may also check for TAB key press event to know when to change the text to the suggested completion. | 0 | 1,838 | 0 | 2 | 2016-10-16T03:12:00.000 | python-3.x,kivy | Kivy TextInput with autocomplete | 0 | 1 | 1 | 40,067,336 | 1 |
0 | 0 | I'm working on a text-based game in Python using Tkinter. All the time the window contains a Label and a few Buttons (mostly 3). If it didn't have GUI, I could just use Pickle or even Python i/o (.txt file) to save data and later retrieve it. But what is the best way to tell the program to load the exact widgets without losing bindings, buttons' commands, classes etc.? P.S.: Buttons lead to cleaning the frame of widgets and summoning new widgets. I'm thinking of assigning a lambda (button's command) to a variable and then saving it (Pickle?) to be able to load it in the future and get the right point in the plot. Should I go for it or is there a better, alternative way to accomplish the thing? (If using lambda may work, I'd still be grateful to see your way of doing that.) | false | 40,071,582 | 0.099668 | 0 | 0 | 1 | You need to save stuff in some kind of config file. In generel I'd recommend JSON and YAML as file formats also ini for ease of parsing.
Also, do not forget about the windows registry (portability lost then though). | 0 | 625 | 0 | 2 | 2016-10-16T14:46:00.000 | python,tkinter | In-game save feature (in tkinter game) | 0 | 1 | 2 | 40,071,607 | 1 |
0 | 0 | I want to make a game in panda3d with support for touch because I want it to be playable on my windows tablet also without attaching a keyboard.
What I want to do is, find a way to draw 2d shapes that don't change when the camera is rotated. I want to add a dynamic analog pad so I must be able to animate it when the d-pad is used with mouse/touch.
Any help will be appreciated | false | 40,077,546 | 0.379949 | 0 | 0 | 2 | Make those objects children of base.render2d, base.aspect2d or base.pixel2d. For proper GUI elements take a look at DirectGUI, for "I just want to throw these images up on the screen" at CardMaker. | 0 | 239 | 0 | 3 | 2016-10-17T02:09:00.000 | python,panda3d | How to draw onscreen controls in panda 3d? | 0 | 1 | 1 | 40,102,063 | 1 |
0 | 0 | I'd like to save the visibility state of a QDockWidget, when the dialog is closed. Even though, the widget is visible, isVisible will return false.
What to do?
Using Python (2.7 in my case) | false | 40,174,747 | 0.197375 | 0 | 0 | 1 | This might be the problem:
Maybe you call isVisible() from an onClose()-function. Means, your Widget was visible, but is not anymore, when you finally call the isVisible() function
Solution
Call isVisibleTo([ParentWidget]). This will give you the visibility value relative to e.g. your QMainWindow. | 0 | 725 | 0 | 1 | 2016-10-21T10:52:00.000 | python,qt | Python Qt: Check visibility of widget / isVisible always return false | 0 | 1 | 1 | 40,174,748 | 1 |
0 | 0 | I'm writing an app in Python 3.4 using tkinter. It is a timer but with two more functions.
When time reaches zero app will shutdown computer (its for windows os generally)
The timer can be stopped when user inputs correct password.
The main window is borderless with blocked Quit button when time is running. But I encountered new problem. Applications can be killed in task manager. So my question is: Is there some way to hide or block from killing process in task manager? | false | 40,208,629 | 0.197375 | 0 | 0 | 1 | OK, i have great idea. In my app for shutdown computer im using os.system('shutdown /p /f') but i could use different switches. shutdown /s /t xxx will do the same but in set time, and computer will shut because it will add scheduled task, and in task manager wont be name of my application which solves my problem :) And my application can be even closed, there is no need to make borderless window and using Quit button because 'shutdown' command works in background.
I hope it is not a problem that i by myself found answer for my question. At least i think ive found correct answer. Will check this when ill back from work.
I found 2 external programs that may help me, but i dont know how use them? Can anybody tell me how use nircmd or psexec? I need only shutdown function from them | 0 | 306 | 0 | 0 | 2016-10-23T22:57:00.000 | python,tkinter | Is there some way to hide or block from kill app wrote in Python3.4? | 0 | 1 | 1 | 40,209,914 | 1 |
0 | 0 | python2.7
when I import Tkinter, it prompt no module named _tkinter, I don't have the limits of administrator, so I install tcl and tk, then recompile python with --with-tcltk-includes and --with-tcltk-libs parameter, but when running 'make', the error """*** WARNING: renaming "_tkinter" since importing it failed: build/lib.linux-x86_64-2.7/_tkinter.so: undefined symbol: Tk_Init""" occurred, I really don't know how to deal with it
can somebody help me?
thanks! | false | 40,214,784 | 0 | 0 | 0 | 0 | I had the same exact issue with Python-3.4.3. I followed Brice's solution and got halfway there. Not only did I require the -l flags after the -L flag as he suggested, but I discovered my LD_LIBRARY_PATH was inadequate when performing the 'make altinstall'. Be sure to include the same directory in LD_LIBRARY_PATH as used in your -L flag entry. | 0 | 648 | 0 | 0 | 2016-10-24T09:19:00.000 | python-2.7,tkinter | undefined symbol: Tk_Init | 0 | 1 | 2 | 50,161,426 | 1 |
0 | 0 | In normal Python (3.x) we always use showerror() from the tkinter module to display an error message but what should I do in PyQt5 to display exactly the same message type as well? | false | 40,227,047 | 0.132549 | 0 | 0 | 4 | Assuming you are in a QWidget from which you want to display an error message, you can simply use QMessageBox.critical(self, "Title", "Message"), replace self by another (main widget for example) if you are not is a QWidget class. | 0 | 56,321 | 0 | 20 | 2016-10-24T20:32:00.000 | python,message,messagebox,pyqt5 | Python PyQt5: How to show an error message with PyQt5 | 0 | 1 | 6 | 60,393,444 | 1 |
0 | 0 | I am working on a virtual console, which would use the systems builtin commands and then do the action and display output results on next line in console. This is all working, but how do I get the contents of the last line, and only the last line in the tkinter text widget? Thanks in advance. I am working in python 3.
I have treed using text.get(text.linestart, text.lineend) To no avail. Have these been deprecated? It spits out an error saying that AttributeError: 'Text' object has no attribute 'linestart' | true | 40,251,259 | 1.2 | 0 | 0 | 1 | You can apply modifiers to the text widget indicies, such as linestart and lineend as well as adding and subtracting characters. The index after the last character is "end".
Putting that all together, you can get the start of the last line with "end-1c linestart". | 0 | 2,994 | 0 | 3 | 2016-10-25T23:19:00.000 | python,python-3.x,tkinter,console | How to get the contents of last line in tkinter text widget (Python 3) | 0 | 2 | 2 | 40,251,792 | 1 |
0 | 0 | I am working on a virtual console, which would use the systems builtin commands and then do the action and display output results on next line in console. This is all working, but how do I get the contents of the last line, and only the last line in the tkinter text widget? Thanks in advance. I am working in python 3.
I have treed using text.get(text.linestart, text.lineend) To no avail. Have these been deprecated? It spits out an error saying that AttributeError: 'Text' object has no attribute 'linestart' | false | 40,251,259 | 0 | 0 | 0 | 0 | Test widget has a see(index) method.
text.see(END) will scroll the text to the last line. | 0 | 2,994 | 0 | 3 | 2016-10-25T23:19:00.000 | python,python-3.x,tkinter,console | How to get the contents of last line in tkinter text widget (Python 3) | 0 | 2 | 2 | 56,634,803 | 1 |
0 | 0 | I am making a hand controlled media player application in Python and through OpenCV.I want to embed gesture window of OpenCV in Tkinter frame so I can add further attributes to it.
Can someone tell how to embed OpenCV camera window into Tkinter frame? | true | 40,269,957 | 1.2 | 0 | 0 | 0 | OpenCV window in Tkinter window is not good idea. Both windows use own mainloop (event loop) which can't work at the same time (or you have to use threading) and don't have contact one with other.
Probably it is easier to get video frame and display in Tkinter window on Label or Canvas. You can use tk.after(miliseconds, function_name) to run periodically function which will update video frame in Tkinter window. | 0 | 747 | 0 | 0 | 2016-10-26T18:46:00.000 | python,opencv,tkinter | opencv window in tkinter frame | 0 | 1 | 1 | 40,271,580 | 1 |
0 | 0 | I have coded a program in Python 3.5 that uses the Tkinter import. I'm trying to figure out a way to run it on computers that don't have Python. First I tried freezing it but I haven't been able to because none of the freezing tools I found support Python 3.5. Then I tried possibly using a online idle but I couldn't find any that support Tkinter. I would prefer to be able to get a .exe file or something similar but if I could run it online that would be good too any ideas?
EDIT
So I have now successfully downloaded PyInstaller using pip. My current problem is when I type this into the console: pyinstaller.exe --onefile --windowed Finder.py
I get this error: 'pyinstaller.exe' is not recognized as an internal or external command,
operable program or batch file.
EDIT
I have now found the pathway to pyinstaller.exe. Now when I try to use it it says Access is denied. | false | 40,325,067 | 0 | 0 | 0 | 0 | Try pyinstaller -F -w Finder.py as the command or you could check out CxFreeze. | 1 | 1,343 | 0 | 1 | 2016-10-30T00:46:00.000 | python,tkinter,python-3.5,cx-freeze | How do I run a Python 3.5 program that uses Tkinter on a computer without Python installed? | 0 | 2 | 3 | 40,326,006 | 1 |
0 | 0 | I have coded a program in Python 3.5 that uses the Tkinter import. I'm trying to figure out a way to run it on computers that don't have Python. First I tried freezing it but I haven't been able to because none of the freezing tools I found support Python 3.5. Then I tried possibly using a online idle but I couldn't find any that support Tkinter. I would prefer to be able to get a .exe file or something similar but if I could run it online that would be good too any ideas?
EDIT
So I have now successfully downloaded PyInstaller using pip. My current problem is when I type this into the console: pyinstaller.exe --onefile --windowed Finder.py
I get this error: 'pyinstaller.exe' is not recognized as an internal or external command,
operable program or batch file.
EDIT
I have now found the pathway to pyinstaller.exe. Now when I try to use it it says Access is denied. | true | 40,325,067 | 1.2 | 0 | 0 | 3 | I finally figured it out after about three days of work. Fist I downloaded PyInstaleller in the zipped form and extracted it. Then I put my program in the PyInstaller folder. Then I opened a regular command prompt. I then typed cd then the location of the PyInstaller folder. Finally I typed pyinstaller.py --one file --windowed program.py. Then when I went into the PyInstaller folder there was a folder called program with the .exe file in the dist folder. Thanks everyone for all of your help! | 1 | 1,343 | 0 | 1 | 2016-10-30T00:46:00.000 | python,tkinter,python-3.5,cx-freeze | How do I run a Python 3.5 program that uses Tkinter on a computer without Python installed? | 0 | 2 | 3 | 40,349,880 | 1 |
0 | 0 | i have to double an image using python,
So i think i can replace each pixel of the image with a square formed by 4 pixels
how do i can do that and assign to each pixel of the little square different colors? | true | 40,341,471 | 1.2 | 0 | 0 | 0 | Is that a homework ? Working with a new target image, as suggested in the comments, is the easiest.
But theoretically, assuming your original image is represented as some 2 dimension table of pixels, you could do it without creating a new image:
First double both dimensions of the original image (with the original image staying on "upper left" and occupying 1/4 of the new image, and filling the other 3/4 with blank or any value).
Then take the lower right pixel from the original image, and write 4 identical pixels in the lower right of the resized image.
Then take the original pixel directly at the the left of the previous original pixel, copy it on the 4 pixels directly at the left of the 4 previous new pixels. Repeat until you reach the left end of the line, then start the process again on the line above.
At some point you will overwrite pixels from the original image, but that doesn't matter since you will already have duplicated those in the new image.
That's pure theory, assuming you are not allowed to use external libraries such as Pillow. | 1 | 1,504 | 0 | 1 | 2016-10-31T11:41:00.000 | python,image,python-3.x,python-3.5 | Double an image using python | 0 | 1 | 1 | 40,343,522 | 1 |
0 | 0 | I've created a gameboy color emulator using C++ and am ready to start developing the frontend that will display the emulator's viewport, emit audio, and also display some debug information.
I'm looking into using Kivy to create the UI frontend and boost.python (which looks pretty promising) to interop between the C++ core and the python UI.
What I would like to have in my front end are:
A window to show the emulator graphics. More specifically something that let's me update a raw bitmap (i.e. raw pixel data) on each frame.
A window to display some debug information. More specifically I want a large scrollable text box to show the disassembled code and another one to show the memory.
A way to emit audio that's generated by the emulator. The core doesn't support audio yet so I'm not sure what it'll look like on the C++ side.
Accept keyboard input to control the game.
Will Kivy allow me to do all of this? I see that it has dependencies on glew and sdl2 which should take care of the graphics and audio requirements, right? Are there widgets that will let me create the disassembly and memory viewer? | true | 40,355,881 | 1.2 | 0 | 0 | 1 | A window to show the emulator graphics, update a raw bitmap on each frame
Not sure how exactly, but you have access to textures and to a huge part of OpenGL through Kivy and Python, so this could be doable.
A window to display some debug information, large scrollable text box
Use RecycleView and Label's core. There's an example for ListView, but since the new changes it's kind of broken. However, in a similar way it could be done for RecycleView
A way to emit audio that's generated by the emulator
Should work without problems if you can pass it to the provider. The only issue I see with built-in audio support in Kivy is pause and seek, because those afaik either aren't implemented (most probably) or are broken. However with Gstreamer it should work.
Accept keyboard input to control the game.
Keyboard and multitouch work out of the box with Kivy, you only need to (for keyboard) extend one method and (for touch) check for collisions with Widgets
Are there widgets that will let me create the disassembly and memory viewer?
No. At least none that I know will do that out of the box. If by disassembly you mean text, dump it into a widget that can handle text. Memory viewer however isn't there and you'll need to create your own widget. That's not hard if you work with Kivy at least for a while.
Kivy by default doesn't do 3D. There are "plugins" that can allow you such thing, but I don't see any that's still maintained so there's this thing. Also I see the code isn't C, but C++ so I'm not sure how to bind those together. Cython should be the rescue here ^^ | 0 | 253 | 0 | 0 | 2016-11-01T07:38:00.000 | python,c++,kivy | Is it feasible to create an emulator front-end using Kivy? | 0 | 1 | 1 | 40,359,340 | 1 |
0 | 0 | I am the sole Matlab user on a team of C++/C# developers. I am transitioning to Python, and was hoping that Cython could help me bridge the gap between my work and my colleagues' work.
I originally thought that Cython could be used to compile Python code to a C source file, which could then be imported/called from Python. I was hoping for two benefits from this:
A speed boost in my programs, and
A C source file that could be handed off to my colleagues for some slight polishing and then ultimately implemented in their (C++/C#) packages.
Unfortunately, it looks like the latter is not an option, but I'm not positive. It looks like the C source file is very bloated with lots of references to Python. I have a three-line Python script that declares a cdef char*, assigns the string "hello world!" to that variable, then prints it. The resulting C file is 2000 lines long.
So, my question is, is benefit #2 unobtainable with Cython? Is the C code generated with Cython only intended to be used by Python, or is there a way to remove the Python bloat and get a concise C translation of the Python code? | true | 40,363,937 | 1.2 | 0 | 0 | 6 | Cython's output is not intended for human consumption
Cython treats C as an intermediate language, in much the same way as LLVM treats LLVM IR as an intermediate language. Cython's purpose is to produce Python extension modules, and C is just the most reasonable means to that end. It will generally produce a maze of twisty little preprocessor directives, all totally unreadable. You should not use Cython if you want C code that you can read. | 1 | 430 | 0 | 3 | 2016-11-01T16:07:00.000 | python,c++,c,cython | Is Cython used for building C code or is it used for building Python extensions? | 0 | 1 | 1 | 40,364,443 | 1 |
0 | 0 | I have a problem shown below that wants to find the quickest way to get between any two points by using only the moves of a knight in chess. My first thought was to us the A* algorithm or Dijkstra's algorithm however, I don't know how to make sure only the moves of a knight are used. I would appreciate it if you could suggest a better algorithm or just some tips to help me. Thank you.
Write a function called answer(src, dest) which takes in two parameters: the source square, on which you start, and the destination square, which is where you need to land to solve the puzzle. The function should return an integer representing the smallest number of moves it will take for you to travel from the source square to the destination square using a chess knight's moves (that is, two squares in any direction immediately followed by one square perpendicular to that direction, or vice versa, in an "L" shape). Both the source and destination squares will be an integer between 0 and 63, inclusive, and are numbered like the example chessboard below:
-------------------------
| 0| 1| 2| 3| 4| 5| 6| 7|
-------------------------
| 8| 9|10|11|12|13|14|15|
-------------------------
|16|17|18|19|20|21|22|23|
-------------------------
|24|25|26|27|28|29|30|31|
-------------------------
|32|33|34|35|36|37|38|39|
-------------------------
|40|41|42|43|44|45|46|47|
-------------------------
|48|49|50|51|52|53|54|55|
-------------------------
|56|57|58|59|60|61|62|63|
------------------------- | false | 40,454,897 | 0.049958 | 0 | 0 | 1 | For this problem, simply doing a breadth-first search is enough (Dijkstra and BFS work in same way for unweighted graphs). To ensure that only the chess knight's moves are used, you'll have to define the moves in a proper way.
Notice that a chess knight moves two squares to any direction, then one square perpendicular to that. This means it can move two squares left of right then one square up or down, or two squares up or down then one square left or right.
The calculation will be much easier if you identify the cells by rows (0 - 7) and columns (0 - 7) instead of 0 - 63. This can be done easily by dividing the cell index by 8 and using the quotient and remainder as row and column indices. So, if the knight is at position (x, y) now, its next possible positions can be any of (x - 2, y - 1), (x - 2, y + 1), (x + 2, y - 1), (x + 2, y + 1), (x - 1, y - 2), (x - 1, y + 2), (x + 1, y - 2), (x + 1, y + 2). Be careful that all of these 8 cells may not be inside the grid, so discard the locations that falls out of the board. | 0 | 1,507 | 0 | 1 | 2016-11-06T21:47:00.000 | python,algorithm,path-finding | Simple algorithm to move from one tile to another using only a chess knight's moves | 0 | 3 | 4 | 40,458,170 | 1 |