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 doing research with mobile apps and need to analyze their code after unzipping the .apk file. However, the process of unzipping naturally involves lots of IO, which doesn't make it scalable, I am thinking if it's possible to hold the unzipped data in memory, with several variables representing it, thus saving the trouble of writing to FS. I am loaded with thousands of apps to analyze, so being able to do something like this would significantly speed up my process. Is there anyone who can suggest a way out for me. I am using python.
Thanks in advance | false | 17,055,496 | 0 | 0 | 0 | 0 | A late entry...but all I had to do was rename the file to a .ZIP extension. | 0 | 14,330 | 1 | 2 | 2013-06-11T23:28:00.000 | android,python,unzip | is it possible to unzip a .apk file(or generally any zipped file) into memory instead of writing it to fs | 0 | 1 | 3 | 64,447,721 | 1 |
0 | 0 | I have to make a GUI for some testing teams. I have been asked to do it in Python, but when I Google, all I see is about Iron Python.
I also was asked not to use Visual Studio because it is too expensive for the company. So if you have any idea to avoid that I would be very happy.
I am still new to Python and programming overall so not any to advanced solutions.
If you have any questions just ask.
GUI PART: with would you use when using windows and mac(most windows) I would like some drag and drop so I don't waste to much time making the display part | false | 17,081,821 | 0 | 0 | 0 | 0 | All implementations can run on Eclipse via PyDev. So it kills the argument of which one to use as it is all the same language, implementations other than this instance are more domain specific. Iron Python targets Microsoft, Jython targets Java, Python targets itself. Each environment naturally has its own complier/library all you are doing is trading environments by choosing one over the other. Each has its positives and negatives but naturally you would want to give Python a try before touching other environments as a beginners rule. | 0 | 21,603 | 0 | 13 | 2013-06-13T07:46:00.000 | python,ironpython | Python vs Iron Python | 0 | 2 | 5 | 37,896,844 | 1 |
0 | 0 | I have to make a GUI for some testing teams. I have been asked to do it in Python, but when I Google, all I see is about Iron Python.
I also was asked not to use Visual Studio because it is too expensive for the company. So if you have any idea to avoid that I would be very happy.
I am still new to Python and programming overall so not any to advanced solutions.
If you have any questions just ask.
GUI PART: with would you use when using windows and mac(most windows) I would like some drag and drop so I don't waste to much time making the display part | false | 17,081,821 | 0.039979 | 0 | 0 | 1 | If you're just trying to create a GUI that runs on Windows, C# on Visual Studio is the easiest way to go. Their free version, Community (used to be Express) provides all the Windows controls you're used to using with a drag and drop GUI builder. | 0 | 21,603 | 0 | 13 | 2013-06-13T07:46:00.000 | python,ironpython | Python vs Iron Python | 0 | 2 | 5 | 30,813,721 | 1 |
1 | 0 | as the question states, I wish to embed a tinymce editor in a PyQT webkit component.
As far as I understand, evaluateJavascript allows for js functions to be called.
However, when I try loading tinymce.min.js, the editor does not display anything at all. As suspected, when evaluating a javascript that 'loads' other javascript files, they don't actually get loaded.
At this point, I feel lost. I will try to manually load 'plugins' that will be specified in tinymce's init function and will update this.
Till that time, any help would be really appreciated. | false | 17,119,388 | 0 | 0 | 0 | 0 | EvaluateJavaScript does make javascript function calls, or embed a whole javascript file. The following details out the attempts to solve the problem:
The approach of first reading the tinyMCE.js file and then using that in an evaluatejavascript method embeds the javascript somewhere, and can't be sniffed out in a webkit console. When loading files using the evaluatejavascript method, any dependencies, such as the ones that tinymce require, are not loaded. I think it's because javascript calls are "attached" to the webkit but not embedded in the frame's DOM itself.
The second approach consists of creating a webkit page and loading an html file. The html file itself embeds the javascript, so the component works like a "browser". In tinymce's configuration, toolbars and unnecessary parts were hidden. TinyMCE version 3 worked well with PyQt4. When the 4th version was embedded in an html page however, textareas were not being converted to tinymce editors. The console itself shows 'undefined' error messages, deduced to the assumption that tinymce 4 uses different javascript syntax and a different compiler.
And so ends my quest to write a stand-alone webkit editor. :) | 0 | 239 | 0 | 0 | 2013-06-15T01:29:00.000 | javascript,python,tinymce,pyqt,qwebkit | Embedding a TinyMCE editor in PyQT QWebkit | 0 | 1 | 1 | 17,288,641 | 1 |
1 | 0 | I have a school project where my team needs to build a board game. We want to use Python based on all the good things we have heard. I have been researching MVC frameworks and came across Django (its part of my installation on Pydev). I have a Mac, fyi.
I have also been looking up Tkinter but cant seem to understand what the difference is between Django and Tkinter. Why would you use one over the other? I understand that Django is for Web Development. And I think I understand that Tkinter is for building GUI's right?
The board game will have multiple players who should all get updated when one of the players makes a move.
Can any of you point me to where I should be looking online based on what I am trying to do? I am not looking for code, but just the right website with some good documentation and tutorials that will help me out. Thanks again, Mash | false | 17,137,050 | 0.291313 | 0 | 0 | 3 | Tkinter is a GUI library (for desktop applications) and Django is for web development. Both are completely different and in fact it is useless to compare them even. | 0 | 2,632 | 0 | 0 | 2013-06-16T19:49:00.000 | python,django,model-view-controller,event-handling,tkinter | Trying to understand Python and all its moving parts - What is the difference between Tkinter and Django | 0 | 1 | 2 | 17,137,094 | 1 |
0 | 0 | I really would like to start getting into Objective C coding, specifically so I can write applications for iOS.
My coding background is that I have written C# .NET GUI Windows apps and PHP web scripts for years; I've also become a very good Python coder in the past year. I have written hundreds of useful command-line Python scripts, and also a few GUI apps using wxPython successfully. I also wrote VB6 GUI apps way back in the day, and of course, I cut my teeth on QuickBASIC in DOS. ;-)
I understand OOP concepts: I understand classes, methods, properties and the like. I use OOP a lot in Python, and obviously use it extensively in C#.
I haven't actually taken the time to really get good at C or C++, however I am able to write simple "test" programs to accomplish small tasks. The problem is that I understand the syntax just fine, but the APIs can be very different depending on platform, and accomplishing the same thing in C on Linux at the command line is totally different than accomplishing it in Windows in a GUI.
I've looked over a few books out there for iOS coding but they seem to assume little to no programming knowledge and quickly bore me, and I can't easily find the information I really need buried among all of the "here's what an object is" or "this is called a class and a method" stuff...
I also tried the Stanford lectures on iTunes U, but I found myself struggling with the MVC concepts and the idea of setting up different files for "implementation" and "header" and all of that...
Is there any resources that you guys can think of that would be good for me to get started with iOS?
It's also worth noting I have dabbled with PyObjC a little on Mac and therefore do understand a LITTLE about the NS foundation classes and such, and I've also looked at Apple's reference documentation and I'm sure that once I get the basics down I could put good use to it, but I still don't know how to actually get a functional iOS app that does something useful going. | false | 17,138,389 | 0.049958 | 1 | 0 | 1 | I learned to write iOs apps from the CS 193P iPhone Application Development course on iTunes U. It's fantastic and I highly recommend it if you are sure iOs is what you want to do. | 0 | 166 | 0 | 0 | 2013-06-16T22:38:00.000 | python,.net,ios | Best intro to iOS for Python/PHP/C# Coder | 0 | 2 | 4 | 17,138,453 | 1 |
0 | 0 | I really would like to start getting into Objective C coding, specifically so I can write applications for iOS.
My coding background is that I have written C# .NET GUI Windows apps and PHP web scripts for years; I've also become a very good Python coder in the past year. I have written hundreds of useful command-line Python scripts, and also a few GUI apps using wxPython successfully. I also wrote VB6 GUI apps way back in the day, and of course, I cut my teeth on QuickBASIC in DOS. ;-)
I understand OOP concepts: I understand classes, methods, properties and the like. I use OOP a lot in Python, and obviously use it extensively in C#.
I haven't actually taken the time to really get good at C or C++, however I am able to write simple "test" programs to accomplish small tasks. The problem is that I understand the syntax just fine, but the APIs can be very different depending on platform, and accomplishing the same thing in C on Linux at the command line is totally different than accomplishing it in Windows in a GUI.
I've looked over a few books out there for iOS coding but they seem to assume little to no programming knowledge and quickly bore me, and I can't easily find the information I really need buried among all of the "here's what an object is" or "this is called a class and a method" stuff...
I also tried the Stanford lectures on iTunes U, but I found myself struggling with the MVC concepts and the idea of setting up different files for "implementation" and "header" and all of that...
Is there any resources that you guys can think of that would be good for me to get started with iOS?
It's also worth noting I have dabbled with PyObjC a little on Mac and therefore do understand a LITTLE about the NS foundation classes and such, and I've also looked at Apple's reference documentation and I'm sure that once I get the basics down I could put good use to it, but I still don't know how to actually get a functional iOS app that does something useful going. | false | 17,138,389 | 0.049958 | 1 | 0 | 1 | I have gotten more from Erica Sadun's books than any of the others, personally. iOS apps use a lot of animation and graphics, by necessity, and her code examples are clean and concise. They aren't beginner's books but you sound as though you're not a beginning coder. They hit on a lot of topics it is hard to find much on.
If you're willing to work through the sample programs, I found iPad iOS 6 Development Essentials to be comprehensive (Neil Smith). However, it tends to focus on the visual IDE of xCode which I think is lousy and chose not to use at all; if you plan to use it, then that would be a good resource imo. Also, I got a book that covered Objective C only (Aaron Hillegass) which I thought was good. The iOS book from the same author was not good for me, because it depended on you working prior chapter examples to proceed to later chapters, which for me was a waste of time, so I bailed out of it quickly. I also got Pro Core Data (Privat and Warner) which I found to be of limited (actually, little) value for the same reason as the Hillegass iOS book -- the examples are too big and not to the point.
And, of course, Google. | 0 | 166 | 0 | 0 | 2013-06-16T22:38:00.000 | python,.net,ios | Best intro to iOS for Python/PHP/C# Coder | 0 | 2 | 4 | 17,140,686 | 1 |
0 | 0 | I'm trying do a very simple task: Make a Button click in Tkinter.
I have an array of Buttons and, when I finish an event, I want to make a Button click event in one of my buttons.
I thought it should be as simple as buttons[2].click(), but that doesn't do anything. | true | 17,162,992 | 1.2 | 0 | 0 | 3 | Try calling .invoke() on the button | 0 | 972 | 0 | 1 | 2013-06-18T07:28:00.000 | python,button,tkinter | Make a click event in Tkinter | 0 | 1 | 1 | 17,163,119 | 1 |
0 | 0 | I changed my computer recently, and the very same program using Python and Pyglet runs a lot slower on the newer computer than on the old one (25 seconds vs. 10 seconds).
The older was an Asus EEE 1015p, with the following specs :
processor : Intel Atom N570
memory : 2 Gb
gfx : Intel GMA 3150
OS : Windows 7 Starter Edition 32
python version : 2.7
pyglet version : 1.1.4
The newer is a HP Pavilion dm1 :
processor : Processeur AMD E2-1800 APU with Radeon(tm) HD Graphics, 1700 MHz
gfx : AMD Radeon HD 7340 Graphics
memory : 4 Gb
OS : Windows 8 64
python version : 2.7 (32 bits)
pyglet version : 1.2alpha1
I suspected a problem of graphics driver, but some programs using OpenGL (for example, Playstation2 Emulator PCSX2) run clearly faster on the newer (by around 40 %) so I'm quite surprised. So I wonder if speed issues are known for some pyglet versions.
The program use batches to render a map made of 4 tiled layers, on which sprites are moving.
Thanks to anyone who can point me what is wrong... | false | 17,164,837 | 0.197375 | 0 | 0 | 1 | Problem solved. I give the answer in the unlikely case someone would encounter it :
it was a driver settings issue : in AMD Vision Engine Control Center, I had to move performance vs. quality setting to max. performance. I have now similar performances on the 2 machines. | 0 | 270 | 0 | 3 | 2013-06-18T09:07:00.000 | python,hardware,pyglet | Pyglet slower on a faster computer | 0 | 1 | 1 | 17,254,328 | 1 |
0 | 0 | Qt interfaces currently look horrible on a retina display as they scale up.Its possible to use an Info.Plist for a complied application but does anyone have a solution for dynamic python such as interfaces created in PySide? | false | 17,211,006 | 0.099668 | 0 | 0 | 1 | I basically found out the solution: be sure you have QT >= 5 installed, since it has been introduced in that version, secondly I am now running python3.3.
Enjoy your retina | 0 | 2,959 | 0 | 3 | 2013-06-20T10:12:00.000 | python,qt,pyqt,pyside | Optimising Python QT apps on retina displays | 0 | 1 | 2 | 17,515,469 | 1 |
0 | 0 | using 2.5.4 on windows 7
is there a simple way to print py files in color (as they appear on the screen) AND select a desired font?
thanks
Glen | false | 17,215,202 | 0.197375 | 0 | 0 | 1 | If you are using IDLE, the default IDE that comes with Python for Windows you should be able to print your Python script with syntax highlighting from there.
If you are looking for a script that takes a python file and then prints it with syntax highlighting, you'd need to provide more information as to what you are trying to achieve. | 1 | 104 | 0 | 2 | 2013-06-20T13:42:00.000 | python,printing | Is there a way to print a py file in color? | 0 | 1 | 1 | 17,225,483 | 1 |
0 | 0 | Does anyone know how to display the waveform of a sound file in a Tkinter window (Python)? | false | 17,303,998 | 0 | 0 | 0 | 0 | Depending on the sound file format, if it is a .wav then you can probably just read it in to a numpy array then plot it, otherwise you are going to have to parse the file format first. | 0 | 257 | 0 | 0 | 2013-06-25T17:41:00.000 | python,python-2.7,audio,tkinter | Plot wavewform in Tkinter (Python) | 0 | 1 | 1 | 17,304,375 | 1 |
0 | 0 | Problem: I have QTableWidget cells populated with text (10 columns). I found out that no matter how much rows I have (10 or 100000) scrolling over rows with heigth ~ over 3000 is very slow and not smooth enough (I've used table.verticalHeader().sectionSize(i) to find out heigth of every row).
What I've tried to do: So I've tried to set height of those rows using table.setRowHeight(i,3000), but still when I scroll over those rows I get delay of 1-5 secunds. Also in that case I need to manualy resize height of row in order to see all text in that row (because it was cuted), and that is slow too.
Questions: I need to do table.resizeRowsToContent() for all smaller rows, so I think solution would be to set limit for height of every row in table. There is setMinimumSectionSize() method but I can't find any for max size, so how can I do it? Is it possible to have scrollbars inside every cell where height is >3000 so I can scroll through text inside that cell? Maybe that will speed up scrolling throug table?
Any help would be appreciated | true | 17,324,670 | 1.2 | 0 | 0 | 1 | This is how I've solved it:
While populating table cells with text, if my text have over 1000 lines (text.count("\n")) I put it in QTextEdit() and then set it with setCellWidget. Reason I didn't put them all in QTextEdit()s is that Windows can show limited number of GUI elements (<20000) and, as I said, I have 10 columns x up to 100000 rows | 0 | 913 | 0 | 1 | 2013-06-26T15:45:00.000 | python,scroll,qtablewidget | Qtablewidget does not scroll smoothly | 0 | 1 | 1 | 21,234,521 | 1 |
0 | 0 | How can I show a window created with Tkinter.Tk() outside visible screen? I need to make it much bigger than the desktop size, and show part of it defined by coordinates. | false | 17,326,583 | 0 | 0 | 0 | 0 | Another possible way is to insert a frame and resize that, eg:
import tkinter as tk
root = tk.Tk()
frame = Frame(root, width = 1000, height = 1000)
frame.pack()
root.mainloop
The size of your window will then be determined by the frame, although the answer already given works just fine too | 0 | 656 | 0 | 2 | 2013-06-26T17:22:00.000 | python,tkinter,tk | Tkinter window outside desktop | 0 | 1 | 2 | 33,200,160 | 1 |
0 | 0 | I have been thinking about my final year project topic and to be honest I want to create something GREAAAT like many others. I know C,C++,Java and Python (Python is getting quite popular these days).. I want to create a small-scale application like Blender (graphics rendering software) any tips for me? I prefer using OpenGL and it's shading language rather than Direct3D since it is open-source.
Tell me the stuffs I should know to pull this off and also if the combination of python and OpenGL a good choice for this application ? | false | 17,328,290 | 0 | 0 | 0 | 0 | I want to create a small-scale application like Blender (graphics rendering software) any tips for me?
Yes: Readjust your perception of software size/complexity. I occasionally contribute (TBH, it's been years since I submitted something substantial) to Blender and over the years it turned into a mighty suite. But the codebase is just as large. | 0 | 688 | 0 | 0 | 2013-06-26T18:58:00.000 | python,opengl,graphics,blender | Creating small scale application like Blender? | 0 | 2 | 2 | 17,328,734 | 1 |
0 | 0 | I have been thinking about my final year project topic and to be honest I want to create something GREAAAT like many others. I know C,C++,Java and Python (Python is getting quite popular these days).. I want to create a small-scale application like Blender (graphics rendering software) any tips for me? I prefer using OpenGL and it's shading language rather than Direct3D since it is open-source.
Tell me the stuffs I should know to pull this off and also if the combination of python and OpenGL a good choice for this application ? | false | 17,328,290 | 0 | 0 | 0 | 0 | A small object-viewer should definitely be possible. That's something you can build and add features upon, depending on how much time is left. I would do the visualization and movement in your scene first, then some basic interactions with your objects (translating, rotating, etc.). The final step would be adding tools (edit polygons, sculpt, etc.). If you are fit enough in C++, OpenGL and Software-Architecture on a larger scale it should be doable. | 0 | 688 | 0 | 0 | 2013-06-26T18:58:00.000 | python,opengl,graphics,blender | Creating small scale application like Blender? | 0 | 2 | 2 | 17,330,177 | 1 |
0 | 0 | I am trying to use C++ lib with python using SWIG,
my problem is that the main class symbol is missing,
$ ldd -r -d _rf24.so 2>&1|grep RF24
undefined symbol: _ZN4RF24C1Ehh (./_rf24.so)
$ objdump -t librf24-bcm.so.1.0 |grep RF24
.
.
.
000032cc g F .text 00000044 _ZN4RF24C1Ehhj
000032cc g F .text 00000044 _ZN4RF24C2Ehhj
.
.
.
python exception:
ImportError: ./_rf24.so: undefined symbol: _ZN4RF24C1Ehh
I tried using the lib objs from the original Makefile or tried to compile them with some flags but the result is the same
build lines:
$ gcc -c RF24_wrap.cxx -I/usr/include/python2.7
$ gcc -lstdc++ -shared bcm2835.o RF24.o RF24_wrap.o -o _rf24.so
RF24.i (the SWIG file):
%module rf24
%{
#include "RF24.h"
%}
%include "RF24.h"
//%include "bcm2835.h"
%include "carrays.i"
%array_class(char, byteArray);
RF24.h (relevant part of the class header file):
.
.
.
// bla bla bla enums...
class RF24
{
private:
// bla bla bla
protected:
// bla bla bla
public:
RF24(uint8_t _cepin, uint8_t _cspin);
RF24(uint8_t _cepin, uint8_t _cspin, uint32_t spispeed )
//bla bla bla | false | 17,362,909 | 0 | 1 | 0 | 0 | Problem Solved! After using c++filt, I have found out that one of the constructors in the lib wasn't defined, after deleting it problem solved | 0 | 215 | 0 | 0 | 2013-06-28T10:44:00.000 | c++,python,swig,porting,symbols | Missing / wrong signature whan converting c++ library to python using SWIG | 0 | 1 | 1 | 37,594,931 | 1 |
0 | 0 | I'm creating a desktop application that is interfaced with using a mobile app or mobile communications ( twitter, txt )
I already have the mechanisms in place to share media ( youtube, instagram, )
with the desktop app from a mobile device.
But, I would like to add a websocket chatbox to the desktop interface. So, that users can add msgs using a webview or websocket client within the mobile app.
BUT
How do I combine websockets with pyqt?
I've found very few examples online... just looking for some insight on this problem. | true | 17,416,893 | 1.2 | 0 | 0 | 1 | A way to do this is to use a QWebView, insert that into your App and then load a HTML5 page in the WebView and use that to communicate with the server.
This way you can probably even reuse the code for the mobile client as the code for the desktop chat interface. | 0 | 1,153 | 0 | 0 | 2013-07-02T03:20:00.000 | python,user-interface,websocket,pyqt | PyQt and WebSockets | 1 | 1 | 1 | 17,417,077 | 1 |
0 | 0 | Simple question, but I've tried a few things and nothing seems to work.
I want to overlay some statistics onto a 3d VTK scene, using 2D vtkTextActors. This works fine, but the text is at times difficult to see, depending on what appears behind it in the 3D scene.
For this reason, I'd like to add a 2d, semi-transparent "box" behind my text actors to provide a darker background.
Which VTK object is appropriate for this? I've tried so far:
vtkLegendBoxActor: Not what I want, but I can use this with no text to display a semi-transparent box on screen. I cannot size it directly and I get warnings about not initialising some of the content.
vtkImageData: Tried manually creating image data and adding it to the scene; I believe it was placed within the 3d scene and not used as an overlay. If that's not the case then I couldn't get it to show at all.
vtkCornerAnnotation: Scales with window size, is fixed to a corner and the background opacity cannot be set AFAIK.
vtkTextActor: Cannot set a background color or opacity
Can anyone tell me how they might achieve what I'm after in VTK? | false | 17,461,600 | 0 | 0 | 0 | 0 | just use vtktexture, vtkimagedata & add your own image as texture background to the vtkrenderer by reducing the opacity like a watermark. thats it | 0 | 1,042 | 0 | 1 | 2013-07-04T03:53:00.000 | python,vtk | Semi-transparent 2d VTK text background | 0 | 1 | 2 | 25,908,567 | 1 |
0 | 0 | I know that many large-scale applications such as video games are created using multiple langages. For example, it's likely the game/physics engines are written in C++ while gameplay tasks, GUI are written in something like Python or Lua.
I understand why this division of roles is done; use lower-level languages for tasks that require extreme optimization, tweaking, efficiency and speed, while using higher-level languages to speed up production time, reduce nasty bugs ect.
Recently, I've decided to undertake a larger personal project and would like to divy-up parts of the project similar to above. At this point in time, I'm really confused about how this interoperability between languages (especially compiled vs interpreted) works.
I'm quite familiar with the details of going from ANSCII code test to loading an executable, when written in something like C/C++. I'm very curious at how something like a video game, built from many different languages, works. This is a large/broad question, but specifically I'm interested in:
How does the code-level logic work? I.e. how can I call Python code from a C++ program? Especially since they don't support the same built-in types?
What does the program image look like? From what I can tell, a video game is running in a single process, so what does the runtime image look like when running a C/C++ program that calls a Python function?
If calling code from an interpreted language from a compiled program, what are the sequence of events that occur? I.e If I'm inside my compiled executable, and for some reason have a call to an interpreted language inside a loop, do I have to wait for the interpreter every iteration?
I'm actually finding a hard time finding information on what happening at the machine-level, so any help would be appreciated. Although I'm curious in general about interoperation of software, I'm specifically interested in C++ and Python interaction.
Thank you very much for any insight, even if it's just pointing me to where I can find more information. | true | 17,507,004 | 1.2 | 1 | 0 | 3 | In the specific case of python, you have basically three options (and this generally applies across the board):
Host python in C++: From the perspective of the C++ programme, the python interpreter is a C library. On the python side, you may or may not need to use something like ctypes to expose the C(++) api.
Python uses C++ code as DLLs/SOs - C++ code likely knows nothing of python, python definitely has to use a foreign function interface.
Interprocess communication - basically, two separate processes run, and they talk over a socket. These days you'd likely use some kind of web services architecture to accomplish this. | 0 | 1,114 | 0 | 8 | 2013-07-06T20:49:00.000 | c++,python,game-engine,language-interoperability | How interoperability works | 0 | 1 | 2 | 17,507,117 | 1 |
0 | 0 | I've to output few points in an interactively selected region of an image. I'm not familiar with PyQt to select the appropriate elements for the task. Please suggest the right way to do it. Currently, this is what I intend to do :
Load the image.
Use QImage (QPixMap?) to display the image.
Select a rectangular region in the image.
Use QRubberBand to select the region.
Draw a grid in the region.
Use QLines?
Make the grid points (interesctions) selectable.
No idea.
Any pointers to snippets using the required classes will be greatly helpful. Thanks ! | true | 17,509,478 | 1.2 | 0 | 0 | 1 | Use QGraphicsScene and QGraphicsView to display your scene.
Use scene->addPixmap to add the image.
Use QRubberBand to select the region as you said.
Use view->mapToScene to convert viewport coordinates obtained from QRubberBand to the scene coordinates.
Add lines using scene->addLine
Add small circle items to lines intersection points using scene->addEllipse. This function returns QGraphicsEllipseItem* object. You should use circles with (0, 0) center. Use item->setPos to move each circle in the proper place.
Use item->setFlag(QGraphicsItem::ItemIsSelectable) to make circle items selectable. You can now select items with mouse clicks.
Use view->dragMode(QGraphicsView::RubberBandDrag) if you want to enable items selection using automatic QRubberBand.
Use QGraphicsScene::selectedItems to obtain selected items. You can then use item->pos() to obtain items positions. | 0 | 934 | 0 | 0 | 2013-07-07T05:10:00.000 | python,qt,pyqt | How to select an area and fill it with a grid in PyQt? | 0 | 1 | 1 | 17,510,954 | 1 |
0 | 0 | I am aiming to change the a part of the Tkinter screen when a button is clicked. Do I have to destroy the screen then redraw it (to create the illusion that only a part is being changed?) Or can I keep the button there and somehow only change one part (like the graphics.) Thanks! | false | 17,517,961 | 0 | 0 | 0 | 0 | No, you do not have to destroy the screen and redraw it. You can easily insert widgets into the current window when a button is clicked. There's nothing special about being run from a button click -- the code is the same as your initialization code. | 0 | 881 | 0 | 0 | 2013-07-08T01:16:00.000 | python,tkinter | Changing Tkinter Screen when button is clicked? | 0 | 1 | 1 | 17,518,474 | 1 |
0 | 0 | I know this question has been asked before but those questions typically lack specific details and result in answers that say something like "It depends what you are trying to do..." so the main gist of this app is that it retrieves remote data (ex. text) and object (ex. images).
Since PHP and python are the two programming languages I feel comfortable with I felt python was more suited for desktop gui apps. I'm creating a desktop music player and here are some of the technical specs I want to include:
A sign in construct that authenticates user credentials (Like
spotify, skype, league of legends) against a remote database (This
will be in mysql.) My thinking is to create a web api for the client to query via HTTP/HTTPS GET/POST
A client side SQLite database that stores the filename, filepath and
id3 tags of the song so upon launching, the application displays each song in a row with the song length, artist, album, genre (Like iTunes)
Retrieve remote images and display them within the application's frame (Like skype displays a person's profile picture.)
Must be cross-platform (At least in Windows and Mac), look native in different OS's but the native look and feel should be easily overridden with custom styles (Ex. rounded buttons with gradients.)
Compilation for Windows and Mac should be relatively straightforward
Of the popular python gui toolkits like PyQt, PyGTK, Tkinter, wxPython, Pyjamas, PyGObject and PySide which are well suited for my application and why? Why are the others not well suited for these specs? Which have good documentation and active communities? | false | 17,522,223 | 0 | 0 | 0 | 0 | I only got expirience with Qt-based Python GUI-toolkits, and found them to be very powerful, well documented and simple to use (as long as you stay away from model-view framework). And they can do all the things you mentioned. So my recomendation would be PyQt or PySide. PySide's advantage is it's license - LGPL, so if your stuff is proprietary - go for PySide. PySide has some troubles however, as it is basically abandoned as of writing this, so you will have to dodge some bugs (nothing realy critical IMO). PyQt is more actively maintained and developed, but it's GPL or commercial (about 400 euros). So if your stuff is free, you should choose PyQt. And yes, use ORM, if possible. Just my 2 cents. | 0 | 1,760 | 0 | 1 | 2013-07-08T08:37:00.000 | python,tkinter,wxpython,pyqt,pygtk | Considerations for python gui toolkit for app that queries remote database? | 0 | 2 | 5 | 17,525,347 | 1 |
0 | 0 | I know this question has been asked before but those questions typically lack specific details and result in answers that say something like "It depends what you are trying to do..." so the main gist of this app is that it retrieves remote data (ex. text) and object (ex. images).
Since PHP and python are the two programming languages I feel comfortable with I felt python was more suited for desktop gui apps. I'm creating a desktop music player and here are some of the technical specs I want to include:
A sign in construct that authenticates user credentials (Like
spotify, skype, league of legends) against a remote database (This
will be in mysql.) My thinking is to create a web api for the client to query via HTTP/HTTPS GET/POST
A client side SQLite database that stores the filename, filepath and
id3 tags of the song so upon launching, the application displays each song in a row with the song length, artist, album, genre (Like iTunes)
Retrieve remote images and display them within the application's frame (Like skype displays a person's profile picture.)
Must be cross-platform (At least in Windows and Mac), look native in different OS's but the native look and feel should be easily overridden with custom styles (Ex. rounded buttons with gradients.)
Compilation for Windows and Mac should be relatively straightforward
Of the popular python gui toolkits like PyQt, PyGTK, Tkinter, wxPython, Pyjamas, PyGObject and PySide which are well suited for my application and why? Why are the others not well suited for these specs? Which have good documentation and active communities? | false | 17,522,223 | 0.07983 | 0 | 0 | 2 | Both PySide and WxPython support all five of your requirements. WxPython uses actual native widgets and also has custom extensions and widgets built on top. It has goodies like wx.CallAfter which'll allow you to run your background tasks in a separate thread and hop back on the UI thread easily.
PySide has a nicer API but draws its own widgets that imitate the underlying OS's UI. It's not as mature as WxPython and packaging it with tools like cx_freeze and PyInstaller is slightly more involved.
Also I recommend that you use an ORM like peewee over plain Sqlite3 for the data storage, it makes managing the data a lot easier and plays well with the freezing tools. | 0 | 1,760 | 0 | 1 | 2013-07-08T08:37:00.000 | python,tkinter,wxpython,pyqt,pygtk | Considerations for python gui toolkit for app that queries remote database? | 0 | 2 | 5 | 17,523,987 | 1 |
0 | 0 | Could you please tell me what is the closest data type in C++ to python list? If there is nothing similar, how would you build it in C++? | false | 17,528,657 | 0.07983 | 1 | 0 | 2 | There is no real equivalent, and it would be extremely difficult
to provide one. Python and C++ are radically different
languages, and providing one really wouldn't make much sense in
the context of C++. The most important differences are that
everything in Python is dynamically allocated, and is an
"object", and that Python uses duck typing.
FWIW: one very early library (before templates) in C++ did offer
containers of Object*, with derived classes to box int,
double, etc. Actual experience showed very quickly that it
wasn't a good idea. (And I'm curious: does any one else
remember it? And particularly, exactly what it was
called---something with NHS in it, but I can't remember more.) | 0 | 21,803 | 0 | 15 | 2013-07-08T14:03:00.000 | c++,python,list | Python list equivalent in C++? | 0 | 2 | 5 | 17,529,258 | 1 |
0 | 0 | Could you please tell me what is the closest data type in C++ to python list? If there is nothing similar, how would you build it in C++? | false | 17,528,657 | 0.197375 | 1 | 0 | 5 | Actually no C++ container is equivalent to Python's list, which is partially a result of the very different object models of C++ and Python. In particular, the suggested and upvoted std::list is IMHO not even close to Python's list type, a I'd rather suggest std::vector or maybe std::deque. That said, it isn't clear what exactly it is that you want and how to "build it" strongly depends on what exactly "it" is, i.e. what you expect from the container.
I'd suggest you take a look at the C++ containers std::vector, std::deque and std::list to get an overview. Then look at things like Boost.Any and Boost.Variant that you can combine with them, maybe also one of the smart pointers and Boost.Optional. Finally, check out Boost.Container and Boost.Intrusive. If the unlikely case that none of these provide a suitable approximation, you need to provide a better explanation of what your actual goals are. | 0 | 21,803 | 0 | 15 | 2013-07-08T14:03:00.000 | c++,python,list | Python list equivalent in C++? | 0 | 2 | 5 | 17,529,154 | 1 |
0 | 0 | I have a scrollable wx.textcontrol widget that updates during the course of the program. Whenever the text is updated,the scrollbar resets to the top of the screen. I don't want that to happen, but I can't figure out how to stop it. Does any of you know? | true | 17,535,252 | 1.2 | 0 | 0 | 2 | Just keep track of the line that you are on/or has been updated and call EnsureVisible on the text control. (Also ensure you are using Append rather than Set to add new text).
Correction, (now I have access to the help files), I was getting mixed up with MakeCellVisible from Grid controls:
YourTextCtrl.ShowPositon(YourTextCtrl.GetLastPosition()) should do the job nicely.
Even better if you call SetInsertionPointEnd() on your text control before the text is inserted, (by using WriteText), then your problem goes away. | 0 | 70 | 0 | 0 | 2013-07-08T20:18:00.000 | python,wxpython | Scroll bar problems | 0 | 1 | 1 | 17,535,320 | 1 |
0 | 0 | I have a frame with buttons and plotting options and wanted to include a table as well in that frame. Is there any example or suggestion on how to do it?
Thanks. | false | 17,539,441 | 0 | 0 | 0 | 0 | You would use a wx.grid.Grid in most cases. You could use a wx.ListCtrl or an ObjectListView widget too. The idea is to put the widgets inside of sizers. So you could have a top level BoxSizer in vertical orientation that contains another sizer or sizers. In this case, I would create a sizer to hold the buttons and nest that sizer in the top level sizer. Then add the table (i.e. grid) to the top level sizer and you're done. | 0 | 88 | 0 | 0 | 2013-07-09T03:31:00.000 | python-2.7,wxpython | How to insert a table inside a frame? | 0 | 2 | 2 | 17,550,349 | 1 |
0 | 0 | I have a frame with buttons and plotting options and wanted to include a table as well in that frame. Is there any example or suggestion on how to do it?
Thanks. | false | 17,539,441 | 0 | 0 | 0 | 0 | The wxpython demo is full of examples of all differant controls. | 0 | 88 | 0 | 0 | 2013-07-09T03:31:00.000 | python-2.7,wxpython | How to insert a table inside a frame? | 0 | 2 | 2 | 17,547,609 | 1 |
0 | 0 | Sorry for the sort of general question, but I'm having a hard time figuring out how to start this. I'm trying to incorporate some natural language toolkit code in Python with a mobile app I'm developing in Unity. It's a very small amount of code, but it's critical for the functioning of the app.
Do I need to have the python code running on some kind of server? How would I go about doing this? I'm very new to python and mobile development.
Thanks. | false | 17,549,279 | 0 | 0 | 0 | 0 | Traditional/classic Python is implemented in C. This makes it easy to integrate into any environment that has support for compiled C.
I'm unfamiliar with Unity, but here are some general guidelines on how you would do it with standard iOS and Android. On iOS, you would just add all of the Python C source files (minus the ones that have a 'main' function) to your project in Xcode. On Android, you would add all of the C source files (again, minus the ones that have a 'main' function) to your project in the JNI part of your project and would use ndk-build to build a native shared library that would be part of your app.
Are you limited to Python? If not, you might want to have a look at Lua as it's much smaller (fewer C source files) and might be quicker to get going. | 1 | 292 | 0 | 0 | 2013-07-09T13:20:00.000 | python,mobile,unity3d,nltk | How can I incorporate Python code in a mobile app? | 0 | 1 | 1 | 17,551,204 | 1 |
0 | 0 | What is the best way to a text based output in a Qt widget? what I mean by this is... like in win RAR or some windows installers where there is a drop down arrow showing more details and it shows live text output of files modified and things of that nature. how would I go about doing that in a Qt app?
I was thinking maybe a none editable multiple line text box... but I'm not sure, because I don't wan't it to be editable.
any help on this would be greatly appreciated. | true | 17,555,111 | 1.2 | 0 | 0 | 1 | QLabel
QTextDocument
QTextEdit
Almost all of the options above, can be configured to be "Read-only" or even unclickable by making them disabled.
QTextStream is also a really useful class.
Hope that helps. | 0 | 590 | 0 | 0 | 2013-07-09T18:01:00.000 | python,qt,pyside | how to make a Qt text output widget? | 0 | 1 | 1 | 17,557,946 | 1 |
0 | 0 | I am aiming to make a money counter for the game i am programming. For example, if I buy something (in the game) I want my money label to update with the new value once this happens. How would I go about this besides creating a loop that checks every second to see if my variable has changed? Thanks so much! | false | 17,557,489 | 0.132549 | 0 | 0 | 2 | Tkinter has a way to link widgets and data. You can create an instance of StringVar, and assign it to the textvariable attribute of a label. Whenever you change the value of the variable, the label will automatically update. | 1 | 858 | 0 | 2 | 2013-07-09T20:24:00.000 | python,user-interface,tkinter | Updating Label when variable changes in Tkinter | 0 | 2 | 3 | 17,560,333 | 1 |
0 | 0 | I am aiming to make a money counter for the game i am programming. For example, if I buy something (in the game) I want my money label to update with the new value once this happens. How would I go about this besides creating a loop that checks every second to see if my variable has changed? Thanks so much! | false | 17,557,489 | 0 | 0 | 0 | 0 | Ping the money counter with a function whenever an action such as buying or selling something occurs | 1 | 858 | 0 | 2 | 2013-07-09T20:24:00.000 | python,user-interface,tkinter | Updating Label when variable changes in Tkinter | 0 | 2 | 3 | 17,557,564 | 1 |
0 | 0 | I'm looking to add a timer for my simple math game. So far everything works just fine, the user gets questions when pressing the button and is given feedback on the answer. I want to add a timer for the user to see how much time it takes to answer the multiplication. This is the final part of my prototype to this mathgame. I want the timer to start when the user clicks "nytt tal" which means new number in swedish, and to stopp when the user clicks "svar" which means answer in swedish. Here is my code.
from Tkinter import *
import tkMessageBox
import random
import time
import sys
# Definition for the question asked to user
def fraga1():
global num3
num3 = random.randint(1, 10)
global num4
num4 = random.randint(1, 10)
global svar1
svar1 = num3 * num4
label1.config(text='Vad blir ' + str(num3) + '*' + str(num4) + '?')
entry1.focus_set()
#The answer giving feedback based on answer
def svar1():
mainAnswer = entry1.get()
if len(mainAnswer) == 0:
tkMessageBox.showwarning(message='Skriv in några nummer!')
return
if int(mainAnswer) != svar1:
tkMessageBox.showwarning(message='Tyvärr det rätta svaret: ' + str(svar1))
else:
tkMessageBox.showinfo(message='RÄTT!! :)')
#The quit button definition
def quit():
global root
root.destroy()
#Definition for the timer this part doesnt work
def start():
global count_flag
fraga1()
count_flag = True
count = 0.0
while True:
if count_flag == False:
break
label['text'] = str(count)
time.sleep(0.1)
root.update()
count += 0.1
#Window code
root = Tk()
root.title("multiplikations tidtagning")
root.geometry('800x500')
count_flag = True
# Welcome message in labels
label2 = Label(root, text="Hej!\n Nu ska vi lösa lite matteproblem!")
label2.config(font=('times', 18, 'bold'), fg='black', bg='white')
label2.grid(row=0, column=0)
#Instructions how to play in labels
label3 = Label(root, text="Instruktioner!\n För att starta ett spel tryck på nyttspel")
label3.config(font=('times', 12, 'bold'), fg='black', bg='white')
label3.grid(row=2, column=2)
#other label
label1 = Label(root)
label1.grid(row=2, column=0)
# entry widget for the start button
entry1 = Entry(root)
entry1.grid(row=3, column=0)
# restart gives a new question
entry1.bind('', func=lambda e:checkAnswer())
#Buttons
fragaBtn = Button(root, text='Nytt tal', command=fraga1)
fragaBtn.grid(row=4, column=0)
svarButton = Button(root, text='Svar', command=svar1)
svarButton.grid(row=4, column=1)
quit_bttn = Button(root, text = "Avsluta", command=quit)
quit_bttn.grid(row=5, column=0)
root.mainloop() | true | 17,569,007 | 1.2 | 0 | 0 | 7 | I think what you need is this .
from Tkinter import *
import time
class StopWatch(Frame):
""" Implements a stop watch frame widget. """
def __init__(self, parent=None, **kw):
Frame.__init__(self, parent, kw)
self._start = 0.0
self._elapsedtime = 0.0
self._running = 0
self.timestr = StringVar()
self.makeWidgets()
def makeWidgets(self):
""" Make the time label. """
l = Label(self, textvariable=self.timestr)
self._setTime(self._elapsedtime)
l.pack(fill=X, expand=NO, pady=2, padx=2)
def _update(self):
""" Update the label with elapsed time. """
self._elapsedtime = time.time() - self._start
self._setTime(self._elapsedtime)
self._timer = self.after(50, self._update)
def _setTime(self, elap):
""" Set the time string to Minutes:Seconds:Hundreths """
minutes = int(elap/60)
seconds = int(elap - minutes*60.0)
hseconds = int((elap - minutes*60.0 - seconds)*100)
self.timestr.set('%02d:%02d:%02d' % (minutes, seconds, hseconds))
def Start(self):
""" Start the stopwatch, ignore if running. """
if not self._running:
self._start = time.time() - self._elapsedtime
self._update()
self._running = 1
def Stop(self):
""" Stop the stopwatch, ignore if stopped. """
if self._running:
self.after_cancel(self._timer)
self._elapsedtime = time.time() - self._start
self._setTime(self._elapsedtime)
self._running = 0
def Reset(self):
""" Reset the stopwatch. """
self._start = time.time()
self._elapsedtime = 0.0
self._setTime(self._elapsedtime)
def main():
root = Tk()
sw = StopWatch(root)
sw.pack(side=TOP)
Button(root, text='Start', command=sw.Start).pack(side=LEFT)
Button(root, text='Stop', command=sw.Stop).pack(side=LEFT)
Button(root, text='Reset', command=sw.Reset).pack(side=LEFT)
Button(root, text='Quit', command=root.quit).pack(side=LEFT)
root.mainloop()
if __name__ == '__main__':
main()
P.S: Fit this in your code I just implemented the basic timer in tkinter. | 0 | 3,643 | 0 | 4 | 2013-07-10T11:03:00.000 | python,user-interface,python-2.7,timer,tkinter | Python timer in math game Tkinter | 0 | 2 | 5 | 17,570,984 | 1 |
0 | 0 | I'm looking to add a timer for my simple math game. So far everything works just fine, the user gets questions when pressing the button and is given feedback on the answer. I want to add a timer for the user to see how much time it takes to answer the multiplication. This is the final part of my prototype to this mathgame. I want the timer to start when the user clicks "nytt tal" which means new number in swedish, and to stopp when the user clicks "svar" which means answer in swedish. Here is my code.
from Tkinter import *
import tkMessageBox
import random
import time
import sys
# Definition for the question asked to user
def fraga1():
global num3
num3 = random.randint(1, 10)
global num4
num4 = random.randint(1, 10)
global svar1
svar1 = num3 * num4
label1.config(text='Vad blir ' + str(num3) + '*' + str(num4) + '?')
entry1.focus_set()
#The answer giving feedback based on answer
def svar1():
mainAnswer = entry1.get()
if len(mainAnswer) == 0:
tkMessageBox.showwarning(message='Skriv in några nummer!')
return
if int(mainAnswer) != svar1:
tkMessageBox.showwarning(message='Tyvärr det rätta svaret: ' + str(svar1))
else:
tkMessageBox.showinfo(message='RÄTT!! :)')
#The quit button definition
def quit():
global root
root.destroy()
#Definition for the timer this part doesnt work
def start():
global count_flag
fraga1()
count_flag = True
count = 0.0
while True:
if count_flag == False:
break
label['text'] = str(count)
time.sleep(0.1)
root.update()
count += 0.1
#Window code
root = Tk()
root.title("multiplikations tidtagning")
root.geometry('800x500')
count_flag = True
# Welcome message in labels
label2 = Label(root, text="Hej!\n Nu ska vi lösa lite matteproblem!")
label2.config(font=('times', 18, 'bold'), fg='black', bg='white')
label2.grid(row=0, column=0)
#Instructions how to play in labels
label3 = Label(root, text="Instruktioner!\n För att starta ett spel tryck på nyttspel")
label3.config(font=('times', 12, 'bold'), fg='black', bg='white')
label3.grid(row=2, column=2)
#other label
label1 = Label(root)
label1.grid(row=2, column=0)
# entry widget for the start button
entry1 = Entry(root)
entry1.grid(row=3, column=0)
# restart gives a new question
entry1.bind('', func=lambda e:checkAnswer())
#Buttons
fragaBtn = Button(root, text='Nytt tal', command=fraga1)
fragaBtn.grid(row=4, column=0)
svarButton = Button(root, text='Svar', command=svar1)
svarButton.grid(row=4, column=1)
quit_bttn = Button(root, text = "Avsluta", command=quit)
quit_bttn.grid(row=5, column=0)
root.mainloop() | false | 17,569,007 | 0 | 0 | 0 | 0 | Use a global variable storing current time when person presses start. Then when the user presses svar in your function svar, just fetch current time, substract them from one another and you get time taken, then reset the global var to 0 also and voila, you have the time taken | 0 | 3,643 | 0 | 4 | 2013-07-10T11:03:00.000 | python,user-interface,python-2.7,timer,tkinter | Python timer in math game Tkinter | 0 | 2 | 5 | 39,337,514 | 1 |
0 | 0 | Install QPython from Google Play store
Open QPython, slide right and click "Console"
Try some code, starting with import androidhelper
u0_a98@android:/ $ python
Python 2.7.2 (default, Jun 3 2013, 20:01:13)
[GCC 4.4.3] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import androidhelper
Traceback (most recent call last):
File "", line 1, in
File "/storage/sdcard0/com.hipipal.qpyplus/lib/site-packages/androidhelper.py", line 43, in
import sl4a
ImportError: No module named sl4a
I'm running Cyanogenmod 10.0.0, Android 4.1.2. Any idea how to import androidhelper successfully? | false | 17,569,671 | 0 | 0 | 0 | 0 | Install the latest from the Google Play store. I'm not getting this error using QPython (classic, not QPython3). | 0 | 3,999 | 0 | 2 | 2013-07-07T17:45:00.000 | system,qpython | Why does qpython say "No module named sl4a"? | 0 | 1 | 3 | 31,173,913 | 1 |
0 | 0 | I am looking for a way to embed a Tkinter GUI into a wiki page. I have looked around Google for a few hours and haven't had any success with a method. Is there a way to do this? | false | 17,603,825 | 0 | 0 | 0 | 0 | Ideas
This may sound like a lot of work, but it needs to be done and hopefully it would solve your problem:
Make your own web browser that uses the latest Python version instead of JavaScript. In fact, write it in Python, with Tkinter. Then you'll be able to use the widgets more naturally.
Tell me. (I might even help.)
Make it so you can embed Python Tkinter widgets as you please.
Figure out how to make the browser so it's not a magnet for people who like to write malicious Python code, or else have a big disclaimer.
Write a plugin and/or extension that either includes or depends upon the Python interpreter and Tkinter, and make the page request that people install it. Make sure your wiki supports plugins, or that your plugin/extension supports wikis that don't support plugins.
As others have said, Python doesn't come with a natural way to make Tkinter widgets in your web browser. You kind of have to make a way, or use someone else's way. If you can put applets in your wiki, I might recommend the Jython method someone else mentioned. | 0 | 183 | 0 | 0 | 2013-07-11T21:26:00.000 | python,tkinter,wiki | Python on a wiki | 0 | 1 | 3 | 23,421,260 | 1 |
0 | 0 | What is the best library (and the link) for utilizing animated GIF files into pygame 2.6? I've been searching through some and they all seem to be either buggy, broken, or removed. | false | 17,627,748 | 0 | 0 | 0 | 0 | Just seperate the gif into images and animate it with pygame. | 0 | 241 | 0 | 1 | 2013-07-13T06:44:00.000 | pygame,python-2.6 | Best Library for utilizing animated GIF in pygame | 0 | 1 | 1 | 17,653,503 | 1 |
0 | 0 | I have wx.grid filled with data and I have search option so when user enters some text, I find it and select that row. The problem is that row only gets selected but doesnt become visible. It doesnt scroll down or up to that row. How can I manually scroll to that row? | true | 17,640,500 | 1.2 | 0 | 0 | 3 | MakeCellVisible( int row, int col ) — forces the particular cell to be visible, effectively works to scroll the grid to be given cell. | 0 | 646 | 0 | 0 | 2013-07-14T14:54:00.000 | python,wxpython,wxgrid | Go to specifc row in wx.grid | 0 | 1 | 1 | 17,640,718 | 1 |
0 | 0 | I am designing a GUI using the wxPython toolkit, which means it's being written in python2. However, I want to use python3 for the actual application code. How would I go about calling my python3 code from the GUI? | false | 17,665,124 | 1 | 0 | 0 | 18 | Talk over a pipe or socket
Enable such python 3 features as you can from __future__ or use a library like six to write code which is compatible with both.
Don't do this.
Finally, are you sure you can't use wxPython in Python 3? There's nothing in the online docs saying you can't. | 0 | 19,541 | 0 | 13 | 2013-07-15T22:40:00.000 | python,python-2.7,python-3.x | Call python3 code from python2 code | 0 | 1 | 2 | 17,665,156 | 1 |
0 | 0 | When I try to run any PyQt5 program from Eclipse, I got this error.
Failed to load platform plugin "windows". Available platforms are: windows, minimal
I've never encountered this problem with PyQt4 but with the new version.
I'm not able to run a program. From other questions here I know it happens with Qt C++ development and the solution is to copy some Qt dll files to executable program directory.
Do I need to do the same in Python development (PyQt5) too? Add those files to the directory, where my *.py files reside? Shouldn't this be managed by PyQt5 installation?
Thank you | false | 17,695,027 | 1 | 0 | 0 | 11 | I encountered this issue with PyQt5 5.0.2, Windows 8, Python 3.3.2; slightly different error message:
Failed to load platform plugin "windows". Available platforms are:
Set the following environment variable and then run the application.
$env:QT_QPA_PLATFORM_PLUGIN_PATH="C:\Python33\Lib\site-packages\PyQt5\plugins\platforms" | 0 | 22,391 | 0 | 9 | 2013-07-17T08:39:00.000 | python,pyqt,pyqt5 | PyQt5 - Failed to load platform plugin "windows". Available platforms are: windows, minimal | 0 | 2 | 8 | 18,178,711 | 1 |
0 | 0 | When I try to run any PyQt5 program from Eclipse, I got this error.
Failed to load platform plugin "windows". Available platforms are: windows, minimal
I've never encountered this problem with PyQt4 but with the new version.
I'm not able to run a program. From other questions here I know it happens with Qt C++ development and the solution is to copy some Qt dll files to executable program directory.
Do I need to do the same in Python development (PyQt5) too? Add those files to the directory, where my *.py files reside? Shouldn't this be managed by PyQt5 installation?
Thank you | false | 17,695,027 | 0.124353 | 0 | 0 | 5 | i had a similar problem when compiling my code with cx_freeze.
Copying the folder platforms from python installation directory into my built folder solved the problem. the "platforms" folder contains qminimal.dll | 0 | 22,391 | 0 | 9 | 2013-07-17T08:39:00.000 | python,pyqt,pyqt5 | PyQt5 - Failed to load platform plugin "windows". Available platforms are: windows, minimal | 0 | 2 | 8 | 43,377,112 | 1 |
0 | 0 | I have a program completed that does the following:
1)Reads formatted data (a sequence of numbers and associated labels) from serial port in real time.
2)Does minor manipulations to data.
3)plots data in real time in a gui I wrote using pyqt.
4)Updates data stats in the gui.
5)Allows post analysis of the data after collection is stopped.
There are two dialogs (separate classes) that are called from within the main window in order to select certain preferences in plotting and statistics.
My question is the following: Right now my data is read in and declared as several global variables that are appended to as data comes in 20x per second or so - a 2d list of values for the numerical values and 1d lists for the various associated text values. Would it be better to create a class in which to store data and its various attributes, and then to use instances of this data class to make everything else happen - like the plotting of the data and the statistics associated with it?
I have a hunch that the answer is yes, but I need a bit of guidance on how to make this happen if it is the best way forward. For instance, would every single datum be a new instance of the data class? Would I then pass them one by one or as a list of instances to the other classes and to methods? How should the passing most elegantly be done?
If I'm not being specific enough, please let me know what other information would help me get a good answer. | false | 17,709,153 | 0.379949 | 0 | 0 | 2 | A reasonably good rule of thumb is that if what you are doing needs more than 20 lines of code it is worth considering using an object oriented design rather than global variables, and if you get to 100 lines you should already be using classes. The purists will probably say never use globals but IMHO for a simple linear script it is probably overkill.
Be warned that you will probably get a lot of answers expressing horror that you are not already.
There are some really good, (and some of them free), books that introduce you to object oriented programming in python a quick google should provide the help you need.
Added Comments to the answer to preserve them:
So at 741 lines, I'll take that as a yes to OOP:) So specifically on the data class. Is it correct to create a new instance of the data class 20x per second as data strings come in, or is it more appropriate to append to some data list of an existing instance of the class? Or is there no clear preference either way? – TimoB
I would append/extend your existing instance. – seth
I think I see the light now. I can instantiate the data class when the "start data" button is pressed, and append to that instance in the subsequent thread that does the serial reading. THANKS! – TimoB | 1 | 184 | 0 | 1 | 2013-07-17T20:01:00.000 | python,user-interface,pyqt | python program structure and use of global variables | 0 | 1 | 1 | 17,709,406 | 1 |
0 | 0 | I have a relatively simple tkinter program that just uses Event, Button and Label objects. I would like to translate this to be usable on an android platform.
1) What python for android should I use? QPython, py4a?
2) And on that platform, what GUI module should I use?
I'd like a little bit of detail for why you think a specific module or app would be best, as I'm just getting into the android scene and want to make an intelligent jump. | false | 17,721,796 | 1 | 0 | 0 | 6 | Even for native purposes, most developers would advise you keep away from Tkinter. It's a dated and unintuitive library that often makes GUI creation and maintenance harder than it needs to be.
The main advantage of developing apps using a Python library and embedding in Android is cross-platform support.
These libraries will often allow you to port your app with ease to many different operating systems.
I will not answer which is "best" since this is an opinion-based question outside the scope of StackOverflow, however I will say it is (generally) easier to port from Kivy to android than it is in some other libraries (such as Qt). But take this with a grain of salt.
Most libraries nowadays offer advanced GUI capabilities built-in, and your choice will likely not limit you in that regard.
Either way, there is no direct/simple way to translate your Tkinter project to any of these, and you will likely have to rewrite it with the library you end up choosing.
I will add that if your intent is developing only for android, most would advise developing in a native Android language, such as Java or Kotlin, or using a development tool which makes use of such languages. This would result in smaller APK sizes and likely faster running times for your app. | 0 | 16,370 | 0 | 12 | 2013-07-18T11:09:00.000 | android,python,tkinter | Tkinter to android translation | 0 | 1 | 1 | 54,502,540 | 1 |
0 | 0 | I'm new to Ipython Notebook. I can cut and paste from other apps into my notebooks, but how do I copy/paste code out of notebook into a different app?
I'm accessing a Linux VNC session via Chicken. I can cut/paste with wild abandon between OSX/Linux using both command X/C/V and/or middle mouse button. I can also copy code into IPython notebook. I'm stopped dead in my tracks trying to get code out of IpyNotebook.
Using Notebook's 'Edit/Copy Cell' doesn't work, neither does 'Ctrl-m c'.
I'm running IPython 0.13.1 | true | 17,731,701 | 1.2 | 0 | 0 | 6 | You have to select and copy code using normal Ctrl-C Ctrl-V. 'Edit/Copy Cell' is a specific action in javascript that does a little more and that browser security policy prevent us to bind with clipboard. | 1 | 12,168 | 0 | 6 | 2013-07-18T18:55:00.000 | ipython-notebook | Possible to copy/paste from IPython Notebook to other apps? | 0 | 1 | 1 | 17,732,561 | 1 |
0 | 0 | I have a window that is always on top as a status display. The problem is that when it is not the focused window the text (using wx.StaticText) becomes gray and thus harder to read.
Is it possible to make the text render in black even though the window is not focused? | false | 17,764,457 | 0 | 0 | 0 | 0 | You could always set the background colour to make the grey clearer. | 0 | 272 | 0 | 0 | 2013-07-20T16:54:00.000 | wxpython | Make disabled text render black | 0 | 1 | 2 | 17,770,596 | 1 |
0 | 0 | In python 3.3.2, how you adjust the time it takes for the suggestion box to appear just after typing a '.'. For example, say I import wxPython and type wx. after 3 seconds a list box would appear showing the available options. Is there any way to set this to appear instantly or in a very short time? Sort of like Visual Studio's intellisense feature which appears instantly.
Thanks in advance :) | true | 17,777,487 | 1.2 | 0 | 0 | 0 | I think you are referring to your IDE, the editor you are using to write your code. If this is the case, that would depend on your editor, which one are you using?
If you are using the built-in editor IDLE, then what you are looking to do is not an available option.
If you are trying to do this within your own code using wxPython (as
SexySaxMan suggested), please provide an example of your code so we can get a better idea of what you are trying to do. | 1 | 104 | 0 | 0 | 2013-07-21T22:13:00.000 | python,autosuggest | How to adjust delay of suggestion list in Python 3.3.2 | 0 | 1 | 2 | 17,777,911 | 1 |
0 | 0 | I'm recently using Boa Constructor to build GUI, and here's my problem:
create a new wx.Frame
add a wx.Panel
add a wx.BoxSizer
add a wx.StaticBox
add a wx.StaticBoxSizer
It crashes every single time and I've no idea why? Am I doing something wrong?
Environment: win 7 Ultimate 64bit / python 2.7.3(32bit) / wxPython 2.8.12.1 / Boa Constructor 0.6.1 | true | 17,807,106 | 1.2 | 0 | 0 | 0 | Found the problem:
Boa Constructor always automatically add wx.StaticBox into previous wx.BoxSizer you created on wx.Panel, and you have to remove wx.StaticBox from wx.BoxSizer before you add wx.StaticBoxSizer for wx.StaticBox, or the whole program would crash. | 0 | 187 | 0 | 0 | 2013-07-23T10:04:00.000 | python,wxpython | Boa Constructor keeps crashing | 0 | 1 | 1 | 18,277,589 | 1 |
0 | 0 | I'm developing an application for a company that is trying to brand itself with a particular font. They've given me all the .otf files for the fonts their other products use. Is it possible to set the font on widgets such as buttons and static texts to use these external files?
If so, would it be platform-independent?
Thanks | false | 17,822,123 | 0.197375 | 0 | 0 | 2 | Not yet, but it will probably be possible soon. I saw a patch and discussion about it recently in the wxWidgets Trac. | 0 | 1,017 | 0 | 3 | 2013-07-23T22:30:00.000 | python,fonts,widget,wxpython | Set wxPython widget font to external font file | 0 | 1 | 2 | 17,824,813 | 1 |
0 | 0 | I'm using win32api in a Python script to control mouse movements. It's working fantastic, but as soon as I click (I also generate click events) outside my Python shell/IDE, all my mouse events immediately stop. If I click my shell/IDE again, control is restored.
It seems like mouse control is only working when my Python shell or IDE is the "active" window - is there any way to retain mouse control even after Python is sent to the background? | true | 17,878,039 | 1.2 | 0 | 0 | 0 | Turns out this was not a Python issue, but was an issue with the device I was using to generate mouse movements. A separate API call was required to allow this device to push events when its owner was out of focus. | 0 | 435 | 0 | 1 | 2013-07-26T09:42:00.000 | python,winapi | Python win32api mouse control losing focus | 0 | 1 | 1 | 18,193,224 | 1 |
0 | 0 | I would like to move a (stereoscopic) video on a computer screen automatically. Think of the video as the ball in a Pong game. The problem is that it should be a stereoscopic 3D video. So the video size itself is kind of small. I did this kind of movements with pictures or drawing object, but I don't know how to do it with video material!
Does somebody know how I can do this? I already searched for video tools in python like pygame or pyglet. I have an external player Bino 3d which can open the desired video. But how can I make it move around the screen?
Or is there a tool in other programming languages like c/c++ or Matlab which can help?
By the way, the program will be on a Linux OS.
I'll be grateful for any help or hints!
Anna | false | 17,881,838 | 0 | 0 | 0 | 0 | I'd try to use a decent video client (mplayer, vlc). They can present the video in lots of ways, hopefully your stereoscopic issue can be solved by them.
Then I would let the client present a single window (not fullscreen) which I then would move around using window manager controls.
If you must not have window decorations around the video or if the output shall be a specific window, I think mplayer at least can be told to use an existing window to perform the output in. Maybe that's an approach then. | 0 | 110 | 0 | 2 | 2013-07-26T12:53:00.000 | python,video,3d,move | move a stereoscopic video on the screen | 0 | 1 | 1 | 17,882,938 | 1 |
0 | 0 | Now I have read the other stackoverflow Game of Life questions and also Googled voraciously.I know what to do for my Python implementation of the Game Of Life.I want to keep track of the active cells in the grid.The problem is I'm stuck at how should I code it.
Here's what I thought up but I was kinda at my wit's end beyond that:
Maintain a ActiveCell list consisting of cell co-ordinates tuples which are active
dead or alive.
When computing next generation , just iterate over the ActiveCell list,compute cell
state and check whether state changes or not.
If state changes , add all of the present cells neighbours to the list
If not , remove that cell from the list
Now the problem is : (" . "--> other cell)
B C D
. A .
. . .
If A satisfies 3) then it adds B,C,D
then if B also returns true for 3) ,which means it will add A,C again
(Duplication)
I considered using OrderedSet or something to take care of the order and avoid duplication.But still these I hit these issues.I just need a direction. | true | 17,897,988 | 1.2 | 0 | 0 | 1 | You have two lists, I'll name them currentState, and newChanges. Here will be the workflow:
Iterate over currentState, figuring out which are newly born cells, and which ones are going to die. Do NOT add these changes to your currentState. If there is a cell to be born or a death, add it to the newChanges list. When you are finished with this step, currentState should look exactly the same as it did at the beginning.
Once you have finished all calculations in step 1 for every cell, then iterate over newChanges. For each pair in newChanges, change it in currentState from dead to alive or vice versa.
Example:
currentState has {0,0} {0,1} {0,2}. (Three dots in a line)
newChanges is calculated to be {0,0} {-1,1} {1,1} {0,2} (The two end dots die, and the spot above and below the middle are born)
currentState recieves the changes, and becomes {-1,1} {0,1} {1 ,1}, and newChanges is cleared. | 0 | 1,235 | 0 | 5 | 2013-07-27T12:50:00.000 | python | Game Of Life : How to keep track of active cells | 0 | 2 | 5 | 17,898,513 | 1 |
0 | 0 | Now I have read the other stackoverflow Game of Life questions and also Googled voraciously.I know what to do for my Python implementation of the Game Of Life.I want to keep track of the active cells in the grid.The problem is I'm stuck at how should I code it.
Here's what I thought up but I was kinda at my wit's end beyond that:
Maintain a ActiveCell list consisting of cell co-ordinates tuples which are active
dead or alive.
When computing next generation , just iterate over the ActiveCell list,compute cell
state and check whether state changes or not.
If state changes , add all of the present cells neighbours to the list
If not , remove that cell from the list
Now the problem is : (" . "--> other cell)
B C D
. A .
. . .
If A satisfies 3) then it adds B,C,D
then if B also returns true for 3) ,which means it will add A,C again
(Duplication)
I considered using OrderedSet or something to take care of the order and avoid duplication.But still these I hit these issues.I just need a direction. | false | 17,897,988 | 0 | 0 | 0 | 0 | Did you consider using an ordered dictionary and just set the values to None? | 0 | 1,235 | 0 | 5 | 2013-07-27T12:50:00.000 | python | Game Of Life : How to keep track of active cells | 0 | 2 | 5 | 17,898,267 | 1 |
0 | 0 | So I have a Tkinter program, which is a nice IDE, since none of them aren't at my standards. Similar to most programs, they have the menu bar at the top? Since in HTML you use the li tag, What is the equivalent of the li tag in python? | false | 17,914,476 | 0 | 0 | 0 | 0 | parse it as an int! Despite common belief, int parsage is always effective! | 0 | 32 | 0 | 0 | 2013-07-29T00:35:00.000 | python-2.7,tkinter | Li tag equivalent in python? | 0 | 1 | 1 | 17,914,482 | 1 |
0 | 0 | i have 2 treewidgets placed in a frame in mainwindow. how can i have 2 different set of context menu options for the 2 treewidgets? i need individual set of right click options for the treewidgets.Thanks in advance.. | true | 17,961,363 | 1.2 | 0 | 0 | 0 | Every QWidget has a contextMenuPolicy property which defines what to do when context menu is requested. A simpliest way to do what you need is like this:
Create QAction objects that call methods you want.
Add these actions to your tree widgets using widget.addAction()
Call widget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
That's it. Context menu for the widget will contain actions you added. | 1 | 1,433 | 0 | 1 | 2013-07-31T04:00:00.000 | python,pyqt,qtreewidget | PyQT treewidgets with different context menu options | 0 | 1 | 1 | 17,962,727 | 1 |
0 | 0 | I'm using the cgkit.wintab module in python to access x,y coordinates of my Wacom tablet. The command cgkit.wintab.Packet.x is supposed to give me the value of the x co-ordinate of the touch on the tablet. Instead I get the response <property object at (hex memory address)>.
How do I extract the value of the x co-ordinate from this object?
Thanks! | false | 18,019,599 | 0.197375 | 0 | 0 | 1 | cgkit.wintab.Packet is a class. You need to look up x on an instance of the class, not the class itself. | 0 | 1,974 | 0 | 1 | 2013-08-02T14:35:00.000 | python,properties,cgkit | How to get the value of a Property Object in Python? | 0 | 1 | 1 | 18,019,711 | 1 |
0 | 0 | I have created a tkinter GUI for my python script. When I run the script, I want a dynamic string in one of the Label widgets on the GUI window, which will display:
"Working."
Then:
"Working.."
then
"Working..."
and then start from "Working." again until the script is completed.
(Actually I'd prefer a progress bar in this area)
Is it possible? | false | 18,047,636 | 0.099668 | 0 | 0 | 1 | Yes, it is possible. There are two ways to do it:
Whenever you want to update the label from your code you can call the_widget.configure(the_text). This will change the text of the label.
You can create an instance of a tkinter.StringVar, and assign it to the textvariable attribute of a label. Whenever you change the value of the variable (via the_variable.set(the_text), the label will automatically update.
Note that for either of these to work, the event loop needs to be able to process events (ie: you won't see anything if your function takes a long time to run and you never call update_idletasks or re-enter the event loop). | 0 | 22,257 | 0 | 4 | 2013-08-04T21:15:00.000 | python,user-interface,tkinter | Python: Is it possible to create an tkinter label which has a dynamic string when a function is running in background? | 0 | 1 | 2 | 18,048,021 | 1 |
0 | 0 | Ok. so I know 2to3 only provides a dif list. However, 2o3 should modify the actual file right?
when I run this command with -w it gives me a dif list. The file is not changed (it is still Tkinter) Also, I sse no backup like 2to3 is supposed to provide.
Edit: I actually did this on a folder. One file in the folder(which was already 3.x) was modified. I put this file in the folder by mistake but the files I wanted we're not changed (though terminal did give me a dif list). | true | 18,059,436 | 1.2 | 0 | 0 | 1 | 2to3 -w will both replace the files and print the diffs; you need to use --no-diffs to turn off the diff output. 2to3 --no-diffs -w dir/*.py should do the trick. | 0 | 182 | 0 | 1 | 2013-08-05T13:31:00.000 | python,python-2.7,python-3.x,diff,python-2to3 | python 2to3 doesn't change huey file when -w argument is provided | 0 | 1 | 1 | 18,995,552 | 1 |
0 | 0 | Can I use pack once the main loop has been showed, or should I use something else to add /remove widgets to /from a vbox afterwards ?
I have this gtk.Window() that contains a vbox, where a menu, a treeview and a button are packed. At the push of this button, I want to display an image in a new container inside this window / vbox, and ideally, close said container at will.
(think image viewer with a file list, you click on an image file and a pane opens displaying it, if you click on another image file the new image is displayed in place of the old, and you can close the image pane)
My question is : How do you do that ? My trials so far led me to believe that once the vbox has been show()'d, you cant pack anything else into it..?
Has the "image" container have to exist prior to being displayed...?
What is the proper process to do this, in witch direction of the GTK manual should I look? | true | 18,065,677 | 1.2 | 0 | 0 | 2 | In GTK+ all widgets are hidden by default (which I think was a stupid design decision, but oh well). You usually call show_all() on a window, so indirectly show all widgets contained in it by the time of the call. If you add (pack, whatever) a widget later, don't forget to show() it manually. | 0 | 152 | 0 | 0 | 2013-08-05T18:59:00.000 | python,gtk,pygtk | pyGTK : pack and unpack | 0 | 1 | 1 | 18,066,003 | 1 |
0 | 0 | I have a wxpython grid sizer that is sizing sublists of bitmap buttons. The master list I would like to create just once because creating these buttons takes a considerable amount of time, and thus I do not want to destroy them. My idea is to somehow remove all of the buttons from the sizer, make a new list of the buttons that I want the sizer to contain, and then use the sizer's AddMany method.
If I can't remove the buttons from the sizer without destroying them, then is there a way to use the sizer's Show method to hide some of the times, but then have the sizer adjust to fill in the gaps? When I hide them, all I can get them to do right now is just to have them disappear and leave a gap. I need the next item to be adjusted to the gap's place.
Also is there a way to sort the grid sizer's item list?
Thanks for any help you can offer. | false | 18,079,351 | 0 | 0 | 0 | 0 | You should be able to call the Layout method on the parent of the sizer, this will make it recalculate the shown items. | 0 | 698 | 0 | 0 | 2013-08-06T11:48:00.000 | python,user-interface,wxpython,wxwidgets | How to either sort a wxsizer or remove items without destroying them? | 0 | 3 | 4 | 18,079,725 | 1 |
0 | 0 | I have a wxpython grid sizer that is sizing sublists of bitmap buttons. The master list I would like to create just once because creating these buttons takes a considerable amount of time, and thus I do not want to destroy them. My idea is to somehow remove all of the buttons from the sizer, make a new list of the buttons that I want the sizer to contain, and then use the sizer's AddMany method.
If I can't remove the buttons from the sizer without destroying them, then is there a way to use the sizer's Show method to hide some of the times, but then have the sizer adjust to fill in the gaps? When I hide them, all I can get them to do right now is just to have them disappear and leave a gap. I need the next item to be adjusted to the gap's place.
Also is there a way to sort the grid sizer's item list?
Thanks for any help you can offer. | false | 18,079,351 | 0 | 0 | 0 | 0 | So I found out that the detach method is what I'm looking for! I would still be interested to know of a way to sort a sizer's item list though, without detaching all of the items and then re attaching a sublist. | 0 | 698 | 0 | 0 | 2013-08-06T11:48:00.000 | python,user-interface,wxpython,wxwidgets | How to either sort a wxsizer or remove items without destroying them? | 0 | 3 | 4 | 18,079,420 | 1 |
0 | 0 | I have a wxpython grid sizer that is sizing sublists of bitmap buttons. The master list I would like to create just once because creating these buttons takes a considerable amount of time, and thus I do not want to destroy them. My idea is to somehow remove all of the buttons from the sizer, make a new list of the buttons that I want the sizer to contain, and then use the sizer's AddMany method.
If I can't remove the buttons from the sizer without destroying them, then is there a way to use the sizer's Show method to hide some of the times, but then have the sizer adjust to fill in the gaps? When I hide them, all I can get them to do right now is just to have them disappear and leave a gap. I need the next item to be adjusted to the gap's place.
Also is there a way to sort the grid sizer's item list?
Thanks for any help you can offer. | true | 18,079,351 | 1.2 | 0 | 0 | 0 | You can't sort the sizer items in place. It would be possible to write your own function for doing this, of course, but it would use wxSizer::Detach() and Insert() under the hood anyhow. | 0 | 698 | 0 | 0 | 2013-08-06T11:48:00.000 | python,user-interface,wxpython,wxwidgets | How to either sort a wxsizer or remove items without destroying them? | 0 | 3 | 4 | 18,086,362 | 1 |
0 | 0 | I have multi threaded wxpython app and main GUI thread receives notification from other threads to show it under modal dialog box. I want some kind of scheduling/queuing so dialog should appear one after other if multiple notification (from other threads) comes at same time. | false | 18,104,712 | 0.197375 | 0 | 0 | 1 | As each notification arrives add it to a queue, (i.e. a list), and as each dialog is closed remove that notification from the queue and if it is not empty show the next - and listen to your users complain.
N.B. Be especially careful not to get into a situation I spotted a few times where clicking on the dismiss button always caused another notification. Another classic case was an error window reporting too many error windows were open. | 0 | 332 | 0 | 0 | 2013-08-07T13:28:00.000 | python,user-interface,wxpython | wxpython, showing modal dialog one by one | 0 | 1 | 1 | 18,120,007 | 1 |
0 | 0 | I have small Python3 application for manipulating some specific XML files. For gui I am using PySide and for parsing files -lxml.
I had some troubles with freezing it with cx_freeze but finally succeed. Now - some parts of application simply don't work... no error message & no log created.
For example on Enter press signal in LineEdit - new dialog should be shown... but nothing happens.
I have same version in standard python files and those are running correctly. How do I debug the frozen application? | false | 18,119,631 | 0 | 0 | 0 | 0 | Take a look at the pyside documentation and see if there is a redirect output to a window option - it is entirely possible that something is causing an error that is being printed out to nowhere. | 0 | 1,843 | 0 | 4 | 2013-08-08T06:50:00.000 | python,pyside,cx-freeze | cx_freeze - how debug app | 0 | 1 | 2 | 18,120,660 | 1 |
0 | 0 | I would like to edit the pygame.image to add a method that returns the name of the object.
I've been looking around in /Library/Python/2.7/site-packages where I found Pygame, but I can't find the image class, even though I have found the folder.
Anyone knows? | false | 18,133,117 | 0 | 0 | 0 | 0 | Assuming pygame 1.9.1 release, it's in the src folder, but is implemented in C. | 1 | 54 | 0 | 0 | 2013-08-08T18:14:00.000 | python,pygame | Where can I find the pygame.image class? | 0 | 1 | 2 | 18,133,587 | 1 |
0 | 0 | I'm using python 2.7 and I'd like to have an GUI with a scrollable list where each item in the list has both an image and some text. I'd like these items to be selectable like in a ListBox. I've tried a couple things and it seems ListBox only accepts text?
What widget/combination of widgets should I use? | true | 18,135,386 | 1.2 | 0 | 0 | 0 | Try placing a whole bunch of buttons in a frame and assigning a scroll bar a to that frame and make it so when the user presses a button is changes colour or picture or something and then any button with that same colour of picture before will go back to normal. Also, and a tkinter variable with which button is active so you can reference it later.
I'm fairly sure you can use both texts and images in a button simultaneously, but if not you can just put a button and an image side by side in the same row on the frame
I recommend you make this entire scrolling object a class and keep references of everything inside within that class.
If you need any help doing this, just give me a shout. | 0 | 794 | 0 | 0 | 2013-08-08T20:20:00.000 | python,tkinter | Python tkinter: a scrollable list with text and images? | 0 | 1 | 1 | 18,137,477 | 1 |
0 | 0 | In Tkinter, when I create an image on a canvas and find the coordinates of it, it only returns two coordinates, so the find_overlapping method doesn't work with it (naturally). Is there an alternative? | false | 18,178,061 | 0 | 0 | 0 | 0 | You should be able to get the image's bounding box (bbox) by calling bbox = canvas.bbox(imageID). Then you can use canvas.find_overlapping(*bbox). | 0 | 1,295 | 0 | 0 | 2013-08-12T00:25:00.000 | python | How to find the overlapping of an image on TkInter Canvas (Python)? | 0 | 1 | 2 | 18,178,111 | 1 |
0 | 0 | I have developed my first .app for mac, written in python and would like to share this .app with some friends.
I have converted the python scripts via py2app. Then I have one .app and compress it to an .dmg file.
I share this .dmg file with the guys and for one, this is working fine. (He has already python installed)
The other people can´t open the .app file, they get error messages. After an intensive search I got it. They have no python installed.
Now my question: How can I include a "one click python installation" in my .dmg file (or as package?!) | false | 18,208,650 | 0 | 0 | 0 | 0 | If you create the .dmg, you can setup a background image that tells users to move your application to the /Applications folder. If your application needs no extra setup, this is preferred, or a (Mac OS X created) .zip file with it.
The package option is better if some additional setup, or scripts checking for Python dependencies, are required. | 1 | 1,590 | 1 | 1 | 2013-08-13T12:05:00.000 | python,macos,package,dmg | I want to share my python app as dmg or package? | 0 | 1 | 1 | 18,209,869 | 1 |
0 | 0 | How do I run C++ and Boost::Python code in parallel without problems?
Eg in my game I'd want to execute Python code in parallel with C++ code; if the embedded Python interpreter's code executes a blocking loop, like while(True): pass, the C++ code would still be running and processing frames to render with its own loop.
I tried with boost::thread and std::thread but unless I joined these threads with the main thread the program would crash...
Any suggestions or examples? | false | 18,213,159 | 0 | 1 | 0 | 0 | You need to use the multiprocessing module in python so that you get a separate GIL for each python thread. | 1 | 1,171 | 0 | 4 | 2013-08-13T15:25:00.000 | c++,python,multithreading,loops,boost-python | Embedded Boost::Python and C++ : run in parallel | 0 | 1 | 2 | 18,213,302 | 1 |
0 | 0 | I need a video player in my PySide application on Windows without any dependencies. Right now I play a video in a QWebView that loads Flash, which works okay, except most of the people using the application are running it on freshly installed copies of Windows which lack Flash, and they aren't willing to install Flash just to play the video in my application.
I could include the flash plugin with my distribution, but that's disallowed by Adobe's licensing.
I must have tried at least two dozen things, but nothing has worked well enough so far. The things that have worked best so far are:
Flash, licensing forbids it from being packed in with my app
PyGame, 1 - only accepted mpeg-1 files, which I've found are massive, 2 - has a tendency to crash
QMovie - seems to only support .mng files, which I've been unable to find a converter for. Additionally, that format is visual only - I need audio, too.
I've been trying to get PyMedia to work, but it's refusing to install (it wants Python 2.7 but I have Python 2.7.3. I've tried installing multiple copies of Python and downgrading before... it's just not worth the headache of trying to get all my code to run with a single version.) | false | 18,234,020 | 0 | 0 | 0 | 0 | Qt's Phonon module plays Videos using the codecs installed in the operating system. So depending on the lowest Version of Windows you plan to support, you could chose one of the preinstalled codecs. Like wmv7 for XP.
Alternatively you could use Phonon and install an efficient free codec like x264. | 0 | 240 | 0 | 0 | 2013-08-14T14:07:00.000 | video,python-2.7,pyside | Play videos with Python on Windows without Dependencies? | 0 | 1 | 1 | 18,250,434 | 1 |
0 | 0 | I'm using wx.ListCtrl for live report in my app, and there will be continuous status updating including inserting a new row when a task starts and deleting related rows when the tasks end. Since the list gets sorted every now and then, you cannot simply delete the rows by the rowid you started with. Although you can assign a unique id using SetItemData, and that way you know exactly which row to delete when a task is done, there does NOT seem to be any method related to deleting a row by that unique id, not even a method to get rowid by unique id, and the only method I found is GetItemData, which will return the unique id for a certain row.
So the only way came to my mind is to iterate all rows checking their unique ids and compares it against the given id, if it matches then delete that row. But this sounds way too clumsy, so is there a better way to delete a specific row after sorting? | true | 18,246,847 | 1.2 | 0 | 0 | 0 | I ended up using ObjectListView to do the job. Basically you build an index for your objects in the list, and then you are able to operate on any row you want. It's way more convenient than wx.ListCtrl | 0 | 911 | 0 | 0 | 2013-08-15T05:31:00.000 | python,user-interface,wxpython,listctrl | How to delete a specific row in wxListCtrl after sorting? | 0 | 1 | 2 | 40,836,750 | 1 |
0 | 0 | Would it be possible to create an internal image viewer plugin for Sublime Text 3? I noticed in their forum people have mentioned it not possible for ST2 due to the fact that the API doesn't allow access to the UI and widgets, but just wondered if it was still the case for ST3? | false | 18,329,995 | 0 | 0 | 0 | 0 | There is nothing yet in Sublime Text 3. It would be nice to preview the image and its dimensions right inside of sublime. For now, you will have to open in finder/browser/whatever you use. | 0 | 4,022 | 0 | 4 | 2013-08-20T08:09:00.000 | python-3.x,sublimetext3 | Sublime Text 3 internal image viewer | 0 | 1 | 2 | 18,389,949 | 1 |
0 | 0 | I've a c++ code on my mac that uses non-standard lybraries (in my case, OpenCV libs) and need to compile this so it can be called from other computers (at least from other mac computers). Runned from python. So I've 3 fundamental questions:
How to compile my project so it can be used from python? I've read
that I should create a *.so file but how to do so?
Should it work like a lib, so python calls some specific functions,
chosen in python level?
Or should it contain a main function that is executed from
command line?
Any ideas on how to do so? PS: I'm using the eclipse IDE to compile my c++ project.
Cheers, | false | 18,342,535 | 0.039979 | 1 | 0 | 1 | How to compile my project so it can be used from python? I've read
that I should create a *.so file but how to do so?
That depends on your compiler. By example with g++:
g++ -shared -o myLib.so myObject.o
Should it work like a lib, so python calls some specific functions,
chosen in python level?
Yes it is, in my opinion. It seems do be the "obvious" way, since it's great for the modularity and the evolution of the C++ code. | 0 | 3,206 | 1 | 2 | 2013-08-20T18:33:00.000 | c++,python,c,opencv,compilation | Calling c++ function, from Python script, on a Mac OSX | 0 | 1 | 5 | 18,342,743 | 1 |
0 | 0 | Where exactly can I override the collective.documentviewer code to disable the icon to view the document full screen in another window? Actually when I only click on the 'customize' button for the documentviewer in zcml it throws up an exception for 'widget', even without addition of a letter of code there and the viewer crashes.I am using version 2.2.1 for collective.documentviewer and Plone 4.1.4 on linux. Please guide. | true | 18,350,333 | 1.2 | 0 | 0 | 1 | You need to carefully blank the <div> section for 'View Document in Fullscreen' in this javascript:
collective.documentviewer-2.2.1 py2.6.egg/collective/documentviewer/resources/assets/viewer.js | 0 | 119 | 0 | 0 | 2013-08-21T06:32:00.000 | python,linux,plone | How do I override the document viewer icon to view in Full Screen in Plone? | 0 | 1 | 1 | 18,373,792 | 1 |
1 | 0 | Background:
I am just about to start development on an mobile and desktop app. They will both be connected to a local wifi network (no internet connection) and will need to communicate with one another. At the outset we are targeting iOS and Windows as the two platforms, with the intention of adding Linux, OSX, and Android support in that order. The desktop app will largely be a database server/notification center for receiving updates from the iOS apps and sending out the data to other iOS apps. There may be a front end to the desktop app, but we could also incorporate it into the iOS app if needed.
For the moment we just want the iOS app to automatically detect when it is on the same network as the server and then display the data that is sent by that server (bonjour like).
As far as I see it there are two paths we could take to implement this
Create a completely native app for each platform (Windows, Linux, OSX).
Pro: We like the ideas of having native apps for performance and ease of install.
Con: I know absolutely nothing about Windows or Linux development.
Create an app that is built using web technologies (probably python) and create an easy to use installer that will create a local server out of the desktop machine which the mobile apps can communicate with.
Pro: Most of the development would be cross-platform and the installer should be easy enough to port.
Con: If we do want to add a front-end to the server app it will not be platform native and would be using a css+html+javascript GUI.
Question:
My question is how would implement the connection between the iOS app and server app in each circumstance.
How would I receive and send notifications over a local network.
How could I connect to the server using NSURLConnection if it does not have a static ip?
I hope this is clear. If not please ask and I will clarify.
Update 09/06/2013
Hopefully this will clear things up. I need to have a desktop app that will manage a database, this app will connect to iOS devices on a local wireless network that is not connected to the internet. I can do this with either the http protocol (preferably with a flask app) or by using a direct socket connection between the apps and the server. My question is which of the above two choices is best? My preference would be for a web-based app using Python+Flask, but I would have no idea how to connect the iOS app to a flask app running on a local network with out a static ip. Any advice on this would be appreciated. | false | 18,405,726 | 0 | 0 | 0 | 0 | I would definitely suggest a webapp. And the answer to your questions are given below:
How would I receive and send notifications over a local network.
Use a REST based web service to communicate with the server.
You have to use polling to receive data:-(
How could I connect to the server using NSURLConnection if it does not have a static ip?
If possible configure a domain name in your network which points to server ip. (Configure local DHCP to give same IP to your server every time based on mac address!)
Have a IP Range and when the app starts, try to reach a specific URL and check if it is responding.
Ask the user to enter the server IP every time the app starts! | 0 | 1,265 | 1 | 4 | 2013-08-23T14:46:00.000 | python,ios,windows,web,bonjour | Connecting iOS app to Windows/Linux apps | 0 | 1 | 2 | 18,773,687 | 1 |
0 | 0 | I'm new to programming and learning to use python with kivy. I have windows 7. Is it possible to open kivy widgets without the terminal automatically opening in the background? | false | 18,429,202 | 0.197375 | 0 | 0 | 1 | use pythonw.exe that is in the python installation directories.
if you have virtualenv installed and your kivy project rests in a virtualenv,
try
/<virtual_env_foler>/scripts/pythonw.exe for pythonw.exe | 0 | 291 | 0 | 1 | 2013-08-25T12:53:00.000 | python,windows,windows-7,kivy | Opening kivy widgets without the terminal? | 0 | 1 | 1 | 18,429,288 | 1 |
0 | 0 | Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file?
I'm using Maya for this UI, and converting this UI file to a readable python version to implement would be really great! | false | 18,429,452 | 0.016665 | 0 | 0 | 1 | Update for anyone using PyQt5 with python 3.x:
Open terminal (eg. Powershell, cmd etc.)
cd into the folder with your .ui file.
Type:
"C:\python\Lib\site-packages\PyQt5\pyuic5.bat" -x Trial.ui -o trial_gui.py
for cases where PyQt5 is not a path variable. The path in quotes " " represents where the pyuic5.bat file is.
This should work! | 1 | 247,890 | 0 | 53 | 2013-08-25T13:24:00.000 | python,pyqt,maya,pymel | Convert pyQt UI to python | 0 | 3 | 12 | 50,134,039 | 1 |
0 | 0 | Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file?
I'm using Maya for this UI, and converting this UI file to a readable python version to implement would be really great! | true | 18,429,452 | 1.2 | 0 | 0 | 73 | You can use pyuic4 command on shell:
pyuic4 input.ui -o output.py | 1 | 247,890 | 0 | 53 | 2013-08-25T13:24:00.000 | python,pyqt,maya,pymel | Convert pyQt UI to python | 0 | 3 | 12 | 18,430,351 | 1 |
0 | 0 | Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file?
I'm using Maya for this UI, and converting this UI file to a readable python version to implement would be really great! | false | 18,429,452 | 0 | 0 | 0 | 0 | I've ran into the same problem recently. After finding the correct path to the pyuic4 file using the file finder I've ran:
C:\Users\ricckli.qgis2\python\plugins\qgis2leaf>C:\OSGeo4W64\bin\pyuic4 -o ui_q gis2leaf.py ui_qgis2leaf.ui
As you can see my ui file was placed in this folder...
QT Creator was installed separately and the pyuic4 file was placed there with the OSGEO4W installer | 1 | 247,890 | 0 | 53 | 2013-08-25T13:24:00.000 | python,pyqt,maya,pymel | Convert pyQt UI to python | 0 | 3 | 12 | 28,266,946 | 1 |
0 | 0 | I have a vector of pointers to objects in c++ and want to expose it to python with a list. So far I gave a reference of a python list to c++. I figured pointers are not suitable for python so I read about how to make a pointer to a reference by (*obj) it. But when I call: myList.append((*obj)); python just crashes. Can someone tell me how to put objects I only have pointers of into a python list correctly so I can manipulate that list later?
Greetings
Chris | false | 18,462,319 | 0 | 0 | 0 | 0 | Okay so the Problem appears when the type is not declared for boost::python. ! | 1 | 123 | 0 | 0 | 2013-08-27T09:56:00.000 | c++,python,list,boost,reference | appending object references to python list with boost | 0 | 1 | 1 | 18,467,078 | 1 |
0 | 1 | I am creating a GUI program using wxPython. I am also using matplotlib to graph some data. This data needs to be animated. To animate the data I am using the FuncAnimate function, which is part of the matplotlib package.
When I first started to write my code I was using a PC, running windows 7. I did my initial testing on this computer and everything was working fine. However my program needs to be cross platform. So I began to run some test using a Mac. This is where I began to encounter an error. As I explained before, in my code I have to animate some data. I programmed it such that the user has the ability to play and pause the animation. Now when the user pauses the animation I get the following error: AttributeError: 'FigureCanvasWxAgg' object has no attribute '_idletimer'. Now I find this to be very strange because like I said I ran this same code on a PC and never got this error.
I was wondering if anyone could explain to me what is meant by this _idletimer error and what are possible causes for this. | false | 18,472,394 | 0.197375 | 0 | 0 | 1 | _idletimer is likely to be a private, possibly implementation specific member of one of the classes - since you do not include the code or context I can not tell you which.
In general anything that starts with an _ is private and if it is not your own, and specific to the local class, should not be used by your code as it may change or even disappear when you rely on it. | 0 | 287 | 0 | 1 | 2013-08-27T17:55:00.000 | python,macos,matplotlib,wxpython | AttributeError: 'FigureCanvasWxAgg' object has no attribute '_idletimer' | 0 | 1 | 1 | 18,474,882 | 1 |
0 | 0 | I noticed wx.ListCtrl would always highlight a whole row wherever it's clicked by default, is there a way to make it only highlight the selected cell? | true | 18,481,533 | 1.2 | 0 | 0 | 1 | No, I think that's built-in. You would have to catch the selection event and probably make all the cells editable so you could select just the cell. Otherwise I would look at UltimateListCtrl as that is a custom widget and you can probably subclass it in such a way as to add that functionality.
Or don't use a ListCtrl at all and switch to using a wx.Grid | 0 | 97 | 0 | 1 | 2013-08-28T07:15:00.000 | python,wxpython,listctrl | Is there a way to only highlight a cell instead of the whole row when it's clicked with wx.ListCtrl? | 0 | 1 | 1 | 18,491,970 | 1 |
0 | 0 | I'm trying to make a wx.lib.filebrowsebutton.FileBrowseButton button match both txt and csv files, but it doesn't seem to support glob pattern as described, *.{txt,csv} ends up matching nothing on windows and it literally tries to look for files with extension of {txt,csv}.
So how do I make it work for both txt and csv files? | true | 18,489,613 | 1.2 | 0 | 0 | 3 | The documentation is not very clear. You should be using a semi-colon inside parenthesis, like so: "TXT and CSV files (*.txt; *.csv)|*.txt; *.csv"
You can also add a second line like so: "TXT and CSV files (*.txt; *.csv)|*.txt; *.csv|PNG files (*.png)|*.png" | 0 | 157 | 0 | 3 | 2013-08-28T13:40:00.000 | python,wxpython,glob,filebrowse | Is there a way to add multiple filemasks in wx.lib.filebrowsebutton.FileBrowseButton? | 0 | 1 | 1 | 18,489,942 | 1 |
0 | 0 | You know you can after working in Qt Designer and converting via pyuic4 command to executable program or module, You can modify your code and merge together and build a complete program, But i have serious question:
Suppose I have QMainWindow, some QFrame and i don't want to save in separately *ui files, i need to save in just one *ui files, it's possible? | true | 18,499,379 | 1.2 | 0 | 0 | 1 | You can't save two forms in one .ui file, but I think that you can do this (I did not tried it but it should work):
save for example one QDialog and one QMainWindow (QFrame can't stand alone-it needs parent widget) in separate .ui files, convert them via pyuic4 command to two .py files and then join those two files into one .py module (copy data from one to another - copy class and create instance in __main__).
That is not very practical when you want to change something in designer , because you'll need to do whole procedure again. | 1 | 114 | 0 | 0 | 2013-08-28T22:32:00.000 | python,qt,user-interface,qt-designer | some Qframe and other widget just in one *ui files (pyuic4) | 0 | 1 | 1 | 18,715,408 | 1 |
0 | 0 | I noticed that even if you set your wildcard to match *.txt files only, all wx.FileDialog does is list all txt files under that directory, still you can input any existent file with a different extension and hit open button without having any problem at all?
There doesn't seem to exist a window style to avoid this from happening, so I guess you have to validate the file extension yourself, right? Interesting, does this count as a bug? | true | 18,501,677 | 1.2 | 0 | 0 | 1 | This is not exclusive to wxPython and is not a bug. Try this in any Windows application and you will see you can save a txt file as a .exe in Notepad or open a .png file in MS Word. A file extension is just a convention, which means it can be broken for any number of reasons. If you are confident that you must check the file extension of a file, you will need to perform some validation with the return value of the wx.FileDialog. | 0 | 333 | 0 | 0 | 2013-08-29T03:06:00.000 | python,wxpython,filedialog | How to make wx.FileDialog(wx.FD_OPEN mode) check input file name extension against the wildcard? | 0 | 1 | 1 | 18,511,156 | 1 |
1 | 0 | I implemented most of my projects in C++ and python. However, we recently got a new database interface that I could only use Java to retrieve data.
I want to stay with my Python/C++ tools but I am wondering if there is a good solution to integrate Java to my Python application. I heard about Jython, but it is a different python implementation and I am concerned some of my C++ tools will not work well with it. Jpype seems simple but it hasn't been updated since 2011, so a little concerned with the compatiablity with the current python/java.
Is there a good solution to this? all opinions are welcomed. | true | 18,538,170 | 1.2 | 0 | 0 | 0 | gcj (gcc compiler for java) supports java 1.5 syntax (1.4 is working better on it) and therefore some Java programs may be compiled to native code. gcjh (or javah) can produce headers for java libraries, so you can write C extensions for python. Of course some libraries could not be compiled with gcj (like Apache Commons Logging) because of using com.sun packages. Did not updated from 2009.
There is another Java to native compiler, commercial Excelsior Jet (it's another JavaVM, it supports Java 1.6 and soon Java 1.7). They said linux-64bit version of their product will be available in 2013-Q4. But I didn't try it well, I don't know, are headers for compiled library can be produced.
There is a lot packages at pypi, like JCC (from PyLucene creator) or Py4J that can use Oracle JavaVM through JNI or sockets. | 0 | 251 | 0 | 1 | 2013-08-30T17:09:00.000 | java,c++,python,interface,integration | Python Integration with Java / C | 0 | 2 | 3 | 18,609,443 | 1 |
1 | 0 | I implemented most of my projects in C++ and python. However, we recently got a new database interface that I could only use Java to retrieve data.
I want to stay with my Python/C++ tools but I am wondering if there is a good solution to integrate Java to my Python application. I heard about Jython, but it is a different python implementation and I am concerned some of my C++ tools will not work well with it. Jpype seems simple but it hasn't been updated since 2011, so a little concerned with the compatiablity with the current python/java.
Is there a good solution to this? all opinions are welcomed. | false | 18,538,170 | 0 | 0 | 0 | 0 | One way to do this is to write web services. A web service can accept an HTTP request, marshal it into a data request, pass that to a Java class that get the data out, map the quert results into a response of some kind, and send it back.
Any client that can send an HTTP request, accept the response and unmarshal it can interact with that service. They need not know that it's implemented in Java.
You pay the price of an extra network roundtrip to get the benefit of language interoperability. | 0 | 251 | 0 | 1 | 2013-08-30T17:09:00.000 | java,c++,python,interface,integration | Python Integration with Java / C | 0 | 2 | 3 | 18,538,315 | 1 |
0 | 0 | I have a program thats like a desktop enviroment with educational games and I was wondering how to put the menubar on the bottom of the window.
Thanks In Advance! | true | 18,546,876 | 1.2 | 0 | 0 | 0 | You can't, if you're talking about the native menubar you get when you set the menu attribute of the root window.
You can create your own menubar that behaves a little bit like a menubar by using a frame and one or more menubuttons, and place that at the bottom. | 0 | 269 | 0 | 0 | 2013-08-31T10:02:00.000 | python,tkinter | tkinter - Change menubar location | 0 | 1 | 1 | 18,548,116 | 1 |
0 | 0 | I'm a python developer with little experience creating android apps in java and want to create an app that will access my university web portal, retrieve some data and show on a view.
So, after researching Kivy, I have a few questions:
1) Which one is easier and faster to develop android apps?
2) Does Kivy have any android feature limitations?
3) And finally, would an android app developed using kivy run as fast as one developed using java? | false | 18,553,849 | 1 | 0 | 0 | 14 | To complete inclement's answer, pyjnius indeed allows to access a lot of the android api. But it's not perfect, calling existing classes is not always enough, and an android programmer often need to create code that will be called by android to manage events, there are two ways to do that, both used by the android api.
The first one is interfaces: you need to create a class that implement an existing java interface, pyjnius can do that, you create a python class and declare which java interface it implements, and have a decorator to declare the methods you have to declare.
The second is subclassing, you need to subclass an existing java class and override some methods, and we don't have a way to do that with pyjnius yet, so for these ones, you'd have to create a java class and use it in your program (fortunately you can mix that with kivy/pyjnius, it's just can't be 100% python in that scenario).
So it can be worth a look to the api beforehand, to see if the parts of the android api you have to access requires that. | 0 | 11,995 | 0 | 21 | 2013-08-31T23:44:00.000 | java,android,python,kivy | Difference between Kivy and Java for android apps | 0 | 1 | 2 | 18,563,503 | 1 |
0 | 0 | I am learning to program (python 3.x) and was wondering what would be best to learn for making android apps/games. I dont know anything about UI really but have heard that kivy? Is on android. Is that worth learning or should i use something else.
Thanks
Edit:
I am using sl4a and py34a on my android device. | false | 18,560,367 | 0.099668 | 0 | 0 | 1 | I'm loving kivy. The irony is, that I found this topic here looking for help with python 3. Python 2 works perfectly, but 3 is still being made compatible. Other than that Kivy is great for beginner coders. Especially, because you don't have to code the complex stuff. | 0 | 2,257 | 0 | 0 | 2013-09-01T16:17:00.000 | android,python-3.x,kivy,sl4a | kivy or something else for android UI | 0 | 2 | 2 | 18,723,415 | 1 |
0 | 0 | I am learning to program (python 3.x) and was wondering what would be best to learn for making android apps/games. I dont know anything about UI really but have heard that kivy? Is on android. Is that worth learning or should i use something else.
Thanks
Edit:
I am using sl4a and py34a on my android device. | false | 18,560,367 | 0.197375 | 0 | 0 | 2 | Kivy is good, and will run on Android, but you can't make Android apps with it. It has no way of interacting with the Android API. You can run a kivy app on the device, but can not read sensors or anything like that. They have a project called pyjnius, which allows you to access Java classes from Python, but not with Python3, and it's not very easy to use unless you know Java.
You have SL4A installed, so you can use web technology to do UIs, including games, which can be rendered on the device using webviews. That said, Kivy is a much more mature and well maintained project. | 0 | 2,257 | 0 | 0 | 2013-09-01T16:17:00.000 | android,python-3.x,kivy,sl4a | kivy or something else for android UI | 0 | 2 | 2 | 19,018,485 | 1 |
0 | 0 | I need to send a set of information to model widget, QTableView/QTableWidget, Then When user click on a row, can open a new widget with ID of sent by information to QTableView/QTableWidget.
I use PyQt
I need to send hidden, it means user can't see my hidden id of database on QTableView/QTableWidget
Primative Question: How can send data to QTableView/QTableWidget without user can see them in TableModel widget such as id of my database table ? | true | 18,563,715 | 1.2 | 0 | 0 | 2 | You can hide a column in a QTableWidget by calling setColumnHidden(int column, bool hide) with the column number, and True for the hide option.
A better solution to this would to be to prevent the user interface from ever receiving this information. A Model-View-Controller setup, or the use of a data access layer could ensure that only the relevant information is sent on to the interface and nothing would require hiding. | 0 | 1,156 | 0 | 2 | 2013-09-01T22:52:00.000 | python,qt,qt4,pyqt,pyqt4 | How to send data to QTableView/QTableWidget (PyQt) | 0 | 1 | 1 | 18,565,528 | 1 |
0 | 0 | I've been write window programs with C# + WPF for a while now. It is very good, has alot of rich elements as of .NET 4.5 but I dont really buy the idea of porting window based programs to other operating system like OS X using mono and others.
I started working on Java and Python, I haven't written any desktop based program with anyone of them yet as there are war of GUI framework/toolkit out there and everyone is just getting religious about things.
I need some clarification hence the following Questions, mind you these questions might be answered before but like I said, Clarifications:
What is the different between GUI toolkit and GUI framework
For Java programming, I see swing is integrated with Netbeans, from my research, people are speaking of qt's Jambi and GTK for java and python, I have no idea about any of these and I want to know, (1) Which do you use and why? (for Java and python), (2) Visual studio do all the magic for WPF and C#, which IDE can do these magic in java and python.
Lastly, I want you all to know that my asking these question is just to know which rich, powerful GUI and cross platform toolkit/framework (Whichever the right term is) is best for java and python with easy learning curve.
Constructive criticism are welcome BUT, I will be glad if there are answers. | false | 18,579,076 | 0 | 0 | 0 | 0 | I know QT is for Java (and Python of course). It is well documented and is used by a lot of people around the world. | 0 | 3,817 | 0 | 3 | 2013-09-02T18:36:00.000 | java,python,swing,user-interface,toolkit | Best GUI Toolkit/Framework for Java and Python | 0 | 1 | 2 | 18,579,176 | 1 |
0 | 0 | I would like to know how to disable the window Maximise button in pyqt4. I am at present using QWidget.setFixedSize (self, QSize) to prevent user window resizing, however the maximise button is still enabled and when pressed causes the application to move to the top left corner of the screen. I am basically wanting to replicate the behaviour of the Windows calculator application, where the maximise icon is greyed out. Does anyone know how to achieve this with PyQt4? | false | 18,600,081 | 0.039979 | 0 | 0 | 1 | you could set the maximumSize and minimumSize with the same values, it'll get to dissapear maximise button | 0 | 20,169 | 0 | 12 | 2013-09-03T19:32:00.000 | python,resize,window,pyqt,pyqt4 | how to disable the window maximize icon using PyQt4? | 0 | 1 | 5 | 29,042,473 | 1 |
0 | 0 | I have scowered stack overflow all day today trying to figure out why when I try to install cython
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
I am using OSX mountain lion and I am using default python with pygame and easygui and command line tools installed trying to make my first app using kivy and I need cython to make the gui.. Are there any other things I should use instead of Kivy but I am pretty impressed from what I saw online. If anyone has any other tips on installing Kivy? I am very lost doing this sorry for a trivial question! | true | 18,603,205 | 1.2 | 0 | 0 | 1 | Which python are you using, the system python or macports or something else?
Make sure you have XCode and gcc installed on your system first. Running which gcc on the command line will help identify where your current version of gcc resides. I assume you already checked this?
As an alternative, you can try installing a precompiled version of cython such as the one that comes with anaconda or the enthought python distribution.
Unfortunately, there's not enough information here to give a definitive answer..... | 1 | 531 | 0 | 0 | 2013-09-03T23:48:00.000 | python,macos,gcc,cython,kivy | When I try to install cython I get an error message unable to execute gcc-4.0 | 0 | 1 | 1 | 18,794,769 | 1 |
0 | 0 | I am in the process of making a text based game with Python, and I have the general idea down. But I am going to make the game in depth to the point where, it will take longer than one sitting to finish it. So I want to be able to make the game to where, on exit, it will save a list of variables (player health, gold, room place, etc) to a file. Then if the player wants to load the file, they go to the load menu, and it will load the file.
I am currently using version 2.7.5 of Python, and am on Windows. | false | 18,606,097 | 0.099668 | 0 | 0 | 4 | First, don't overthink this. You don't need to use anything complicated. As a preliminary step, research basic file input/output in python.
Second, I'm assuming you have a player class in your game? Or possibly an overall class which keeps track of game state. Well have that class store default values for your variables like health, gold etc. Then have a method which can modify this class like def load_stats(player): or def load_stats(game): something. and have it read in from a save file which can have any format you like and modify the variables of your player/game state.
First test loading of game files and make sure you can get it so that your player class gets modified.
Then all you have to do is add a save game feature that lets you output these variables back to a file in your directory system somewhere.
Try doing this and let me know if you need any help afterwards. | 1 | 36,232 | 0 | 5 | 2013-09-04T05:35:00.000 | python,save | Python text game: how to make a save feature? | 0 | 1 | 8 | 18,606,314 | 1 |
0 | 0 | I want to use Grid from wxpython and use it in my GUI which is based on PyQt. Is it possible? | true | 18,711,451 | 1.2 | 0 | 0 | 2 | The simple answer is, no. Or, if it is possible, it's certainly not easy.
Although there are many similarities in look and function between wxPython and PyQt, under the hood they are essentially different. | 0 | 264 | 0 | 0 | 2013-09-10T05:43:00.000 | python,user-interface,wxpython,pyqt | Can wxpython and PyQt be used together in same GUI? | 0 | 1 | 1 | 18,732,393 | 1 |
1 | 0 | Hi want to add text box and label in plone site
but, that plone site does not display text box
how can i create text box in plone site
thanks! | true | 18,711,815 | 1.2 | 0 | 0 | 5 | You can create a static text portlet in that context you need it: folder, page. | 0 | 111 | 0 | 0 | 2013-09-10T06:12:00.000 | python,html,plone | How to create text box in plone site | 0 | 1 | 1 | 18,714,130 | 1 |
0 | 0 | Currently i need to transfer data between C++ and Python applications.
As long as Thrift doesn't work with unsigned int, what's the best way to transfer unsigned?
Is there only way like:
assign unsigned to signed
serialize -> send -> receive -> deserialize this signed
assign signed to unsigned
Should i do it manually all the time or there are already some 3rd party libraries?
How do i do it in the case of C++/Python applications? In C++/C++ applications i can just static_cast<signed/unsigned>(unsigned/signed) for conversion, but what about Python? | true | 18,758,535 | 1.2 | 1 | 0 | 3 | There are two options that make sense (and a bunch of others):
Use the next largest signed integer with Thrift. Of course, with UINT64 this is not possible, as there is no i128, but it works up to UINT32
Cast the unsigned bits into signed. Not very clean and requires documentation, but it works.
The "bunch of others" include
Convert it into a string and back. And watch your performance going down.
Use binary type. Ok, that's a bit far out, but still possible and can be done by just reinterpreting the bits as with 2. above
But again, I'd recommend 1. or 2. | 0 | 1,934 | 0 | 2 | 2013-09-12T07:51:00.000 | c++,python,serialization,thrift | apache thrift, serialize unsigned | 0 | 1 | 1 | 18,772,101 | 1 |
0 | 0 | We are currently using Cython to make bindings to some networking and DB libraries. We want also use SDL, but PySDL2 uses ctypes for binding. While Cython is whole interpreter, ctypes is just library. But, Cython and ctypes are most often portrayed as alternatives to each other. Thus I am totally unsure if they are compatible.
So, question: it is possible to use Cython and ctypes together in one project? | false | 18,785,825 | 0.761594 | 0 | 0 | 5 | Here's a brief summary of how both tools work:
ctypes is a very pythonic wrapper over a library called cffi, which is able to load shared libraries (.so or .dll files), and call them, without first compiling any code to wrap the functions defined in those libraries. You do have to tell ctypes about the functions it'll call, so that it can convert from the python types (int, str, and so on) to the abi expressed in the shared lib (uint32_t, char *, and so on).
Cython is a 'sort of python' to C translator. The generated C code can be compiled and the result is a special sort of shared library (.so or .dll again) which has all the right functions to be a Python C extension. Cython is very smart, based on the type annotations in the input, it knows whether to emit code that directly calls C functions (when you use cdef) or calls regular python objects by way of the PyObject_Call C api.
Since you can (more or less) freely mix C and python in Cython sources, you should have no difficulty using PySDL2 in your Cython library, just invoking it as though it were regular python, import it, call it, everything should "just work".
That said, You might benefit from including libsdl declarations in your code, directly, if you end up calling out to SDL from tight inner loops, to avoid the overhead of converting from the low level C types to python types, just to have ctypes convert them back again. You could probably put that off until your application has grown a bit and you notice some performance bottlenecks. | 1 | 2,695 | 0 | 3 | 2013-09-13T12:00:00.000 | python,ctypes,cython,pysdl2 | Cython + ctypes? | 0 | 1 | 1 | 19,071,067 | 1 |
Subsets and Splits