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 am building a file browser using Gtk.IconView in python. I am trying to find the path of an icon selected using " selection-changed" signal using gtk.IconView.get_path_at_pos(x,y).
The docs are mum on how to obtain the (x,y). How do I find them?
using python 2.7 and pygtk 2.24 | true | 22,940,269 | 1.2 | 0 | 0 | 1 | You don't use get_path_at_pos. It is meant for cases where you handle the button presses directly (which you should avoid unless you really have good reasons to do so).
Simply use gtk_icon_view_get_selected_items (C) or the pygtk equivalent iconview.get_selected_items() which gives you a list (in C a GList) of currentl... | 0 | 84 | 0 | 0 | 2014-04-08T14:35:00.000 | python,gtk | Finding Mouse click position in IconView in GTK | 0 | 1 | 1 | 22,942,890 | 1 |
0 | 0 | Is there a way to have a ListCtrl cell span several columns? Or perhaps to able to append a panel / other element to a ListCtrl item that will contain the info I need? | true | 22,948,589 | 1.2 | 0 | 0 | 1 | No. The ListCtrl does not support that functionality. There is a pure Python list control widget called the UltimateListCtrl that allows you add any widget to a cell, although it doesn't appear to allow cell spanning either. I would still try this widget and see if it works for you. If it does not, you may be able to p... | 0 | 30 | 0 | 0 | 2014-04-08T21:30:00.000 | python-2.7,wxpython | Possible for ListCtrl Colspan, or similar functionality? | 0 | 1 | 1 | 22,968,522 | 1 |
0 | 0 | I have a QGLWidget in which openGL objects are created. I want to get better anti-aliasing than I have now by using glutInitDisplayMode(GLUT_DOUBLE | GLUT_MULTISAMPLE | GLUT_DEPTH).
How can I impliment this function (in python)? | true | 22,961,926 | 1.2 | 0 | 0 | 1 | Qt is an application framework that implements the GUI event loop. GLUT is an application, that implements the GUI event loop. There can be only one GUI event loop in a process. Hence Qt and GLUT can not be mixed.
Just configure QGLWidget with multisampling. Create a QGLFormat instance, call setSampleBuffers(true) on i... | 0 | 238 | 0 | 1 | 2014-04-09T12:03:00.000 | python,opengl,glut,antialiasing,qglwidget | How can I use glutInitDisplayMode() in a QGLWidget, so I can get anti-aliasing? | 0 | 1 | 1 | 22,969,282 | 1 |
0 | 0 | I am creating an application in Python that uses SQLite databases and wxPython. I want to implement it using MVC in some way. I am just curious about threading. Should I be doing this in any scenario that uses a GUI? Would this kind of application require it? | false | 22,999,993 | 0.049958 | 0 | 0 | 1 | You will use multithreading to perform parallel or background tasks that you don't want the main thread to wait, you don't want it to hang the GUI while it runs, or interfer with the user interactivity, or some other priority tasks.
Most applications today don't use multithreading or use very little of it. Even if they... | 1 | 106 | 0 | 1 | 2014-04-10T22:08:00.000 | python,multithreading,model-view-controller,python-multithreading | When should I be considering using threading | 0 | 4 | 4 | 23,000,219 | 1 |
0 | 0 | I am creating an application in Python that uses SQLite databases and wxPython. I want to implement it using MVC in some way. I am just curious about threading. Should I be doing this in any scenario that uses a GUI? Would this kind of application require it? | false | 22,999,993 | 0.049958 | 0 | 0 | 1 | Actually, GUIs are typically single threaded implementations where a single thread (called UI thread) keeps polling for events and keeps executing them in the order they occur.
Regarding the main question, consider this scenario.
At the click of a button you want to do something time consuming that takes say 5-10 seco... | 1 | 106 | 0 | 1 | 2014-04-10T22:08:00.000 | python,multithreading,model-view-controller,python-multithreading | When should I be considering using threading | 0 | 4 | 4 | 23,000,279 | 1 |
0 | 0 | I am creating an application in Python that uses SQLite databases and wxPython. I want to implement it using MVC in some way. I am just curious about threading. Should I be doing this in any scenario that uses a GUI? Would this kind of application require it? | true | 22,999,993 | 1.2 | 0 | 0 | 0 | almost certainly you already are...
alot of wx is already driven by an asynchronous event loop ..
that said you should use wx.PubSub for communication within an MVC style wx Application, but it is unlikely that you will need to implement any kind of threading (you get it for free practically)
a few good places to pytho... | 1 | 106 | 0 | 1 | 2014-04-10T22:08:00.000 | python,multithreading,model-view-controller,python-multithreading | When should I be considering using threading | 0 | 4 | 4 | 23,000,020 | 1 |
0 | 0 | I am creating an application in Python that uses SQLite databases and wxPython. I want to implement it using MVC in some way. I am just curious about threading. Should I be doing this in any scenario that uses a GUI? Would this kind of application require it? | false | 22,999,993 | 0.049958 | 0 | 0 | 1 | One thing I learned from javascript/node.js is that there is a difference between asynchronous programming and parallel programming. In asynchronous programming you may have things running out of sequence, but any given task runs to completion before something else starts running. That way you don't have to worry abo... | 1 | 106 | 0 | 1 | 2014-04-10T22:08:00.000 | python,multithreading,model-view-controller,python-multithreading | When should I be considering using threading | 0 | 4 | 4 | 23,000,216 | 1 |
0 | 0 | I'm trying to solidify my python knowledge by doing some gui development, should I try Tkinter or jump directly to PyQT for better IDE support? | false | 23,070,926 | 0.197375 | 0 | 0 | 2 | If your main goal is to solidify your python knowledge, I would recommend Tkinter. It's simpler and it's already installed with Python.
If you want to build complex applications, I recommend PyQt, which is way more powerful. | 0 | 2,947 | 0 | 2 | 2014-04-14T21:37:00.000 | python,user-interface,tkinter | Tkinter first or PyQt? | 0 | 1 | 2 | 23,071,223 | 1 |
0 | 0 | I apologize in advance for this being a bit vague, but I'm trying to figure out what the best way is to write my program from a high-level perspective. Here's an overview of what I'm trying to accomplish:
RasPi takes input from altitude sensor on serial port at 115000 baud.
Does some hex -> dec math and updates state ... | false | 23,097,604 | 0 | 1 | 0 | 0 | I don't think that RasPi would work that well running multithreaded programs. Try the first method, though it would be interesting to see the results of a multithreaded program. | 0 | 73 | 0 | 0 | 2014-04-16T01:51:00.000 | python,multithreading,buffer,raspberry-pi | How to structure my Python code? | 0 | 1 | 1 | 23,097,644 | 1 |
0 | 0 | I need to ask a question on how to set a development environment for Kivy under Windows 7. Normally i work with Kivy on Linux, but i need to develop an application for a client who uses Windows. From the Kivy documents, there are two alternatives:
1- Download and Unzip the file containing the Kivy environment plus the ... | true | 23,102,090 | 1.2 | 0 | 0 | 2 | I am using kivy on windows 7 . You can use option 1 . it wont damage your current python 2.7 because you can just change the path of environment to the python interpreter which comes with kivy .
in case you need to turn back to your older python installed just change the environment variables .
Ino order to add third ... | 1 | 879 | 0 | 1 | 2014-04-16T06:52:00.000 | android,windows,python-2.7,kivy | Kivy development environment on Windows 7 | 0 | 1 | 1 | 23,105,151 | 1 |
0 | 0 | I am currently in a project where a lot of 3D printing designs need to be done. They are all parameterized, so I'd like to write a python code to generate those design files (in .STL format) for me. I was wondering that, is there a python package that can do this? Because currently I am all doing those by hand using So... | false | 23,123,384 | 0.132549 | 0 | 0 | 2 | Yes, more than one.
In my humble experience, I tried many Open Source tools for parametric CAD modeling using Python (FreeCAD, Rhino-Grasshopper, Blender, Salome).
All of them are valid options and the best one is represented by your ability to either model or code.
I recently favour SALOME (www.salome-platform.org) b... | 1 | 5,404 | 0 | 4 | 2014-04-17T02:08:00.000 | python,rapid-prototyping | Is there a python library to generate STL file for 3D printing? | 0 | 1 | 3 | 36,361,624 | 1 |
0 | 0 | I have a python script that runs the GUI which is coded using Tkinter.
Problem is when i run the script, there are 2 windows opened. One is the GUI and other is the black console window.
I need to integrate both the windows so that when I start the script only one window appears.
Any ideas are much appreciated.
Thanks... | false | 23,141,471 | 0 | 0 | 0 | 0 | (I am pretty sure there is a better way, but) one way is to change the .pyc object file extension to .pyw and the console will not appear when you launch your GUI using the .pyw file. | 0 | 780 | 0 | 0 | 2014-04-17T19:07:00.000 | python,user-interface,console,tkinter,integration | Integration of console window with GUI using TkInter | 0 | 1 | 2 | 23,141,544 | 1 |
0 | 0 | I'm looking at using Kivy to create a program that needs to display a window on each monitor, is there a way to accomplish this? I'd also prefer not to have a single window spanning across.
If not, is there another (good looking, windows/linux) GUI toolkit that can accomplish this? | true | 23,178,570 | 1.2 | 0 | 0 | 8 | You can have two separate windows running two separate kivy apps controlling/communicating with each other via osc/twisted/... However one "App" instance is only limited to one App window for that process. It can launch another process(subprocess.popen) which has a new window though. | 0 | 1,500 | 0 | 5 | 2014-04-20T04:53:00.000 | python,user-interface,kivy | Multiple monitors with Kivy | 0 | 1 | 1 | 23,179,572 | 1 |
0 | 0 | I want to connect to a mySQL database with python, then query a number corresponding to an image, and load this image in Qt. From what I found online, it is suggested not to use mysql database to store the image, but instead store a file location on the server. If this is the case, can I load the image (do i have to ... | false | 23,190,976 | 0.197375 | 0 | 1 | 1 | You don't need to download the file using FTP (or the like) to load it into Qt.
Assuming the database stores the correct file path to the image, you can just use the same functionality once you get the file path, i.e. you anyway only need the file path to load the image into Qt. There is nothing special you would do by... | 0 | 421 | 0 | 0 | 2014-04-21T04:50:00.000 | python,mysql,pyqt | mySQL connection and loading images to Qt | 0 | 1 | 1 | 23,191,497 | 1 |
0 | 0 | I used to have PyGame installed on my PC but formatted my PC and now need it installed again. I have followed the same process as last time and have installed Python 3.3 and PyGame 3.3.0 off of GitBucket. I install PyThon to my only HDD as Python33 and Pygame in a different file on my HDD as PythonX, but for some reaso... | false | 23,250,659 | 0 | 0 | 0 | 0 | The pygame library must be in site-packages folder in Lib folder of your python folder.
It's better you don't personalize this kind of instalation. Why separate a language of its libraries? | 1 | 108 | 0 | 0 | 2014-04-23T16:52:00.000 | python,pygame | Installing PyGame issues | 0 | 1 | 1 | 28,335,704 | 1 |
0 | 0 | I have made a database file using SQL commands in python. i have used quite a lot of foreign keys as well but i am not sure how to display this data onto qt with python? any ideas? i would also like the user to be able to add/edit/delete data | false | 23,268,179 | 0.099668 | 0 | 1 | 1 | This question is a bit broad, but I'll try answering it anyway. Qt does come with some models that can be connected to a database. Specifically classes like QSqlTableModel. If you connect such a model to your database and set it as the model for a QTableView it should give you most of the behavior you want.
Unfortunate... | 0 | 4,532 | 0 | 1 | 2014-04-24T11:55:00.000 | python,sql,qt,pyqt | How to display data from a database file onto pyqt so that the user can add/delete/edit the data? | 0 | 1 | 2 | 23,281,662 | 1 |
0 | 0 | Does anyone know of an easy way to draw ellipses that are not aligned to the x & y axis. I am very new to pygame so please forgive my ignorance, but I cannot find anything related to it.
If no easy method exists, can someone help me in how I might draw this besides generating many many points on the ellipse and plottin... | false | 23,281,952 | -0.07983 | 0 | 0 | -2 | I do not know python or pygame, but depending on what you are building, it may be easier to just make an image using a program like inkscape for pc and mac, or inkpad for iPad. Both of these let you make a diagonal ellipse, and then export it as a .png and use it in your code. Again, if this is possible really depends ... | 0 | 7,513 | 0 | 4 | 2014-04-25T00:01:00.000 | python,pygame | drawing a diagonal ellipse with pygame | 0 | 1 | 5 | 23,282,068 | 1 |
0 | 0 | I'll keep my question short and simple.
Assume I have a python program which calls C++ code from a DLL compiled in C/C++.
-Will the speed/performance of the executing code be preserved?
Assume I have a python program ... has a binding to a C++ library (for example - GTK or Wx).
-Is the speed going to match that of t... | true | 23,288,692 | 1.2 | 0 | 0 | 2 | When Python calls into C++ code, the code it executes is the machine code generated by the C++ compiler. You will have some cost at the interface level, as you have to marshal Python types into C++ types and vice versa, but the C++ code itself will run at pretty much the same speed as if it were called from C++; any d... | 0 | 1,197 | 0 | 1 | 2014-04-25T09:04:00.000 | python,c++,dll,binding,module | Python bindings; calling C code & performance | 0 | 1 | 1 | 23,289,534 | 1 |
0 | 0 | I'm trying to use the python kled module that's featured in QT Designer under ubuntu 13.10 Unity. Is it possible to use with Unity or will i need to use a KDE environment? | true | 23,305,663 | 1.2 | 0 | 0 | 1 | I use KLed in my PyQt4 gui. Originally it was developed in the Kubuntu environment, so this wasn't an issue, but we ended up having to move to Unity (Ubuntu 14.04 LTS). In order to still use KLed I found that I needed to apt-get install the python libraries from kde (didn't want to install Kubuntu as it interfered with... | 0 | 637 | 0 | 0 | 2014-04-26T01:50:00.000 | python,pyqt,qt-designer | PyQt kled in Unity enviornmet? | 0 | 1 | 1 | 25,923,294 | 1 |
0 | 0 | i build my GUI with wxGlade. I think it is very comfortable but i´m looking for a widget/button which open a frame to chose a directory or file..
Can u help me? | false | 23,310,229 | 0 | 0 | 0 | 0 | WxGlade does not directly support a adding a wx.FileDialog to your GUI. As someone answer you have to create and event linked to a button,menu,or toolbar then in your code enter the programming to open a filedialog and return text from it. What I normally do is use the toolbox button to create a generic dialog box and ... | 0 | 1,034 | 0 | 0 | 2014-04-26T11:31:00.000 | python,wxpython,wxglade | wxGlade - Button to chose directory and file | 0 | 1 | 2 | 28,642,528 | 1 |
0 | 0 | A friend and I are making a game in pygame. We would like to have a pygame window embedded into a tkinter or WxPython frame, so that we can include text input, buttons, and dropdown menus that are supported by WX or Tkinter. I have scoured the internet for an answer, but all I have found are people asking the same ques... | false | 23,319,059 | 0.066568 | 0 | 0 | 1 | According to the tracebacks, the program crashes due to TclErrors. These are caused by attempting to access the same file, socket, or similar resource in two different threads at the same time. In this case, I believe it is a conflict of screen resources within threads. However, this is not, in fact, due to an internal... | 0 | 31,504 | 0 | 24 | 2014-04-27T03:30:00.000 | python,tkinter,wxpython,pygame,embed | Embedding a Pygame window into a Tkinter or WxPython frame | 0 | 1 | 3 | 23,683,962 | 1 |
0 | 0 | I'm new to this so sorry it if doesn't make much sense.
I'v created a simple 2d game with Python 3.4 and Pygame and I want to create an exe file that includes python 3.4, the pygame module, the game files and launches the python game file when opened.
Thanks. | true | 23,319,956 | 1.2 | 0 | 0 | 1 | If you're using Python 3.x, you can use cx_Freeze. | 1 | 271 | 0 | 2 | 2014-04-27T06:00:00.000 | python,file,pygame,directory,exe | How do I turn a Pygame Folder into an application (eg .exe)? | 0 | 1 | 2 | 23,372,498 | 1 |
0 | 0 | I'm a trainee novice programmer.
I have / am creating simple programs, generally around screen scraping, data caption (postrgres), various processing methods and now a GUI via wxpython
I find a lot of these programs overlap - ie use same techniques, and get some very long copied and pasted programs!
Overtime I improve ... | true | 23,362,560 | 1.2 | 0 | 0 | 1 | There is a range of techniques you can use :
Shared modules - A set of modules with well defined interfaces - functions, classes etc. These modules sit in a folders which every application you use can get to - i.e. the path to the folder is added to PYTHON_PATH environment variable. These interfaces should be enginee... | 1 | 152 | 0 | 1 | 2014-04-29T10:51:00.000 | python,class,sharing | How do I go make my Python code more efficient and dynamic? | 0 | 1 | 2 | 23,362,812 | 1 |
0 | 0 | I'm trying to use the data collected by a form I to a sqlite query. In this form I've made a spin button which gets any numeric input (ie. either2,34 or 2.34) and sends it in the form of 2,34 which python sees as str.
I've already tried to float() the value but it doesn't work. It seems to be a locale problem but someh... | true | 23,388,647 | 1.2 | 0 | 1 | 1 | AFAIK, WinXP supports setlocale just fine.
If you want to do locale-aware conversions, try using locale.atof('2,34') instead of float('2,34'). | 0 | 48 | 0 | 0 | 2014-04-30T12:53:00.000 | python,sqlite,pygtk | pygtk spinbutton "greek" floating point | 0 | 1 | 1 | 23,389,055 | 1 |
0 | 0 | I do not have any code to show with this question because I am just seeking advice. I have a functional piece of code and through the execution of which I create approx 20 - 30 unique panels. I only use one at any given time (with a few small exceptions) and I use show/hide to manage which panels are displayed at a g... | true | 23,415,765 | 1.2 | 0 | 0 | 0 | There are a couple of approaches. The first is to just create all of the panels that you need and hide them as you've been doing. Another approach would be to create the sizers with the widgets laid out appropriately and just hide the sizers as needed. This way you would only ever have one or two panels, but different ... | 0 | 16 | 0 | 0 | 2014-05-01T20:10:00.000 | wxpython,panel | wxpython create multiple panels at start or as the program progresses | 0 | 1 | 1 | 23,416,753 | 1 |
0 | 0 | I encountered Error: 'module' object has no attribute 'copy' while running a pygame program. In my code, I never referred to a copy attribute, so I don't understand where the error is coming from. | true | 23,418,949 | 1.2 | 0 | 0 | 21 | I think there is a python file named "copy" in your directory. I had the same problem, after I delete the "copy" file, the error has gone. | 1 | 11,076 | 0 | 6 | 2014-05-02T00:33:00.000 | module,pygame,python-2.5,attributeerror,traceback | Pygame AttributeError: 'module' object has no attribute 'copy' | 0 | 1 | 1 | 31,551,977 | 1 |
0 | 0 | How can I make a PyQt5 application to look like the same when run on Windows, and Linux?
I would prefer the Windows style on both systems.
Thanks | true | 23,427,939 | 1.2 | 0 | 0 | 3 | You can call QApplication::setStyle("windows") before creating QApplication object to set a style by name. However, Qt on Linux is usually built without modern Windows styles, so it's possible that the best you will accomplish is the classic (old) Windows style, which is not very attractive. You can also try to use "fu... | 0 | 1,984 | 0 | 0 | 2014-05-02T12:14:00.000 | python,qt,pyqt | Make PyQt application look like the same on Windows and Linux | 0 | 2 | 2 | 23,436,083 | 1 |
0 | 0 | How can I make a PyQt5 application to look like the same when run on Windows, and Linux?
I would prefer the Windows style on both systems.
Thanks | false | 23,427,939 | 0 | 0 | 0 | 0 | You can use existing styles mentioned above
or you can specify the styles of your widgets using Stylesheet, which is quite powerful. | 0 | 1,984 | 0 | 0 | 2014-05-02T12:14:00.000 | python,qt,pyqt | Make PyQt application look like the same on Windows and Linux | 0 | 2 | 2 | 23,474,604 | 1 |
0 | 0 | I finally managed to write a little app that reads from a sqlite database and show the results to a treeview. Another form (in another module) gives the ability to write new or update existing records. After writing to the database it closes the window
What I'm trying to do now is to update the "main" window (containin... | true | 23,428,618 | 1.2 | 0 | 0 | 8 | Finally I managed to figure this out, so I post this answer to my own question in case someone finds it helpful:
All I had to do was to .clear the list_store, rebuild it and use set_model to the TreeView.
The refresh function goes as below:
liststore.clear()
create_model_checks() # re-create liststore
treeView.set_mode... | 0 | 3,427 | 0 | 6 | 2014-05-02T12:49:00.000 | python,sqlite,treeview | pygtk treeview contents update/refresh | 0 | 1 | 1 | 23,489,182 | 1 |
0 | 0 | I have a scene, and I need to be able to overlay the scene with translucent polygons (which can be done easily using pygame.gfxdraw.filled_polygon which supports drawing with alpha), but the catch is that the amount of translucency has to fade over a distance (so for example, if the alpha value is 255 at one end of the... | true | 23,439,474 | 1.2 | 0 | 0 | 0 | It is possible that you have already thought of this and have decided against it, but it would obviously run far better in real time if the polygons were pre-drawn. Presuming there aren't very many different types of polygons, you could even resize them however you need and you would be saving CPU.
Also, assuming that ... | 0 | 948 | 0 | 2 | 2014-05-03T02:08:00.000 | python,pygame,alpha | Gradient alpha polygon with pygame | 0 | 1 | 1 | 23,485,047 | 1 |
0 | 0 | I have very complicated problem. I´ve search whole internet and tried everything, but nothing worked. I want get string from listbox and than delete line in file with word from listbox. Can please somebody help me? Here is code:
def OnDelete(self, event):
sel = self.listbox.GetSelection()
if sel != -1:... | false | 23,448,140 | 0 | 0 | 0 | 0 | Than you very much! I have fixed it! If somebody will have the same problem you must change OnDelete code (The first code in question) for this:
def OnDelete(self, event):
sel = self.listbox.GetSelection()
f = open("Save/savegame.txt", "r")
read = f.readlines()
f.close()
name ... | 0 | 817 | 0 | 0 | 2014-05-03T18:11:00.000 | string,listbox,wxpython | How to get string from listbox | 0 | 1 | 2 | 23,455,859 | 1 |
0 | 0 | I am using wxPython for a board game. And want to drag chessman over positions.
What is the container I should use? Should I put image for chessman in its own panel or as button or somewhere? | true | 23,464,220 | 1.2 | 0 | 0 | 1 | I think you could use a wx.Panel without any issues. There is a CustomDragAndDrop example in the wxPython demo that shows how to drag and drop images from one wx.Window to another. A wx.Panel is a type of wx.Window and I would think it would be better to use anyway. I would give that a try. | 0 | 68 | 0 | 0 | 2014-05-05T03:13:00.000 | image,drag-and-drop,wxpython | wxPython -- Drag and Drop image between position-fixed containers, what is the suitable container? | 0 | 1 | 1 | 23,479,767 | 1 |
0 | 0 | I am working with an embedded python system which requires a C++ frontend using OpenSceneGraph for rendering visualizations. My question is:
Is there any possible way to perform this task? I need to modify C++ osg nodes from Python. Would it be an option to create wrappers for this osg nodes? If this is the answer cou... | true | 23,467,814 | 1.2 | 0 | 0 | 0 | Finally I managed to solve this issue by creating a new python type (python extension) and using Node Visitors to assign node references upon creation. | 0 | 741 | 0 | 0 | 2014-05-05T08:12:00.000 | python,c++,openscenegraph | How can I use C++ OSG objects from Python? | 0 | 1 | 3 | 23,624,458 | 1 |
0 | 0 | I'm implementing an algorithm into my Python web application, and it includes doing some (possibly) large clustering and matrix calculations. I've seen that Python can use C/C++ libraries, and thought that it might be a good idea to utilize this to speed things up.
First: Are there any reasons not to, or anything I sh... | false | 23,491,608 | 0.066568 | 1 | 0 | 1 | Not the answer you expected, but i have been down that road and advise KISS:
First make it work in the most simple way possible.
Only than look into speeding things up later / complicating the design.
There are lots of other ways to phrase this such as "do not fix hypothetical problems unless resources are unlimited"... | 0 | 1,084 | 0 | 4 | 2014-05-06T10:04:00.000 | python,c++,mysql,c | Using C/C++ for heavy calculations in Python (Also MySQL) | 0 | 3 | 3 | 23,493,503 | 1 |
0 | 0 | I'm implementing an algorithm into my Python web application, and it includes doing some (possibly) large clustering and matrix calculations. I've seen that Python can use C/C++ libraries, and thought that it might be a good idea to utilize this to speed things up.
First: Are there any reasons not to, or anything I sh... | true | 23,491,608 | 1.2 | 1 | 0 | 1 | Use the ecosystem.
For matrices, using numpy and scipy can provide approximately the same range of functionality as tools like Matlab. If you learn to write idiomatic code with these modules, the inner loops can take place in the C or FORTRAN implementations of the modules, resulting in C-like overall performance with ... | 0 | 1,084 | 0 | 4 | 2014-05-06T10:04:00.000 | python,c++,mysql,c | Using C/C++ for heavy calculations in Python (Also MySQL) | 0 | 3 | 3 | 23,497,013 | 1 |
0 | 0 | I'm implementing an algorithm into my Python web application, and it includes doing some (possibly) large clustering and matrix calculations. I've seen that Python can use C/C++ libraries, and thought that it might be a good idea to utilize this to speed things up.
First: Are there any reasons not to, or anything I sh... | false | 23,491,608 | 0.066568 | 1 | 0 | 1 | cython support for c++ is much better than what it was. You can use most of the standard library in cython seamlessly. There are up to 500x speedups in the extreme best case.
My experience is that it is best to keep the cython code extremely thin, and forward all arguments to c++. It is much easier to debug c++ direct... | 0 | 1,084 | 0 | 4 | 2014-05-06T10:04:00.000 | python,c++,mysql,c | Using C/C++ for heavy calculations in Python (Also MySQL) | 0 | 3 | 3 | 23,497,054 | 1 |
0 | 0 | How do you go about selecting a specific line in a QTextEdit and changing say... The font colour to green
I am using a QTextEdit widget to display the content of a file, a sequence of commands being sent over rs232. I would like to provide some visual feedback as to what line is being executed, say change the text colo... | false | 23,550,613 | 0.066568 | 0 | 0 | 1 | I think that you can afford generating a new TextEdit content from the relevant data, every time something changes. That should be very easy to implement. QCursors and stuff like that is good for editable QTextEdits which is not true in your case. And there is no guarantee that it will be faster at all. | 0 | 2,307 | 0 | 0 | 2014-05-08T19:14:00.000 | python,pyqt4 | format a specific line in a QtextEdit | 0 | 1 | 3 | 23,551,836 | 1 |
0 | 0 | I have a multi-threaded (via pyqt) application which plots realtime data (data is processed in the second thread and passed to the gui thread to plot via a pyqt-signal). If I place the mouse over the application it continues to run at full speed (as measured by the time difference between calls to app.processEvents()).... | false | 23,567,726 | 0.379949 | 0 | 0 | 2 | It's likely you have items in the scene that accept their own mouse input, but it's difficult to say without seeing code. In particular, be wary of complex plot lines that are made clickable--it is very expensive to compute the intersection of the mouse cursor with such complex shapes.
The best (some would say only) w... | 0 | 742 | 0 | 0 | 2014-05-09T14:53:00.000 | python,qt,pyqt,pyqtgraph | PYQTGraph application slows down when mouse moves over application | 0 | 1 | 1 | 23,572,444 | 1 |
0 | 0 | I'm preparing exercises for school classes involving Python's turtle library.
The students are already drawing terrific pictures, but I want them to be able to detect existing pictures and colours in order to modify the behaviour of their program.
For example I would like to provide them with code which draws a maze us... | false | 23,579,631 | 0 | 0 | 0 | 0 | I would use an array keep all x and y that is used for the maze in an array like stated above. Then have a size of a box around the turtle defined for detecting purposes. | 1 | 3,154 | 0 | 3 | 2014-05-10T09:57:00.000 | python,turtle-graphics | How to read pixel colours using Python turtle.py | 0 | 1 | 2 | 51,011,317 | 1 |
0 | 0 | I have a static library I created from C++, and would like to test this using a Driver code.
I noticed one of my professors like to do his tests using python, but he simply executes the program (not a library in this case, but an executable) using random test arguments.
I would like to take this approach, but I realize... | false | 23,622,923 | 0.197375 | 1 | 0 | 5 | It really depends on what it is you are trying to test. It almost always makes sense to write unit tests in the same language as the code you are testing so that you can construct the objects under test or invoke the functions under test, both of which can be most easily done in the same language, and verify that they ... | 0 | 4,198 | 0 | 28 | 2014-05-13T04:40:00.000 | python,c++,unit-testing | Is it acceptable practice to unit-test a program in a different language? | 0 | 5 | 5 | 23,623,089 | 1 |
0 | 0 | I have a static library I created from C++, and would like to test this using a Driver code.
I noticed one of my professors like to do his tests using python, but he simply executes the program (not a library in this case, but an executable) using random test arguments.
I would like to take this approach, but I realize... | false | 23,622,923 | 0.158649 | 1 | 0 | 4 | Why not, it's an awesome idea because you really understand that you are testing the unit like a black box.
Of course there may be technical issues involved, what if you need to mock some parts of the unit under test, that may be difficult in a different language.
This is a common practice for integration tests though... | 0 | 4,198 | 0 | 28 | 2014-05-13T04:40:00.000 | python,c++,unit-testing | Is it acceptable practice to unit-test a program in a different language? | 0 | 5 | 5 | 23,623,087 | 1 |
0 | 0 | I have a static library I created from C++, and would like to test this using a Driver code.
I noticed one of my professors like to do his tests using python, but he simply executes the program (not a library in this case, but an executable) using random test arguments.
I would like to take this approach, but I realize... | false | 23,622,923 | 0.158649 | 1 | 0 | 4 | I would say it depends on what you're actually trying to test. For true unit testing, it is, I think, best to test in the same language, or at least a binary-compatible language (i.e. testing Java with Groovy -- I use Spock in this case, which is Groovy based, to unit-test my Java code, since I can intermingle the Java... | 0 | 4,198 | 0 | 28 | 2014-05-13T04:40:00.000 | python,c++,unit-testing | Is it acceptable practice to unit-test a program in a different language? | 0 | 5 | 5 | 23,623,031 | 1 |
0 | 0 | I have a static library I created from C++, and would like to test this using a Driver code.
I noticed one of my professors like to do his tests using python, but he simply executes the program (not a library in this case, but an executable) using random test arguments.
I would like to take this approach, but I realize... | false | 23,622,923 | 1 | 1 | 0 | 9 | A few things to keep in mind:
If you are writing tests as you code, then, by all means, use whatever language works best to give you rapid feedback. This enables fast test-code cycles (and is fun as well). BUT.
Always have well-written tests in the language of the consumer. How is your client/consumer going to call yo... | 0 | 4,198 | 0 | 28 | 2014-05-13T04:40:00.000 | python,c++,unit-testing | Is it acceptable practice to unit-test a program in a different language? | 0 | 5 | 5 | 23,623,093 | 1 |
0 | 0 | I have a static library I created from C++, and would like to test this using a Driver code.
I noticed one of my professors like to do his tests using python, but he simply executes the program (not a library in this case, but an executable) using random test arguments.
I would like to take this approach, but I realize... | true | 23,622,923 | 1.2 | 1 | 0 | 28 | I'd say that it's best to test the API that your users will be exposed to. Other tests are good to have as well, but that's the most important aspect.
If your users are going to write C/C++ code linking to your library, then it would be good to have tests making use of your library the same way.
If you are going to shi... | 0 | 4,198 | 0 | 28 | 2014-05-13T04:40:00.000 | python,c++,unit-testing | Is it acceptable practice to unit-test a program in a different language? | 0 | 5 | 5 | 23,623,088 | 1 |
1 | 0 | I've a strange issue. pserve --reload has stopped reloading the templates. It is reloading if some .py-file is changing, but won't notice .mak-file changes anymore.
I tried to fix it by:
Checking the filepermissions
Creating the new virtualenv, which didn't help.
Installing different version of mako without any effec... | false | 23,646,485 | 0.099668 | 1 | 0 | 1 | Oh my,
I found the thing... I had <%block cached="True" cache_key="${self.filename}+body"> and the file inclusion was inside of that block.
Cheerious:) | 0 | 216 | 0 | 0 | 2014-05-14T05:42:00.000 | python,pyramid,mako,waitress | Pyramid Mako pserver --reload not reloading in Mac | 0 | 1 | 2 | 23,654,584 | 1 |
0 | 0 | I am developing a simple standalone, graphical application in python. My development has been done on linux but I would like to distribute the application cross-platform.
I have a launcher script which checks a bunch of environment variables and then sets various configuration options, and then calls the application wi... | false | 23,659,248 | 0 | 0 | 0 | 0 | Firstly, you should always use .pyw for GUIs.
Secondly, you could convert it to .exe if you want people without python to be able to use your program. The process is simple. The hardest part is downloading one of these:
for python 2.x: p2exe
for python 3.x: cx_Freeze
You can simply google instructions on how to use ... | 0 | 933 | 1 | 1 | 2014-05-14T15:40:00.000 | python,user-interface,cross-platform | python or pythonw in creating a cross-platform standalone GUI app | 0 | 2 | 2 | 23,660,787 | 1 |
0 | 0 | I am developing a simple standalone, graphical application in python. My development has been done on linux but I would like to distribute the application cross-platform.
I have a launcher script which checks a bunch of environment variables and then sets various configuration options, and then calls the application wi... | false | 23,659,248 | 0 | 0 | 0 | 0 | If you save the file as main.pyw, it should run the script without opening up a new cmd/terminal.
Then you can run it as python main.pyw | 0 | 933 | 1 | 1 | 2014-05-14T15:40:00.000 | python,user-interface,cross-platform | python or pythonw in creating a cross-platform standalone GUI app | 0 | 2 | 2 | 23,659,489 | 1 |
0 | 0 | So I've been making a game using Python, specifically the PyGame module. Everything has been going fairly well (except Python's speed, am I right :P), and I've got a nice list of accomplishments from this, but I just ran into a... speedbump. Maybe a mountain. I'm not to sure yet. The problem is:
How do I go about impl... | false | 23,666,333 | 0 | 0 | 0 | 0 | Since I can't have a look into your code, I can't assess how useful this answer will be for you.
My approach for side scroller, moveable maps, etc. is to blit all tiles onto a pygame.Surface spanning the dimensions of the whole level/map/ etc. or at least a big chunk of it. This way I have to blit only one surface per ... | 0 | 2,049 | 0 | 0 | 2014-05-14T22:38:00.000 | python,camera,pygame,2d-games | 2D Game Engine - Implementing a Camera | 0 | 1 | 2 | 23,671,391 | 1 |
0 | 0 | I just used py2exe to compile my python app that uses pyqt. The size of it is 23MB.
The Pyqt libraries (PyQt4.QtCore.pyd, PyQt4.QtGui.pyd, QtCore4.dll and QtGui4.dll) sum more than 17MB.
Is there a way to use QT with a reduced size?
Thank you! | false | 23,678,753 | 0 | 0 | 0 | 0 | PyQt is essentially a wrapper around Qt.
In theory it should be possible to use Qt without PyQt, but you'd have to make the bindings yourself. | 0 | 475 | 0 | 0 | 2014-05-15T12:51:00.000 | python,pyqt,py2exe | Reduce Size py2exe and pyqt | 0 | 1 | 1 | 23,681,056 | 1 |
0 | 0 | I have a tkinter program written in python 3.3.3. I see myself in the need of making the the program get focus when the user unlocks the computer. I don't really know how to go ahead and start with this, users have a .exe version of the program that I created with cxfreeze. I f i need to modify the .py and create anoth... | false | 23,691,819 | 0 | 0 | 0 | 0 | I cannot answer this specifically for 'unlock' event (if there even is one in the GUI; I can't find one by cursory search.).
But I think the real answer is to change the question. Having a program simply take focus when user unlocks the display is very un-Windows-ish behavior. The Windows user expects to see the de... | 0 | 100 | 0 | 0 | 2014-05-16T02:43:00.000 | python,python-3.x,tkinter | Get focus on tkinter program after pc is unlocked | 0 | 1 | 1 | 23,704,276 | 1 |
0 | 0 | Can i compile files like:
- Images,
- sounds,
- fonts,
- etc..
For example if I have "click.wav" and i dont want to let users play it themself. | false | 23,715,822 | 0 | 0 | 0 | 0 | From what I've done, no, you cannot. The best ways imo are as follows:
Making folders (files>images) to make it less desirable to look for them.
(Not sure how well this would work with pygame) but hidden folders might work. I used hidden folders for file writing in python.
Otherwise I think that it wouldn't be so bad i... | 0 | 416 | 0 | 1 | 2014-05-17T20:32:00.000 | python,compilation,pygame,exe,cx-freeze | Compiled my Game made in pygame to .exe. Is there any way to compile all files? | 0 | 1 | 1 | 28,030,394 | 1 |
1 | 0 | so I trying to build project for cocos2d-x. I'm currently at cmd and when I type python android-build.py -p 19 cpp-tests it start making project but then I get error that build failed. Problem is bescause it can't find javac compiler.
"Perhaps JAVA_HOME does not point to the JDk. It is currently set to
"c:/Program ... | false | 23,716,064 | 0 | 1 | 0 | 0 | You have to point JAVA_HOME to this path:
C:\android\Java\jdk1.8.0_05 | 0 | 90 | 0 | 1 | 2014-05-17T21:04:00.000 | java,android,python,c++ | JAVA_HOME "bug" | 0 | 1 | 1 | 31,828,819 | 1 |
0 | 0 | I am working on my Python project using PySide as my Ui language. My projet is a game which require an internet connection to update the users'score and store in the database.
My problem is how can I store my database in the internet. I mean that all users can access this information when they are connected to an inter... | false | 23,754,108 | 0 | 0 | 1 | 0 | I'm not familiar with PySide .. but the idea is
you need to build a function that when internet connection is available it should synchronize your local database with online database and in the server-side you need to build a script that can handle requests ( POST / GET ) to receive the scores and send it to database ... | 0 | 193 | 0 | 0 | 2014-05-20T07:59:00.000 | python,database,sockets,pyside,qtsql | Using Database with Pyside and Socket | 0 | 1 | 1 | 23,754,331 | 1 |
0 | 1 | Current conditions:
C code being rewritten to do almost the same type of simulation every time (learning behavior in mice)
Matlab code being written for every simulation to plot results (2D, potentially 3D graphs)
Here are my goals:
Design GUI (wxPython) that allows me to build a dynamic simulator
GUI also displays ... | false | 23,819,504 | 0.197375 | 0 | 0 | 1 | It would help to know what the turnaround time for the simulation runs is and how fast you want to display and update graphs. More or less realtime, tens of milliseconds for each? Seconds? Minutes?
If you want to draw graphs, I'd recommend Matplotlib rather than OpenGL. Even hacking the Matplotlib code yourself to make... | 0 | 461 | 0 | 1 | 2014-05-23T01:04:00.000 | python,c,opengl,interop,python-cffi | Interoperability advice - Python, C, Matplotlib/OpenGL run-time efficency | 0 | 1 | 1 | 23,861,390 | 1 |
0 | 0 | I am trying to download/install Light Table. I want it to show up in the start menu.
When downloading light table, it shows up as a Zip folder in the TEMP file. I've extracted the files and am unable to get it to show up in the start menu.
Normally the programs I download have an installer that does this automatically.... | false | 23,846,899 | 0.53705 | 0 | 0 | 3 | It's pretty easy to do.
Unzip to where ever
Move the LightTable directory (from inside LightTableWin) to your Program Files (x86) directory.
2.1 If you are using Windows Explorer, you'll need to start windows explorer as an administrator (found by right clicking the program icon)
open your Program Files (x86)\Ligh... | 1 | 2,589 | 0 | 2 | 2014-05-24T15:45:00.000 | python,windows-7,installation,lighttable | Install Light Table editor on Windows 7 | 0 | 1 | 1 | 29,813,451 | 1 |
0 | 0 | I have searched a lot and I know how to open a directory dialog window.
But what I am looking for is the method to open a directory folder under windows OS, just like you right click one of your local folder and select open.
Any suggestions? | false | 23,859,613 | 0.132549 | 0 | 0 | 4 | You may simply try this:
os.startfile(whatever_valid_filename)
This starts the default OS application for whatever_valid_filename, meaning Explorer for a folder name, default notepad for a .txt file, etc. | 0 | 21,145 | 0 | 4 | 2014-05-25T20:22:00.000 | python,pyqt,pyqt4 | PyQt - How to open a directory folder? | 0 | 1 | 6 | 41,981,238 | 1 |
0 | 0 | I'm writing a mediaplayer-gui fitting some needs of a medialibrary containing classical music only.
Language is python3/tkinter.
One backend is gstreamer1.0, playbin (seems to be the only one, playing gapless).
When playbin gets the uri of a file with 5.0 channels
(FRONT_LEFT,FRONT_RIGHT,FRONT_CENTER,REAR_LEFT,REAR_RIG... | false | 23,884,156 | 0.197375 | 0 | 0 | 1 | I'd suggest to file a bug and ideally make your test files available.
If you want to track this down yourself take a look at the GST_DEBUG="*:3" ./your-app output to see which element is emitting the warning. | 0 | 193 | 0 | 0 | 2014-05-27T08:08:00.000 | python,gstreamer | how to make playbin of gstreamer1.0 playing multichannel-audio 5.0 playing without downmixing to stereo | 0 | 1 | 1 | 23,921,536 | 1 |
0 | 0 | I have a Kivy-based Python project that I'm trying to build. It uses the NavigationDrawer component from Kivy Garden, through an import:
from kivy.garden.navigationdrawer import NavigationDrawer
I have a PyInstaller spec file for it which builds a distributable version. This version works well on my machine, but unfo... | false | 24,048,350 | 0 | 0 | 0 | 0 | I had a similar issue with garden modules. When I install like the following:
start cmd /C "garden install --kivy roulettescroll"
start cmd /C "garden install --kivy roulette"
start cmd /C "garden install --kivy tickline"
start cmd /C "garden install --kivy datetimepicker"
I add PyInstaller ... --hidden-import=kivy.ga... | 1 | 2,433 | 0 | 4 | 2014-06-04T22:00:00.000 | python,kivy,pyinstaller | Kivy Garden in PyInstaller - stuck trying to trace import | 0 | 3 | 4 | 39,481,035 | 1 |
0 | 0 | I have a Kivy-based Python project that I'm trying to build. It uses the NavigationDrawer component from Kivy Garden, through an import:
from kivy.garden.navigationdrawer import NavigationDrawer
I have a PyInstaller spec file for it which builds a distributable version. This version works well on my machine, but unfo... | false | 24,048,350 | 0.099668 | 0 | 0 | 2 | You could just copy the navigationdrawer code from C:\Users\me\.kivy\garden\garden.navigationdrawer to your app directory, call the folder 'navigationdrawer' and replace the import with from navigationdrawer import NavigationDrawer.
It's not quite the 'right' way to do it (there's probably some way to make pyinstaller ... | 1 | 2,433 | 0 | 4 | 2014-06-04T22:00:00.000 | python,kivy,pyinstaller | Kivy Garden in PyInstaller - stuck trying to trace import | 0 | 3 | 4 | 24,048,458 | 1 |
0 | 0 | I have a Kivy-based Python project that I'm trying to build. It uses the NavigationDrawer component from Kivy Garden, through an import:
from kivy.garden.navigationdrawer import NavigationDrawer
I have a PyInstaller spec file for it which builds a distributable version. This version works well on my machine, but unfo... | false | 24,048,350 | -0.049958 | 0 | 0 | -1 | Go to your python site packages there is a folder named garden, look in __init__.py. There is a explanation how to install navigationdrawer. | 1 | 2,433 | 0 | 4 | 2014-06-04T22:00:00.000 | python,kivy,pyinstaller | Kivy Garden in PyInstaller - stuck trying to trace import | 0 | 3 | 4 | 35,244,089 | 1 |
0 | 0 | I have a database table (created using the SQLite3 library) and would like to be able to open a new window (in a program that I am writing) which will simply display the contents of the table (*.db) with a scroll bar to the user (perhaps on a grid like you would find in a spreadsheet).
Are there any easy ways of achiev... | true | 24,118,765 | 1.2 | 0 | 0 | 1 | I think you would use
.grid() in a Frame or
multiple Listboxes with as many scrollbars as you like. | 0 | 1,409 | 0 | 0 | 2014-06-09T10:53:00.000 | python,sqlite,tkinter | Is there a tkinter widget to easily display a table (SQLite) in a window (canvas)? | 0 | 1 | 1 | 24,123,191 | 1 |
0 | 0 | I am currently working on a project to import a Matlab program to python for integration into ImageJ as a plugin. The program contains Mex files and the source code was written in C++. Is there a way to call the C++ functions without having to rewrite them in python. Thanks!!! | true | 24,153,503 | 1.2 | 1 | 0 | 1 | If you can build your program as a shared library, then you can use the ctypes foreign-function interface to call your functions.
This is often less work (and less complex) than wrapping the functions with Cython or writing your own C-API extension, but it is also more limited in what you can do. Therefore, I recommend... | 0 | 1,339 | 0 | 0 | 2014-06-11T01:54:00.000 | python,c,matlab,mex | Call C/C++ code from Python | 0 | 1 | 2 | 24,154,260 | 1 |
0 | 0 | I have created a windows app which runs a python script. I'm able to capture the output of the script in textbox.
Now i need to pass a shared object to python script as an argument from my app.
what type of shared object should i create so that python script can accept it and run it or in simple words how do i create s... | false | 24,237,335 | 0.099668 | 0 | 0 | 1 | Since python is running as another process. This is no way for python to access object in c# directly since process isolation.
A way of marshal and un-marshal should be included to communicate between processes.
There are many way to communicate between processes. Share memory, file, TCP and so on. | 1 | 912 | 0 | 3 | 2014-06-16T05:54:00.000 | c#,python,.net,share,shared-objects | shared object in C# to be used in python script | 0 | 2 | 2 | 24,281,523 | 1 |
0 | 0 | I have created a windows app which runs a python script. I'm able to capture the output of the script in textbox.
Now i need to pass a shared object to python script as an argument from my app.
what type of shared object should i create so that python script can accept it and run it or in simple words how do i create s... | false | 24,237,335 | 0.099668 | 0 | 0 | 1 | 5.4. Extending Embedded Python
will help you to access the application object.
In this case both application and python running in single process. | 1 | 912 | 0 | 3 | 2014-06-16T05:54:00.000 | c#,python,.net,share,shared-objects | shared object in C# to be used in python script | 0 | 2 | 2 | 32,651,105 | 1 |
0 | 0 | Pretty self-explanatory from the title. I'm using PyQt4 to crawl pages and I occasionally get a SegFault error.
The overall program seems to still be working regardless though, so all I want to do is prevent that "Segmentation Fault (core dumped)" error from being shown on the console. How is this done? | true | 24,268,634 | 1.2 | 0 | 0 | 2 | Segmentation Fault is an system error, which occurs when your program tries to access wrong memory address. It is internal program problem and you cannot continue process. It could be possible, but believe me, you should not. So, you should fix it.
To fix it, you should dig into Qt internals, but I'd like to suggest yo... | 1 | 205 | 0 | 1 | 2014-06-17T16:11:00.000 | python | "Segmentation Fault" being thrown by third party package. How to prevent it from displaying on console? | 0 | 1 | 1 | 24,268,970 | 1 |
0 | 0 | I've been trying to add separator lines between rows in my grid. I tried using wx.Menu() with the AppendSeparator() method, however the wx grid can't add objects of type Menu. Is there any other way? | true | 24,287,228 | 1.2 | 0 | 0 | 1 | This is not supported by the grid widget. You could size a column or row such that it is skinnier than usual and change all the cells in that row or column to have a different background color. You might also be able to utilize a custom label renderer or cell renderer. See the wxPython demo for examples. | 0 | 160 | 0 | 0 | 2014-06-18T13:43:00.000 | python-2.7,wxpython | How do I add a separator in a grid in wxPython? | 0 | 1 | 1 | 24,311,759 | 1 |
0 | 0 | I am having this error flood my terminal and make it impossible to debug. Is there a way to silence this warning? This error only generated when I included a scrollToBottom() on my TableWidget. | false | 24,289,418 | 0 | 0 | 0 | 0 | It would be much better if some of your actual code would have been available.
The reason you are seeing this is that you are using a different type of threading than QThreads . That is in general not advisable, but it is not illegal. There are three things that you will have to take care
All calls should end up being... | 1 | 7,241 | 0 | 3 | 2014-06-18T15:23:00.000 | python,qt,error-handling,pyqt,suppress-warnings | How to suppress warning QPixmap: It is not safe to use pixmaps outside the GUI thread | 0 | 2 | 3 | 33,542,567 | 1 |
0 | 0 | I am having this error flood my terminal and make it impossible to debug. Is there a way to silence this warning? This error only generated when I included a scrollToBottom() on my TableWidget. | false | 24,289,418 | 0 | 0 | 0 | 0 | You should better design your code to avoid displaying this message. If you created the pixmap in another thread and "use" it in the GUI thread this might work now, tomorrow or forever ... or will not. Don't do that.
You cannot suppress the output of this warning without changing the Qt sources or installing a message ... | 1 | 7,241 | 0 | 3 | 2014-06-18T15:23:00.000 | python,qt,error-handling,pyqt,suppress-warnings | How to suppress warning QPixmap: It is not safe to use pixmaps outside the GUI thread | 0 | 2 | 3 | 24,291,464 | 1 |
0 | 0 | I've been looking for ways to make a GUI with a .py file, and have so far only found frameworks and modules like Tkinter. However, my ultimate goal is for this code to run on a lot of computers that don't necessarily have these modules installed. The machines are only guaranteed to have Python on them. Does anyone know... | true | 24,295,681 | 1.2 | 0 | 0 | 3 | The best way to do this would be to ship your application with those modules as a part of it; the user's computer doesn't need to have the GUI framework installed if you provide it.
What you're asking would essentially require you to write an entire GUI framework, which would give a result that would be similar or wors... | 1 | 57 | 0 | 1 | 2014-06-18T21:57:00.000 | python,user-interface | Can I make a GUI with Python without any extraneous software? | 0 | 1 | 1 | 24,295,727 | 1 |
0 | 0 | I'm packaging a GUI app for MacOS with Pyinstaller, using --windowed flag. Is it possible to package it so that it would show a console in addition to the GUI? When I tried to set console=True, the GUI part fails.
In other words, when I start the App from the terminal by typing "open My.App/Contents/MacOS/myapp", then ... | false | 24,333,323 | 0 | 0 | 0 | 0 | while you create application don't add those options
--windowed and --noconsole | 1 | 425 | 1 | 6 | 2014-06-20T18:15:00.000 | python,macos,pyinstaller | How to package a Mac OS app with Pyinstaller that shows both a console and a GUI? | 0 | 1 | 1 | 53,956,162 | 1 |
0 | 0 | It seems to me the buffer protocol is more for exposing Python buffer to C.
I couldn't find a way to create a bytes object using existing buffer without copying in C.
Basically what I want is to implement something similar to PyBytes_FromStringAndSize() but without copying, and with a callback to free the buffer when t... | false | 24,336,655 | 0.197375 | 0 | 0 | 1 | The only way to do this is to create a new object with PyBufferProcs* PyTypeObject.tp_as_buffer. I checked cpython source code thoroughly, as of 3.4.1, there is no out-of-box (so to speak) solution. | 0 | 444 | 0 | 7 | 2014-06-20T22:38:00.000 | python-3.x,python-c-api,python-c-extension | python c-api: create bytes using existing buffer without copying | 0 | 1 | 1 | 26,024,351 | 1 |
0 | 0 | I'm working on a project that requires user generated images to be applied to various 3D models (mugs, t-shirts etc). I've explored numerous applications, (Pyglet, Blender, Panda to name a few), and am looking for ideas / guidance as to the best approach.
Appears to me that the world of 3D modelling has quite a steep l... | false | 24,367,286 | 0 | 0 | 0 | 0 | In the case where you're interested in replacing textures on-the-fly, you should render your objects as UV maps.
UV maps specify the pixel offset within the texture so that once a texture is chosen, it is a simple process of table lookup for filling in the texture.
You might consider rendering at double the resolutio... | 0 | 87 | 0 | 2 | 2014-06-23T13:32:00.000 | python,image-processing,3d | Looking for advice on applying textures to 3D models at run time | 0 | 1 | 1 | 24,371,384 | 1 |
0 | 0 | I am learning wxpython and have a question.
When I create a treectrl within framework and call framework.show(), the first item in the treectrl is automatically selected (i.e., EVT_TREE_SEL_CHANGED event is fired). However, when I create a treectrl in a panel, add the panel to a notebook and add the notebook to frame... | false | 24,442,775 | 0 | 0 | 0 | 0 | I don't know why exactly does this happen but this looks like a bug in wxWidgets. In practice, this means that it you shouldn't rely on this behaviour because it might (and in fact I'm pretty sure it does) behave differently under other platforms and also could change in future wxWidgets versions. | 0 | 291 | 0 | 1 | 2014-06-27T01:42:00.000 | python,wxpython,wxwidgets | wxpython: EVT_TREE_SEL_CHANGED event in treectrl in notebook when created | 0 | 1 | 1 | 24,454,132 | 1 |
0 | 0 | My goal is to create a window that has a variable level of transparency and no standard border. On top of that area I would like to display opaque items, especially text, that might need to be made transparent. I have tried using SetTransparency methods, SetBackgroundColor and wx.TRANSPARENT_WINDOW styles but haven't h... | true | 24,457,479 | 1.2 | 0 | 0 | 1 | wxPython does not support this behavior. You might be able to fake it by creating lots of custom widgets or by drawing everything, but it will be a lot of work. You would be better off switching to a different toolkit that has this sort of thing builtin. wxPython is for developers that want to make applications that lo... | 0 | 328 | 0 | 0 | 2014-06-27T17:18:00.000 | wxpython | Is it possible to have a transparent window while having opaque children? | 0 | 1 | 1 | 24,457,910 | 1 |
0 | 0 | Hi I am trying to make a punny cookie clicker type game called py clicker and made an invisible circle over the sprite which is a pie. How do I detect if the mouse is within the circle so when the user clicks it checks if it is in the circle and adds one to the counter? | false | 24,473,156 | 0 | 0 | 0 | 0 | you can use the graphics library and use the method called getMouse. | 0 | 127 | 0 | 0 | 2014-06-29T04:27:00.000 | python,pygame | Python 2.7.7/Pygame - How to detect if the mouse is within a circle? | 0 | 1 | 3 | 24,473,291 | 1 |
0 | 0 | How the hell to install tkinter on to my PC ?
I tried for week to install it. I can not figure it out. Please, Help.
How does it work ? Is there a site you install it from or what ? | false | 24,499,602 | 0 | 0 | 0 | 0 | Just change your code to
from tkinter import *
In python3, the issue is with capitalization, so you should use tkinter instead of Tkinter. | 0 | 10,084 | 0 | 3 | 2014-06-30T21:59:00.000 | python,tkinter,installation | How to install Tkinter? | 0 | 1 | 4 | 57,996,033 | 1 |
0 | 0 | I'm considering attempting a game built using Panda3D where no objects are built using a 3D editor. It would all be made and rendered using geometric functions. This includes multiple characters running around, spells being cast and buildings and other objects being around.
How viable of an idea is this? Would renderin... | false | 24,523,468 | 0 | 0 | 0 | 0 | Have a look at other games made with Panda3D. see the tutorials, demos, etc. That will give you a good overview of what can be possibly made. Check for the keyword technologies that you need - SSAO, Skeletal-Animation, Physics, etc.
In general, you might want to detalise your idea and see how other games implement part... | 0 | 344 | 0 | 0 | 2014-07-02T05:27:00.000 | python,3d,render,panda3d | Real-time Geometry Rendering with Panda3D -- Efficient? | 0 | 1 | 1 | 25,160,655 | 1 |
0 | 0 | I am writing an app in kivy which does cpu-heavy calculations at launch. I want the app to display what it's doing at the moment along with the progress, however, since the main loop is not reached yet, it just displays empty white screen until it finishes working. Can I force kivy to update the interface?
Basically I'... | false | 24,529,197 | 0.197375 | 0 | 0 | 1 | Leaving aside the question of whether you should be using threading or something instead (which possibly you should), the answer is just that you should move your cpu calculations to somewhere else. Display something simple initially (i.e. returning a simple widget from your build method), then do the calculations afte... | 0 | 2,011 | 0 | 1 | 2014-07-02T10:47:00.000 | python,kivy | Force update GUI in kivy | 0 | 1 | 1 | 24,530,629 | 1 |
0 | 0 | I have code as follows
log = wx.TextCtrl(panel, wx.ID_ANY, size=(300,100),
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.TE_DONTWRAP)
I'm writing logs into this box by redirecting stdout.
How do I make the cursor dissappear for the TextCtrl because it appends logs based on the position ... | false | 24,538,053 | 0 | 0 | 0 | 0 | But if you use log.Disable, the scrollbar won't work | 0 | 3,622 | 0 | 1 | 2014-07-02T18:05:00.000 | python,wxpython | Disable cursor in TextCtrl - wxPython | 0 | 1 | 5 | 44,200,976 | 1 |
0 | 0 | I'm using glutBitmapCharacter of pyOpenGL in Python, but the only fonts I can choose to use are helvetica and times_new_roman. Is it possible to add more fonts? | false | 24,563,337 | 0 | 0 | 0 | 0 | Not without modifying your GLUT implementation to add additional enums and font bitmaps. | 0 | 571 | 0 | 0 | 2014-07-03T21:09:00.000 | python,opengl,text,fonts,pyopengl | python more fonts in glut (glutBitmapCharacter) | 0 | 1 | 1 | 24,563,549 | 1 |
0 | 0 | Basically if I drag a cell I can size it to whatever size I want. Is there functionality in wxPython where cells expand automatically to fit the size of the text inside of them? | true | 24,609,197 | 1.2 | 0 | 0 | 1 | The Grid class has AutoSizeColumn/AutoSizeRow and AutoSizeColumns/AutoSizeRows methods that do a fairly good job of generically resizing rows or cols to be large enough for the contents of the row or col. They can be fairly expensive operations for large grids however, so they should be used with care. | 0 | 2,930 | 0 | 1 | 2014-07-07T11:09:00.000 | python,wxpython,wxgrid | How to make text fit in cells in a wxPython grid? | 0 | 1 | 3 | 24,620,168 | 1 |
0 | 0 | I am planning on using IronPython to develop a GUI interface for some python code. Do I need to know any other programming languages other than python. Also if not are there any other GUI packages/addon's to python that only use python to implement and get the final product working? | true | 24,635,660 | 1.2 | 1 | 0 | 2 | You don't need to know any other languages - modulo a few implementation differences, Python is Python is Python. You will, however, need to know the Microsoft windowing library, with which I believe you will have to interface to build a GUI. | 1 | 134 | 0 | 2 | 2014-07-08T15:20:00.000 | python,ironpython | Does IronPython just use Python or to use IronPython do I need to know other programming languages other than python? | 0 | 1 | 1 | 24,636,635 | 1 |
0 | 0 | I have used img2py to convert an image into a .py file. But how to use that converted file in pygame. Is there any specific code for it? | false | 24,639,577 | 0.379949 | 0 | 0 | 2 | The PyEmbeddedImage class has a GetData method (or Data property) that can be used to fetch the raw data of the embedded image, in PNG format. | 1 | 748 | 0 | 1 | 2014-07-08T18:52:00.000 | wxpython,pygame | How to use/decompress the file made by img2py | 0 | 1 | 1 | 24,644,067 | 1 |
0 | 0 | I have a Python code that needs to be able to execute a C++ code. I'm new to the idea of creating libraries but from what I have learned so far I need to know whether I need to use static or dynamic linking.
I have read up on the pros and cons of both but there is a lot of jargon thrown around that I do not understand ... | true | 24,650,785 | 1.2 | 1 | 0 | 5 | It depends on your desired deployment. If you use dynamic linking will need to carefully manage the libraries (.so, .dll) on your path and ensure that the correct version is loaded. This can be helped if you include the version number in the filename, but then that has its own problems (security... displaying version n... | 0 | 2,081 | 0 | 3 | 2014-07-09T10:07:00.000 | python,c++,dll,static-libraries | Advise needed for Static vs Dynamic linking | 0 | 1 | 3 | 24,650,884 | 1 |
0 | 0 | Alright so this is a specific question about data transfer using different windows in pyqt4. Basically I have 3 windows, each with its own class definition, that I have designed for a project but I'm confused about how to properly arrange these windows.
Ideal Functionality:
Let's say I have 3 windows; A, B, and C. Win... | true | 24,708,697 | 1.2 | 0 | 0 | 0 | C have to be child of A than you can close B. B can call function in parent A to open C and then B can close itself. | 0 | 33 | 0 | 0 | 2014-07-12T01:20:00.000 | python-3.x,pyqt4 | Controlling Windows/Information PYQT4 | 0 | 1 | 1 | 24,714,113 | 1 |
0 | 0 | Hello I am developing easy space invaders clone game and i need to figure out a way how to detect collision of the bullet and the alien when i shoot. Any suggestions ? Thanks | true | 24,713,228 | 1.2 | 0 | 0 | 1 | Use Pygame in place of Tkinter (eventually in place of Canvas) - there are functions to check collisions.
To check collision you have to get position both elements and check distance between them:
a2 + b2 = c2
a = x1 - x2 , b = y1 - y2 , c = distance between objects A(x1,y1) and B(x2,y2)
If distance is smaller then so... | 0 | 6,110 | 0 | 0 | 2014-07-12T13:04:00.000 | python,tkinter | How to detect collisions of two canvas object Tkinter | 0 | 1 | 2 | 24,713,651 | 1 |
1 | 0 | I've got a text view and a web view, each inside a scrolled window of their own and I'm trying to achieve synchronized scrolling between the two but I can't seem to get it to work.
The web view is basically taking the text from the text view and rendering it as marked up HTML via webview.load_html_string(). I think the... | false | 24,718,142 | 0 | 0 | 0 | 0 | why do you want sync those scrollbars? You can achieve this by using the same Gtk.Adjustment (number of pages sets to 0).
I haven't use much of webkit but it essentialy a widget. so maybe a workaround would be disconnect a signal "value-changed" from Gtk.Adjustment until "load-status" signal from WebKitView reached We... | 0 | 221 | 0 | 0 | 2014-07-12T23:15:00.000 | python,webkit,gtk,pygtk | pygtk TextView and WebKit.WebView synchronized scrolling | 0 | 1 | 1 | 24,722,441 | 1 |
0 | 0 | When I open a site with the webkit webview, the entire window resizes to fit the page not allowing scrollbars. The window's height exceeds my screen height. Also, when a webview is in the window, I can resize the window outward, but I can't resize it inward. A webview won't show at all in a VBox if I do: MyVBox.pack_st... | true | 24,729,658 | 1.2 | 0 | 0 | 0 | you have to put the Gtk.WebKitView inside a Gtk.ScrolledWindow. since it implement a Gtk.Scrollable you need not using a Gtk.Viewport. and put the window inside your Gtk.Box | 0 | 118 | 0 | 0 | 2014-07-14T04:46:00.000 | python,webkit,gtk,pygtk,webkitgtk | PyWebkitGTK loads a website fully vertical into window and will not resize inward | 0 | 1 | 1 | 24,751,754 | 1 |
0 | 0 | I'm drawing a map of a real world floor with dimensions roughly 100,000mm x 200,000mm.
My initial code contained a function that converted any millimeter based position to screen positioning using the window size of my pygame map, but after digging through some of the pygame functions, I realized that the pygame transf... | false | 24,743,758 | 0.197375 | 0 | 0 | 2 | I dont fully understand your question, but to attempt to answer it here is the following.
No you should not fully draw to the screen then scale it. This is the wrong approach. You should tile very large surfaces and only draw the relevant tiles. If you need a very large view, you should use a scaled down image (pre-sca... | 0 | 1,634 | 0 | 1 | 2014-07-14T18:57:00.000 | python,graphics,pygame | Pygame Large Surfaces | 0 | 2 | 2 | 24,744,048 | 1 |
0 | 0 | I'm drawing a map of a real world floor with dimensions roughly 100,000mm x 200,000mm.
My initial code contained a function that converted any millimeter based position to screen positioning using the window size of my pygame map, but after digging through some of the pygame functions, I realized that the pygame transf... | false | 24,743,758 | 0 | 0 | 0 | 0 | If your map is not dynamic, I would suggest draw a map outside the game and load it in game.
If you plan on converting the game environment into a map, It might be difficult for a large environment. 100,000mm x 200,000mm is a very large area when converting into a pixels. I would suggest you to scale it down before loa... | 0 | 1,634 | 0 | 1 | 2014-07-14T18:57:00.000 | python,graphics,pygame | Pygame Large Surfaces | 0 | 2 | 2 | 24,744,442 | 1 |
0 | 0 | I am trying to visualize a Control Flow Graph in Python using pyqtgraph. I have the following two problems.
How can I visualize the edges with a direction?
How can I visualize a self edge?
I tried looking into the documentation, but couldn't find. Obviously, I didn't get time to read it all! | false | 24,760,322 | 0.099668 | 0 | 0 | 1 | While pyqtgraph is awesome, for my use case I found a much better tool to do this.
graphviz is a nice tool to develop Control Flow Graphs quite conveniently, and has a large number of features for this particular problem. | 0 | 375 | 0 | 0 | 2014-07-15T14:03:00.000 | python,pyqtgraph | Edges with Direction in pyqtgraph GraphItem | 0 | 2 | 2 | 25,269,345 | 1 |
0 | 0 | I am trying to visualize a Control Flow Graph in Python using pyqtgraph. I have the following two problems.
How can I visualize the edges with a direction?
How can I visualize a self edge?
I tried looking into the documentation, but couldn't find. Obviously, I didn't get time to read it all! | true | 24,760,322 | 1.2 | 0 | 0 | 0 | For direction, you might add a pg.ArrowItem at the end of each line (although this could have poor performance for large networks), and for self connections, QtGui.QGraphicsEllipseItem combined with an arrow. | 0 | 375 | 0 | 0 | 2014-07-15T14:03:00.000 | python,pyqtgraph | Edges with Direction in pyqtgraph GraphItem | 0 | 2 | 2 | 24,763,543 | 1 |
0 | 0 | No i don't ask about spritesheets.
I'm working on a game in pygame and I want to know if it's possible to divide sprite into parts like body parts and then use it in collision-detection with pygame.sprite.groupcollide? | true | 24,763,949 | 1.2 | 0 | 0 | 2 | The default Sprite class has no notion of separate parts of a sprite; the whole thing is assigned a single bounding box. If you plan on using pygame.sprite.groupcollide it seems like you don't want an individual sprite anyway, you want them packaged together in their own group. Keep in mind that the pygame.sprite.Group... | 1 | 357 | 0 | 3 | 2014-07-15T16:55:00.000 | python,pygame,collision-detection,sprite | How to divide sprite into smaller parts in pygame? | 0 | 1 | 1 | 24,764,544 | 1 |
0 | 0 | My question is about QDial. It can make the full tour around. When the value is 0 it jumps to 100 and if the value is 100 and you turn it a little more it passes to 0 suddenly.
How can I disable this? | false | 24,776,767 | 0.066568 | 0 | 0 | 1 | Actually @Trilarion , setWrapping to false does not fix his problem.
The Dial still jumps from end to beginning and vice-versa. This is not cool in some applications.
The only solution, I believe, is to hardly not allowing the Dial to do this in a slot. For example, in value changed. Considering you stored the previous... | 0 | 351 | 0 | 1 | 2014-07-16T09:12:00.000 | python,qt,slider,pyqt,limit | QDial disabling full tour | 0 | 1 | 3 | 34,220,799 | 1 |
0 | 0 | I have terrible doubts regarding python config file approach.
I am creating a program with a GUI (PyQt). The program loads some settings from a .cfg file using the configparser module. And the user can edit these settings from the GUI with the user preferences widget. When the preferences widget is closed the .cfg file... | false | 24,785,121 | 0 | 0 | 0 | 0 | Updating the state of your application may not be a trivial thing if you are somewhere in the middle. Just an example:
Your app = A car
You launch your app = You start your car
You set in the preferences the variable type_tyre to Winter
Your running app still has type_tyre equals Sommer
You attempt to change tyres whi... | 1 | 699 | 0 | 0 | 2014-07-16T15:45:00.000 | python,pyqt,updating,configparser | Python - update configparser between modules | 0 | 1 | 2 | 24,871,124 | 1 |
0 | 0 | I have an application made up of Frames, Frames in Frames and Labels in Frames. There is quite a lot of them and I am looking for a way to modify some of the default values.
I am particularly interested in modifying .columnconfigure() since I call .columnconfigure(0, weight=1) on each of the columns, in each frame. Thi... | true | 24,806,713 | 1.2 | 0 | 0 | 3 | No, there is no way to change the defaults. You can easily write your own grid function to automatically configure the weight of each column. You could do this by subclassing Frame, for instance. | 0 | 207 | 0 | 0 | 2014-07-17T14:46:00.000 | python,tkinter | how to change default values for .columnconfigure() in tkinter? | 0 | 1 | 2 | 24,814,914 | 1 |
0 | 0 | I have two questions that I can not answer to myself:
How can I change the size of my window, if I do not know the exact size of the phone screen? I.e. my aim is to fit all screen sizes.
Is there any difference between clicking with mouse and touching with fingers in the code? If I write code for clicking, will it wor... | true | 24,830,313 | 1.2 | 0 | 0 | 2 | On mobile, your app should automatically fill the phone screen. You don't need to worry about it. On desktop, you can use the --size=WxH option to test a specific screen size, or use the screen module (-m screen:nexus7 for example - run kivy with -m screen to see the available options).
No. All mouse/touchscreen intera... | 0 | 399 | 0 | 1 | 2014-07-18T17:02:00.000 | android,python,kivy | Kivy: how to change window size properties and the difference between click and touch | 0 | 1 | 1 | 24,830,380 | 1 |
0 | 0 | Good afternoon,
I'm using a QTableview+QAbstractTableModel to display a potentially large amount of data (20k+ rows) were each row consists of cells holding text of various length, including newlines, displayed using a custom delegate. The data resides in memory (no database, stream or similar) and might be changed fro... | false | 24,864,255 | 0.197375 | 0 | 0 | 1 | If you set verticalHeader.sizeHint to ResizeToContents, on any row update ALL table will be processed to obtain new column width. This behaviour is life saver for most of us, if we don't have a large table that frequently update.
First, don't use resizeToContents size hint!
Basic solution: use fixed size for columns w... | 0 | 772 | 0 | 2 | 2014-07-21T11:42:00.000 | python,qt,pyqt4 | QTableview - ResizeToContents queries every row? | 0 | 1 | 1 | 24,951,937 | 1 |
0 | 0 | I am pretty new to python, my background is with VB visual studios, I am trying to develop a app in which I want to consume WCF service. Found Suds is the required python module.
I am using Kivy 1.8.0 and Eclipse with pydev on Windows 7 64bit. Could you please point me in correct direction on how to instal the package... | true | 24,954,106 | 1.2 | 0 | 0 | 0 | Are you by any chance running the Python 3 version of Kivy? Suds looks like it is abandondonware (last release in 2010) and likely does not have a Python3 port. You may have luck with the Python2.7 version of Kivy and pip installing suds, but keep in mind you will be relying on an apparently unsupported module (suds) f... | 1 | 396 | 0 | 1 | 2014-07-25T10:53:00.000 | python,installation,kivy,suds | Kivy with suds - module installation | 0 | 1 | 2 | 25,000,617 | 1 |
0 | 0 | How can I get raw base64 PNG data from a PyQt4.QtGui.QImage object? The only method I can find that seems like it would help is bits(), but that just returns a sip.voidptr object and I have no idea where to go from there. | false | 24,965,646 | -0.197375 | 0 | 0 | -2 | You have the right method if you want to directly access the data in memory. It is a C array, and has no python object associated, so it's a little tricky. You need: the start address from bits(), the depth() and the byteCount(). ctypes.string_at would give you access to the data there, which you would pass to a numpy ... | 0 | 1,434 | 0 | 0 | 2014-07-25T22:52:00.000 | python,qt,python-3.x,pyqt | Convert PyQt4.QtGui.QImage object to base64 PNG data | 0 | 1 | 2 | 24,965,943 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.