[{"Question":"A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the simulation from a small Django app. At least I hope so.\nDo I have the right plan? Has anyone else done something similar? Can you let me know if there are any serious pitfalls that I'm not aware of at the moment?","AnswerCount":4,"Available Count":3,"Score":0.2449186624,"is_accepted":false,"ViewCount":2313,"Q_Id":5136,"Users Score":5,"Answer":"One thing to remember is that the Matlab compiler does not actually compile the Matlab code into native machine instructions. It simply wraps it into a standalone executable or a library with its own runtime engine that runs it. You would be able to run your code without Matlab installed, and you would be able to interface it with other languages, but it will still be interpreted Matlab code, so there would be no speedup.","Q_Score":14,"Tags":"python,c,matlab","A_Id":1659332,"CreationDate":"2008-08-07T18:47:00.000","Title":"Does anyone have experience creating a shared library in MATLAB?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the simulation from a small Django app. At least I hope so.\nDo I have the right plan? Has anyone else done something similar? Can you let me know if there are any serious pitfalls that I'm not aware of at the moment?","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":2313,"Q_Id":5136,"Users Score":2,"Answer":"I'd also try ctypes first. \n\nUse the Matlab compiler to compile the code into C. \nCompile the C code into a DLL.\nUse ctypes to load and call code from this DLL\n\nThe hardest step is probably 1, but if you already know Matlab and have used the Matlab compiler, you should not have serious problems with it.","Q_Score":14,"Tags":"python,c,matlab","A_Id":138534,"CreationDate":"2008-08-07T18:47:00.000","Title":"Does anyone have experience creating a shared library in MATLAB?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the simulation from a small Django app. At least I hope so.\nDo I have the right plan? Has anyone else done something similar? Can you let me know if there are any serious pitfalls that I'm not aware of at the moment?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":2313,"Q_Id":5136,"Users Score":3,"Answer":"I won't help much but I remember that I was able to wrap a MATLAB simulation into DLL and then call it from a Delphi app. It worked really well.","Q_Score":14,"Tags":"python,c,matlab","A_Id":5302,"CreationDate":"2008-08-07T18:47:00.000","Title":"Does anyone have experience creating a shared library in MATLAB?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.\nI have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations.\nThe problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle.\nSo I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to.\nHas anyone got any experiences of something similar to this they would care to share?","AnswerCount":8,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":7527,"Q_Id":11060,"Users Score":0,"Answer":"My recommendation would be to figure out a set of known input-output results, such as some simpler cases that you already have in place, and unit test the code that is produced. It's entirely possible that as you change the generator that the exact string that is produced may be slightly different... but what you really care is whether it is interpreted in the same way. Thus, if you test the results as you would test that code if it were your feature, you will find out if it succeeds in the ways you want.\nBasically, what you really want to know is whether your generator will produce what you expect without physically testing every possible combination (also: impossible). By ensuring that your generator is consistent in the ways you expect, you can feel better that the generator will succeed in ever-more-complex situations.\nIn this way, you can also build up a suite of regression tests (unit tests that need to keep working correctly). This will help you make sure that changes to your generator aren't breaking other forms of code. When you encounter a bug that your unit tests didn't catch, you may want to include it to prevent similar breakage.","Q_Score":29,"Tags":"c++,python,unit-testing,code-generation,swig","A_Id":3331503,"CreationDate":"2008-08-14T13:59:00.000","Title":"How should I unit test a code-generator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.\nI have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations.\nThe problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle.\nSo I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to.\nHas anyone got any experiences of something similar to this they would care to share?","AnswerCount":8,"Available Count":5,"Score":0.1243530018,"is_accepted":false,"ViewCount":7527,"Q_Id":11060,"Users Score":5,"Answer":"Recall that \"unit testing\" is only one kind of testing. You should be able to unit test the internal pieces of your code generator. What you're really looking at here is system level testing (a.k.a. regression testing). It's not just semantics... there are different mindsets, approaches, expectations, etc. It's certainly more work, but you probably need to bite the bullet and set up an end-to-end regression test suite: fixed C++ files -> SWIG interfaces -> python modules -> known output. You really want to check the known input (fixed C++ code) against expected output (what comes out of the final Python program). Checking the code generator results directly would be like diffing object files...","Q_Score":29,"Tags":"c++,python,unit-testing,code-generation,swig","A_Id":11443,"CreationDate":"2008-08-14T13:59:00.000","Title":"How should I unit test a code-generator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.\nI have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations.\nThe problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle.\nSo I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to.\nHas anyone got any experiences of something similar to this they would care to share?","AnswerCount":8,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":7527,"Q_Id":11060,"Users Score":0,"Answer":"Yes, results are the ONLY thing that matters. The real chore is writing a framework that allows your generated code to run independently... spend your time there.","Q_Score":29,"Tags":"c++,python,unit-testing,code-generation,swig","A_Id":11128,"CreationDate":"2008-08-14T13:59:00.000","Title":"How should I unit test a code-generator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.\nI have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations.\nThe problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle.\nSo I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to.\nHas anyone got any experiences of something similar to this they would care to share?","AnswerCount":8,"Available Count":5,"Score":1.2,"is_accepted":true,"ViewCount":7527,"Q_Id":11060,"Users Score":14,"Answer":"I started writing up a summary of my experience with my own code generator, then went back and re-read your question and found you had already touched upon the same issues yourself, focus on the execution results instead of the code layout\/look.\nProblem is, this is hard to test, the generated code might not be suited to actually run in the environment of the unit test system, and how do you encode the expected results?\nI've found that you need to break down the code generator into smaller pieces and unit test those. Unit testing a full code generator is more like integration testing than unit testing if you ask me.","Q_Score":29,"Tags":"c++,python,unit-testing,code-generation,swig","A_Id":11074,"CreationDate":"2008-08-14T13:59:00.000","Title":"How should I unit test a code-generator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.\nI have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations.\nThe problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle.\nSo I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to.\nHas anyone got any experiences of something similar to this they would care to share?","AnswerCount":8,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":7527,"Q_Id":11060,"Users Score":0,"Answer":"If you are running on *nux you might consider dumping the unittest framework in favor of a bash script or makefile. on windows you might consider building a shell app\/function that runs the generator and then uses the code (as another process) and unittest that.\nA third option would be to generate the code and then build an app from it that includes nothing but a unittest. Again you would need a shell script or whatnot to run this for each input. As to how to encode the expected behavior, it occurs to me that it could be done in much the same way as you would for the C++ code just using the generated interface rather than the C++ one.","Q_Score":29,"Tags":"c++,python,unit-testing,code-generation,swig","A_Id":11235,"CreationDate":"2008-08-14T13:59:00.000","Title":"How should I unit test a code-generator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What is the best way to use PyGame (SDL) within a PyGTK application?\nI'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events.","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":4838,"Q_Id":25661,"Users Score":0,"Answer":"I tried doing this myself a while ago, and I never got it to work perfectly. Actually I never got it to work at all under Windows, as it kept crashing the entire OS and I ran out of patience. I continued to use it though as it was only important it ran on Linux, and was only a small project. I'd strongly recommend you investigate alternatives. It always felt like a nasty hack, and made me feel dirty.","Q_Score":9,"Tags":"python,gtk,pygtk,sdl,pygame","A_Id":88457,"CreationDate":"2008-08-25T04:36:00.000","Title":"pyGame within a pyGTK application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What is the best way to use PyGame (SDL) within a PyGTK application?\nI'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events.","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":4838,"Q_Id":25661,"Users Score":0,"Answer":"There's a simple solution that might work for you. \nWrite the PyGTK stuff and PyGame stuff as separate applications. Then from the PyGTK application call the PyGame application, using os.system to call the PyGame application. If you need to share data between the two then either use a database, pipes or IPC.","Q_Score":9,"Tags":"python,gtk,pygtk,sdl,pygame","A_Id":199288,"CreationDate":"2008-08-25T04:36:00.000","Title":"pyGame within a pyGTK application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions pertains to drag and drop in other GUI frameworks as well). The frameworks provides a couple of callbacks (OnEnter and OnDragOver) that purportedly allow me to inform the system whether the current mouse position is a valid place to drop whatever it is that is being dragged. From these methods I can return wx.DragNone, wx.DragCopy, etc. What baffles me is that from within these methods I am not allowed to call GetData, which means I am not allowed to examine the data that the user is dragging. If I cannot see the data, how am I supposed to know whether it is OK for the user to drop here?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":584,"Q_Id":26706,"Users Score":1,"Answer":"There is no way to see dragged data in OnEnter and OnDragOver methods.\nThe only solution I found is to store the dragged item in some instance variable that is then readable inside these methods.","Q_Score":6,"Tags":"python,user-interface,drag-and-drop,wxpython,wxwidgets","A_Id":139047,"CreationDate":"2008-08-25T19:43:00.000","Title":"wxpython: How do I examine dragged data in OnDragOver?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions pertains to drag and drop in other GUI frameworks as well). The frameworks provides a couple of callbacks (OnEnter and OnDragOver) that purportedly allow me to inform the system whether the current mouse position is a valid place to drop whatever it is that is being dragged. From these methods I can return wx.DragNone, wx.DragCopy, etc. What baffles me is that from within these methods I am not allowed to call GetData, which means I am not allowed to examine the data that the user is dragging. If I cannot see the data, how am I supposed to know whether it is OK for the user to drop here?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":584,"Q_Id":26706,"Users Score":1,"Answer":"One solution, which is a hack of limited usefulness, is when a drag is initiated, store the dragged data in a global or static reference somewhere. This way, in the OnEnter and OnDragOver handlers, it is possible to get a reference to the data being dragged. This is of course only useful for drags within the same application (the same instance of the application, actually).","Q_Score":6,"Tags":"python,user-interface,drag-and-drop,wxpython,wxwidgets","A_Id":26707,"CreationDate":"2008-08-25T19:43:00.000","Title":"wxpython: How do I examine dragged data in OnDragOver?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've played around with GTK, TK, wxPython, Cocoa, curses and others. They are are fairly horrible to use.. GTK\/TK\/wx\/curses all seem to basically be direct-ports of the appropriate C libraries, and Cocoa basically mandates using both PyObjC and Interface Builder, both of which I dislike..\nThe Shoes GUI library for Ruby is great.. It's very sensibly designed, and very \"rubyish\", and borrows some nice-to-use things from web development (like using hex colours codes, or :color => rgb(128,0,0))\nAs the title says: are there any nice, \"Pythonic\" GUI toolkits?","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":10824,"Q_Id":35922,"Users Score":1,"Answer":"I use pyGtk. I think wxPython is nice but it's too limited, and PyQt is, well, Qt. =)","Q_Score":19,"Tags":"python,user-interface","A_Id":36761,"CreationDate":"2008-08-30T12:19:00.000","Title":"Are there any \"nice to program\" GUI toolkits for Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.0181798149,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":1,"Answer":"Personally I would recommend coding it out instead of using Glade. I'm still learning python and pyGtk but I will say that writing out the UI by hand gave me a lot of insight on how things work under the hood. \nOnce you have it learned I'd say to give glade, or other UI designers a try but definitely learn how to do it the \"hard\" way first.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":751707,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.0181798149,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":1,"Answer":"For quick and simple screens I use Glade. But for anything that needs finer levels of control, I create a custom classes for what I actually need (this is important, because it's too easy to get carried away with generalisations).\nWith a skinny applications specific classes, I can rapidly change the look and feel application wide from a single place. Rather like using CSS to mantain consistency for web sites.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":199167,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.0906594778,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":5,"Answer":"I started out using glade, but soon moved to just doing everything in code. Glade is nice for simple things, and it's good when you're learning how GTK organizes the widgets (how things are packed, etc). Constructing everything in code, however, you have much more flexibility. Plus, you don't have the glade dependency.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":106889,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.0363476168,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":2,"Answer":"I recommend using Glade for rapid development, but not for learning. Why? because some times you will need to tune up some widgets in order to work as you want they to work, and if you don't really know\/understand the properties attributes of every widget then you will be in troubles.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":305667,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.072599319,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":4,"Answer":"I usually start with Glade until I come to a point where it doesn't have the features I need, e.g. creating a wizard. As long as I'm using the standard widgets that Glade provides, there's really no reason to hand-code the GUI.\nThe more comfortable I become with how Glade formats the code, the better my hand-coding becomes. Not to mention, it's real easy to use Glade to make the underlying framework so you don't have to worry about all the initializations.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":107959,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.0363476168,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":2,"Answer":"First, start to put this in perspective.\nYou will be using GTK. This is a huge C library built in 1993 using the best traditions of 1970s coding style. It was built to help implement the GIMP, a Photoshop competitor wanna-be with user interface blunders of legend. A typical gui field might have forty or more parameters, mostly repetitive, having getters and setters. There will be pain.\nThe GTK itself manages a complete dynamic type system in C using GObject. This makes debugging a special joy that requires manually walking through arrays of pointers to methods full of generic argument lists with implicit inheritance. You will also be jumping through Pango libraries when you least expect it, e.g., using a Pango constant for where in a label the ellipsis go when the page is small. Expect more pain.\nBy now, you are probably vowing to wrap all your GTK interactions in a Model-View-Controller architecture specific to your application. This is good.\nUsing Glade, or gtkBuilder, or Stetic, will help coral the huge coupling problem of forty parameters to a function. Glade provides a basic GUI builder to drag and drop components together. The parameters and inherited parameters are somewhat separated out. The output of Glade is .glade XML file which you will then read in, attach your callbacks (\"signal handlers\") to identically named functions, and query or update the in-memory version of that XML to get widgets that you then use pyGTK to manipulate. Glade itself is a creaky and not well maintained. \nUsing pyGTK gives you annoyingly fine grained control in order to build your GUI. This will be verbose, copy-and-paste code. Each attribute will be a separate function call. The attribute setter does not return anything, so chaining the calls is out of the question. Usually, your IDE will give only minimal help on what functions mean and you will be constantly referring to DevHelp or some other tool.\nOne would almost expect GTK GUIs were meant to fail.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":2149087,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":0.0906594778,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":5,"Answer":"Glade is very useful for creating interfaces, it means you can easily change the GUI without doing much coding. You'll find that if you want to do anything useful (e.g. build a treeview) you will have to get familiar with various parts of the GTK documentation - in practice finding a good tutorial\/examples.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":54313,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.\nThe thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.\nI was wondering if the more experienced ones among us (remember, I'm just a beginner) could point out the benefits and caveats of using Glade as opposed to creating everything in the code itself (assuming that learning the correct gtk bindings wouldn't exactly be a problem).","AnswerCount":11,"Available Count":8,"Score":1.0,"is_accepted":false,"ViewCount":8539,"Q_Id":48123,"Users Score":12,"Answer":"Use GtkBuilder instead of Glade, it's integrated into Gtk itself instead of a separate library.\nThe main benefit of Glade is that it's much, much easier to create the interface. It's a bit more work to connect signal handlers, but I've never felt that matters much.","Q_Score":32,"Tags":"python,gtk,pygtk,glade,gtk2","A_Id":48136,"CreationDate":"2008-09-07T04:00:00.000","Title":"Glade or no glade: What is the best way to use PyGtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"What is the best way to start developing Windows Mobile Professional applications in Python? Is there a reasonable SDK including an emulator? Is it even possible without doing excessive amount of underlaying Windows API calls for UI for instance?","AnswerCount":4,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":7815,"Q_Id":60446,"Users Score":9,"Answer":"(I used to write customer apps for Windows Mobile.)\nForget about python. Even if it's technically possible:\n\nyour app will be big (you'll have to bundle the whole python runtime with your app)\nyour app will use lots of memory (python is a memory hog, relative to C\/C++)\nyour app will be slow\nyou wont find any documentation or discussion groups to help you when you (inevitably) encounter problems\n\nGo with C\/C++ (or C#). Visual Studio 2005\/2008 have decent tools for those (SDK for winmo built-in, debugging on the emulator or device connected through USB), the best documentation is for those technologies plus there are active forums\/discussion groups\/mailing lists where you can ask for help.","Q_Score":4,"Tags":"python,windows-mobile","A_Id":60945,"CreationDate":"2008-09-13T09:56:00.000","Title":"Windows Mobile development in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi?\nFor example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to replace VBSCRIPT. However, we would need to provide Ruby\/Python scripting in the old Delphi application. Is it possible to use the managed dlls provided by IronRuby\/IronPython from Delphi code?","AnswerCount":6,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":877,"Q_Id":74386,"Users Score":3,"Answer":"Why not embed CPython instead, which has an API intended to be used directly from C\/C++. You lose the multiple language advantage but probably gain simplicity.","Q_Score":5,"Tags":".net,delphi,ironpython,unmanaged,ironruby","A_Id":934717,"CreationDate":"2008-09-16T16:44:00.000","Title":"Using DLR from Unmanaged Code","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2526,"Q_Id":82180,"Users Score":0,"Answer":"For plotting with you should also consider matplotlib, which provides a higher level API and integrates well with PyQT.","Q_Score":2,"Tags":"python,qt,gtk,pyqt","A_Id":453179,"CreationDate":"2008-09-17T11:28:00.000","Title":"PyQt and PyCairo","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0114280739,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":2,"Answer":"Towards answering the updated question, its a chicken\/egg problem. The best way to justify an expense is to show how it reduces a cost somewhere else, so you may need to spend some extra\/personal time to learn something first to build some kind of functional prototype.\nShow your boss a demo like \"hey, i did this thing, and it saves me this much time [or better yet, this much $$], imagine if everyone could use this how much money we would save\"\nand then after they agree, explain how it is some other technology and that it is worth the expense to get more training, and training for others on how to do it better.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":87121,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"Personally I work on a Java app, but I couldn't get by without perl for some supporting scripts. \nI've got scripts to quickly flip what db I'm pointing at, scripts to run build scripts, scripts to scrape data & compare stuff. \nSure I could do all that with java, or maybe shell scripts (I've got some of those too), but who wants to compile a class (making sure the classpath is set right etc) when you just need something quick and dirty. Knowing a scripting language can remove 90% of those boring\/repetitive manual tasks.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84456,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"They're useful for the \"Quick Hack\" that is for plugging a gap in your main language for a quick (and potentially dirty) fix faster than it would take to develop the same in your main language. An example: a simple script in perl to go through a large text file and replace all instances of an email address with another is trivial with an amount of time taken in the 10 minute range. Hacking a console app together to do the same in your main language would take multiples of that.\nYou also have the benefit that exposing yourself to additional languages broadens your abilities and learning to attack problems from a different languages perspective can be as valuable as the language itself.\nFinally, scripting languages are very useful in the realm of extension. Take LUA as an example. You can bolt a lua interpreter into your app with very little overhead and you now have a way to create rich scripting functionality that can be exposed to end users or altered and distributed quickly without requiring a rebuild of the entire app. This is used to great effect in many games most notably World of Warcraft.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84443,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"Im not sure if this is what you are looking for, but we write our main application with Java at the small company I work for, but have used python to write smaller scripts quickly. Backup software, temporary scripts to manipulate data and push out results. It just seems easier sometimes to sit down with python and write a quick script than mess with classes and stuff in java. \nTemp scripts that aren't going to stick around don't need a lot of design time wasted on them.\nAnd I am lazy, but it is good to just learn as much as you can of course and see what features exist in other languages. Knowing more never hurts you in future career changes :)","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84423,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"You should also consider learning a functional programming language like Scala. It has many of the advantages of Ruby, including a concise syntax, and powerful features like closures. But it compiles to Java class files and and integrate seamlessly into a Java stack, which may make it much easier for your employer to swallow.\nScala isn't dynamically typed, but its \"implicit conversion\" feature gives many, perhaps even all of the benefits of dynamic typing, while retaining many of the advantages of static typing.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84584,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"Learning something with a flexible OOP system, like Lisp or Perl (see Moose), will allow you to better expand and understand your thoughts on software engineering. Ideally, every language has some unique facet (whether it be CLOS or some other technique) that enhances, extends and grows your abilities as a programmer.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":85167,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"If all you have is a hammer, every problem begins to look like a nail.\nThere are times when having a screwdriver or pair of pliers makes a complicated problem trivial.\nNobody asks contractors, carpenters, etc, \"Why learn to use a screwdriver if i already have a hammer?\". Really good contractors\/carpenters have tons of tools and know how to use them well. All programmers should be doing the same thing, learning to use new tools and use them well.\n\nBut before we use any power tools, lets\n take a moment to talk about shop safety. Be sure\n to read, understand, and follow all the\n safety rules that come with your power\n tools. Doing so will greatly reduce\n the risk of personal injury. And remember\n this: there is no more important rule\n than to wear these: safety glasses\n -- Norm","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":85733,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Dynamic languages are fantastic for prototyping ideas. Often for performance reasons they won't work for permanent solutions or products. But, with languages like Python, which allow you to embed standard C\/C++\/Java inside them or visa versa, you can speed up the really critical bits but leave it glued together with the flexibility of a dynamic language.\n...and so you get the best of both worlds. If you need to justify this in terms of why more people should learn these languages, just point out much faster you can develop the same software and how much more robust the solution is (because debugging\/fixing problems in dynamic languages is in my experience, considerably easier!).","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":85789,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Knowing grep and ruby made it possible to narrow down a problem, and verify the fix for, an issue involving tons of java exceptions on some production servers. Because I threw the solution together in ruby, it was done (designed, implemented, tested, run, bug-fixed, re-run, enhanced, results analyzed) in an afternoon instead of a couple of days. I could have solved the same problem using an all-java solution or a C# solution, but it most likely would have taken me longer.\nHaving dynamic language expertise also sometimes leads you to simpler solutions in less dynamic languages. In ruby, perl or python, you just intuitively reach for associative arrays (hashes, dictionaries, whatever word you want to use) for the smallest things, where you might be tempted to create a complex class hierarchy in a statically typed language when the problem doesn't necessarily demand it.\nPlus you can plug in most scripting languages into most runtimes. So it doesn't have to be either\/or.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":85891,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0114280739,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":2,"Answer":"Learning a new language is a long-term process. In a couple of days you'll learn the basics, yes. But! As you probably know, the real practical applicability of any language is tied to the standard library and other available components. Learning how to use the efficiently requires a lot of hands-on experience. \nPerhaps the only immediate short-term benefit is that developers learn to distinguish the nails that need a Python\/Perl\/Ruby -hammer. And, if they are any good, they can then study some more (online, perhaps!) and become real experts.\nThe long-term benefits are easier to imagine:\n\nThe employee becomes a better developer. Better developer => better quality. We are living in a knowledge economy these days. It's wiser to invest in those brains that already work for you.\nIt is easier to adapt when the next big language emerges. It is very likely that the NBL will have many of the features present in today's scripting languages: first-class functions, closures, streams\/generators, etc. \nNew market possibilities and ability to respond more quickly. Even if you are not writing Python, other people are. Your clients? Another vendor in the project? Perhaps a critical component was written in some other language? It will cost money and time, if you do not have people who can understand the code and interface with it.\nRecruitment. If your company has a reputation of teaching new and interesting stuff to people, it will be easier to recruit the top people. Everyone is doing Java\/C#\/C++. It is not a very effective way to differentiate yourself in the job market.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":85898,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"The \"real benefit\" that an employer could see is a better programmer who can implement solutions faster; however, you will not be able to provide any hard numbers to justify the expense and an employer will most likely have you work on what makes money now as opposed to having you work on things that make the future better. \nThe only time you can get training on the employer's dime, is when they perceive a need for it and it's cheaper than hiring a new person who already has that skill-set.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":85910,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Testing.\nIt's often quicker and easier to test your C#\/Java application by using a dynamic language. You can do exploratory testing at the interactive prompt and quickly create automated test scripts.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":86366,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"I think the main benefits of dynamic languages can be boiled down to\n\nRapid development\nGlue\n\nThe short design-code-test cycle time makes dynamic languages ideal for prototyping, tools, and quick & dirty one-off scripts. IMHO, the latter two can make a huge impact on a programmer's productivity. It amazes me how many people trudge through things manually instead of whipping up a tool to do it for them. I think it's because they don't have something like Perl in their toolbox.\nThe ability to interface with just about anything (other programs or languages, databases, etc.) makes it easy to reuse existing work and automate tasks that would otherwise need to be done manually.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":86657,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Others have already explained why learning more languages makes you a better programmer.\nAs for convincing your boss it's worth it, this is probably just your company's culture. Some places make career and skill progress a policy (move up or out), some places value it but leave it up to the employee's initiative, and some places are very focused on the bottom line.\nIf you have to explain why learning a language is a good thing to your boss, my advice would be to stay at work only as long as necessary, then go home and study new things on your own.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":86738,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"For after work work, for freelance jobs...:) and final to be programming literate as possible as...;)","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":87164,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.017141178,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":3,"Answer":"Edit: I wrote this before reading the update to the original question. See my other answer for a better answer to the updated question. I will leave this as is as a warning against being the fastest gun in the west =)\nOver a decade ago, when I was learning the ways of the Computer, the Old Wise Men With Beards explained how C and C++ are the tools of the industry. No one used Pascal and only the foolhardy would risk their companies with assembler.\nAnd of course, no one would even mention the awful slow ugly thing called Java. It will not be a tool for serious business.\nSo. Um. Replace the languages in the above story and perhaps you can predict the future. Perhaps you can't. Point is, Java will not be the Last Programming Language ever and also you will most likely switch employers as well. The future is charging at you 24 hours per day. Be prepared.\nLearning new languages is good for you. Also, in some cases it can give you bragging rights for a long time. My first university course was in Scheme. So when people talk to me about the new language du jour, my response is something like \"First-class functions? That's so last century.\"\nAnd of course, you get more stuff done with a high-level language.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84571,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":1.2,"is_accepted":true,"ViewCount":32287,"Q_Id":84340,"Users Score":80,"Answer":"A lot of times some quick task comes up that isn't part of the main software you are developing. Sometimes the task is one off ie compare this file to the database and let me know the differences. It is a lot easier to do text parsing in Perl\/Ruby\/Python than it is in Java or C# (partially because it is a lot easier to use regular expressions). It will probably take a lot less time to parse the text file using Perl\/Ruby\/Python (or maybe even vbscript cringe and then load it into the database than it would to create a Java\/C# program to do it or to do it by hand.\nAlso, due to the ease at which most of the dynamic languages parse text, they are great for code generation. Sure your final project must be in C#\/Java\/Transact SQL but instead of cutting and pasting 100 times, finding errors, and cutting and pasting another 100 times it is often (but not always) easier just to use a code generator.\nA recent example at work is we needed to get data from one accounting system into our accounting system. The system has an import format, but the old system had a completely different format (fixed width although some things had to be matched). The task is not to create a program to migrate the data over and over again. It is to shove the data into our system and then maintain it there going forward. So even though we are a C# and SQL Server shop, I used Python to convert the data into the format that could be imported by our application. Ultimately it doesn't matter that I used python, it matters that the data is in the system. My boss was pretty impressed.\nWhere I often see the dynamic languages used for is testing. It is much easier to create a Python\/Perl\/Ruby program to link to a web service and throw some data against it than it is to create the equivalent Java program. You can also use python to hit against command line programs, generate a ton of garbage (but still valid) test data, etc.. quite easily.\nThe other thing that dynamic languages are big on is code generation. Creating the C#\/C++\/Java code. Some examples follow:\nThe first code generation task I often see is people using dynamic languages to maintain constants in the system. Instead of hand coding a bunch of enums, a dynamic language can be used to fairly easily parse a text file and create the Java\/C# code with the enums.\nSQL is a whole other ball game but often you get better performance by cut and pasting 100 times instead of trying to do a function (due to caching of execution plans or putting complicated logic in a function causing you to go row by row instead of in a set). In fact it is quite useful to use the table definition to create certain stored procedures automatically.\nIt is always better to get buy in for a code generator. But even if you don't, is it more fun to spend time cutting\/pasting or is it more fun to create a Perl\/Python\/Ruby script once and then have that generate the code? If it takes you hours to hand code something but less time to create a code generator, then even if you use it once you have saved time and hence money. If it takes you longer to create a code generator than it takes to hand code once but you know you will have to update the code more than once, it may still make sense. If it takes you 2 hours to hand code, 4 hours to do the generator but you know you'll have to hand code equivalent work another 5 or 6 times than it is obviously better to create the generator.\nAlso some things are easier with dynamic languages than Java\/C#\/C\/C++. In particular regular expressions come to mind. If you start using regular expressions in Perl and realize their value, you may suddenly start making use of the Java regular expression library if you haven't before. If you have then there may be something else.\nI will leave you with one last example of a task that would have been great for a dynamic language. My work mate had to take a directory full of files and burn them to various cd's for various customers. There were a few customers but a lot of files and you had to look in them to see what they were. He did this task by hand....A Java\/C# program would have saved time, but for one time and with all the development overhead it isn't worth it. However slapping something together in Perl\/Python\/Ruby probably would have been worth it. He spent several hours doing it. It would have taken less than one to create the Python script to inspect each file, match which customer it goes to, and then move the file to the appropriate place.....Again, not part of the standard job. But the task came up as a one off. Is it better to do it yourself, spend the larger amount of time to make Java\/C# do the task, or spend a much smaller amount of time doing it in Python\/Perl\/Ruby. If you are using C or C++ the point is even more dramatic due to the extra concerns of programming in C or C++ (pointers, no array bounds checking, etc.).","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84943,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Often, dynamc languages (especially python and lua) are embedded in programs to add a more plugin-like functionality and because they are high-level languages that make it easy to add certain behavior, where a low\/mid-level language is not needed.\nLua specificially lacks all the low-level system calls because it was designed for easeof-use to add functionality within the program, not as a general programming language.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84400,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"It's all about broadening your horizons as a developer. If you limit yourself to only strong-typed languages, you may not end up the best programmer you could.\nAs for tasks, Python\/Lua\/Ruby\/Perl are great for small simple tasks, like finding some files and renaming them. They also work great when paired with a framework (e.g. Rails, Django, Lua for Windows) for developing simple apps quickly. Hell, 37Signals is based on creating simple yet very useful apps in Ruby on Rails.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84441,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Philosophical issues aside, I know that I have gotten value from writing quick-and-dirty Ruby scripts to solve brute-force problems that Java was just too big for. Last year I had three separate directory structures that were all more-or-less the same, but with lots of differences among the files (the client hadn't heard of version control and I'll leave the rest to your imagination). \nIt would have taken a great deal of overhead to write an analyzer in Java, but in Ruby I had one working in about 40 minutes.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84383,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"Given the increasing focus to running dynamic languages (da-vinci vm etc.) on the JVM and the increasing number of dynamic languages that do run on it (JRuby, Grrovy, Jython) I think the usecases are just increasing. Some of the scenarios I found really benifited are\n\nPrototyping- use RoR or Grails to build quick prototypes with advantage of being able to runn it on the standard app server and (maybe) reuse existing services etc.\nTesting- right unit tests much much faster in dynamic languages\nPerformance\/automation test scripting- some of these tools are starting to allow the use standard dynamic language of choice to write the test scripts instead of proprietary script languages. Side benefit might be to the able to reuse some unit test code you've already written.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":90403,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"Don't tell your employer that you want to learn Ruby. Tell him you want to learn about the state-of-the-art in web framework technologies. it just happens that the hottest ones are Django and Ruby on Rails.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":98291,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Don't bother your employer, spend ~$40 on a book, download some software, and devote some time each day to read\/do exercises. In no time you'll be trained :)","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":114875,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0285636566,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":5,"Answer":"A good hockey player plays where the puck is. A great hockey player plays where the puck is going to be.\n- Wayne Gretzky\nOur industry is always changing. No language can be mainstream forever. To me Java, C++, .Net is where the puck is right now. And python, ruby, perl is where the puck is going to be. Decide for yourself if you wanna be good or great!","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":92642,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"I have often found that learning another language, especially a dynamically typed language, can teach you things about other languages and make you an overall better programmer. Learning ruby, for example, will teach you Object Oriented programming in ways Java wont, and vice versa. All in all, I believe that it is better to be a well rounded programmer than stuck in a single language. It makes you more valuable to the companies\/clients you work for.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84382,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":0,"Answer":"Dynamic languages are a different way to think and sometimes the practices you learn from a dynamic or functional language can transfer to the more statically typed languages but if you never take the time to learn different languages, you'll never get the benefit of having a knew way to think when you are coding.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":90005,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":1.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":21,"Answer":"Let me turn your question on its head by asking what use it is to an American English speaker to learn another language?\nThe languages we speak (and those we program in) inform the way we think. This can happen on a fundamental level, such as c++ versus javascript versus lisp, or on an implementation level, in which a ruby construct provides a eureka moment for a solution in your \"real job.\"\nSpeaking of your real job, if the market goes south and your employer decides to \"right size\" you, how do you think you'll stack up against a guy who is flexible because he's written software in tens of languages, instead of your limited exposure? All things being equal, I think the answer is clear.\nFinally, you program for a living because you love programming... right?","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84362,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":1.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":9,"Answer":"I primarily program in Java and C# but use dynamic languages (ruby\/perl) to support smoother deployment, kicking off OS tasks, automated reporting, some log parsing, etc.\nAfter a short time learning and experimenting with ruby or perl you should be able to write some regex manipulating scripts that can alter data formats or grab information from logs. An example of a small ruby\/perl script that could be written quickly would be a script to parse a very large log file and report out only a few events of interest in either a human readable format or a csv format. \nAlso, having experience with a variety of different programming languages should help you think of new ways to tackle problems in more structured languages like Java, C++, and C#.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84437,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":1.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":7,"Answer":"One big reason to learn Perl or Ruby is to help you automate any complicated tasks that you have to do over and over.\nOr if you have to analyse contents of log files and you need more mungeing than available using grep, sed, etc.\nAlso using other languages, e.g. Ruby, that don't have much \"setup cost\" will let you quickly prototype ideas before implementing them in C++, Java, etc.\nHTH\ncheers,\nRob","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":84535,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":0.0057142235,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":1,"Answer":"I have found the more that I play with Ruby, the better I understand C#. \n1) As you switch between these languages that each of them has their own constructs and philosophies behind the problems that they try to solve. This will help you when finding the right tool for the job or the domain of a problem.\n2) The role of the compiler (or interpreter for some languages) becomes more prominent. Why is Ruby's type system differ from the .Net\/C# system? What problems do each of these solve? You'll find yourself understanding at a lower level the constructs of the compiler and its influence on the language\n3) Switching between Ruby and C# really helped me to understand Design Patterns better. I really suggest implementing common design patterns in a language like C# and then in a language like Ruby. It often helped me see through some of the compiler ceremony to the philosophy of a particular pattern.\n4) A different community. C#, Java, Ruby, Python, etc all have different communities that can help engage your abilities. It is a great way to take your craft to the next level.\n5) Last, but not least, because new languages are fun :)","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":2870953,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wonder why would a C++, C#, Java developer want to learn a dynamic language?\nAssuming the company won't switch its main development language from C++\/C#\/Java to a dynamic one what use is there for a dynamic language?\nWhat helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?\nUpdate\nAfter seeing the first few responses it is clear that there are two issues.\nMy main interest would be something that is justifiable to the employer as an expense.\nThat is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the\nemployers are usually looking for some \"real\" benefit.","AnswerCount":35,"Available Count":31,"Score":1.0,"is_accepted":false,"ViewCount":32287,"Q_Id":84340,"Users Score":14,"Answer":"I don't think anyone has mentioned this yet. Learning a new language can be fun! Surely that's a good enough reason to try something new.","Q_Score":66,"Tags":"c#,java,python,ruby,perl","A_Id":89272,"CreationDate":"2008-09-17T15:16:00.000","Title":"Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken .qdf files.\n@Swati: Quicken .qif format is for transfer only and is not kept up to date by the application like the .qdf file is.","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":11880,"Q_Id":91890,"Users Score":5,"Answer":"QDF is proprietary and not really meant for reading other than my Quicken, probably for a reason as it is messy. \nI would recommend finding a way to export the qdf into an OFX (Open Financial Exchange) or qif file. I have done some financial and quickbooks automation and I did something similar. The problem is if you don't export to an exchange format, each version differs and strange things happen for many conditions that since they aren't documented (QDF) it becomes a bad situation for the programmer.\nOFX is what allows online banking, brokerages and apps like mint.com securely get financial data. It is a standard and consistent. Finding a way to this is much better if at all possible.","Q_Score":12,"Tags":"c#,java,python,file-format,quicken","A_Id":2278316,"CreationDate":"2008-09-18T12:02:00.000","Title":"Reading quicken data files","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background. \nIs it possible to have two states for the pack manager: one for one set of widgets and another for another set?","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":3016,"Q_Id":112263,"Users Score":2,"Answer":"The answer to your specific question is no. You can't have two states or otherwise use pack two different ways in the same parent. \nHowever, what I think you want to accomplish is simple. Use the built-in features of the canvas to create an image item that is part of the canvas, then pack things into the canvas as if it were a frame. \nYou can accomplish a similar thing by creating a label widget with an image, then pack your other widgets into the label.\nOne advantage to using a canvas is you can easily tile an image to fill the whole canvas with a repeating background image so as the window grows the image will continue to fill the window (of course you can just use a sufficiently large original image...)","Q_Score":2,"Tags":"python,tkinter,geometry,pack","A_Id":112337,"CreationDate":"2008-09-21T21:45:00.000","Title":"How do I overlap widgets with the Tkinter pack geometry manager?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background. \nIs it possible to have two states for the pack manager: one for one set of widgets and another for another set?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3016,"Q_Id":112263,"Users Score":0,"Answer":"Not without swapping widget trees in and out, which I don't think can be done cleanly with Tk. Other toolkits can do this a little more elegantly.\n\nCOM\/VB\/MFC can do this with an ActiveX control - you can hide\/show multiple ActiveX controls in the same region. Any of the containers will let you do this by changing the child around. If you're doing a windows-specific program you may be able to accomplish it this way.\nQT will also let you do this in a similar manner.\nGTK is slightly harder.","Q_Score":2,"Tags":"python,tkinter,geometry,pack","A_Id":112432,"CreationDate":"2008-09-21T21:45:00.000","Title":"How do I overlap widgets with the Tkinter pack geometry manager?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm specifically looking for one that lets me display a map of US states with each one as it's own \"object\" in the sense that I can control the color, on click, and on mouseover of each one individually. GTK is my personal preference, but at this point I'd settle for just about anything. The application itself will be written in Python, FWIW.","AnswerCount":5,"Available Count":3,"Score":0.0399786803,"is_accepted":false,"ViewCount":906,"Q_Id":112483,"Users Score":1,"Answer":"If you consider Qt, consider also throwing in kdelibs dependency, \n then you'll have marble widget, which handles maps in neat way.\n\nThanks for advertizing Marble. But you are incorrect: \nThe Marble Widget doesn't depend on kdelibs at all. It just depends on Qt (>=4.3).\nAdditionally Marble also has just received Python bindings.\nI think that the given problem can be solved using Marble. Would just take a few days of work at max. If you have questions about Marble, feel free to ask us on our mailing list or IRC.","Q_Score":1,"Tags":"python,qt,gtk,desktop","A_Id":302298,"CreationDate":"2008-09-21T23:10:00.000","Title":"Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm specifically looking for one that lets me display a map of US states with each one as it's own \"object\" in the sense that I can control the color, on click, and on mouseover of each one individually. GTK is my personal preference, but at this point I'd settle for just about anything. The application itself will be written in Python, FWIW.","AnswerCount":5,"Available Count":3,"Score":0.0798297691,"is_accepted":false,"ViewCount":906,"Q_Id":112483,"Users Score":2,"Answer":"If you consider Qt, consider also throwing in kdelibs dependency, then you'll have marble widget, which handles maps in neat way.\nIf you stick only to Qt, then QGraphicsView is a framework to go.\n(note: kdelibs != running whole kde desktop)","Q_Score":1,"Tags":"python,qt,gtk,desktop","A_Id":146015,"CreationDate":"2008-09-21T23:10:00.000","Title":"Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm specifically looking for one that lets me display a map of US states with each one as it's own \"object\" in the sense that I can control the color, on click, and on mouseover of each one individually. GTK is my personal preference, but at this point I'd settle for just about anything. The application itself will be written in Python, FWIW.","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":906,"Q_Id":112483,"Users Score":0,"Answer":"Quick tip, if you color each state differently you can identify which one to pick from the color under mouse cursor rather than doing a complex point in polygon routine.","Q_Score":1,"Tags":"python,qt,gtk,desktop","A_Id":122701,"CreationDate":"2008-09-21T23:10:00.000","Title":"Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks.","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3106,"Q_Id":139005,"Users Score":1,"Answer":"It will come down to you using the QScrollArea, it is a widget that implements showing something that is larger than the available space. You will not need to use QScrollBar directly. I don't have a PyQt example but there is a C++ example in the QT distribution it is called the \"Image Viewer\". The object hierarchy will still be the same","Q_Score":0,"Tags":"python,pyqt","A_Id":139056,"CreationDate":"2008-09-26T12:05:00.000","Title":"PyQt - QScrollBar","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've written code for communication between my phone and comp thru TCP sockets. When I type out the code line by line in the interactive console it works fine. However, when i try running the script directly through filebrowser.py it just wont work. I'm using Nokia N95. Is there anyway I can run this script directly without using filebrowser.py?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1588,"Q_Id":141647,"Users Score":0,"Answer":"If the code is working in the interactive interpreter when typed, but not when run directly then I would suggest seeing if your code has reached a deadlock on the socket, for example both ends are waiting for data from the other. When typing into the interactive interpreter there is a longer delay between the execution of each line on code.","Q_Score":1,"Tags":"python,sockets,mobile","A_Id":142502,"CreationDate":"2008-09-26T20:07:00.000","Title":"Socket programming for mobile phones in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've written code for communication between my phone and comp thru TCP sockets. When I type out the code line by line in the interactive console it works fine. However, when i try running the script directly through filebrowser.py it just wont work. I'm using Nokia N95. Is there anyway I can run this script directly without using filebrowser.py?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1588,"Q_Id":141647,"Users Score":0,"Answer":"Don't you have the \"Run script\" menu in your interactive Python shell?","Q_Score":1,"Tags":"python,sockets,mobile","A_Id":215001,"CreationDate":"2008-09-26T20:07:00.000","Title":"Socket programming for mobile phones in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've written code for communication between my phone and comp thru TCP sockets. When I type out the code line by line in the interactive console it works fine. However, when i try running the script directly through filebrowser.py it just wont work. I'm using Nokia N95. Is there anyway I can run this script directly without using filebrowser.py?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1588,"Q_Id":141647,"Users Score":0,"Answer":"Well, it doesn't appear to be a deadlock situation. It throws an error saying remote server refused connection. However, like I said before, if i type the very same code into the interactive interpreter it works just fine. I'm wondering if the error is because the script is run through filebrowser.py?","Q_Score":1,"Tags":"python,sockets,mobile","A_Id":142786,"CreationDate":"2008-09-26T20:07:00.000","Title":"Socket programming for mobile phones in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am making a Python gui project that needs to duplicate the look of a Windows gui environment (ie Explorer). I have my own custom icons to draw but they should be selectable by the same methods as usual; click, ctrl-click, drag box etc. Are any of the gui toolkits going to help with this or will I have to implement it all myself. If there aren't any tools to help with this advice would be greatly appreciated.\nedit I am not trying to recreate explorer, that would be madness. I simply want to be able to take icons and lay them out in a scrollable window. Any number of them may be selected at once. It would be great if there was something that could select\/deselect them in the same (appearing at least) way that Windows does. Then all I would need is a list of all the selected icons.","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":547,"Q_Id":145155,"Users Score":2,"Answer":"In wxPython there's a plethora of ready-made list and tree controls (CustomTreeCtrl, TreeListCtrl, and others), a mixture of which you can use to create a simple explorer in minutes. The wxPython demo even has a few relevant examples (see the demo of MVCTree).","Q_Score":1,"Tags":"python,user-interface","A_Id":145174,"CreationDate":"2008-09-28T03:39:00.000","Title":"Something like Explorer's icon grid view in a Python GUI","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I could not find any pointers on how to create a menubar icon on OSX using wx. I originally thought that the wxTaskBarIcon class would do, but it actually creates an icon on the Dock. On Windows, wxTaskBarIcon creates a Systray icon and associated menu, and I would think that on mac osx it would create a menubar icon, I guess not.","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":4972,"Q_Id":145894,"Users Score":1,"Answer":"As of wxPython 2.9.2.0 wx.TaskBarIcon will create a menubar icon now instead on OSX, so long as you call SetIcon.","Q_Score":6,"Tags":"macos,wxpython,wxwidgets","A_Id":25845284,"CreationDate":"2008-09-28T14:02:00.000","Title":"how to set a menubar icon on mac osx using wx","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I need to develop a small-medium sized desktop GUI application, preferably with Python as a language of choice because of time constraints.\nWhat GUI library choices do I have which allow me to redistribute my application standalone, assuming that the users don't have a working Python installation and obviously don't have the GUI libraries I'm using either?\nAlso, how would I go about packaging everything up in binaries of reasonable size for each target OS? (my main targets are Windows and Mac OS X)\nAddition:\nI've been looking at WxPython, but I've found plenty of horror stories of packaging it with cx_freeze and getting 30mb+ binaries, and no real advice on how to actually do the packaging and how trust-worthy it is.","AnswerCount":7,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5407,"Q_Id":153956,"Users Score":0,"Answer":"I've used py2Exe myself - it's really easy (at least for small apps).","Q_Score":11,"Tags":"python,user-interface,wxpython,distribution,freeze","A_Id":153999,"CreationDate":"2008-09-30T16:50:00.000","Title":"Python GUI Application redistribution","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to develop an app using turbogears and sqlalchemy.\nThere is already an existing app using kinterbasdb directly under mod_wsgi on the same server.\nWhen both apps are used, neither seems to recognize that kinterbasdb is already initialized\nIs there something non-obvious I am missing about using sqlalchemy and kinterbasdb in separate apps? In order to make sure only one instance of kinterbasdb gets initialized and both apps use that instance, does anyone have suggestions?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":270,"Q_Id":155029,"Users Score":2,"Answer":"I thought I posted my solution already...\nModifying both apps to run under WSGIApplicationGroup ${GLOBAL} in their httpd conf file\nand patching sqlalchemy.databases.firebird.py to check if self.dbapi.initialized is True\nbefore calling self.dbapi.init(... was the only way I could manage to get this scenario up and running.\nThe SQLAlchemy 0.4.7 patch:\n\ndiff -Naur SQLAlchemy-0.4.7\/lib\/sqlalchemy\/databases\/firebird.py SQLAlchemy-0.4.7.new\/lib\/sqlalchemy\/databases\/firebird.py\n--- SQLAlchemy-0.4.7\/lib\/sqlalchemy\/databases\/firebird.py 2008-07-26 12:43:52.000000000 -0400\n+++ SQLAlchemy-0.4.7.new\/lib\/sqlalchemy\/databases\/firebird.py 2008-10-01 10:51:22.000000000 -0400\n@@ -291,7 +291,8 @@\n global _initialized_kb\n if not _initialized_kb and self.dbapi is not None:\n _initialized_kb = True\n- self.dbapi.init(type_conv=type_conv, concurrency_level=concurrency_level)\n+ if not self.dbapi.initialized:\n+ self.dbapi.init(type_conv=type_conv, concurrency_level=concurrency_level)\n return ([], opts)\n\n def create_execution_context(self, *args, **kwargs):","Q_Score":1,"Tags":"python,sqlalchemy,kinterbasdb","A_Id":175634,"CreationDate":"2008-09-30T20:47:00.000","Title":"SQLAlchemy and kinterbasdb in separate apps under mod_wsgi","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images.\nI'm currently using matplotlib (Wxagg backend), and it's possible that I'll be able to continue using it, but I suspect it won't be able to sufficiently scale in terms of performance or capabilities.\nRequirements are:\n\nCross-platform (Linux, MacOS X,\nWindows)\nLow complexity overhead\nPlays well with wxpython (at least won't step on each other's toes unduly)\nInteractivity. Detect when objects are clicked on, moused over, etc. \n\nNote that high performance isn't on the list, but the ability to handle ~100 bitmap objects on the screen would be good.\nYour thoughts?","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":29957,"Q_Id":169810,"Users Score":3,"Answer":"You can try pygame, its very easy to handle and similar to SDL under c++","Q_Score":12,"Tags":"python,animation,2d","A_Id":1568711,"CreationDate":"2008-10-04T05:36:00.000","Title":"2D animation in Python","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a SetFont() call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and wxPython In Action book don't discuss this.\nIs there a way to easily apply the same SetFont() method to all these text objects without making separate calls each time?","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1595,"Q_Id":171694,"Users Score":5,"Answer":"You can do this by calling SetFont on the parent window (Frame, Dialog, etc) before adding any widgets. The child widgets will inherit the font.","Q_Score":3,"Tags":"python,fonts,wxpython","A_Id":184571,"CreationDate":"2008-10-05T08:27:00.000","Title":"Applying a common font scheme to multiple objects in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am in the position of having to make a technology choice early in a project which is targetted at mobile phones. I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appropriate IDE's and emulators.\nPlease don't tell me that I should be developing on Windows Mobile, I have already decided not to do that so will mark those answers down.","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1684,"Q_Id":173484,"Users Score":0,"Answer":"I have some J2ME experience and now I decided to write a couple of useful apps for my phone so I decided to use PyS60 to study Python by the way:)\nSome things I don't like about the platform are:\n\nYou can't invoke any graphical functions (module appuifw) from non-main thread.\nPython script model is not well-suited for ui applications because the script must contain explicit while loop or semaphore to prevent main thread from exit\nThere function sys.exit() is not available.\n\nAgain, I'm a newbie to PyS60 so if the issues given above do have nice workarounds don't hesitate to write them as comments. I would be very grateful.","Q_Score":10,"Tags":"python,mobile,pys60","A_Id":1195831,"CreationDate":"2008-10-06T07:37:00.000","Title":"Does anyone have experience with PyS60 mobile development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am in the position of having to make a technology choice early in a project which is targetted at mobile phones. I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appropriate IDE's and emulators.\nPlease don't tell me that I should be developing on Windows Mobile, I have already decided not to do that so will mark those answers down.","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1684,"Q_Id":173484,"Users Score":0,"Answer":"I've written a calculator, that I'd like to have, and made a simple game. \nI wrote it right on the phone. I was writing in text editor then switched to Python and ran a script. It is not very comfortable, but it's ok. Moreover, I was writing all this when I hadn't PC nearby.\nIt was a great experience!","Q_Score":10,"Tags":"python,mobile,pys60","A_Id":489368,"CreationDate":"2008-10-06T07:37:00.000","Title":"Does anyone have experience with PyS60 mobile development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way:\n\napplication.py - holds the primary application class (most functional routines)\ngui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.\ncommand.py - holds command line automation functions not dependent on data in the application class\nstate.py - holds the state data persistence class\n\nThis has served fairly well so far, but at this point application.py is starting to get rather long. I have looked at numerous other PyGTK applications and they seem to have similar structural issues. At a certain point the primary module starts to get very long and there is not obvious way of breaking the code out into narrower modules without sacrificing clarity and object orientation.\nI have considered making the GUI the primary module and having seperate modules for the toolbar routines, the menus routines, etc, but at that point I believe I will lose most of the benefits of OOP and end up with an everything-references-everything scenario.\nShould I just deal with having a very long central module or is there a better way of structuring the project so that I don't have to rely on the class browser so much?\nEDIT I\nOk, so point taken regarding all the MVC stuff. I do have a rough approximation of MVC in my code, but admittedly I could probably gain some mileage by further segregating the model and controller. However, I am reading over python-gtkmvc's documentation (which is a great find by the way, thank you for referencing it) and my impression is that its not going to solve my problem so much as just formalize it. My application is a single glade file, generally a single window. So no matter how tightly I define the MVC roles of the modules I'm still going to have one controller module doing most everything, which is pretty much what I have now. Admittedly I'm a little fuzzy on proper MVC implementation and I'm going to keep researching, but it doesn't look to me like this architecture is going to get any more stuff out of my main file, its just going to rename that file to controller.py.\nShould I be thinking about separate Controller\/View pairs for seperate sections of the window (the toolbar, the menus, etc)? Perhaps that is what I'm missing here. It seems that this is what S. Lott is referring to in his second bullet point.\nThanks for the responses so far.","AnswerCount":6,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2015,"Q_Id":216093,"Users Score":0,"Answer":"So having not heard back regarding my edit to the original question, I have done some more research and the conclusion I seem to be coming to is that yes, I should break the interface out into several views, each with its own controller. Python-gtkmvc provides the ability to this by providing a glade_top_widget_name parameter to the View constructor. This all seems to make a good deal of sense although it is going to require a large refactoring of my existing codebase which I may or may not be willing to undertake in the near-term (I know, I know, I should.) Moreover, I'm left to wonder whether should just have a single Model object (my application is fairly simple--no more than twenty-five state vars) or if I should break it out into multiple models and have to deal with controllers observing multiple models and chaining notifications across them. (Again, I know I really should do the latter.) If anyone has any further insight, I still don't really feel like I've gotten an answer to the original question, although I have a direction to head in now.\n(Moreover it seems like their ought to be other architectural choices at hand, given that up until now I had not seen a single Python application coded in the MVC style, but then again many Python applications tend to have the exact problem I've described above.)","Q_Score":8,"Tags":"python,gtk,module,pygtk,organization","A_Id":219737,"CreationDate":"2008-10-19T06:07:00.000","Title":"How do I coherently organize modules for a PyGTK desktop application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way:\n\napplication.py - holds the primary application class (most functional routines)\ngui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.\ncommand.py - holds command line automation functions not dependent on data in the application class\nstate.py - holds the state data persistence class\n\nThis has served fairly well so far, but at this point application.py is starting to get rather long. I have looked at numerous other PyGTK applications and they seem to have similar structural issues. At a certain point the primary module starts to get very long and there is not obvious way of breaking the code out into narrower modules without sacrificing clarity and object orientation.\nI have considered making the GUI the primary module and having seperate modules for the toolbar routines, the menus routines, etc, but at that point I believe I will lose most of the benefits of OOP and end up with an everything-references-everything scenario.\nShould I just deal with having a very long central module or is there a better way of structuring the project so that I don't have to rely on the class browser so much?\nEDIT I\nOk, so point taken regarding all the MVC stuff. I do have a rough approximation of MVC in my code, but admittedly I could probably gain some mileage by further segregating the model and controller. However, I am reading over python-gtkmvc's documentation (which is a great find by the way, thank you for referencing it) and my impression is that its not going to solve my problem so much as just formalize it. My application is a single glade file, generally a single window. So no matter how tightly I define the MVC roles of the modules I'm still going to have one controller module doing most everything, which is pretty much what I have now. Admittedly I'm a little fuzzy on proper MVC implementation and I'm going to keep researching, but it doesn't look to me like this architecture is going to get any more stuff out of my main file, its just going to rename that file to controller.py.\nShould I be thinking about separate Controller\/View pairs for seperate sections of the window (the toolbar, the menus, etc)? Perhaps that is what I'm missing here. It seems that this is what S. Lott is referring to in his second bullet point.\nThanks for the responses so far.","AnswerCount":6,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":2015,"Q_Id":216093,"Users Score":2,"Answer":"\"holds the primary application class (most functional routines)\"\nAs in singular -- one class?\nI'm not surprised that the One Class Does Everything design isn't working. It might not be what I'd call object-oriented. It doesn't sound like it follows the typical MVC design pattern if your functionality is piling up in a single class.\nWhat's in this massive class? I suggest that you can probably refactor this into pieces. You have two candidate dimensions for refactoring your application class -- if, indeed, I've guessed right that you've put everything into a single class.\n\nBefore doing anything else, refactor into components that parallel the Real World Entities. It's not clear what's in your \"state.py\" -- wether this is a proper model of real-world entities, or just mappings between persistent storage and some murky data structure in the application. Most likely you'd move processing out of your application and into your model (possibly state.py, possibly a new module that is a proper model.)\nBreak your model into pieces. It will help organize the control and view elements. The most common MVC mistake is to put too much in control and nothing in the model.\n\nLater, once your model is doing most of the work, you can look at refactor into components that parallel the GUI presentation. Various top-level frames, for example, should probably have separate cotrol objects. It's not clear what's in \"GUI.py\" -- this might be a proper view. What appears to be missing is a Control component.","Q_Score":8,"Tags":"python,gtk,module,pygtk,organization","A_Id":216386,"CreationDate":"2008-10-19T06:07:00.000","Title":"How do I coherently organize modules for a PyGTK desktop application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this?","AnswerCount":3,"Available Count":3,"Score":-0.0665680765,"is_accepted":false,"ViewCount":1345,"Q_Id":219215,"Users Score":-1,"Answer":"python 2.6.2 + tkinter 8.5, no problems","Q_Score":3,"Tags":"python,windows,windows-vista,tkinter","A_Id":792527,"CreationDate":"2008-10-20T17:19:00.000","Title":"How do I use Tkinter with Python on Windows Vista?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this?","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":1345,"Q_Id":219215,"Users Score":1,"Answer":"It seems this is a one of the many weird Vista problems and some random reinstalling, installing\/upgrading of the visual studio runtime or some such seems sometimes to help, or disabling sxs in the system configuration or writing a manifest file etc.\nThough I think you should downgrade to windows XP.","Q_Score":3,"Tags":"python,windows,windows-vista,tkinter","A_Id":219326,"CreationDate":"2008-10-20T17:19:00.000","Title":"How do I use Tkinter with Python on Windows Vista?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this?","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1345,"Q_Id":219215,"Users Score":1,"Answer":"Maybe you should downgrade to 2.5 version?","Q_Score":3,"Tags":"python,windows,windows-vista,tkinter","A_Id":219284,"CreationDate":"2008-10-20T17:19:00.000","Title":"How do I use Tkinter with Python on Windows Vista?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.\nHowever, I'm realizing that the limitations of the wizard are making it difficult to design \"elegant\" logic flow. For example, because all pages of the wizard are initalized at the same time, I can't have the values entered in one page available to the next one. I have to put a button on each page to get the values from a previous page rather than simply having fields auto-populated.\nI've thought about alternatives to using the wizard. I think the best idea is to have some buttons on one panel that change the information on another panel, e.g. a splitter window.\nHowever, I can't find any documentation in wxPython on how to dynamically change the panel. Everything I've found so far is really pretty static, hence the use of the wizard. Even the \"wxPython in Action\" book doesn't mention it.\nAre there any tutorials for making \"dynamic panels\" or better management of a wizard?","AnswerCount":5,"Available Count":2,"Score":0.0399786803,"is_accepted":false,"ViewCount":2843,"Q_Id":224337,"Users Score":1,"Answer":"The wxPython demo has an example of a \"dynamic\" wizard. Pages override GetNext() and GetPrev() to show pages dynamically. This shows the basic technique; you can extend it to add and remove pages, change pages on the fly, and rearrange pages dynamically.\nThe wizard class is just a convenience, though. You can modify it, or create your own implementation. A style that seems popular nowadays is to use an HTML-based presentation; you can emulate this with the wxHtml control, or the IEHtmlWindow control if your app is Windows only.","Q_Score":3,"Tags":"python,wxpython,wizard","A_Id":247409,"CreationDate":"2008-10-22T02:54:00.000","Title":"Alternatives to a wizard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.\nHowever, I'm realizing that the limitations of the wizard are making it difficult to design \"elegant\" logic flow. For example, because all pages of the wizard are initalized at the same time, I can't have the values entered in one page available to the next one. I have to put a button on each page to get the values from a previous page rather than simply having fields auto-populated.\nI've thought about alternatives to using the wizard. I think the best idea is to have some buttons on one panel that change the information on another panel, e.g. a splitter window.\nHowever, I can't find any documentation in wxPython on how to dynamically change the panel. Everything I've found so far is really pretty static, hence the use of the wizard. Even the \"wxPython in Action\" book doesn't mention it.\nAre there any tutorials for making \"dynamic panels\" or better management of a wizard?","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2843,"Q_Id":224337,"Users Score":0,"Answer":"I'd get rid of wizard in whole. They are the most unpleasant things I've ever used.\nThe problem that requires a wizard-application where you click 'next' is perhaps a problem where you could apply a better user interface in a bit different manner. Instead of bringing up a dialog with annoying 'next' -button. Do this:\nBring up a page. When the user inserts the information to the page, extend or shorten it according to the input. If your application needs to do some processing to continue, and it's impossible to revert after that, write a new page or disable the earlier section of the current page. When you don't need any input from the user anymore or the app is finished, you can show a button or enable an existing such.\nI don't mean you should implement it all in browser. Make simply a scrolling container that can contain buttons and labels in a flat list.\nBenefit: The user can just click a tab, and you are encouraged to put all the processing into the end of filling the page.","Q_Score":3,"Tags":"python,wxpython,wizard","A_Id":247633,"CreationDate":"2008-10-22T02:54:00.000","Title":"Alternatives to a wizard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?","AnswerCount":9,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":25055,"Q_Id":238523,"Users Score":6,"Answer":"Yes. If python is much more natural to you than C++, it might be a good idea to learn pygame first. You'll have to go through a translation process when migrating to using SDL and C, but it should be a more-or-less one-to-one mapping.","Q_Score":18,"Tags":"c++,python,sdl,pygame","A_Id":239167,"CreationDate":"2008-10-26T19:54:00.000","Title":"Is Python and pygame a good way to learn SDL?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?","AnswerCount":9,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":25055,"Q_Id":238523,"Users Score":0,"Answer":"I wouldn't consider Python (or any managed or interpreted language, for that matter) a good way to learn any complex task, because it insulates the programmer from the workings of the system too much. As a friend of mine put it, \"Python loves you and wants you to be happy.\" And that's all well and good if you already know the fundamentals, but if you want to learn, the last thing you want is a language that does all the work for you.\nYou'll learn the what very quickly, but not the why, and then when something goes badly wrong, (and it will eventually, in any non-trivial project,) you'll be left with no idea what's happening or why.","Q_Score":18,"Tags":"c++,python,sdl,pygame","A_Id":255136,"CreationDate":"2008-10-26T19:54:00.000","Title":"Is Python and pygame a good way to learn SDL?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?","AnswerCount":9,"Available Count":5,"Score":0.022218565,"is_accepted":false,"ViewCount":25055,"Q_Id":238523,"Users Score":1,"Answer":"python won't prevent you off learning design and that's pretty much the more important thing to learn IMO, I'm doing a smash bros clone with pygame and I learnt a lot in design. And yet you will learn not to write too much suboptimal code too, python have clever and beautiful hacks too.","Q_Score":18,"Tags":"c++,python,sdl,pygame","A_Id":275461,"CreationDate":"2008-10-26T19:54:00.000","Title":"Is Python and pygame a good way to learn SDL?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?","AnswerCount":9,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":25055,"Q_Id":238523,"Users Score":6,"Answer":"pygame abstracts the SDL interface quite a lot, therefore I don't think there's much of an advantage carried over.","Q_Score":18,"Tags":"c++,python,sdl,pygame","A_Id":238659,"CreationDate":"2008-10-26T19:54:00.000","Title":"Is Python and pygame a good way to learn SDL?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?","AnswerCount":9,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":25055,"Q_Id":238523,"Users Score":6,"Answer":"You can learn some techniques, ways to implement game logic etc. in SDL-based enviroment but after moving to C++\/SDL you will have to use SDL functions directly, helper functions\/objects from pyGame will be completely useles.","Q_Score":18,"Tags":"c++,python,sdl,pygame","A_Id":238671,"CreationDate":"2008-10-26T19:54:00.000","Title":"Is Python and pygame a good way to learn SDL?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.\nJust to avoid the \"just use C\" comments, here is why I want to use Python:\nThere are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.\nThanks for any help.","AnswerCount":6,"Available Count":5,"Score":0.0333209931,"is_accepted":false,"ViewCount":18416,"Q_Id":242059,"Users Score":1,"Answer":"What OpenGL library are you using? What windowing library? What version of Python?\nMost likely cause I can think of is that your windowing library (SDL or whatever you're using) isn't initializing OpenGL before you start calling into it.","Q_Score":15,"Tags":"python,opengl,fedora","A_Id":242063,"CreationDate":"2008-10-28T02:29:00.000","Title":"OpenGl with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.\nJust to avoid the \"just use C\" comments, here is why I want to use Python:\nThere are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.\nThanks for any help.","AnswerCount":6,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":18416,"Q_Id":242059,"Users Score":0,"Answer":"We have neither ideas about random segmentation faults. There is not enough information. What python libraries are you using for opengl? How do you use them? Can you show us your code? It's probably something trivial but my god -skill ends up to telling me just and only that.\nRaytracer in python? I'd prefer just doing that in C with those structs. But then, I'm assuming you aren't going to do a realtime raytracer so that may be ok.","Q_Score":15,"Tags":"python,opengl,fedora","A_Id":242371,"CreationDate":"2008-10-28T02:29:00.000","Title":"OpenGl with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.\nJust to avoid the \"just use C\" comments, here is why I want to use Python:\nThere are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.\nThanks for any help.","AnswerCount":6,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":18416,"Q_Id":242059,"Users Score":0,"Answer":"Perhaps you are calling an OpenGL function that requires an active OpenGL context, without having one? That shouldn't necessarily crash, but I guess it might. How to set up such a context depends on the platform, and it's been a while since I used GL from Python (and when I did, I also used GTK+ which complicates matters).","Q_Score":15,"Tags":"python,opengl,fedora","A_Id":246922,"CreationDate":"2008-10-28T02:29:00.000","Title":"OpenGl with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.\nJust to avoid the \"just use C\" comments, here is why I want to use Python:\nThere are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.\nThanks for any help.","AnswerCount":6,"Available Count":5,"Score":0.0665680765,"is_accepted":false,"ViewCount":18416,"Q_Id":242059,"Users Score":2,"Answer":"Well, I don't know if these are the libs the original poster are using but I saw identical issues in a pet project I'm working on (Graphics Engine using C++ and Python) using PyOpenGL.\nPyOpenGL didn't correctly pick up the rendering context if it was created after the python script had been loaded (I was loading the script first, then calling Python methods in it from my C++ code).\nThe problem doesn't appear if you initialize the display and create the OpenGL rendering context before loading the Python script.","Q_Score":15,"Tags":"python,opengl,fedora","A_Id":1778664,"CreationDate":"2008-10-28T02:29:00.000","Title":"OpenGl with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.\nJust to avoid the \"just use C\" comments, here is why I want to use Python:\nThere are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.\nThanks for any help.","AnswerCount":6,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":18416,"Q_Id":242059,"Users Score":0,"Answer":"Scripts never cause segmentation faults. \nBut first see if your kernel and kmod video driver working property ...\nExtension modules can cause \"segmentation fault\".","Q_Score":15,"Tags":"python,opengl,fedora","A_Id":2284461,"CreationDate":"2008-10-28T02:29:00.000","Title":"OpenGl with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int\/long. I need to blit this DC into a memory DC in python. The only thing I can't figure out how to do is get a wxDC derived object from the int\/long that win32gui returns. None of the wxDC objects allow me to pass an actual DC handle to them from what I can tell. This of course keeps me from doing my blit. Is there any way to do this?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1086,"Q_Id":244340,"Users Score":0,"Answer":"From what I can tell, DCs in python are abstracted due to platform variation. So a device context in python doesn't directly map to a device context in Windows even though many of the methods are direct Windows method calls. To make this happen it appears you would need to make your own DelegateDC class or something similar that is intended just for Windows so that you could set the DC handle directly.\nThere might also be some way to attach a wxWindow to the window handle after which you could get a wxWindowDC from the wxWindow...can't figure this out though.","Q_Score":2,"Tags":"wxpython,device,win32gui,bitblit","A_Id":253897,"CreationDate":"2008-10-28T18:35:00.000","Title":"wxPython wxDC object from win32gui.GetDC","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).\nQuestion: Where shall start to understand how to compile a PythonCE module that will give additional functionality to Python on Windows mobile. Also, what is the required toolkit. Is it at all possible on Mac (Leopard)?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":871,"Q_Id":252859,"Users Score":1,"Answer":"MSDN has plenty of samples for C++ development on Windows Mobile, and the SDK comes with several sample application. Unfortunately VS Express editions (the free ones) do not come with compilers for Smart Devices. The only free option is the older eMbedded Visual C++ (eVC), which is now something like 8 years old and not supported (though it can still create apps for devices at least up through CE 5.0).","Q_Score":1,"Tags":"c,windows-mobile,extending,pythonce","A_Id":253562,"CreationDate":"2008-10-31T08:13:00.000","Title":"Extending PythonCE to Access gsm\/camera\/gps Easily from PythonCE","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a UI library to create a message box or input box in python?","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":6196,"Q_Id":257398,"Users Score":11,"Answer":"Your best bet is the tkMessageBox module, which should work on all systems (as Python will typically come with Tkinter).\nIf you can restrict yourself to a specific operating system, better choices might be available.","Q_Score":6,"Tags":"python,user-controls,user-interface","A_Id":257403,"CreationDate":"2008-11-02T21:22:00.000","Title":"Message Box in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a UI library to create a message box or input box in python?","AnswerCount":4,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":6196,"Q_Id":257398,"Users Score":2,"Answer":"I've heard good things about wx python, which is also multi-platform.","Q_Score":6,"Tags":"python,user-controls,user-interface","A_Id":257532,"CreationDate":"2008-11-02T21:22:00.000","Title":"Message Box in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Background\nI have been asked by a client to create a picture of the world which has animated arrows\/rays that come from one part of the world to another. \nThe rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The rays will start in one country's boundary and end in another's. As each animated transaction happens a continuously updating sum of the amounts of all the transactions will be shown at the bottom of the image. The amounts of the individual transactions will be randomized. There will also be a year showing on the image that will increment every n seconds.\nThe randomization, summation and incrementing are not a problem for me, but I am at a loss as to how to approach the animation of the arrows\/rays.\nMy question is what is the best way to do this? What frameworks\/libraries are best suited for this job?\nI am most fluent in python so python suggestions are most easy for me, but I am open to any elegant way to do this.\nThe client will present this as a slide in a presentation in a windows machine.","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":902,"Q_Id":267660,"Users Score":2,"Answer":"The client will present this as a slide in a presentation in a windows machine\n\nI think this is the key to your answer. Before going to a 3d implementation and writing all the code in the world to create this feature, you need to look at the presentation software. Chances are, your options will boil down to two things:\n\nAnimated Gif\nCustom Presentation Scripts\n\nObviously, an animated gif is not ideal due to the fact that it repeats when it is done rendering, and to make it last a long time would make a large gif.\nCustom Presentation Scripts would probably be the other way to allow him to bring it up in a presentation without running any side-programs, or doing anything strange. I'm not sure which presentation application is the target, but this could be valuable information.\nHe sounds like he's more non-technical and requesting something he doesn't realize will be difficult. I think you should come up with some options, explain the difficulty in implementing them, and suggest another solution that falls into the 'bang for your buck' range.","Q_Score":1,"Tags":"python,image,graphics,animation,drawing","A_Id":267698,"CreationDate":"2008-11-06T04:44:00.000","Title":"How to create a picture with animated aspects programmatically","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Background\nI have been asked by a client to create a picture of the world which has animated arrows\/rays that come from one part of the world to another. \nThe rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The rays will start in one country's boundary and end in another's. As each animated transaction happens a continuously updating sum of the amounts of all the transactions will be shown at the bottom of the image. The amounts of the individual transactions will be randomized. There will also be a year showing on the image that will increment every n seconds.\nThe randomization, summation and incrementing are not a problem for me, but I am at a loss as to how to approach the animation of the arrows\/rays.\nMy question is what is the best way to do this? What frameworks\/libraries are best suited for this job?\nI am most fluent in python so python suggestions are most easy for me, but I am open to any elegant way to do this.\nThe client will present this as a slide in a presentation in a windows machine.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":902,"Q_Id":267660,"Users Score":1,"Answer":"It depends largely on the effort you want to expend on this, but the basic outline of an easy way. Would be to load an image of an arrow, and use a drawing library to color and rotate it in the direction you want to point(or draw it using shapes\/curves).\nFinally to actually animate it interpolate between the coordinates based on time.\nIf its just for a presentation though, I would use Macromedia Flash, or a similar animation program.(would do the same as above but you don't need to program anything)","Q_Score":1,"Tags":"python,image,graphics,animation,drawing","A_Id":267676,"CreationDate":"2008-11-06T04:44:00.000","Title":"How to create a picture with animated aspects programmatically","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.\nThe alternatives I tried were:\n\nBoost.Python\nI liked the cleaner API produced by Boost.Python, but the fact that it would have required that users install an additional dependency made us switch to SWIG.\nSWIG\nSWIG's main advantage for us was that it doesn't require end users to install it to use the final program.\n\nWhat have you used to do this, and what has been your experience with it?","AnswerCount":5,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":12800,"Q_Id":276761,"Users Score":23,"Answer":"I've used both (for the same project): Boost is better integrated with the STL, and especially C++ exceptions. Also, its memory management mechanism (which tries to bridge C++ memory management and Python GC) is way more flexible than SWIG's. However, SWIG has much better documentation, no external dependencies, and if you get the library wrapped in SWIG for Python you're more than half-way there to getting a Java\/Perl\/Ruby wrapper as well.\nI don't think there's a clear-cut choice: for smaller projects, I'd go with Boost.Python again, for larger long-lived projects, the extra investment in SWIG is worth it.","Q_Score":41,"Tags":"c++,python,boost,swig","A_Id":277306,"CreationDate":"2008-11-10T00:34:00.000","Title":"Exposing a C++ API to Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.\nThe alternatives I tried were:\n\nBoost.Python\nI liked the cleaner API produced by Boost.Python, but the fact that it would have required that users install an additional dependency made us switch to SWIG.\nSWIG\nSWIG's main advantage for us was that it doesn't require end users to install it to use the final program.\n\nWhat have you used to do this, and what has been your experience with it?","AnswerCount":5,"Available Count":2,"Score":0.0798297691,"is_accepted":false,"ViewCount":12800,"Q_Id":276761,"Users Score":2,"Answer":"A big plus for Boost::Python is that it allows for tab completion in the ipython shell: You import a C++ class, exposed by Boost directly, or you subclass it, and from then on, it really behaves like a pure Python class.\nThe downside: It takes so long to install and use Boost that all the Tab-completion time-saving won't ever amortize ;-(\nSo I prefer Swig: No bells and whistles, but works reliably after a short introductory example.","Q_Score":41,"Tags":"c++,python,boost,swig","A_Id":847688,"CreationDate":"2008-11-10T00:34:00.000","Title":"Exposing a C++ API to Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet\nWhich would you recommend and why?","AnswerCount":9,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":18513,"Q_Id":279912,"Users Score":32,"Answer":"Start with pyglet. It contains the best high-level API, which contains all you need to get started, from opening a window to drawing sprites and OpenGL primitives using their friendly and powerful Sprite and Batch classes.\nLater, you might also want to write your own lower-level code, that makes calls directly to OpenGL functions such as glDrawArrays, etc. You can do this using pyglet's OpenGL bindings, or using PyOpenGL's. The good news is that whichever you use, you can insert such calls right into the middle of your existing pyglet application, and they will 'just work'. Transitioning your code from Pyglet to PyOpenGL is fairly easy, so this is not a decision you need to worry about too much upfront. The trades-off between the two are:\nPyOpenGL's bindings make the OpenGL interface more friendly and pythonic. For example, you can pass vertex arrays in many different forms, ctypes arrays, numpy arrays, plain lists, etc, and PyOpenGL will convert them into something OpenGL can use. Things like this make PyOpenGL really easy and convenient.\npyglet's OpenGL bindings are automatically generated, and are not as friendly to use as PyOpenGL. For example, sometimes you will have to manually create ctypes objects, in order to pass 'C pointer' kinds of args to OpenGL. This can be fiddly. The plus side though, is pyglet's bindings tends to be significantly faster.\nThis implies that there is an optimal middle ground: Use pyglet for windowing, mouse events, sound, etc. Then use PyOpenGL's friendly API when you want to make direct OpenGL function calls. Then when optimising, replace just the small percentage of performance-critical PyOpenGL calls that lie within your inner render loop with the pyglet equivalents. For me, this gives me between 2 and 4 times faster framerates, with PyOpenGL's convenience for 90% of my code.","Q_Score":25,"Tags":"python,pyglet,pyopengl","A_Id":4246325,"CreationDate":"2008-11-11T03:17:00.000","Title":"PyOpenGl or pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet\nWhich would you recommend and why?","AnswerCount":9,"Available Count":5,"Score":0.0886555158,"is_accepted":false,"ViewCount":18513,"Q_Id":279912,"Users Score":4,"Answer":"pyglet's GL API is nowhere near as nice as PyOpenGL's - pyglet's is at the raw ctypes layer which means you'll need to learn ctypes as well. If you're planning on doing a bunch of OpenGL programming you'll want to use PyOpenGL. \nThe nice thing is you can mix the two just fine. Use pyglet to provide the GL context, sounds, events, image loading and texture management, text rendering, etc, etc. Use PyOpenGL for the actual OpenGL programming you need to do.","Q_Score":25,"Tags":"python,pyglet,pyopengl","A_Id":2396038,"CreationDate":"2008-11-11T03:17:00.000","Title":"PyOpenGl or pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet\nWhich would you recommend and why?","AnswerCount":9,"Available Count":5,"Score":0.0886555158,"is_accepted":false,"ViewCount":18513,"Q_Id":279912,"Users Score":4,"Answer":"pyglet has a lot of nice extras included with it (like image loading and sound). If you're starting out, I'd try pyglet first, and then switch to PyOpenGL if you feel like you want to get closer to the metal.\nThe real important question though is: what are you trying to accomplish?","Q_Score":25,"Tags":"python,pyglet,pyopengl","A_Id":279942,"CreationDate":"2008-11-11T03:17:00.000","Title":"PyOpenGl or pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet\nWhich would you recommend and why?","AnswerCount":9,"Available Count":5,"Score":0.0886555158,"is_accepted":false,"ViewCount":18513,"Q_Id":279912,"Users Score":4,"Answer":"I promote pyglet because it has the nicest API I've yet seen on stuff like this.\nPyglet has opengl API as well. But it's often nicer to use the recently added vertex list support.\npyglet.gl","Q_Score":25,"Tags":"python,pyglet,pyopengl","A_Id":281395,"CreationDate":"2008-11-11T03:17:00.000","Title":"PyOpenGl or pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet\nWhich would you recommend and why?","AnswerCount":9,"Available Count":5,"Score":0.0665680765,"is_accepted":false,"ViewCount":18513,"Q_Id":279912,"Users Score":3,"Answer":"I would recommend Pyglet because it is very easy to get started and have something basic running, and then you can add more advanced techniques at your own pace.","Q_Score":25,"Tags":"python,pyglet,pyopengl","A_Id":397041,"CreationDate":"2008-11-11T03:17:00.000","Title":"PyOpenGl or pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I get a list of the running applications? I'm referring to the ones in the panel at the bottom of the screen.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":368,"Q_Id":306456,"Users Score":0,"Answer":"The panel you are referring to is the GNOME panel. So this is a GNOME question, not a GTK question.\nThere is not a well-defined concept of \"multi-window application\" in GNOME that I know of. The panel task list is probably build by querying the window manager for the list of windows and grouping the windows by their \"class\" property.\nThere are also various window manager hints that must be taken into account, for example to ignore panels and other utility windows. In your place, I would look at the source code of the taskbar applet. There is maybe some documentation somewhere that covers the status-quo, but I do know where it would be.","Q_Score":2,"Tags":"python,gtk,pygtk","A_Id":306866,"CreationDate":"2008-11-20T19:02:00.000","Title":"How can I get a list of the running applications with GTK?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"How can I get a list of the running applications? I'm referring to the ones in the panel at the bottom of the screen.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":368,"Q_Id":306456,"Users Score":3,"Answer":"I believe what you are looking for is libwnck","Q_Score":2,"Tags":"python,gtk,pygtk","A_Id":307046,"CreationDate":"2008-11-20T19:02:00.000","Title":"How can I get a list of the running applications with GTK?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":3640,"Q_Id":310224,"Users Score":0,"Answer":"Isn't the whole point of using wxPython being to use WxWidgets? Isn't the whole point of using THAT being to have a cross platform GUI library?\nIn other words, forget about X11, and just use the native wxPython on windows.\nIf you want to avoid requiring the user to install wxPython and its dependencies, consider writing an installer. Alternatively, investigate py2exe to \"compile\" python to an .exe file (plus supporting .zip and .dll files), which is much more ammendable to \"installing by merely copying files\".","Q_Score":4,"Tags":"python,installation,wxpython,cygwin,compilation","A_Id":4467468,"CreationDate":"2008-11-21T21:18:00.000","Title":"How do you compile wxPython under cygwin?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":3640,"Q_Id":310224,"Users Score":0,"Answer":"I tried another solution for using wxPython in cygwin:\n\nI installed python27 and wxPython in Windows7\nDid \"echo 'export PATH=\/cygdrive\/c\/Python27\/:$PATH'>>~\/.bashrc\"\nRestart cygwin\n\nIt works. Cheer!\nI don't know if any other Path should be added, but my program was executed on Fedora and it works on there.","Q_Score":4,"Tags":"python,installation,wxpython,cygwin,compilation","A_Id":11237925,"CreationDate":"2008-11-21T21:18:00.000","Title":"How do you compile wxPython under cygwin?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?","AnswerCount":4,"Available Count":3,"Score":0.1488850336,"is_accepted":false,"ViewCount":3640,"Q_Id":310224,"Users Score":3,"Answer":"You would need a full working X environment to get it to work. It would be much easier to just use Python and wxPython under plain vanilla Windows. Do you have a special case?","Q_Score":4,"Tags":"python,installation,wxpython,cygwin,compilation","A_Id":310365,"CreationDate":"2008-11-21T21:18:00.000","Title":"How do you compile wxPython under cygwin?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to install the Python Imaging Library 1.1.6 for Python 2.6. After downloading the installation executable (Win XP), I receive the following error message:\n\"Application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem\"\nAny thoughts on what I have done \/ not done? The application has not been installed, and I can't import the module through the IDLE session. Thoughts?","AnswerCount":4,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":784,"Q_Id":321668,"Users Score":1,"Answer":"Install Python \"for all users\", not \"just for me\".","Q_Score":4,"Tags":"python,image-processing","A_Id":323097,"CreationDate":"2008-11-26T18:21:00.000","Title":"Application configuration incorrect with Python Imaging Library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to install the Python Imaging Library 1.1.6 for Python 2.6. After downloading the installation executable (Win XP), I receive the following error message:\n\"Application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem\"\nAny thoughts on what I have done \/ not done? The application has not been installed, and I can't import the module through the IDLE session. Thoughts?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":784,"Q_Id":321668,"Users Score":0,"Answer":"I got that same message recently to do with the wxPython library. It was because wxPython had been built using a later version of Visual C++ than I had on my PC. As atzz suggests, one solution is to install the appropriate redistributable package. Try a Google search for 'Microsoft Visual C++ 2008 Redistributable Package' and do the download. If that doesn't work, repeat for the 2005 version.","Q_Score":4,"Tags":"python,image-processing","A_Id":368543,"CreationDate":"2008-11-26T18:21:00.000","Title":"Application configuration incorrect with Python Imaging Library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I use something like this: \nscreen.addstr(text, color_pair(1) | A_BOLD), but it doesn't seem to work..\nHowever, A_REVERSE and all others attribute does work! \nIn fact, I'm trying to print something in white, but the COLOR_WHITE prints it gray.. and after a while of searching, it seems that printing it gray + BOLD makes it! \nAny helps would be greatly appreciated.","AnswerCount":2,"Available Count":1,"Score":0.4621171573,"is_accepted":false,"ViewCount":6287,"Q_Id":327026,"Users Score":5,"Answer":"I tried this: screen.addstr(text, curses.color_pair(1) | curses.A_BOLD) and it worked!\nSo just add curses. and it should do the trick.\nOf course at the beginning use: import curses","Q_Score":6,"Tags":"python,linux,curses,bold","A_Id":53016371,"CreationDate":"2008-11-29T01:46:00.000","Title":"Attribute BOLD doesn't seem to work in my curses","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm giving my first steps on Python. I saw that we don't have switch case statement,\nso I would you guys implement a text Menu in python?\nThanks","AnswerCount":6,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5723,"Q_Id":327597,"Users Score":0,"Answer":"To your first question I agree with Ali A.\nTo your second question :\nimport sys\nsys.exit(1)","Q_Score":3,"Tags":"python","A_Id":327735,"CreationDate":"2008-11-29T15:01:00.000","Title":"Suggestion to implement a text Menu without switch case","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a long time C++\/Java developer trying to get into Python and am looking for the stereotypical \"Python for C++ Developers\" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references?\nAs a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study?\nThanks in advance.","AnswerCount":8,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":43679,"Q_Id":328577,"Users Score":4,"Answer":"I learned a lot about Python by reading the source of the standard library that ships with Python. I seem to remember having a few \"a-ha!\" moments when reading urllib2.py in particular.","Q_Score":56,"Tags":"c++,python","A_Id":328599,"CreationDate":"2008-11-30T07:14:00.000","Title":"Python for C++ Developers","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a long time C++\/Java developer trying to get into Python and am looking for the stereotypical \"Python for C++ Developers\" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references?\nAs a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study?\nThanks in advance.","AnswerCount":8,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":43679,"Q_Id":328577,"Users Score":0,"Answer":"For the best examples of code of a language, the language's standard library is often a good place to look. Pick a recent piece, though - old parts are probably written for older versions and also sometimes were written before the library became big enough to warrant big standards - like PHP and Erlang's libraries, which have internal inconsistency.\nFor Python in particular, Python 3000 is cleaning up the library a lot, and so is probably a great source of good Python code (though it is written for a future Python version).","Q_Score":56,"Tags":"c++,python","A_Id":328598,"CreationDate":"2008-11-30T07:14:00.000","Title":"Python for C++ Developers","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a long time C++\/Java developer trying to get into Python and am looking for the stereotypical \"Python for C++ Developers\" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references?\nAs a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study?\nThanks in advance.","AnswerCount":8,"Available Count":3,"Score":0.024994793,"is_accepted":false,"ViewCount":43679,"Q_Id":328577,"Users Score":1,"Answer":"C# and Java are seen as cleaner replacements for C++ in many application areas so there is often a \"migration\" from one to the other - which is why there are books available.\nPython and C++ are very different beasts, and although they are both considered general purpose programming languages they are targetted towards different ends of the programming spectrum.\nDon't try to write C++ in Python; in fact, try to forget C++ when writing Python.\nI found it far better to learn the common Python paradigms and techniques and apply them to my C++ programs than the other way around.","Q_Score":56,"Tags":"c++,python","A_Id":328689,"CreationDate":"2008-11-30T07:14:00.000","Title":"Python for C++ Developers","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently looking at developing a mobile apps for the S60 platform and is specifically looking at PyS60. It seems to suggest that the it can be compiled into native .sis files without the need for an embedded python interpreter. Reading through the documentations I could not find any statements where this is explicitly mentioned. While I am right now downloading the SDKs, Emulators, and the whole bunch of tool chains needed to test the development out on Linux, I thought I would ask here a bit while I am doing that.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1161,"Q_Id":334765,"Users Score":1,"Answer":"Linux is not officially supported for Series60 development yet. You will save yourself a lot of headache using Windows, weirdly enough.\nAs far as Python is oncerned, I think the developed application is packaged into a .sis file but still requires the PyS60 interpreter to run once installed.","Q_Score":9,"Tags":"python,symbian,s60,pys60","A_Id":337308,"CreationDate":"2008-12-02T17:30:00.000","Title":"Does PyS60 produce sis files that are native?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.","AnswerCount":8,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":3355,"Q_Id":340128,"Users Score":0,"Answer":"Very interesting. \nWhat would happen if you write all your code with IronPython (not just the unit tests)? Would you end up with approximately 10 times less code? \nMaybe I should learn IronPython too.","Q_Score":13,"Tags":"c#,python,unit-testing,ironpython","A_Id":342457,"CreationDate":"2008-12-04T10:21:00.000","Title":"IronPython For Unit Testing over C#","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.","AnswerCount":8,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":3355,"Q_Id":340128,"Users Score":0,"Answer":"I gotta go with Will and Jon..\nI would prefer my tests be in the same language as the code I'm testing; it causes fewer cognitive context switches. But maybe I'm just not as mentally agile as I once was.\n\nJon","Q_Score":13,"Tags":"c#,python,unit-testing,ironpython","A_Id":443959,"CreationDate":"2008-12-04T10:21:00.000","Title":"IronPython For Unit Testing over C#","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.","AnswerCount":8,"Available Count":6,"Score":0.0748596907,"is_accepted":false,"ViewCount":3355,"Q_Id":340128,"Users Score":3,"Answer":"Actually testing is a great opportunity to try integrating a new language. Languages like Python shine especially well in testing, and it's a low risk project to try - the worst case is not too bad at all.\nAs far as experience testing another language in Python, I've tested C and C++ systems like this and it was excellent. I think it's definitely worth a shot.\nWhat Jon says is true, though - the level of tooling for Python in general, and IronPython in particular, is nowhere near that of C#. How much that affects you is something you'll find out in your pilot.","Q_Score":13,"Tags":"c#,python,unit-testing,ironpython","A_Id":342490,"CreationDate":"2008-12-04T10:21:00.000","Title":"IronPython For Unit Testing over C#","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.","AnswerCount":8,"Available Count":6,"Score":0.0748596907,"is_accepted":false,"ViewCount":3355,"Q_Id":340128,"Users Score":3,"Answer":"Python being a much less verbose language than C# might actually lower the barrier to writing unit tests since there is still a lot of developers that are resistant to doing automated unit testing in general. Introducing and having them use a language like IronPython that typically tends to take less time to write the equivalent code in C# might actually encourage more unit tests to be written which is always a good thing.\nPlus, by using IronPython for your test code, you might end up with less lines of code (LOC) for your project overall meaning that your unit tests might be more likely to be maintained in the long run versus being ignored and\/or discarded.","Q_Score":13,"Tags":"c#,python,unit-testing,ironpython","A_Id":341683,"CreationDate":"2008-12-04T10:21:00.000","Title":"IronPython For Unit Testing over C#","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.","AnswerCount":8,"Available Count":6,"Score":1.0,"is_accepted":false,"ViewCount":3355,"Q_Id":340128,"Users Score":6,"Answer":"Python is excellent for UnitTesting C# code. Our app is 75% in Python and 25% C#(Python.Net), and our unit tests are 100% python. \nI find that it's much easier to make use of stubs and mocks in Python which is probably one of the most critical components that enable one to write effective unittests.","Q_Score":13,"Tags":"c#,python,unit-testing,ironpython","A_Id":346907,"CreationDate":"2008-12-04T10:21:00.000","Title":"IronPython For Unit Testing over C#","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.","AnswerCount":8,"Available Count":6,"Score":0.049958375,"is_accepted":false,"ViewCount":3355,"Q_Id":340128,"Users Score":2,"Answer":"There's an obvious disadvantage which is that everyone working on the code now needs to be proficient in two languages, not just one. I'm fairly hairy but not very pointy, but I do see why managers might be sceptical.","Q_Score":13,"Tags":"c#,python,unit-testing,ironpython","A_Id":340152,"CreationDate":"2008-12-04T10:21:00.000","Title":"IronPython For Unit Testing over C#","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Okay, what is it, and why does it occur on Win2003 server, but not on WinXP.\nIt doesn't seem to affect my application at all, but I get this error message when I close the application. And it's annoying (as errors messages should be).\nI am using pyOpenGl and wxPython to do the graphics stuff. Unfortunately, I'm a C# programmer that has taken over this Python app, and I had to learn Python to do it.\nI can supply code and version numbers etc, but I'm still learning the technical stuff, so any help would be appreciated.\nPython 2.5, wxPython and pyOpenGL","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":91403,"Q_Id":345991,"Users Score":2,"Answer":"After adding the Logging above, I was able to see that the problem was caused by missing TConstants class, which I was excluding in the py2exe setup.py file. \nAfter removing the \"Tconstants\" from the excluded list, I no longer had problems.","Q_Score":80,"Tags":"python,logging,opengl,wxpython,pyopengl","A_Id":369184,"CreationDate":"2008-12-06T05:59:00.000","Title":"Python - No handlers could be found for logger \"OpenGL.error\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to decide on a GUI\/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform?\nIf possible, cite strengths and weaknesses of the suggested toolkit.\nThank you,\nLuis","AnswerCount":3,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":1840,"Q_Id":360602,"Users Score":8,"Answer":"Python binding of Wx is very strong since at least one of the core developer is a python guy itself. WxWdgets is robust, time proven stable, mature, but also bit more than just GUI. Even is a lot is left out in WxPython - because Python itself offers that already - you might find that extra convenient for your project. Wx is the fastest especially on Win, because it lets render the OS and yes WxLicense is de facto LGPL. With XRC you have also a way like Glade to click you to a UI that you can reuse by different projects and languages. What is one major reason for me to use Wx is the fast and helping mailing list, never seen a flamewar, you get even often answers from core developers there, like the notorious vadim zeitlin++. The only thing con to Wx is the API that once grew out of MS MFC and has still its darker(unelegant) corners, but with every version you have some improvements on that as well.\nQT done some nice stuff, especially warping the language but under python that don't count. They invented also a lot of extra widgets. In wx you have also combined, more complex widgets like e.g. for config dialog, but that goes not that far as in QT. \nAnd you could of course use GTK. almost no difference under linux to Wx but a bit alien and slower under win. but also free.","Q_Score":4,"Tags":"python,windows,linux,native,gui-toolkit","A_Id":361672,"CreationDate":"2008-12-11T19:38:00.000","Title":"What GUI toolkit looks best for a native LAF for Python in Windows and Linux?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to decide on a GUI\/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform?\nIf possible, cite strengths and weaknesses of the suggested toolkit.\nThank you,\nLuis","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1840,"Q_Id":360602,"Users Score":0,"Answer":"Like others said, PyQt or wxPython... The technical difference between the two is more or less imaginary - it's a question of your comfort with the toolkit that matters, really.","Q_Score":4,"Tags":"python,windows,linux,native,gui-toolkit","A_Id":361996,"CreationDate":"2008-12-11T19:38:00.000","Title":"What GUI toolkit looks best for a native LAF for Python in Windows and Linux?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a two part question. A dumb technical query and a broader query about my possibly faulty approach to learning to do some things in a language I'm new to.\nI'm just playing around with a few Python GUI libraries (mostly wxPython and IronPython) for some work I'm thinking of doing on an open source app, just to improve my skills and so forth.\nBy day I am a pretty standard c# bod working with a pretty normal set of MS based tools and I am looking at Python to give me a new perspective. Thus using Ironpython Studio is probably cheating a bit (alright, a lot). This seems not to matter because however much it attempts to look like a Visual Studio project etc. There's one simple behaviour I'm probably being too dumb to implement.\nI.E. How do I keep my forms in nice separate code files, like the c# monkey I have always been ,and yet invoke them from one another? I've tried importing the form to be invoked to the main form but I just can't seem to get the form to be recognized as anything other than an object. The new form appears to be a form object in its own code file, I am importing the clr. I am trying to invoke a form's 'Show' method. Is this not right?\nI've tried a few (to my mind more unlikely) ways around this but the problem seems intractable. Is this something I'm just not seeing or would it in fact be more appropriate for me to change the way I think about my GUI scripting to fit round Python (in which case I may switch back to wxPython which seemed more approachable from a Pythonic point of view) rather than try to look at Python from the security of the Visual Studio shell?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1298,"Q_Id":362428,"Users Score":0,"Answer":"In the end it was even simpler.\nI was trying to invoke the subform thus:\nf = frmSubform()\nf.Show()\nBut I actually needed to do it this way\nf = frmSubform()\nForm.Show(f)\nForm.ShowDialog(f) worked also; in a Dialog format of course.\nA simple enough error but until you know you, well, don't know.\nI'm not 100% sure I understand at this stage why what works, works, but I'm sure I shall learn with experience.","Q_Score":1,"Tags":"ironpython,ironpython-studio","A_Id":363455,"CreationDate":"2008-12-12T10:36:00.000","Title":"Ironpython Studio forms","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've had some experience with Pygame, but there seems to be a lot of buzz around Pyglet these days.\nHow do these two libraries compare? What would be the advantage of using one over the other, both in features and ease of use?\nFinally, would you say that one is more Pythonic than the other?","AnswerCount":5,"Available Count":2,"Score":0.1194272985,"is_accepted":false,"ViewCount":24875,"Q_Id":370680,"Users Score":3,"Answer":"Having looked at both pygame and pyglet I found pyglet easier to pick up and was able to write a simple breakout style game within a few days.","Q_Score":46,"Tags":"python,pygame,pyglet","A_Id":2477829,"CreationDate":"2008-12-16T07:55:00.000","Title":"Differences between Python game libraries Pygame and Pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've had some experience with Pygame, but there seems to be a lot of buzz around Pyglet these days.\nHow do these two libraries compare? What would be the advantage of using one over the other, both in features and ease of use?\nFinally, would you say that one is more Pythonic than the other?","AnswerCount":5,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":24875,"Q_Id":370680,"Users Score":15,"Answer":"Pyglet is good (for 2D games) if you never intend to draw any vector graphics or primitives within the game itself, and just stick to loading images from disk. It's also much cleaner because there's no need to write your own game loop and have to worry about speed and timing and responsiveness.\nHowever, if you ever have to generate graphics on-the-fly, and then save them, either as a variable or as a file, then pyglet becomes considerably more complicated because you start having to muck around with the low-level OpenGL functions. In those scenarios, pygame is much more user-friendly, with its software rendering and Surface class. Or you could use Python Imaging Library and interface it with pyglet.\nObviously, for 3D games, you are going to have to muck around with OpenGL functions anyway, in which case I recommend pyglet over pygame + PyOpenGL.","Q_Score":46,"Tags":"python,pygame,pyglet","A_Id":4520448,"CreationDate":"2008-12-16T07:55:00.000","Title":"Differences between Python game libraries Pygame and Pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking into writing a wxWidget that displays a graphical node network, and therefore does a lot of drawing operations. I know that using Python to do it is going to be slower, but I'd rather get it working and port it later when its functional. Ideally, if the performance hit isn't too great, I'd prefer to keep the codebase in Python for easy updates.\nWhat I'm wondering is how much slower should I expect things to go? I realize this is vague and open ended, but I just need a sense of what to expect. Will drawing 500 circles bog down? Will it be noticeable at all? What are your experiences?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":1255,"Q_Id":379442,"Users Score":1,"Answer":"For drawing, people have suggested PyGame. I like PyGame, its easy to work with and works well. Other choices would be Pyglet, or using PyOpenGL (you can most likely draw to a wx widget too, though I've never done it).\nPersonally, I'd do it in Python using whatever library I'm most familiar with (in my case, I'd use pygtk and cairo) and worry about performance only when it becomes a problem - then profile and optimize the bottleneck, if its Python code thats slow, I'll know which bits to run in C instead.","Q_Score":6,"Tags":"c++,python,performance,drawing,wxpython","A_Id":380558,"CreationDate":"2008-12-18T21:52:00.000","Title":"How much slower is a wxWidget written in Python versus C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting out with wxPython and have been working my way through every tutorial and example I can get my hands on. I've run into a slight problem, however, and it has to do with the wx.App versus the wx.Frame and which should contain specific methods. Just about every example I've seen don't go much beyond layouts\/sizers and event handling, none really tackle project organization of a wxPython project.\nFor example, I have a method that gets a list of folders. The way most examples would deal with this would be to stick the method right in the frame class. This method has the potential to be used in several other parts of the application, so it would make more sense to store it at the application class level.\nHow should I organize and call \"universal\" methods like these so that I don't clutter up my frame classes.\nUPDATE:\nTo clarify, the \"list of folders\" was just an example, my actual method does a lot more work. What I'm saying is I have code that isn't Frame-specific. If I had this in the application class, what is the best way to call it from and event method in my frame.\nI'm looking for actual project organization techniques, not programming fundamentals.","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":1063,"Q_Id":390867,"Users Score":2,"Answer":"As Mark stated you should make a new class that handles things like this. \nThe ideal layout of code when using something like wxWidgets is the model view controller where the wxFrame class only has the code needed to display items and all the logic and business rules are handled by other class that interact with the wxFrame. This way you can change logic and business rules with out having to change your interface and change (or swap) your interface with out having to change your logic and business rules.","Q_Score":1,"Tags":"python,wxpython,wxwidgets,model-view-controller,project-organization","A_Id":390912,"CreationDate":"2008-12-24T06:07:00.000","Title":"Calling Application Methods from a wx Frame Class","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting out with wxPython and have been working my way through every tutorial and example I can get my hands on. I've run into a slight problem, however, and it has to do with the wx.App versus the wx.Frame and which should contain specific methods. Just about every example I've seen don't go much beyond layouts\/sizers and event handling, none really tackle project organization of a wxPython project.\nFor example, I have a method that gets a list of folders. The way most examples would deal with this would be to stick the method right in the frame class. This method has the potential to be used in several other parts of the application, so it would make more sense to store it at the application class level.\nHow should I organize and call \"universal\" methods like these so that I don't clutter up my frame classes.\nUPDATE:\nTo clarify, the \"list of folders\" was just an example, my actual method does a lot more work. What I'm saying is I have code that isn't Frame-specific. If I had this in the application class, what is the best way to call it from and event method in my frame.\nI'm looking for actual project organization techniques, not programming fundamentals.","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1063,"Q_Id":390867,"Users Score":2,"Answer":"Your classes that inherit from wxWidgets\/wxPython data types should not implement any business logic. wxWidgets is a GUI library, so any subclasses of wxApp or wxFrame should remain focused on GUI, that is on displaying the interface and being responsive to user actions. \nThe code that does something useful should be separated from wx, as you can decide later to use it in some web or console application and you don't want to create wxApp object in such case. You can also decide later on to move some computations to separate 'worker threads', while your GUI will be the 'main thread' - responsive, and repainted properly during long lasting computations. \nLast but not least - the classes that encapsulate your logic might tend to grow during projects lifetime. If they're mixed with your GUI classes they will grow faster, and finally they become so complex that you're almost unable to debug them... \nWhile having them separated leads to clean code when you don't mix bugs in logic with bugs in GUI (refreshing\/layout\/progress bar etc.). Such approach has another nice feature - ability to split work among GUI-people and logic-people, which can do their work without constant conflicts.","Q_Score":1,"Tags":"python,wxpython,wxwidgets,model-view-controller,project-organization","A_Id":394333,"CreationDate":"2008-12-24T06:07:00.000","Title":"Calling Application Methods from a wx Frame Class","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting out with wxPython and have been working my way through every tutorial and example I can get my hands on. I've run into a slight problem, however, and it has to do with the wx.App versus the wx.Frame and which should contain specific methods. Just about every example I've seen don't go much beyond layouts\/sizers and event handling, none really tackle project organization of a wxPython project.\nFor example, I have a method that gets a list of folders. The way most examples would deal with this would be to stick the method right in the frame class. This method has the potential to be used in several other parts of the application, so it would make more sense to store it at the application class level.\nHow should I organize and call \"universal\" methods like these so that I don't clutter up my frame classes.\nUPDATE:\nTo clarify, the \"list of folders\" was just an example, my actual method does a lot more work. What I'm saying is I have code that isn't Frame-specific. If I had this in the application class, what is the best way to call it from and event method in my frame.\nI'm looking for actual project organization techniques, not programming fundamentals.","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1063,"Q_Id":390867,"Users Score":0,"Answer":"In a proper OOP design, this would be independent or part of a filesystem class - it wouldn't be part of the app or the frame.","Q_Score":1,"Tags":"python,wxpython,wxwidgets,model-view-controller,project-organization","A_Id":390887,"CreationDate":"2008-12-24T06:07:00.000","Title":"Calling Application Methods from a wx Frame Class","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you can build with the available tools, specifically in the types of available widgets.\nI'm interested in using some of the more advanced wxPython widgets such as the ListView (grid), Tree, etc. This would involve using a complete wxFrame (window) to display the whole UI, which would essentially mean that window would no longer be tied to Maya. Not a deal breaker, but it means when Maya is minimized, the window won't follow suit.\nI've tried something like this before with tkinter as a test, but found that it needed a MainLoop to run in its own thread. This is logical, but in my case, it conflicts with Maya's own thread, essentially making Maya hang until the window is closed. This is due to the fact that Maya runs all scripts, be they MEL or Python, in a single thread that the main Maya GUI shares. This is to prevent one script from, say, deleting an object while another script is trying to do work on the same object.\nwxPython has this same \"mainloop\" methodolgy. I'm wondering if there's any way around it so that it can work within Maya?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3503,"Q_Id":397337,"Users Score":0,"Answer":"The best way to go is creating a QWidget with what you need, and using it from within a MPxCommand thru the C++ API. That way you also have the chance to inject complete custom editors into Maya via scriptedPanels.\nBut if you're bound to Python, pyQt is the way to go.","Q_Score":8,"Tags":"python,scripting,wxpython,wxwidgets,maya","A_Id":30247511,"CreationDate":"2008-12-29T08:41:00.000","Title":"Using external GUI libraries to make user interfaces in Autodesk Maya","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you can build with the available tools, specifically in the types of available widgets.\nI'm interested in using some of the more advanced wxPython widgets such as the ListView (grid), Tree, etc. This would involve using a complete wxFrame (window) to display the whole UI, which would essentially mean that window would no longer be tied to Maya. Not a deal breaker, but it means when Maya is minimized, the window won't follow suit.\nI've tried something like this before with tkinter as a test, but found that it needed a MainLoop to run in its own thread. This is logical, but in my case, it conflicts with Maya's own thread, essentially making Maya hang until the window is closed. This is due to the fact that Maya runs all scripts, be they MEL or Python, in a single thread that the main Maya GUI shares. This is to prevent one script from, say, deleting an object while another script is trying to do work on the same object.\nwxPython has this same \"mainloop\" methodolgy. I'm wondering if there's any way around it so that it can work within Maya?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3503,"Q_Id":397337,"Users Score":0,"Answer":"I don't know if there is a way around a mainloop for the gui, since it is needed to handle all event chains and redraw queues. \nBut there are several means of inter-process communication, like pipes or semaphores. Maybe it is an option to split your Maya extension into the actual plugin, being tight into maya, and a separate application for the gui. These two could use such means to communicate and exchange model information between plugin and gui.\nI'm not sure, however, if I can really recommend this approach because it very much complicates the application.\nYou could have a look at IPython, an interactive Python shell, whose dev team has put some effort into integrating it with wxPython. They have some way of interrupting the event loop and hooking into it to do their own stuff.","Q_Score":8,"Tags":"python,scripting,wxpython,wxwidgets,maya","A_Id":398469,"CreationDate":"2008-12-29T08:41:00.000","Title":"Using external GUI libraries to make user interfaces in Autodesk Maya","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"More particularly - I have a window handle of another running application. This application contains a TListControl.UnicodeClass control somewhere (I know this from Winspector). How can I, using the Windows API and that window handle, go through all the items in that list control and get the text from all of the items?\nYou can assume the language is C\/C++, though I'll actually be using win32all for python. References to the appropriate API calls would be great.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1808,"Q_Id":408334,"Users Score":2,"Answer":"Above answers are completely wrong and don't even know what is a PAS.\nThis has been answered hundreds of times for 20 years on Usenet.\nYou must use IPC of course (RPM)\nask on news:\/\/comp.os.ms-windows.programmer.win32 for code.","Q_Score":1,"Tags":"python,windows,winapi,controls","A_Id":409110,"CreationDate":"2009-01-02T23:49:00.000","Title":"In Windows, how can I enumerate and get text from another window's controls?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to force my python app to the front if a condition occurs. I'm using Kubuntu & QT3.1\nI've tried setActiveWindow(), but it only flashes the task bar in KDE.\nI think Windows has a function bringwindowtofront() for VB.\nIs there something similar for KDE?","AnswerCount":3,"Available Count":1,"Score":0.2605204458,"is_accepted":false,"ViewCount":2418,"Q_Id":412214,"Users Score":4,"Answer":"Check if KWin is configured to prevent focus stealing.\nThere might be nothing wrong with your code -- but we linux people don't like applications bugging us when we work, so stealing focus is kinda frowned upon, and difficult under some window managers.","Q_Score":1,"Tags":"python,qt","A_Id":413073,"CreationDate":"2009-01-05T03:36:00.000","Title":"How to bring program to front using python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Does anyone know of an example where it is shown how to drag a button from one panel to another in wxPython?\nI have created a bitmap button in a panel, and I would like to be able to drag it to a different panel and drop I there. \nI haven't found any examples using buttons, just text and files.\nI am using the latest version of Python and wxPython.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1052,"Q_Id":425722,"Users Score":4,"Answer":"If you want to graphically represent the drag, one good way to do this is to create a borderless Frame that follows the mouse during a drag. You remove the button from your source Frame, temporarily put it in this \"drag Frame\", and then, when the user drops, add it to your destination Frame.","Q_Score":1,"Tags":"python,drag-and-drop,wxpython","A_Id":425740,"CreationDate":"2009-01-08T20:17:00.000","Title":"Drag button between panels in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"My site is full of rounded corners on every box and picture, except for the thumbnails of user uploaded photos.\nHow can I use the Python Imaging Library to 'draw' white or transparent rounded corners onto each thumbnail?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3944,"Q_Id":430379,"Users Score":0,"Answer":"Might it not be a better idea (assuming HTML is the output) to use HTML and CSS to put some rounded borders on those pictures? That way, if you want to change the look of your site, you don't have to do any image reprocessing, and you don't have to do any image processing in the first place.","Q_Score":0,"Tags":"python,python-imaging-library,rounded-corners","A_Id":430410,"CreationDate":"2009-01-10T02:00:00.000","Title":"Draw rounded corners on photo with PIL","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering if there is something similar to Java's JFileChooser for Python?\nJFileChooser is a graphical front end to choose a file.\nPreferably something that is already with Python. Maybe with Tkinter.","AnswerCount":6,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":2182,"Q_Id":433945,"Users Score":4,"Answer":"wxPython (www.wxpython.org) provides the wx.FileDialog class which will give you a native file selection dialog on any of the supported platforms (Mac, Linux or Windows).","Q_Score":4,"Tags":"java,python,jfilechooser","A_Id":433967,"CreationDate":"2009-01-11T23:03:00.000","Title":"JFileChooser for Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering if there is something similar to Java's JFileChooser for Python?\nJFileChooser is a graphical front end to choose a file.\nPreferably something that is already with Python. Maybe with Tkinter.","AnswerCount":6,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2182,"Q_Id":433945,"Users Score":0,"Answer":"Maybe you would like to take a look at Jython.","Q_Score":4,"Tags":"java,python,jfilechooser","A_Id":433977,"CreationDate":"2009-01-11T23:03:00.000","Title":"JFileChooser for Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've got a wx.Toolbar and I'd like to make the buttons larger. I've searched and can't seem to find any concrete documentation on how to do this.\nI'm also wondering how well this will translate across platforms; what will happen to the buttons and icons on OSX?","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":3854,"Q_Id":445037,"Users Score":2,"Answer":"Doesn't the size of the toolbar adapts itself automatically to the size of the bitmap icons? I think if you want a bigger toolbar, you need bigger bitmaps.","Q_Score":2,"Tags":"python,user-interface,wxpython,wxwidgets,toolbar","A_Id":446014,"CreationDate":"2009-01-14T22:57:00.000","Title":"How to make a wx Toolbar buttons larger?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c\/c++ extension for performance.\nWith the help of swig you almost don't need to care about arguments etc. Everything works fine.\nNow my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code.\nDoes anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.","AnswerCount":10,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":32045,"Q_Id":456884,"Users Score":8,"Answer":"An observation: Based on the benchmarking conducted by the pybindgen developers, there is no significant difference between boost.python and swig. I haven't done my own benchmarking to verify how much of this depends on the proper use of the boost.python functionality. \nNote also that there may be a reason that pybindgen seems to be in general quite a bit faster than swig and boost.python: it may not produce as versatile a binding as the other two. For instance, exception propagation, call argument type checking, etc. I haven't had a chance to use pybindgen yet but I intend to. \nBoost is in general quite big package to install, and last I saw you can't just install boost python you pretty much need the whole Boost library. As others have mentioned compilation will be slow due to heavy use of template programming, which also means typically rather cryptic error messages at compile time. \nSummary: given how easy SWIG is to install and use, that it generates decent binding that is robust and versatile, and that one interface file allows your C++ DLL to be available from several other languages like LUA, C#, and Java, I would favor it over boost.python. But unless you really need multi-language support I would take a close look at PyBindGen because of its purported speed, and pay close attention to robustness and versatility of binding it generates.","Q_Score":70,"Tags":"python,c++,c,swig,cython","A_Id":3167276,"CreationDate":"2009-01-19T08:32:00.000","Title":"Extending python - to swig, not to swig or Cython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c\/c++ extension for performance.\nWith the help of swig you almost don't need to care about arguments etc. Everything works fine.\nNow my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code.\nDoes anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.","AnswerCount":10,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":32045,"Q_Id":456884,"Users Score":6,"Answer":"There be dragons here. Don't swig, don't boost. For any complicated project the code you have to fill in yourself to make them work becomes unmanageable quickly. If it's a plain C API to your library (no classes), you can just use ctypes. It will be easy and painless, and you won't have to spend hours trawling through the documentation for these labyrinthine wrapper projects trying to find the one tiny note about the feature you need.","Q_Score":70,"Tags":"python,c++,c,swig,cython","A_Id":461364,"CreationDate":"2009-01-19T08:32:00.000","Title":"Extending python - to swig, not to swig or Cython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c\/c++ extension for performance.\nWith the help of swig you almost don't need to care about arguments etc. Everything works fine.\nNow my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code.\nDoes anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.","AnswerCount":10,"Available Count":3,"Score":0.0599281035,"is_accepted":false,"ViewCount":32045,"Q_Id":456884,"Users Score":3,"Answer":"If its not a big extension, boost::python might also be an option, it executes faster than swig, because you control what's happening, but it'll take longer to dev.\nAnyways swig's overhead is acceptable if the amount of work within a single call is large enough. For example if you issue is that you have some medium sized logic block you want to move to C\/C++, but that block is called within a tight-loop, frequently, you might have to avoid swig, but I can't really think of any real-world examples except for scripted graphics shaders.","Q_Score":70,"Tags":"python,c++,c,swig,cython","A_Id":456894,"CreationDate":"2009-01-19T08:32:00.000","Title":"Extending python - to swig, not to swig or Cython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for a way to implement this design in wxPython on Linux...\nI have a toolbar with a button, when the button is pressed a popup should appear, mimicking an extension of the toolbar (like a menu), and this popup should show two columns of radio buttons (say 2x5) and a text box...\nMy main problem is that the toolbar is small in height, so the popup has to overflow the bounds of the window\/client area..\nI thought of two possible implementations: \n\nby using a wxMenu, since a menu can be drawn outside the client area. I fear that the layout possibilities aren't flexible enough for my goal\nby using a shaped frame. Pressing the button would re-shape the frame and draw the needed widgets as requested.\n\nMy question is: am I missing something \/ wrong on something? :) Is this doable at all?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":551,"Q_Id":462320,"Users Score":1,"Answer":"Using a menu is a no-go, because wxWidgets can't put widgets on a menu. Using the shaped frame would be possible in principle, but the problem is then to get the position of the button you clicked, to display the window at the right position. I tried to do that back then, but didn't have luck (in C++ wxWidgets). Maybe this situation changed in between though, good luck. \nYou can also try a wxComboCtrl, which allows you to have a custom popup window. That one could then display the radio boxes and the input control.","Q_Score":1,"Tags":"wxpython,wxwidgets,shaped-window","A_Id":462387,"CreationDate":"2009-01-20T17:44:00.000","Title":"Window-overflowing widget in wxWidgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am adding some wx.StaticText objects on top of my main wx.Frame, which already has a background image applied. However, the StaticText always seems to draw with a solid (opaque) background color, hiding the image. I have tried creating a wx.Color object and changing the alpha value there, but that yields no results. Is there any way I can put text on the frame and have the background shine through? And furthermore, is it possible to make the text itself translucent? Thanks.","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":472,"Q_Id":462933,"Users Score":1,"Answer":"You probably need some graphics rendering widget. As far as I know, in wxPython you can use either built-in wxGraphicsContext or pyCairo directly. Cairo is more powerful. However, I don't know the details.","Q_Score":1,"Tags":"python,wxpython,transparency,opacity","A_Id":464706,"CreationDate":"2009-01-20T20:20:00.000","Title":"Is it possible to make text translucent in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am adding some wx.StaticText objects on top of my main wx.Frame, which already has a background image applied. However, the StaticText always seems to draw with a solid (opaque) background color, hiding the image. I have tried creating a wx.Color object and changing the alpha value there, but that yields no results. Is there any way I can put text on the frame and have the background shine through? And furthermore, is it possible to make the text itself translucent? Thanks.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":472,"Q_Id":462933,"Users Score":0,"Answer":"I would try aggdraw into a small canvas.\nAny Static Text uses the platform's native label machinery, so you don't get that sort of control over it.","Q_Score":1,"Tags":"python,wxpython,transparency,opacity","A_Id":598202,"CreationDate":"2009-01-20T20:20:00.000","Title":"Is it possible to make text translucent in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is going to be a generic question.\nI am struggling in designing a GUI application, esp. with dealing with interactions between different parts.\nI don't know how I should deal with shared state. On one hand, shared state is bad, and things should be as explicit as possible. On the other hand, not having shared state introduces unwanted coupling between components.\nAn example:\nI want my application to be extendable in an Emacs\/Vim sort of way, via scripts. Clearly, some sort of shared state needs to be modified, so that the GUI will use it. My initial plan was having a global \"session\" that is accessible from everywhere, but I'm not so sure about it.\nOne tricky use case is key bindings. I want the user to be able to specify custom keybindings from a script. Each keybinding maps to an arbitrary command, that receives the session as the only argument.\nNow, the editor component captures keypresses. It has to have access to the keymappings, which are per-session, so it needs access to the session. Is coupling the editor to the session a good idea? Other components will also need to access the keybindings, so the session now becomes shared and can be a singleton...\nIs there any good reading about designing GUI applications that goes beyond MVC?\nThis is Python and wxPython, FWIW.\n[EDIT]: Added concrete usecase.","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":805,"Q_Id":471279,"Users Score":2,"Answer":"If you've looked at MVC you're probably moving in the right direction. MVC, MVP, Passive View, Supervising Controller. Those are all different ways, each with their own pros and cons, of accomplishing what you're after. I find that Passive View is the \"ideal\", but it causes you to introduce far too many widgets into your GUI interfaces (i.e. IInterface). In general I find that Supervising Controller is a good compromise.","Q_Score":9,"Tags":"python,model-view-controller,user-interface,architecture,wxpython","A_Id":471297,"CreationDate":"2009-01-22T23:25:00.000","Title":"Organising a GUI application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is going to be a generic question.\nI am struggling in designing a GUI application, esp. with dealing with interactions between different parts.\nI don't know how I should deal with shared state. On one hand, shared state is bad, and things should be as explicit as possible. On the other hand, not having shared state introduces unwanted coupling between components.\nAn example:\nI want my application to be extendable in an Emacs\/Vim sort of way, via scripts. Clearly, some sort of shared state needs to be modified, so that the GUI will use it. My initial plan was having a global \"session\" that is accessible from everywhere, but I'm not so sure about it.\nOne tricky use case is key bindings. I want the user to be able to specify custom keybindings from a script. Each keybinding maps to an arbitrary command, that receives the session as the only argument.\nNow, the editor component captures keypresses. It has to have access to the keymappings, which are per-session, so it needs access to the session. Is coupling the editor to the session a good idea? Other components will also need to access the keybindings, so the session now becomes shared and can be a singleton...\nIs there any good reading about designing GUI applications that goes beyond MVC?\nThis is Python and wxPython, FWIW.\n[EDIT]: Added concrete usecase.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":805,"Q_Id":471279,"Users Score":1,"Answer":"In MVC, the Model stuff is the shared state of the information.\nThe Control stuff is the shared state of the GUI control settings and responses to mouse-clicks and what-not.\nYour scripting angle can \n1) Update the Model objects. This is good. The Control can be \"Observers\" of the model objects and the View be updated to reflect the observed changes.\n2) Update the Control objects. This is not so good, but... The Control objects can then make appropriate changes to the Model and\/or View.\nI'm not sure what the problem is with MVC. Could you provide a more detailed design example with specific issues or concerns?","Q_Score":9,"Tags":"python,model-view-controller,user-interface,architecture,wxpython","A_Id":471307,"CreationDate":"2009-01-22T23:25:00.000","Title":"Organising a GUI application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software structures. So we believe IronPython is a good platform for us because it provides standard GUI functionality on windows and access to all of .Net libraries. \nI know Ironpython studio is not complete, and in fact I had a hard time adding my references but I was wondering if someone could list some of the pros and cons of this migration for us, considering Python code is easier to read by our clients and we usually deliver a proof-of-concept prototype instead of a full-functional code, our clients usually go ahead and implement the application themselves","AnswerCount":3,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":5128,"Q_Id":471712,"Users Score":7,"Answer":"The way you describe things, it sounds like you're company is switching to Python simple for the sake of Python. Is there some specific reason you want to use Python? Is a more dynamic language necessary? Is the functional programming going to help you at all? If you've got a perfectly good working set of tools in C#, why bother switching?\nIf you're set on switching, you may want to consider starting with standard Python unless you're specifically tied to the .NET libraries. You can write cross platform GUIs using a number of different frameworks like wxPython, pyQt, etc. That said, Visual Studio has a far superior GUI designer to just about any of the tools out there for creating Python windowed layouts.","Q_Score":16,"Tags":"python,ironpython,ironpython-studio","A_Id":471725,"CreationDate":"2009-01-23T02:49:00.000","Title":"Pros and cons of IronPython and IronPython Studio","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software structures. So we believe IronPython is a good platform for us because it provides standard GUI functionality on windows and access to all of .Net libraries. \nI know Ironpython studio is not complete, and in fact I had a hard time adding my references but I was wondering if someone could list some of the pros and cons of this migration for us, considering Python code is easier to read by our clients and we usually deliver a proof-of-concept prototype instead of a full-functional code, our clients usually go ahead and implement the application themselves","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":5128,"Q_Id":471712,"Users Score":18,"Answer":"My company, Resolver Systems, develops what is probably the biggest application written in IronPython yet. (It's called Resolver One, and it's a Pythonic spreadsheet). We are also hosting the Ironclad project (to run CPython extensions under IronPython) and that is going well (we plan to release a beta of Resolver One & numpy soon).\nThe reason we chose IronPython was the .NET integration - our clients want 100% integration on Windows and the easiest way to do that right now is .NET. \nWe design our GUI (without behaviour) in Visual Studio, compile it into a DLL and subclass it from IronPython to add behaviour.\nWe have found that IronPython is faster at some cases and slower at some others. However, the IronPython team is very responsive, whenever we report a regression they fix it and usually backport it to the bugfix release. If you worry about performance, you can always implement a critical part in C# (we haven't had to do that yet).\nIf you have experience with C#, then IronPython will be natural for you, and easier than C#, especially for prototypes.\nRegarding IronPython studio, we don't use it. Each of us has his editor of choice (TextPad, Emacs, Vim & Wing), and everything works fine.","Q_Score":16,"Tags":"python,ironpython,ironpython-studio","A_Id":472355,"CreationDate":"2009-01-23T02:49:00.000","Title":"Pros and cons of IronPython and IronPython Studio","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working with PyGTK, trying to come up with a combination of widgets that will do the following:\n\nLet me add an endless number of widgets in a column\nProvide a vertical scrollbar to get to the ones that run off the bottom\nMake the widgets' width adjust to fill available horizontal space when the window is resized\n\nThanks - I'm new to GTK.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4354,"Q_Id":474034,"Users Score":8,"Answer":"An endless number of widgets in a column: Sounds like a GtkVBox.\nVertical scrollbar: Put your VBox in a GtkScrolledWindow.\nHorizontal stretching: This requires setting the appropriate properties for the VBox, ScrolledWindow, and your other widgets. At least in Glade the defaults seem to mostly handle this (You will probably want to change the scrollbar policy of the ScrolledWindow).\n\nNow for the trick. If you just do what I've listed above, the contents of the VBox will try to resize vertically as well as horizontally, and you won't get your scrollbar. The solution is to place your VBox in a GtkViewport.\nSo the final hierarchy is ScrolledWindow( Viewport( VBox( widgets ) ) ).","Q_Score":4,"Tags":"python,gtk,pygtk,widget","A_Id":474134,"CreationDate":"2009-01-23T18:53:00.000","Title":"Which GTK widget combination to use for scrollable column of widgets?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":0,"Answer":"Between komodo and wingide i would go for wing. The license is not that expensive and the fact that it is commercial gives you a bigger probability of more updates and bug fixes. If you, like me, prefer a free solution, then stick with pydev. At least until aptana closes the free door :)","Q_Score":18,"Tags":"python,ide","A_Id":495362,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0363476168,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":2,"Answer":"Check to see if the 'P' icon is appearing for your items and in the top of your editor after opening it. If it's not appearing, it may be that there's a problem with the file association, so, go to window > preferences > general > editors > file associations and make sure that the .py files are associated with the Python Editor (note that because of an eclipse bug, if it seems correct, you may have to remove the association and add it again)","Q_Score":18,"Tags":"python,ide","A_Id":1399741,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0181798149,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":1,"Answer":"It sounds like you have to specify the location of the Python interpreter. Do this under Preferences > Pydev > Interpreter - Python. Create a new interpreter and point it to the Python interpreter executable.","Q_Score":18,"Tags":"python,ide","A_Id":4665424,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0906594778,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":5,"Answer":"Make sure you use 'Open With' as 'Python Editor' by right clicking on the file - It worked for me","Q_Score":18,"Tags":"python,ide","A_Id":17847161,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":0,"Answer":"Check your Theme configuration. Python highlighting uses Theme Colors","Q_Score":18,"Tags":"python,ide","A_Id":18933901,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":0,"Answer":"In case anyone else makes the embarrassing mistake that I did: be sure your source code file actually ends with \".py\". Even if its in a Python project, PyDev won't guess without the extension.","Q_Score":18,"Tags":"python,ide","A_Id":19301447,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":0,"Answer":"When syntax highlighting was not working for me using PyDev, I discovered that there were somehow two 'Python Editor' associations defined for .py files in my installation of Eclipse\/PyDev. From the Eclipse Main Menu, go to Window > Preferences > General > Editors > FileAssociations to see the file extension <-> editor mapping. I set a different one as default for .py files at the bottom of the dialog, and got syntax highlighting working again.","Q_Score":18,"Tags":"python,ide","A_Id":35208736,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":0.0,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":0,"Answer":"Well, I tried the Wing Professional and I think its really the best Py IDE out there.","Q_Score":18,"Tags":"python,ide","A_Id":495297,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":1.0,"is_accepted":false,"ViewCount":31316,"Q_Id":491053,"Users Score":13,"Answer":"The typical reason that code completion doesn't work under PyDev is that the libraries aren't in the PYTHONPATH. If you go into the Project Properties, and setup PyDev PYTHONPATH preferences to include the places where the code you are trying to complete lives, it will work just fine...\nProject > Properties > PyDev-PYTHONPAH > click 'Add source folder'","Q_Score":18,"Tags":"python,ide","A_Id":1836524,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it?\nKomodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. \nI prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please.\nIf I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion","AnswerCount":11,"Available Count":10,"Score":1.2,"is_accepted":true,"ViewCount":31316,"Q_Id":491053,"Users Score":23,"Answer":"To enable code completion, go to Window > Preferences > Pydev > Editor > Code Completion, and check the 'Use Code Completion?' box, as well as the other boxes for what you want to complete on. It seems to take a second to load, the first time it has to complete something.\nSyntax coloring should just work by default. Right-click on the file in the package explorer, go to 'Open With', and make sure you're opening it with the Python Editor, and not the regular Text Editor.\nI don't know exactly what you mean by importing external modules. I have my source in a separate directory structure on disk; my PyDev projects contain folders linked to those. Code completion works for that, as well as other modules like 'os'. If you're having troubles, are the modules added to the PyDev's Python search path (not necessarily the same as the regular one)?\nI took a brief look at Komodo and Wingware a while back, so I can't answer the second part of your question. But ended up going with PyDev. I'm not a big fan of Eclipse, but PyDev works reasonably well for me.","Q_Score":18,"Tags":"python,ide","A_Id":492073,"CreationDate":"2009-01-29T09:50:00.000","Title":"No code completion and syntax highlighting in Pydev","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a frame with a textctrl. When the mouse enters the textctrl (EVT_ENTER_WINDOW) I show a PopupWindow on top of the textctrl, and when the mouse leaves the popup (EVT_LEAVE_WINDOW) I hide it again.\nEverything works fine, except when inside the PopupWindow there's a ScrolledWindow with shown scrollbars. The EVT_LEAVE_WINDOW gets fired when I move the mouse on top of a scrollbar, so it looks like wxPython thinks the scrollbars are not part of the scrolledwindow.. :\/\nI tried binding the event to the popup or the scrollwindow itself, but nothing changes.. Is there a way I could get around this?\nMany thanks!\n(wxPython 2.8.8.0 on Xubuntu 8.10)","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":628,"Q_Id":492365,"Users Score":0,"Answer":"Since tooltips normally disappear when the user moves the mouse you could also bind to EVT_MOTION instead of EVT_LEAVE_WINDOW and hide the tooltip when the user moves the mouse.","Q_Score":1,"Tags":"wxpython,wxwidgets","A_Id":826451,"CreationDate":"2009-01-29T16:30:00.000","Title":"ScrolledWindow and wx.EVT_LEAVE_WINDOW","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a frame with a textctrl. When the mouse enters the textctrl (EVT_ENTER_WINDOW) I show a PopupWindow on top of the textctrl, and when the mouse leaves the popup (EVT_LEAVE_WINDOW) I hide it again.\nEverything works fine, except when inside the PopupWindow there's a ScrolledWindow with shown scrollbars. The EVT_LEAVE_WINDOW gets fired when I move the mouse on top of a scrollbar, so it looks like wxPython thinks the scrollbars are not part of the scrolledwindow.. :\/\nI tried binding the event to the popup or the scrollwindow itself, but nothing changes.. Is there a way I could get around this?\nMany thanks!\n(wxPython 2.8.8.0 on Xubuntu 8.10)","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":628,"Q_Id":492365,"Users Score":0,"Answer":"Robin Dunn told me: \"the same thing would happen with any other widgets that are on the scrolled window, just as the frame will get a EVT_LEAVE_WINDOW when the mouse moves into the scrolled window (assuming some portion of the frame was visible so it could have received an enter window event too)\"","Q_Score":1,"Tags":"wxpython,wxwidgets","A_Id":11717036,"CreationDate":"2009-01-29T16:30:00.000","Title":"ScrolledWindow and wx.EVT_LEAVE_WINDOW","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"in my python program to upload a file to the internet, im using a GTK progress bar to show the upload progress. But the problems that im facing is that the progress bar does not show any activity until the upload is complete, and then it abruptly indicates upload complete. im using pycurl to make the http requests...my question is -\ndo i need to have a multi-threaded application to upload the file and simultaneously update the gui? or is there some other mistake that im making? \nThanks in advance!","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":6986,"Q_Id":496814,"Users Score":1,"Answer":"More than likely the issue is that in your progress callback, which is where I presume you're updating the progress bar, you're not making a call to manually update the display i.e. run through the GUI's event loop. This is just speculation though, if you can provide more code, it might be easier to narrow it down further.\nThe reason you need to manually update the display is because your main thread is also performing the upload, which is where it's blocking.","Q_Score":9,"Tags":"python,user-interface,gtk,progress-bar,pygtk","A_Id":496995,"CreationDate":"2009-01-30T19:17:00.000","Title":"Progress bar not updating during operation","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a C extension module for Python and I want to make it available to Rubyists.\nThe source has a number of C modules, with only one being Python-dependent. The rest depend only on each other and the standard library. I can build it with python setup.py build in the usual way.\nI've been experimenting with adding Ruby support using newgem and I can build a version of the extension with rake gem. However, the combined source has an ugly directory layout (mixing Gem-style and Setuptools-style structures) and the build process is a kludge.\nI can't just keep all the sources in the same directory because mkmf automatically picks up the Python-dependent module and tries to build that, and users shouldn't have to install Python to compile a module that won't be used. My current hack is for extconf.rb to copy the Python-independent source-files into the same directory as the Ruby-dependent extension module.\nIs there a saner way to make the code available to both languages? Should I just duplicate the Python-independent code in a separate Gem? Should I release the independent code as a separate lib built with autotools? Is there a version of mkmf that can skip the unwanted module?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":734,"Q_Id":511412,"Users Score":5,"Answer":"One way to solve it is to create three different projects:\n\nThe library itself, independent on python & ruby\nPython bindings\nRuby bindings\n\nThat's probably the cleanest solution, albeit it requires a bit more work when doing releases, but it has the advantage that you can release a new version of the Ruby bindings without having to ship a new library\/python bindings version.","Q_Score":8,"Tags":"python,ruby,setuptools,newgem","A_Id":511871,"CreationDate":"2009-02-04T13:42:00.000","Title":"Combined Python & Ruby extension module","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been writing tools in Maya for years using MEL and Python. I'd consider myself an expert in custom window\/gui design in Maya except for one area; modifying existing panels and editors.\nTypically, I'm building tools that need totally custom UIs, so its customary for me to build them from scratch. However, recently I've found myself wanting to add some additional functionality to the layer editor in Maya. I've seen tutorials that explain how to do this, but now that I want to do it, I can't find any.\nLinks to tutorials or a brief code snippet to get me started would be great. I just need to know how to find the layer editor\/panel and, say, add a button or text field to it.","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":5048,"Q_Id":527314,"Users Score":1,"Answer":"Have you tried searching ui item names in MEL files under maya installation directory? It should be one of the MEL scripts included, and from there you can just modify it.","Q_Score":1,"Tags":"python,user-interface,maya,panels,mel","A_Id":551109,"CreationDate":"2009-02-09T07:05:00.000","Title":"How to modify existing panels in Maya using MEL or Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've got an wx App that has the UI defined in XRC files. Each form is in its own xrc file. There is one panel that is common to many of the forms. Is there a way to have objects defined in one file that are included and referenced in another?\nI know there is a object_ref mechanism, but I can't see how that can reference external xrc files.\nI'd like something that worked similar to the way you can define xsd elements in one file and include and reference them in another xsd file.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":260,"Q_Id":537774,"Users Score":1,"Answer":"XRC doesn't have an include mechanism that I know of, but you can have custom widgets.\nSo implement your common panel as its own XRC, and set that up as something that you can reference by class name in other xrc files.\nYou would create an XmlResourceHandler that handles the custom Panel in the XRC, and instantiates your Panel class. The place to look is demo\/wxXmlResourceHandler.py\nYou can even extend XRCed to recognize your own resource, and insert it into future dialogs with ease.","Q_Score":0,"Tags":"wxpython,wxwidgets,xrc","A_Id":598169,"CreationDate":"2009-02-11T16:58:00.000","Title":"Is there to include elements from one xrc file in another xrc file","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How to remove tkinter icon from title bar in it's window","AnswerCount":7,"Available Count":1,"Score":0.057080742,"is_accepted":false,"ViewCount":45549,"Q_Id":550050,"Users Score":2,"Answer":"Alternative to @ubomb's solution for adding custom images by utilizing Tkinter.PhotoImage's built-in support for processing .gif images.\nFrom file:\nicon = Tkinter.PhotoImage(file=\"logo.gif\")\nfrom base64:\ngif_base64_string = \"\"\" R0lGODdhEAAQAIcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4O Dg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEh ... 4B8AAP9Ci\/4HoLTpfwD+qV4NoHVAADs= \"\"\"\nicon = Tkinter.PhotoImage(data=gif_base64_string)\nVisit the undermentioned link for more details:\n\/\/effbot.org\/tkinterbook\/photoimage.htm","Q_Score":26,"Tags":"python,python-3.x,tkinter,tk","A_Id":52803981,"CreationDate":"2009-02-15T00:27:00.000","Title":"Removing the TK icon on a Tkinter window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For C++, Java, or Python, what are some good game + free game engines that are easy to pick up?\nAny type of game engine is okay. I just want to get started somewhere by looking into different game engines and their capabilities.","AnswerCount":14,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":10754,"Q_Id":564469,"Users Score":0,"Answer":"There is a RPG engine called VERGE if you're interested. Never tried it but I heard good things from it. \nI think it's in C++.","Q_Score":9,"Tags":"java,c++,python","A_Id":1949983,"CreationDate":"2009-02-19T09:05:00.000","Title":"What is a good & free game engine?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In a \"multitouch\" environement, any application showed on a surface can be rotated\/scaled to the direction of an user. Actual solution is to drawing the application on a FBO, and draw a rotated\/scaled rectangle with the texture on it. I don't think it's good for performance, and all graphics cards don't provide FBO.\nThe idea is to clip the rendering viewport in the direction of user.\nSince glViewport cannot be used for that, is another way exist to achieve that ?\n(glViewport use (x, y, width, height), and i would like (x, y, width, height, rotation from center?))\nPS: rotating the modelview or projection matrix will not help, i would like to \"rotate the clipping plan\" generated by glViewport. (only part of the all scene).","AnswerCount":2,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":3051,"Q_Id":577639,"Users Score":2,"Answer":"If you already have the code set up to render your scene, try adding a glRotate() call to the viewmodel matrix setup, to \"rotate the camera\" before rendering the scene.","Q_Score":2,"Tags":"python,math,opengl","A_Id":577672,"CreationDate":"2009-02-23T13:33:00.000","Title":"Rotating a glViewport?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In a \"multitouch\" environement, any application showed on a surface can be rotated\/scaled to the direction of an user. Actual solution is to drawing the application on a FBO, and draw a rotated\/scaled rectangle with the texture on it. I don't think it's good for performance, and all graphics cards don't provide FBO.\nThe idea is to clip the rendering viewport in the direction of user.\nSince glViewport cannot be used for that, is another way exist to achieve that ?\n(glViewport use (x, y, width, height), and i would like (x, y, width, height, rotation from center?))\nPS: rotating the modelview or projection matrix will not help, i would like to \"rotate the clipping plan\" generated by glViewport. (only part of the all scene).","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":3051,"Q_Id":577639,"Users Score":2,"Answer":"There's no way to have a rotated viewport in OpenGL, you have to handle it manually. I see the following possible solutions :\n\nKeep on using textures, perhaps using glCopyTexSubImage instead of FBOs, as this is basic OpenGL feature. If your target platforms are hardware accelerated, performance should be ok, depending on the number of viewports you need on your desk, as this is a very common use case nowadays.\nWithout textures, you could setup your glViewport to the screen-aligned bounding rectangle (rA) of your rotated viewport (rB) (setting also proper scissor testing area). Then draw a masking area, possibly only in depth or stencil buffer, filling the (rA - rB) area, that will prevent further drawing on those pixels. Then draw normally your application, using a glRotate to adjust you projection matrix, so that the rendering is properly oriented according to rB.","Q_Score":2,"Tags":"python,math,opengl","A_Id":593825,"CreationDate":"2009-02-23T13:33:00.000","Title":"Rotating a glViewport?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?","AnswerCount":4,"Available Count":4,"Score":0.1488850336,"is_accepted":false,"ViewCount":417,"Q_Id":595296,"Users Score":3,"Answer":"Yes, PyS60 is based on CPython, thus uses the C stack.","Q_Score":3,"Tags":"python,symbian,nokia,pys60","A_Id":595330,"CreationDate":"2009-02-27T15:48:00.000","Title":"Does the stack limit of Symbian also apply to PyS60?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?","AnswerCount":4,"Available Count":4,"Score":0.049958375,"is_accepted":false,"ViewCount":417,"Q_Id":595296,"Users Score":1,"Answer":"Increasing the Symbian stack size is done through a parameter in the mmp file.\nThis is valid when you create a native application that the toolchain will turn into an exe file.\nIf you were to upgrade the Python runtime on your phone, with a version you built yourself, you could increase the stack size of the runtime process itself.","Q_Score":3,"Tags":"python,symbian,nokia,pys60","A_Id":606180,"CreationDate":"2009-02-27T15:48:00.000","Title":"Does the stack limit of Symbian also apply to PyS60?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?","AnswerCount":4,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":417,"Q_Id":595296,"Users Score":0,"Answer":"I would assume that PyS60 should be doing the memory management for you, as your program will probably be constrained by the resources of PyS60.","Q_Score":3,"Tags":"python,symbian,nokia,pys60","A_Id":685145,"CreationDate":"2009-02-27T15:48:00.000","Title":"Does the stack limit of Symbian also apply to PyS60?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?","AnswerCount":4,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":417,"Q_Id":595296,"Users Score":1,"Answer":"There is a difference between python runtime and python apps. Also from PyS60 app developer point of view, it's the heapsize that's more interesting...\nVersion 1.9.5 comes by default with heapsize 100k min and 4M max. Of course you can define those by yourself when creating the SIS package to release and distribute your application.\nSorry if I answered right question with wrong answer (stack vs heap).\nStack is usually \"enough\", but with deep enough recursion you can run out of it. Have done it - and fixed some endless loops :) Never had any real stack problems. Usually it's the heap that runs out, esp with graphics manipulation.","Q_Score":3,"Tags":"python,symbian,nokia,pys60","A_Id":915134,"CreationDate":"2009-02-27T15:48:00.000","Title":"Does the stack limit of Symbian also apply to PyS60?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm hosting IronPython in a c#-based WebService to be able to provide custom extension scripts. However, I'm finding that memory usage sharply increases when I do simple load testing by executing the webservice repeatedly in a loop.\nIronPython-1.1 implemented IDisposable on its objects so that you can dispose of them when they are done. The new IronPython-2 engine based on the DLR has no such concept.\nFrom what I understood, everytime you execute a script in the ScriptEngine a new assembly is injected in the appdomain and can't be unloaded.\nIs there any way around this?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1344,"Q_Id":610128,"Users Score":0,"Answer":"Turns out, after aspnet_wp goes to about 500mb, the garbage collector kicks in and cleans out the mess. The memory usage then drops to about 20mb and steadily starts increasing again during load testing.\nSo there's no memory 'leak' as such.","Q_Score":2,"Tags":"performance,ironpython","A_Id":613533,"CreationDate":"2009-03-04T11:11:00.000","Title":"IronPython memory usage","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm hosting IronPython in a c#-based WebService to be able to provide custom extension scripts. However, I'm finding that memory usage sharply increases when I do simple load testing by executing the webservice repeatedly in a loop.\nIronPython-1.1 implemented IDisposable on its objects so that you can dispose of them when they are done. The new IronPython-2 engine based on the DLR has no such concept.\nFrom what I understood, everytime you execute a script in the ScriptEngine a new assembly is injected in the appdomain and can't be unloaded.\nIs there any way around this?","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1344,"Q_Id":610128,"Users Score":1,"Answer":"You could try creating a new AppDomain every time you run one of your IronPython scripts. Although assebmlies cannot be unloaded from memory you can unload an AppDomain and this will allow you to get the injected assembly out of memory.","Q_Score":2,"Tags":"performance,ironpython","A_Id":611623,"CreationDate":"2009-03-04T11:11:00.000","Title":"IronPython memory usage","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of a technical exercise on what can be done?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3214,"Q_Id":619437,"Users Score":0,"Answer":"cross-platform compatibility\n\nYes","Q_Score":28,"Tags":"python,interpreter,pypy","A_Id":619480,"CreationDate":"2009-03-06T16:25:00.000","Title":"What does PyPy have to offer over CPython, Jython, and IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of a technical exercise on what can be done?","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":3214,"Q_Id":619437,"Users Score":38,"Answer":"PyPy is really two projects:\n\nAn interpreter compiler toolchain allowing you to write interpreters in RPython (a static subset of Python) and have cross-platform interpreters compiled standalone, for the JVM, for .NET (etc)\nAn implementation of Python in RPython\n\nThese two projects allow for many things.\n\nMaintaining Python in Python is much easier than maintaining it in C\nFrom a single codebase you can generate Python interpreters that run on the JVM, .NET and standalone - rather than having multiple slightly incompatible implementations\nPart of the compiler toolchain includes an experimental JIT generator (now in its fifth incarnation and starting to work really well) - the goal is for a JITed PyPy to run much faster than CPython\nIt is much easier to experiment with fundamental language features - like removing the GIL, better garbage collection, integrating stackless and so on\n\nSo there are really a lot of reasons for PyPy to be exciting, and it is finally starting to live up to all its promises.","Q_Score":28,"Tags":"python,interpreter,pypy","A_Id":619544,"CreationDate":"2009-03-06T16:25:00.000","Title":"What does PyPy have to offer over CPython, Jython, and IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"wx (and wxPython) has two events I miss in PyQt: \n\nEVT_IDLE that's being sent to a frame. It can be used to update the various widgets according to the application's state\nEVT_UPDATE_UI that's being sent to a widget when it has to be repainted and updated, so I can compute its state in the handler\n\nNow, PyQt doesn't seem to have these, and the PyQt book suggests writing an updateUi method and calling it manually. I even ended up calling it from a timer once per 0.1 seconds, in order to avoid many manual calls from methods that may update the GUI. Am I missing something? Is there a better way to achieve this?\n\nAn example: I have a simple app with a Start button that initiates some processing. The start button should be enabled only when a file has been opened using the menu. In addition, there's a permanent widget on the status bar that displays information.\nMy application has states:\n\nBefore the file is opened (in this state the status bar show something special and the start button is disabled)\nFile was opened and processing wasn't started: the start button is enabled, status bar shows something else\nThe processing is running: the start button now says \"Stop\", and the status bar reports progress\n\nIn Wx, I'd have the update UI event of the button handle its state: the text on it, and whether it's enabled, depending on the application state. The same for the status bar (or I'd use EVT_IDLE for that).\nIn Qt, I have to update the button in several methods that may affect the state, or just create a update_ui method and call it periodically in a timer. What is the more \"QT\"-ish way?","AnswerCount":4,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":2691,"Q_Id":624050,"Users Score":1,"Answer":"As far as I understand EVT_IDLE is sent when application message queue is empty. There is no such event in Qt, but if you need to execute something in Qt when there are no pending events, you should use QTimer with 0 timeout.","Q_Score":2,"Tags":"python,qt,wxpython,pyqt","A_Id":624282,"CreationDate":"2009-03-08T18:26:00.000","Title":"wx's idle and UI update events in PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"wx (and wxPython) has two events I miss in PyQt: \n\nEVT_IDLE that's being sent to a frame. It can be used to update the various widgets according to the application's state\nEVT_UPDATE_UI that's being sent to a widget when it has to be repainted and updated, so I can compute its state in the handler\n\nNow, PyQt doesn't seem to have these, and the PyQt book suggests writing an updateUi method and calling it manually. I even ended up calling it from a timer once per 0.1 seconds, in order to avoid many manual calls from methods that may update the GUI. Am I missing something? Is there a better way to achieve this?\n\nAn example: I have a simple app with a Start button that initiates some processing. The start button should be enabled only when a file has been opened using the menu. In addition, there's a permanent widget on the status bar that displays information.\nMy application has states:\n\nBefore the file is opened (in this state the status bar show something special and the start button is disabled)\nFile was opened and processing wasn't started: the start button is enabled, status bar shows something else\nThe processing is running: the start button now says \"Stop\", and the status bar reports progress\n\nIn Wx, I'd have the update UI event of the button handle its state: the text on it, and whether it's enabled, depending on the application state. The same for the status bar (or I'd use EVT_IDLE for that).\nIn Qt, I have to update the button in several methods that may affect the state, or just create a update_ui method and call it periodically in a timer. What is the more \"QT\"-ish way?","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":2691,"Q_Id":624050,"Users Score":5,"Answer":"The use of EVT_UPDATE_UI in wxWidgets seems to highlight one of the fundamental differences in the way wxWidgets and Qt expect developers to handle events in their code.\nWith Qt, you connect signals and slots between widgets in the user interface, either handling \"business logic\" in each slot or delegating it to a dedicated method. You typically don't worry about making separate changes to each widget in your GUI because any repaint requests will be placed in the event queue and delivered when control returns to the event loop. Some paint events may even be merged together for the sake of efficiency.\nSo, in a normal Qt application where signals and slots are used to handle state changes, there's basically no need to have an idle mechanism that monitors the state of the application and update widgets because those updates should occur automatically.\nYou would have to say a bit more about what you are doing to explain why you need an equivalent to this event in Qt.","Q_Score":2,"Tags":"python,qt,wxpython,pyqt","A_Id":624734,"CreationDate":"2009-03-08T18:26:00.000","Title":"wx's idle and UI update events in PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing an IM client for Mac (in Python, but an Objective C \/ Cocoa solution here is fine). I want to detect whether or not the user is currently watching a movie or playing a game in the foreground, or doing anything else that takes up the entire screen. If so, I won't play a sound when a new IM comes in, but if not, I will play the sound.\nHow can I detect this? Is there some way to get the foreground window with Applescript and look at its dimensions? Or is there some other API call?","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1606,"Q_Id":633086,"Users Score":0,"Answer":"The two solutions posted so far apply to \u201creal\u201d full-screen, but it\u2019s worth noting that many full-screen apps just put a window over the whole screen (or, as vasi points out, a whole screen). To be accurate, you\u2019ll have to check both.","Q_Score":2,"Tags":"python,objective-c,cocoa,macos,fullscreen","A_Id":633718,"CreationDate":"2009-03-11T02:11:00.000","Title":"Detecting fullscreen on Mac","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?","AnswerCount":6,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":5022,"Q_Id":636990,"Users Score":6,"Answer":"If all you want is a GUI, wxPython should do the trick.\nIf you're looking to add sound, controller input, and take it beyond a simple card game, then you may want to use pygame.","Q_Score":6,"Tags":"python,wxpython,pygame,playing-cards","A_Id":637017,"CreationDate":"2009-03-12T00:53:00.000","Title":"wxPython or pygame for a simple card game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?","AnswerCount":6,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":5022,"Q_Id":636990,"Users Score":3,"Answer":"Generally, PyGame is the better option for coding games. But that's for the more common type of games - where things move on the screen and you must have a good \"frame-rate\" performance. \nFor something like a card game, however, I'd go with wxPython (or rather, PyQt). This is because a card game hasn't much in terms of graphics (drawing 2D card shapes on the screen is no harder in wx \/ PyQt than in PyGame). And on the other hand, you get lots of benefits from wx - like a ready-made GUI for interaction. \nIn Pygame you have to create a GUI yourself or wade through several half-baked libraries that do it for you. This actually makes sense for Pygame because when you create a game you usually want a GUI of your own, that fits the game's style. But for card games, most chances are that wx's standard GUI widgets will do the trick and will save you hours of coding.","Q_Score":6,"Tags":"python,wxpython,pygame,playing-cards","A_Id":640064,"CreationDate":"2009-03-12T00:53:00.000","Title":"wxPython or pygame for a simple card game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?","AnswerCount":6,"Available Count":3,"Score":0.0333209931,"is_accepted":false,"ViewCount":5022,"Q_Id":636990,"Users Score":1,"Answer":"I'd say pygame -- I've heard it's lots of fun, easy and happy. Also, all of my experiences with wxPython have been sad an painful.\nBut I'm not bias or anything.","Q_Score":6,"Tags":"python,wxpython,pygame,playing-cards","A_Id":637004,"CreationDate":"2009-03-12T00:53:00.000","Title":"wxPython or pygame for a simple card game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am planning to write an simple 3d(isometric view) game in Java using jMonkeyEngine - nothing to fancy, I just want to learn something about OpenGL and writing efficient algorithms (random map generating ones). \nWhen I was planning what to do, I started wondering about switching to Python. I know that Python didn't come into existence to be a tool to write 3d games, but is it possible to write good looking games with this language? \nI have in mind 3d graphics, nice effects and free CPU time to power to rest of game engine? I had seen good looking java games - and too be honest, I was rather shocked when I saw level of detail achieved in Runescape HD. \nOn the other hand, pygame.org has only 2d games, with some starting 3d projects. Are there any efficient 3d game engines for python? Is pyopengl the only alternative? Good looking games in python aren't popular or possible to achieve? \nI would be grateful for any information \/ feedback.","AnswerCount":8,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":17104,"Q_Id":641770,"Users Score":18,"Answer":"If you are worried about 3D performance: Most of the performance-critical parts will be handled by OpenGL (in a C library or even in hardware), so the language you use to drive it should not matter too much.\nTo really find out if performance is a problem, you'd have to try it. But there is no reason why it cannot work in principle.\nAt any rate, you could still optimize the critical parts, either in Python or by dropping to C. You still gain Python's benefit for most of the game engine which is less performance-critical.","Q_Score":16,"Tags":"python,opengl","A_Id":641832,"CreationDate":"2009-03-13T07:48:00.000","Title":"Can 3D OpenGL game written in Python look good and run fast?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am planning to write an simple 3d(isometric view) game in Java using jMonkeyEngine - nothing to fancy, I just want to learn something about OpenGL and writing efficient algorithms (random map generating ones). \nWhen I was planning what to do, I started wondering about switching to Python. I know that Python didn't come into existence to be a tool to write 3d games, but is it possible to write good looking games with this language? \nI have in mind 3d graphics, nice effects and free CPU time to power to rest of game engine? I had seen good looking java games - and too be honest, I was rather shocked when I saw level of detail achieved in Runescape HD. \nOn the other hand, pygame.org has only 2d games, with some starting 3d projects. Are there any efficient 3d game engines for python? Is pyopengl the only alternative? Good looking games in python aren't popular or possible to achieve? \nI would be grateful for any information \/ feedback.","AnswerCount":8,"Available Count":2,"Score":0.024994793,"is_accepted":false,"ViewCount":17104,"Q_Id":641770,"Users Score":1,"Answer":"There was a Vampires game out a few years ago where most if not all of the code was in Python. Not sure if the 3D routines were in them, but it worked fine.","Q_Score":16,"Tags":"python,opengl","A_Id":645987,"CreationDate":"2009-03-13T07:48:00.000","Title":"Can 3D OpenGL game written in Python look good and run fast?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I noticed that my programs written with wxPython have Win98 button style.\nBut Boa Constructor (that is written using wxPython too) got pretty buttons.\nHow to make buttons look like current Windows buttons style?","AnswerCount":4,"Available Count":2,"Score":-0.0996679946,"is_accepted":false,"ViewCount":1511,"Q_Id":642853,"Users Score":-2,"Answer":"Have you tried running your scripts with pythonw.exe instead of python.exe?","Q_Score":3,"Tags":"python,coding-style,wxpython","A_Id":642948,"CreationDate":"2009-03-13T14:01:00.000","Title":"WinXP button-style with wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I noticed that my programs written with wxPython have Win98 button style.\nBut Boa Constructor (that is written using wxPython too) got pretty buttons.\nHow to make buttons look like current Windows buttons style?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1511,"Q_Id":642853,"Users Score":0,"Answer":"The answers so far handle distributing the package as an executable (eg. py2exe), where the answer has already been given.\nBut since (i think) python 2.6 you have the same problem when just starting the .py file from the commandline (Vista and Windows7). Robin Dunn suggested using update_manifest.py which he distributes with wxPython and puts it in the same directory as python.exe.\nAfter applying update_manifest.py using a copied version of python.exe wxPython apps have the correct themed look and yes it also works using windows7 RC1.","Q_Score":3,"Tags":"python,coding-style,wxpython","A_Id":841710,"CreationDate":"2009-03-13T14:01:00.000","Title":"WinXP button-style with wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a C++ application that has embedded Python. I'm building with Visual Studio 2005. When I try to link to python26.lib, I get a number of unresolved symbols, all of which begin with \"__imp\":\nerror LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main\npython26.lib is an import library (installed by the Python 2.6 installer). What do I have to do to resolve these symbols? They do exist in the import library (dumpbin \/all shows them). Thanks.","AnswerCount":2,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":6181,"Q_Id":658879,"Users Score":2,"Answer":"Try to include C:\\WINDOWS\\system32\\python26.dll in your references. python26.lib contains the symbol names for the main DLL.","Q_Score":8,"Tags":"python,visual-studio,import,linker","A_Id":659107,"CreationDate":"2009-03-18T15:52:00.000","Title":"Linking to Python import library in Visual Studio 2005","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a C++ application that has embedded Python. I'm building with Visual Studio 2005. When I try to link to python26.lib, I get a number of unresolved symbols, all of which begin with \"__imp\":\nerror LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main\npython26.lib is an import library (installed by the Python 2.6 installer). What do I have to do to resolve these symbols? They do exist in the import library (dumpbin \/all shows them). Thanks.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":6181,"Q_Id":658879,"Users Score":13,"Answer":"Looks like I was trying to link a 64-bit Python library to a 32-bit application. I wish the linker would tell me something other than \"unresolved symbol.\" Linking to the 32-bit library fixes the problem.","Q_Score":8,"Tags":"python,visual-studio,import,linker","A_Id":660181,"CreationDate":"2009-03-18T15:52:00.000","Title":"Linking to Python import library in Visual Studio 2005","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time.\nIs there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates.\nThe technologies in question are just examples, but I want to stick with Python as far as possible.","AnswerCount":8,"Available Count":3,"Score":0.024994793,"is_accepted":false,"ViewCount":1574,"Q_Id":671741,"Users Score":1,"Answer":"There is a good book on wxPython, \"wxPython in Action\", which can't be said for some of the other solutions. No knock on the others. I've had success developing with wxPython in the past and it comes with a great set of demo applications with source code from which you can borrow liberally.\nThe best UI designer I found for wxPython applications is a commercial one, Anthemion DialogBlocks. It's by one of the wxPython programmers and is worth the money. Other solutions for UI design include wxGlade (I found it usable but not featureful) and Boa Constructor (haven't used it). Wing IDE might also have one. Stani's Python Editor bundles wxGlade, I believe. There are a lot of other projects that don't really work or are fairly old.\nAs far as SQL automation goes, as another answerer says, I'd look at SQL alchemy, but the learning curve for a small application might be too much and you'd be better off just going straight to odbc. The best odbc api is the one used by Django, pyodbc.\nIt's been a while since I developed with these tools, so there may be something newer for each, but at the time these were definitely the best of breed in my opinion.","Q_Score":7,"Tags":"python,user-interface,sqlite,gtk,glade","A_Id":691567,"CreationDate":"2009-03-22T22:49:00.000","Title":"Is there a Python library that allows to build user interfaces without writing much code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time.\nIs there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates.\nThe technologies in question are just examples, but I want to stick with Python as far as possible.","AnswerCount":8,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1574,"Q_Id":671741,"Users Score":0,"Answer":"I had lots of success with wxPython, but that was some years ago now and there may be better new solutions...","Q_Score":7,"Tags":"python,user-interface,sqlite,gtk,glade","A_Id":678000,"CreationDate":"2009-03-22T22:49:00.000","Title":"Is there a Python library that allows to build user interfaces without writing much code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time.\nIs there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates.\nThe technologies in question are just examples, but I want to stick with Python as far as possible.","AnswerCount":8,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":1574,"Q_Id":671741,"Users Score":4,"Answer":"PyQt and its models can automate some of these tasks for you (to some amount off course, e.g. filling widgets with data from a database and handling most of the widgets behaviour, buffering etc.).\nIf you want a more object-oriented approach to handling SQL you could look into an ORM-oriented solution (for example SQLAlchemy).","Q_Score":7,"Tags":"python,user-interface,sqlite,gtk,glade","A_Id":671752,"CreationDate":"2009-03-22T22:49:00.000","Title":"Is there a Python library that allows to build user interfaces without writing much code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"My next work is going to be heavily focused on working with data that is best understood when organized on a two-dimensional zoomable plane or canvas, instead of using lists and property forms.\nThe library can be based on OpenGL, GTK+ or Cairo. It should allow me to:\n\nbuild widgets out of vector shapes and text (perhaps even SVG based?)\narrange these widgets on a 2D plane\ncatch widget-related events\nzoom deeply into a widget to reveal additional data\narrange widgets in a tree\nanimate widgets fluidly\n\nIt wouldn't hurt if it would also allow for some databinding or model\/view concept.","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":802,"Q_Id":673434,"Users Score":3,"Answer":"Qt has this covered... check PyQt","Q_Score":3,"Tags":"python,user-interface,opengl,gtk,cairo","A_Id":673447,"CreationDate":"2009-03-23T13:51:00.000","Title":"Is there a Python library for easily writing zoomable UI's?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a continuation of my question Python2.5.2\nThe code i developed is working fine with clr.Addreference().\nNow thee problem is I have to load ny script which uses dll developed in .NET to another application.They had used QT for its implementation.There is a Script console in that application.When ii entered 'import clr' ,it was saying 'No module named clr' or 'Cannot import clr'.What shall i do?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":614,"Q_Id":680336,"Users Score":3,"Answer":"You won't be able to run your script in that application. The script console in that QT application doubtlessly uses plain ol' CPython instead of IronPython. There's no real good way to change that without significant surgery to the application that's hosting the python console.","Q_Score":0,"Tags":"python,ironpython","A_Id":680367,"CreationDate":"2009-03-25T05:34:00.000","Title":"Python 2.5.2 continued","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I hit this issue about two years ago when I first implemented our SWIG bindings. As soon as we exposed a large amount of code we got to the point where SWIG would output C++ files so large the compiler could not handle them. The only way I could get around the issue was to split up the interfaces into multiple modules and to compile them separately.\nThis has several downsides:\n\u2022 Each module must know about dependencies in other modules. I have a script to generate the interface files which handles this side of things, but it adds extra complexity.\n\u2022 Each additional module increases the time that the dynamic linker requires to load in the code. I have added an init.py file that imports all the submodules, so that the fact that the code is split up is transparent to the user, but what is always visible is the long load times.\nI'm currently reviewing our build scripts \/ build process and I wanted to see if I could find a solution to this issue that was better than what I have now. Ideally, I'd have one shared library containing all the wrapper code. \nDoes anyone know how I can acheive this with SWIG? I've seen some custom code written in Ruby for a specific project, where the output is post-processed to make this possible, but when I looked at the feasibility for Python wrappers it does not look so easy.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2117,"Q_Id":697749,"Users Score":0,"Answer":"If split properly, the modules don't necessarily need to have the same dependencies as the others - just what's necessary to do compilation. If you break things up appropriately, you can have libraries without cyclic dependencies. The issue with using multiple libraries is that by default, SWIG declares its runtime code statically, and as a result, as problems passing objects from one module to another. You need to enable a shared version of the SWIG runtime code.\nFrom the documentation (SWIG web page documentation link is broken):\n\nThe runtime functions are private to\n each SWIG-generated module. That is,\n the runtime functions are declared\n with \"static\" linkage and are visible\n only to the wrapper functions defined\n in that module. The only problem with\n this approach is that when more than\n one SWIG module is used in the same\n application, those modules often need\n to share type information. This is\n especially true for C++ programs where\n SWIG must collect and share\n information about inheritance\n relationships that cross module\n boundaries.\n\nCheck out that section in your downloaded documentation (section 16.2 The SWIG runtime code), and it'll give you details on how to enable this so that objects can be properly handled when passed from one module to the other.\nFWIW, I've not worked with Python SWIG, but have done Tcl SWIG.","Q_Score":9,"Tags":"c++,python,swig","A_Id":698089,"CreationDate":"2009-03-30T15:40:00.000","Title":"Is it possible to split a SWIG module for compilation, but rejoin it when linking?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wx.Frame, in which I have a vertical BoxSizer with two items, a TextCtrl and a custom widget. I want the custom widget to have a fixed pixel height, while the TextCtrl will expand normally to fill the window. What should I do?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2175,"Q_Id":730394,"Users Score":6,"Answer":"Got it.\nWhen creating the widget, use a size of (-1,100), where \"100\" is the height you want. Apparently the \"-1\" is a sort of \"None\" in this context.\nWhen adding the widget to the sizer, use a proportion of 0, like this:\nself.sizer.Add(self.timeline,0,wx.EXPAND)","Q_Score":2,"Tags":"python,layout,wxpython,widget","A_Id":730452,"CreationDate":"2009-04-08T14:53:00.000","Title":"wxPython: Making a fixed-height panel","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm kind of lost on how to approach this problem, I'd like to write a GUI ideally using Tkinter with python, but I initially started with Qt and found that the problem extends either with all GUI frameworks or my limited understanding.\nThe data in this case is coming from a named pipe, and I'd like to display whatever comes through the pipe into a textbox. I've tried having one thread listen on the pipe and another create the GUI, but in both cases one thread always seems to hang or the GUI never gets created. \nAny suggestions?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":641,"Q_Id":731759,"Users Score":0,"Answer":"When I did something like this I used a separate thread listening on the pipe. The thread had a pointer\/handle back to the GUI so it could send the data to be displayed.\nI suppose you could do it in the GUI's update\/event loop, but you'd have to make sure it's doing non-blocking reads on the pipe. I did it in a separate thread because I had to do lots of processing on the data that came through.\nOh and when you're doing the displaying, make sure you do it in non-trivial \"chunks\" at a time. It's very easy to max out the message queue (on Windows at least) that's sending the update commands to the textbox.","Q_Score":0,"Tags":"python,user-interface,named-pipes","A_Id":731919,"CreationDate":"2009-04-08T20:46:00.000","Title":"Showing data in a GUI where the data comes from an outside source","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm kind of lost on how to approach this problem, I'd like to write a GUI ideally using Tkinter with python, but I initially started with Qt and found that the problem extends either with all GUI frameworks or my limited understanding.\nThe data in this case is coming from a named pipe, and I'd like to display whatever comes through the pipe into a textbox. I've tried having one thread listen on the pipe and another create the GUI, but in both cases one thread always seems to hang or the GUI never gets created. \nAny suggestions?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":641,"Q_Id":731759,"Users Score":0,"Answer":"In the past when I've had GUI's reading data off of external things (eg: ethernet sockets), I've had a separate thread that handles servicing the external thing, and a timed callback (generally set to something like half a second) to update the GUI widget that displays the external data.","Q_Score":0,"Tags":"python,user-interface,named-pipes","A_Id":731927,"CreationDate":"2009-04-08T20:46:00.000","Title":"Showing data in a GUI where the data comes from an outside source","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just want the equivalent of closing and reopening my main program. I want to invoke it when a \"new\"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop.\nHow can I get this done?","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":6011,"Q_Id":731887,"Users Score":1,"Answer":"You could take all your GUI building logic and initial state code out of the mainloop and put it into functions. Call these functions from the mainloop (something like: buildgui() & initstate()) and then, when the user clicks your menu icon, just call initstate() to set it back like it was when the application first started.","Q_Score":3,"Tags":"python,tkinter","A_Id":732131,"CreationDate":"2009-04-08T21:14:00.000","Title":"Resetting the main GUI window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just want the equivalent of closing and reopening my main program. I want to invoke it when a \"new\"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop.\nHow can I get this done?","AnswerCount":3,"Available Count":3,"Score":0.2605204458,"is_accepted":false,"ViewCount":6011,"Q_Id":731887,"Users Score":4,"Answer":"There are at least three ways you can solve this. \nMethod one: the head fake. When you create your app, don't put all the widgets in the root window. Instead, hide the root window and create a new toplevel that represents your application. When you restart it's just a matter of destroying that new toplevel and re-running all your start-up logic.\nMethod two: nuke and pave. Similar in concept but slightly different in execution. In this model, when you want to restart you simply delete all the widgets in the main window, reset the geometry to null (so the window will once again resize itself based on its contents) and then run the logic that draws all the other widgets.\nMethod three: if it worked the first time... As suggested by Martin v. L\u00f6wis, simply have your program exec a new instance of the program, then exit. \nThe first two methods are potentially faster and have the (dis?)advantage of preserving the current environment. For example you could save the copy of the clipboard, column widths, etc. The third method absolutely guarantees a blank slate.","Q_Score":3,"Tags":"python,tkinter","A_Id":732529,"CreationDate":"2009-04-08T21:14:00.000","Title":"Resetting the main GUI window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just want the equivalent of closing and reopening my main program. I want to invoke it when a \"new\"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop.\nHow can I get this done?","AnswerCount":3,"Available Count":3,"Score":0.1325487884,"is_accepted":false,"ViewCount":6011,"Q_Id":731887,"Users Score":2,"Answer":"If you are on Unix, restart the entire application with os.execv. Make sure you pass all command line arguments etc.","Q_Score":3,"Tags":"python,tkinter","A_Id":732085,"CreationDate":"2009-04-08T21:14:00.000","Title":"Resetting the main GUI window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know I can call Tkinter.Tk().winfo_rgb(color) to get a tuple of values that represent the named color.\nfor instance Tkinter.Tk().winfo_rgb(\"red\") returns (65535, 0, 0)\nThe problem is it also opens a window. I was hoping to abstract some color calculations into a generic color class, and handle whether or not the class was instantiated with \"red\" or \"#ff0000\" or maybe even some other formats.\nWith the class abstracted, I don't have a tk parent to pull this info from without instantiating a new window, or passing in a parent.\nIs there any way to get this kind of color name \u2192 hex value conversion without having an instantiated Tk window?","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1348,"Q_Id":732192,"Users Score":0,"Answer":"Instantiate Tk(), run the code once, and then stick the information into your source as a dict literal?","Q_Score":2,"Tags":"python,colors,tkinter","A_Id":732452,"CreationDate":"2009-04-08T22:47:00.000","Title":"Get Tk winfo_rgb() without having a window instantiated","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a web-app using Python and Pylons. I need a textbox that is rich (ie, provides the ability to bold\/underline\/add bullets..etc...). Does anyone know a library or widget I can use?\nIt doesn't have to be Python\/Pylons specific, as it can be a Javascript implementation as well.\nThanks!","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":8362,"Q_Id":732429,"Users Score":1,"Answer":"webkit-gtk is getting very stable, and i believe has python bindings now so technically you could use that (then your text editor merely needs to be <\/body> and you'd be done. Unfortunately i'm not sure how complete its bindings are at present","Q_Score":4,"Tags":"javascript,python,http,pylons,widget","A_Id":732453,"CreationDate":"2009-04-09T00:52:00.000","Title":"HTML Rich Textbox","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I understood that in certain Windows XP programs, like Photoshop, there is something called \"scratch disks\". What I understood that this means, and please correct me if I'm wrong, is that Photoshop manages its own virtual memory on the hard-drive, instead of letting Windows manage it. I understood that the reason for this is some limitation by Windows XP on how much total memory a process can take, regardless of HD space. I think it's around 3 GB. Did I get it right so far?\nI am making an application in Python for running simulations. It will take a lot of memory, and will run on Windows XP. Is it possible for it to use scratch disks? How?","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":561,"Q_Id":737947,"Users Score":0,"Answer":"You are probably looking for something like ZODB. However, though ZODB tries hard to be transparent, no solution is going to be 100% free of artifacts. You have to write your code with an awareness that your objects primarily live in a database, but that there are multiple representations of your objects, there are caching\/syncing issues, etc. Nothing is going to make this very difficult problem completely trivial for you.","Q_Score":2,"Tags":"python,windows,memory-management","A_Id":4207006,"CreationDate":"2009-04-10T15:11:00.000","Title":"Scratch disks in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I understood that in certain Windows XP programs, like Photoshop, there is something called \"scratch disks\". What I understood that this means, and please correct me if I'm wrong, is that Photoshop manages its own virtual memory on the hard-drive, instead of letting Windows manage it. I understood that the reason for this is some limitation by Windows XP on how much total memory a process can take, regardless of HD space. I think it's around 3 GB. Did I get it right so far?\nI am making an application in Python for running simulations. It will take a lot of memory, and will run on Windows XP. Is it possible for it to use scratch disks? How?","AnswerCount":7,"Available Count":2,"Score":0.0285636566,"is_accepted":false,"ViewCount":561,"Q_Id":737947,"Users Score":1,"Answer":"Scratch disks will benefit your application in the case that it works with very big files, \nIs that the case? \nIf not, then i don't think you may find something that will benefit your application in scratch disks.","Q_Score":2,"Tags":"python,windows,memory-management","A_Id":737963,"CreationDate":"2009-04-10T15:11:00.000","Title":"Scratch disks in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've written a python CGI script that converts files into .jpgs and displays them in a simple HTML page. I don't want to clutter up the folders with these .jpg files, so I used tempfile.NamedTemporaryFile to create a file to store the converted .jpg output. Everything works great, but i want to remove this file after the page is displayed. Currently I have delete=False set, but i can't seem to remove the file without causing a broken img link.","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":510,"Q_Id":759271,"Users Score":3,"Answer":"You can't remove the file from your cgi script. Because the html page is send to the user only after your script finishes to run. And then the users browser parse the html and fetch the jpg file.\nThe simplest option is to write the temporary files to a sub directory and periodically clean that directory (living in it the last few minutes only). There are ways to improve this process but they are probably pointless.\nA more advanced option (which is also probably pointless, depending on your scenario) is to configure the web server to run a script on the \"get jpg\" request. And then you can stream the jpg through your script. That way you will know when the jpg was fetched. And in this script you can call a subscript asynchronically to delete the jpg file.","Q_Score":2,"Tags":"python,image,cgi","A_Id":759547,"CreationDate":"2009-04-17T06:37:00.000","Title":"How can I remove a temporary file (image) that is being displayed by CGI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing an editor which has lot of parameters that could be easily interacted with through text. I find it inconvenient to implement a separate text-editor or lots of UI code for every little parameter. Usual buttons, boxes and gadgets would be burdensome and clumsy. I'd much rather let user interact with those parameters through vim.\nThe preferable way for me would be to get editor open vim with my text buffer. Then, when one would save the text buffer in vim, my editor would get notified from that and update it's view.","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":300,"Q_Id":763372,"Users Score":6,"Answer":"Write your intermediate results (what you want the user to edit) to a temp file. Then use the $EDITOR environment variable in a system call to make the user edit the temp file, and read the results when the process finishes.\nThis lets users configure which editor they want to use in a pseudo-standard fashion.","Q_Score":1,"Tags":"python,linux,vim","A_Id":763426,"CreationDate":"2009-04-18T12:34:00.000","Title":"How to interact through vim?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"There are various ways to take screenshots of a running application in Windows. However, I hear that an application can be tailored such that it can notice when a screenshot is being taken of it, through some windows event handlers perhaps? Is there any way of taking a screenshot such that it is impossible for the application to notice? (Maybe even running the application inside a VM, and taking a screenshot from the host?) I'd prefer solutions in Python, but anything will do.","AnswerCount":4,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":3194,"Q_Id":767212,"Users Score":6,"Answer":"There will certainly be no protection against a screenshot taken with a digital camera.","Q_Score":0,"Tags":"python,windows,events,operating-system,screenshot","A_Id":767992,"CreationDate":"2009-04-20T07:11:00.000","Title":"Programmatically taking screenshots in windows without the application noticing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"There are various ways to take screenshots of a running application in Windows. However, I hear that an application can be tailored such that it can notice when a screenshot is being taken of it, through some windows event handlers perhaps? Is there any way of taking a screenshot such that it is impossible for the application to notice? (Maybe even running the application inside a VM, and taking a screenshot from the host?) I'd prefer solutions in Python, but anything will do.","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":3194,"Q_Id":767212,"Users Score":3,"Answer":"> I hear that an application can be tailored such that it can notice when a screenshot is being taken of it\nComplete nonsense.\nDon't repeat what kids say...\nRead MSDN about screenshots.","Q_Score":0,"Tags":"python,windows,events,operating-system,screenshot","A_Id":767985,"CreationDate":"2009-04-20T07:11:00.000","Title":"Programmatically taking screenshots in windows without the application noticing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Is there a way to force a gtk.Window object to ignore the Window Manager's show\/hide commands, such as \"iconify\" and \"show desktop?\"\nI'm trying to create a persistent window, stuck to the desktop, that will not disappear with all other windows when the desktop is exposed.\nEDIT: I guess what I'm wondering specifically is whether or not it's possible to reproduce the behavior found in applications such as docks, desktop widgets, system trays, etc. using PyGTK?","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1034,"Q_Id":769175,"Users Score":0,"Answer":"Not having received a \"this is how to do this\" answer and having done a bit more research I can say that -- as far as I know -- there is no easy way to achieve this sort of functionality with PyGTK. The best options are to set window manager hints and leave it up to the WM to do what you want (hopefully).","Q_Score":1,"Tags":"python,gtk,pygtk,x11","A_Id":1030408,"CreationDate":"2009-04-20T16:57:00.000","Title":"Persistent Windows in PyGTK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to force a gtk.Window object to ignore the Window Manager's show\/hide commands, such as \"iconify\" and \"show desktop?\"\nI'm trying to create a persistent window, stuck to the desktop, that will not disappear with all other windows when the desktop is exposed.\nEDIT: I guess what I'm wondering specifically is whether or not it's possible to reproduce the behavior found in applications such as docks, desktop widgets, system trays, etc. using PyGTK?","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1034,"Q_Id":769175,"Users Score":0,"Answer":"I think gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN) is what you want. It is also GDK_WINDOW_TYPE_HINT_DOCK, but then the window stay on top of all, and you can't send it back.","Q_Score":1,"Tags":"python,gtk,pygtk,x11","A_Id":5474070,"CreationDate":"2009-04-20T16:57:00.000","Title":"Persistent Windows in PyGTK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to force a gtk.Window object to ignore the Window Manager's show\/hide commands, such as \"iconify\" and \"show desktop?\"\nI'm trying to create a persistent window, stuck to the desktop, that will not disappear with all other windows when the desktop is exposed.\nEDIT: I guess what I'm wondering specifically is whether or not it's possible to reproduce the behavior found in applications such as docks, desktop widgets, system trays, etc. using PyGTK?","AnswerCount":5,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1034,"Q_Id":769175,"Users Score":2,"Answer":"You've got it backwards; it's not the window manager telling the window to minimize, by sending it a command. The window manager owns the window, if it wants to stop mapping a window, it will just do it, without asking the window for permission.\nSo I would think that the answer is \"no\".","Q_Score":1,"Tags":"python,gtk,pygtk,x11","A_Id":771431,"CreationDate":"2009-04-20T16:57:00.000","Title":"Persistent Windows in PyGTK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I defined an handler for EVT_IDLE that does a certain background task for me. (That task is to take completed work from a few processes and integrate it into some object, making a visible change in the GUI.)\nThe problem is that when the user is not moving the mouse or doing anything, EVT_IDLE doesn't get called more than once. I would like this handler to be working all the time. So I tried calling event.RequestMore() at the end of the handler. Works, but now it takes a whole lot of CPU. (I'm guessing it's just looping excessively on that task.)\nI'm willing to limit the number of times the task will be carried out per second; How do I do that?\nOr do you have another solution in mind?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1623,"Q_Id":783023,"Users Score":0,"Answer":"This sounds like a use case for wxTimerEvent instead of wxIdleEvent. When there is processing to do call wxTimerEvent.Start(). When there isn't any to do, call wxTimerEvent.Stop() and call your methods to do processing from EVT_TIMER.\n(note: i use from wxWidghets for C++ and am not familiar with wxPython but I assume they have a similar API)","Q_Score":3,"Tags":"python,wxpython","A_Id":783439,"CreationDate":"2009-04-23T18:45:00.000","Title":"wxPython: Using EVT_IDLE","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Has anyone done this? I've tried generating a c# proxy class and connecting through it, but I cannot figure out how to get IronPython to use the generated app.config file that defines the endpoint. It tries to connect, but I just get an error about no default endpoint. I would ideally like to make the connection using only IronPython code and not use the proxy class, if possible. The binding for the service I am trying to connect to is a NetTcpBinding if that makes any difference.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2231,"Q_Id":783120,"Users Score":0,"Answer":"Is your WCF service interface available in a shared assembly? If so, you could look at using the ChannelFactory to create your client proxy dynamically (instead of using the generated C# proxy). With that method you can supply all the details of the endpoint when you create the ChannelFactory and you won't require any configuration in your .config file.","Q_Score":2,"Tags":"wcf,ironpython","A_Id":783626,"CreationDate":"2009-04-23T19:08:00.000","Title":"How to connect to a WCF Service with IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use with Python 3.0?\nAny suggestions are welcomed.\nThanks!","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1811,"Q_Id":800769,"Users Score":0,"Answer":"Just use whichever editor you are most comfortable with.\nThe \"leading space as logic\" and duck typing mean that there is a limited amount of syntax checking and re-factoring an editor can reasonably do (or is required!) with python source.\nIf you dont have a favorite editor then just use the \"idle\" editor which comes with most python distributions.\nIf you were talking about a GUI design tool then you need to choose among the several supported GUIs (Tk, WxWindows etc. etc.) before you choose your design tool.","Q_Score":3,"Tags":"python,user-interface,python-3.x","A_Id":800794,"CreationDate":"2009-04-29T03:37:00.000","Title":"About GUI editor that would be compatible with Python 3.0","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use with Python 3.0?\nAny suggestions are welcomed.\nThanks!","AnswerCount":6,"Available Count":4,"Score":0.0333209931,"is_accepted":false,"ViewCount":1811,"Q_Id":800769,"Users Score":1,"Answer":"There are many useful libraries (not to mention educational material, cookbook snippets, etc.) that have yet to be ported to Python 3.0, so I recommend using Python 2.x for now (where, currently, 5 <= x <= 6). Doubly so if you're a beginner to Python. Triply so if you're actually planning on releasing some software--many systems do not ship with Python 3.0.\nPython 3.0 is not radically different from the Python 2.x series; what you learn in Python 2 will very much still apply to Python 3. Searching Python 3.0 here on SO reveals many threads in which the majority declare that they're not moving to Python 3.0 anytime soon.","Q_Score":3,"Tags":"python,user-interface,python-3.x","A_Id":800824,"CreationDate":"2009-04-29T03:37:00.000","Title":"About GUI editor that would be compatible with Python 3.0","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use with Python 3.0?\nAny suggestions are welcomed.\nThanks!","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1811,"Q_Id":800769,"Users Score":0,"Answer":"WING 3.2 beta work in python 3.\nricnar","Q_Score":3,"Tags":"python,user-interface,python-3.x","A_Id":800941,"CreationDate":"2009-04-29T03:37:00.000","Title":"About GUI editor that would be compatible with Python 3.0","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use with Python 3.0?\nAny suggestions are welcomed.\nThanks!","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1811,"Q_Id":800769,"Users Score":0,"Answer":"The only GUI toolkit currently available in Python3.0 is Tkinter, and I don't think there are any Python3.0 GUI-builders available yet.","Q_Score":3,"Tags":"python,user-interface,python-3.x","A_Id":800918,"CreationDate":"2009-04-29T03:37:00.000","Title":"About GUI editor that would be compatible with Python 3.0","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a little experience developing small command-line applications with Python. I want to move on to developing GUIs with Python. From the available GUI toolkits for Python, the ones I feel the most inclined to are wxPython and Tkinter; but I don't want to code all of the GUI by myself all of the time.\nAre there any good GUI IDEs for any of these toolkits? It doesn't need to be free or open source.","AnswerCount":8,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":70190,"Q_Id":800849,"Users Score":2,"Answer":"I use Eclipse with PyDev as my Python IDE (Which is probably not the best solution out there, but it is quite decent)\nFor GUI developement, I have used wxGlade for a mid-sized project and found it to be quite easy to use one you've grasped the concepts of WxPython. The XML generation is very useful for separating actual GUI design from program logic.\nAll of the these are free.","Q_Score":43,"Tags":"python,user-interface,ide,wxpython,tkinter","A_Id":17740395,"CreationDate":"2009-04-29T04:17:00.000","Title":"Nice IDE with GUI designer for wxPython or Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a little experience developing small command-line applications with Python. I want to move on to developing GUIs with Python. From the available GUI toolkits for Python, the ones I feel the most inclined to are wxPython and Tkinter; but I don't want to code all of the GUI by myself all of the time.\nAre there any good GUI IDEs for any of these toolkits? It doesn't need to be free or open source.","AnswerCount":8,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":70190,"Q_Id":800849,"Users Score":0,"Answer":"I've used wxGlade for a few mission-critical apps. If you're a little weak in wx, it can be rough, but once you get used to it, its a great tool.","Q_Score":43,"Tags":"python,user-interface,ide,wxpython,tkinter","A_Id":801176,"CreationDate":"2009-04-29T04:17:00.000","Title":"Nice IDE with GUI designer for wxPython or Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":1.2,"is_accepted":true,"ViewCount":3120,"Q_Id":816212,"Users Score":14,"Answer":"In general it's all of these things. Memory, speed, and probably most importantly programmer familiarity. Apple has a huge investment in Objective C, Java is known by basically everyone, and C# is very popular as well. If you're trying for mass programmer appeal it makes sense to start with something popular, even if it's sort of boring.\nThere aren't really any technical requirements stopping it. We could write a whole Ruby stack and let the programmer re-implement the slow bits in C and it wouldn't be that big of a deal. It would be an investment for whatever company is making the mobile OS, and at the end of the day I'm not sure they gain as much from this.\nFinally, it's the very beginning of mobile devices. In 5 years I wouldn't be at all surprised to see a much wider mobile stack.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816248,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":0,"Answer":"webOS -- the new OS from Palm, which will debut on the Pre -- has you write apps against a webkit runtime in JavaScript. Time will tell how successful it is, but I suspect it will not be the first to go down this path. As mobile devices become more powerful, you'll see dynamic languages become more prevalent.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":817560,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":0,"Answer":"Memory is also a significant factor. It's easy to eat memory in Python, unfortunately.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816228,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":0,"Answer":"There is a linux distribution for OpenMoko Freerunner called SHR. Most of its settings and framework code is written in python and... well, it isn't very fast. It is bearable, but it was planned from the beginning to rewrite it in Vala.\nOn the other side, my few smallish apps work fast enough (with the only drawback having big startup time) to consider python to develop user applications.\nFor the record: Freerunner has ARM-something 400MHz and 128MB of RAM. I guess that once mobile devices cross 1GHz, languages like Python will be fast enough for middle-level stuff too (the low-level being the kernel).","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":1077315,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0153834017,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":1,"Answer":"I think that performance concerns may be part of, but not all of, the reason. Mobile devices do not have very powerful hardware to work with.\nI am partly unsure about this, though.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816225,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0153834017,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":1,"Answer":"One of the most pressing matters is garbage collection. Garbage collection often times introduce unpredictable pauses in embedded machines which sometimes need real time performance.\nThis is why there is a Java Micro Edition which has a different garbage collector which reduces pauses in exchange for a slower program.\nRefcounting garbage collectors (like the one in CPython) are also less prone to pauses but can explode when data with many nested pointers (like a linked list) get deleted.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816233,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":0,"Answer":"There are many reasons. Among them:\n\nbusiness reasons, such as software lock-in strategies,\nefficiency: dynamic languages are usually perceived to be slower (and in some cases really are slower, or at least provide a limit to the amount of optimsation you can do. On a mobile device, optimising code is necessary much more often than on a PC), and tend to use more memory, which is a significant issue on portable devices with limited memory and little cache,,\nkeeping development simple: a platform that supports say Python and Ruby and Java out of the box:\n\n\nmeans thrice the work to write documentation and provide support,\ndivides development effort into three; it takes longer for helpful material to appear on the web and there are less developers who use the same language as you on your platform,\nrequires more storage on the device to support all these languages,\n\nmanagement need to be convinced. I've always felt that the merits of Java are easily explained to a non-technical audience. .Net and Obj-C also seem a very natural choice for a Microsoft and Apple platform, respectively.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816266,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0153834017,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":1,"Answer":"Jailbroken iPhones can have python installed, and I actually use python very frequently on mine.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816219,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I was wondering why smartphone\/mobile device OSs are not written to allow dynamic languages as the language of choice? iPhone uses Objective-C, Google Android uses Java, Windows Mobile uses any manner of .NET language.\nWhat would be the reasoning behind a mobile OS being written in Python, Ruby, or any other dynamic language? I understand that at a low level they would not cut it but C or C++ would be fine for that and Python, for example, could be the layer on top to interact with it. I mean, there is Jython or CPython.\nI was just wondering why we do not see more dynamic language support in today's mobile OS's.","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":3120,"Q_Id":816212,"Users Score":0,"Answer":"I suspect the basic reason is a combination of security and reliability. You don't want someone to be easily able to hack the phone, and you want to have some control over what's being installed.","Q_Score":10,"Tags":"python,ruby,mobile,operating-system,dynamic-languages","A_Id":816217,"CreationDate":"2009-05-03T03:09:00.000","Title":"Python\/Ruby as mobile OS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm beginner for the GUI programing using Tkinter, so who can tell me some useful sample codes which contains some useful codes.","AnswerCount":10,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1839,"Q_Id":818458,"Users Score":0,"Answer":"You have the source for idle. That shows useful tkinter code.","Q_Score":2,"Tags":"python,tkinter","A_Id":818490,"CreationDate":"2009-05-04T01:03:00.000","Title":"How can I begin with Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm beginner for the GUI programing using Tkinter, so who can tell me some useful sample codes which contains some useful codes.","AnswerCount":10,"Available Count":3,"Score":0.0599281035,"is_accepted":false,"ViewCount":1839,"Q_Id":818458,"Users Score":3,"Answer":"I used Manning's book on Tkinter, as someone else mentioned. The tutorials are very thorough, and you quickly get into the habit of thinking like a GUI coder. The New Mexico Tech worksheet is useful as a reference, but a bit too clumsy for a first resource.","Q_Score":2,"Tags":"python,tkinter","A_Id":7546018,"CreationDate":"2009-05-04T01:03:00.000","Title":"How can I begin with Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm beginner for the GUI programing using Tkinter, so who can tell me some useful sample codes which contains some useful codes.","AnswerCount":10,"Available Count":3,"Score":0.0399786803,"is_accepted":false,"ViewCount":1839,"Q_Id":818458,"Users Score":2,"Answer":"Mark Lutz's tome Programming Python deals at length with Tkinter. The Introduction to Tkinter ( effbot.org) and Tkinter reference: a GUI for Python (John Shipman, New Mexico Tech) are good summaries of the major features. I have read that the Tk\/Tcl manual is a good reference but that might be for later.","Q_Score":2,"Tags":"python,tkinter","A_Id":1035813,"CreationDate":"2009-05-04T01:03:00.000","Title":"How can I begin with Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm learning wxPython so most of the libraries and classes are new to me.\nI'm creating a Preferences dialog class but don't know the best way to make sure the OK\/Cancel (or Save\/Close) buttons are in the correct order for the platform. This program is intended to run both on GNOME and Windows, so I want to make sure that the buttons are in the correct order for each platform.\nDoes wxPython provide functionality that prevents me from doing a if platform.system() == 'Linux' kind of hack?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1095,"Q_Id":818942,"Users Score":4,"Answer":"The appearance of a dialog can change only if you use stock dialogs (like wx.FileDialog), if you make your own the layout will stay the same on every platform.\nwx.Dialog has a CreateStdDialogButtonSizer method that creates a wx.StdDialogButtonSizer with standard buttons where you might see differences in layout on different platforms but you don't have to use that.","Q_Score":2,"Tags":"python,user-interface,cross-platform,wxpython","A_Id":819026,"CreationDate":"2009-05-04T06:04:00.000","Title":"WxPython: Cross-Platform Way to Conform Ok\/Cancel Button Order","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm learning wxPython so most of the libraries and classes are new to me.\nI'm creating a Preferences dialog class but don't know the best way to make sure the OK\/Cancel (or Save\/Close) buttons are in the correct order for the platform. This program is intended to run both on GNOME and Windows, so I want to make sure that the buttons are in the correct order for each platform.\nDoes wxPython provide functionality that prevents me from doing a if platform.system() == 'Linux' kind of hack?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1095,"Q_Id":818942,"Users Score":0,"Answer":"There's the GenericMessageDialog widget that should do the right thing depending on the platform (but I've never used it so I'm not sure it does). See the wxPython demo. \nYou can also use the SizedControls addon library (it's part of wxPython). The SizedDialog class helps to create dialogs that conform to the Human Interface Guidelines of each platform. See the wxPython demo.","Q_Score":2,"Tags":"python,user-interface,cross-platform,wxpython","A_Id":819330,"CreationDate":"2009-05-04T06:04:00.000","Title":"WxPython: Cross-Platform Way to Conform Ok\/Cancel Button Order","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm learning wxPython so most of the libraries and classes are new to me.\nI'm creating a Preferences dialog class but don't know the best way to make sure the OK\/Cancel (or Save\/Close) buttons are in the correct order for the platform. This program is intended to run both on GNOME and Windows, so I want to make sure that the buttons are in the correct order for each platform.\nDoes wxPython provide functionality that prevents me from doing a if platform.system() == 'Linux' kind of hack?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1095,"Q_Id":818942,"Users Score":0,"Answer":"If you're going to use wx (or any other x-platform toolkit) you'd better trust that it does the right thing, mon!-)","Q_Score":2,"Tags":"python,user-interface,cross-platform,wxpython","A_Id":819110,"CreationDate":"2009-05-04T06:04:00.000","Title":"WxPython: Cross-Platform Way to Conform Ok\/Cancel Button Order","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using wx.FileDialog in a wxPython 2.8.8.0 application, under Xubuntu 8.10.. My problem is that this dialog isn't network-aware, so I can't browse Samba shares.\nI see that this problem plagues other applications too (Firefox, Audacious...) so I'd like to ask where I could find informations on how to make it work.\nIs that dialog supposed to be already network-aware? Am I missing something? Some library maybe? Or should I write my own implementation?\nMany thanks!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":276,"Q_Id":825724,"Users Score":0,"Answer":"Robin Dunn himself told me that\n\nIt's using the \"native\" GTK file\n dialog, just like the other apps, so \n there isn't anything that wx can do\n about it.\n\nSo as a workaround I ended up installing gvfs-fuse and browsing\nthe network through $HOME\/.gvfs.. A bit klunky but it works.","Q_Score":1,"Tags":"linux,ubuntu,wxpython","A_Id":876524,"CreationDate":"2009-05-05T16:22:00.000","Title":"Network-aware wx.FileDialog","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I got the impression that Panel is better. Is that true?\nWhat advantage does one have over the other? What reason is there to use one over the other?","AnswerCount":1,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":3627,"Q_Id":842208,"Users Score":20,"Answer":"wx.Window is the base class for all widgets (not necessarily all windows - the name is misleading).\nwx.Panel is a subclass of wx.Window, which is more tailored towards containing widgets inside it. For example, it by default allows moving between widgets using \"tab\", and handles a focus event in a way that is more useful with child widgets.","Q_Score":4,"Tags":"wxpython,wxwidgets","A_Id":843023,"CreationDate":"2009-05-08T23:10:00.000","Title":"wxPython: What is the difference between a wx.Panel and a wx.Window?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a vb.net application that has got 2 textboxes, 7 radio buttons and 2 buttons(one named compile and the other 'run'). How can I load the content of a C\/C++(or any programming language) file into the 1st textbox and on clicking the compile button, i should be able to show the errors or the C\/C++ program in the 2nd textbox. On clicking Run, I should be able to show the output in the 2nd textbox. In short, I want to use the 2nd textbox as a terminal\/console. The radio buttons are 4 selecting the language C or C++ or python or C# or java or perl or vb.\nAre the compilers of all these languages present in .net? If so how can I call them?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1053,"Q_Id":847860,"Users Score":1,"Answer":"Compiling can be done by calling cl.exe which comes with Visual Studio. Of course you could also use GCC instead.","Q_Score":1,"Tags":"c#,c++,python,c,vb.net","A_Id":847883,"CreationDate":"2009-05-11T12:24:00.000","Title":"How to write a vb.net code to compile C\/C++ programs?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've wanted to get into Python development for awhile and most of my programming experience has been in .NET and no mobile development. I recently thought of a useful app to make for my windows mobile phone and thought this could be a great first Python project. \nI did a little research online and found PyCe which I think is what I would need to get started on the app? Can anyone with some experience in this area point me in the right direction? What to download to get started, what lightweight database I could use, etc?\nThanks in advance!","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1216,"Q_Id":864887,"Users Score":1,"Answer":"Can't help you much with Python\\CE but if you want a great db for mobile devices SQLLite will do the job for you. If you do a quick google you'll find there are libraries for connecting to SQLLite with Python too.","Q_Score":0,"Tags":"python,windows-mobile,mobile-phones","A_Id":864988,"CreationDate":"2009-05-14T18:17:00.000","Title":"Beginning Windows Mobile 6.1 Development With Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"using Ruby or Python, does someone know how to draw on the screen, covering up any other window? Kind of like, press a key, and the program will show current weather or stock quote on the screen (using the whole screen as the canvas), and then press the key again, and everything restores to the same as before? (like Mac OS X's dash board).","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":179,"Q_Id":872737,"Users Score":1,"Answer":"I would recommend PyGame.","Q_Score":1,"Tags":"python,ruby,user-interface","A_Id":873925,"CreationDate":"2009-05-16T16:19:00.000","Title":"does someone know how to show content on screen (covering up any window) using Ruby or Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"using Ruby or Python, does someone know how to draw on the screen, covering up any other window? Kind of like, press a key, and the program will show current weather or stock quote on the screen (using the whole screen as the canvas), and then press the key again, and everything restores to the same as before? (like Mac OS X's dash board).","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":179,"Q_Id":872737,"Users Score":4,"Answer":"You could use the systems dashboard (desktop widgets, or whatever it's called) API. In order to do that you need bindings to it for Python or Ruby.\nAlternatively you could use some generic gui toolkit or application framework and just create a frameless window with transparent background. Then you need to be sure that the chosen toolkit supports 'always-on-top' options on your desired platform(s).","Q_Score":1,"Tags":"python,ruby,user-interface","A_Id":872757,"CreationDate":"2009-05-16T16:19:00.000","Title":"does someone know how to show content on screen (covering up any window) using Ruby or Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm sorry for the verbal description.\nI have a wxPython app in a file called applicationwindow.py that resides in a package called garlicsimwx. When I launch the app by launching the aforementioned file, it all works well. However, I have created a file rundemo.py in a folder which contains the garlicsimwx package, which runs the app as well. When I use rundemo.py, the app launches, however, when the main wx.Frame imports a sub-package of garlicsimwx, namely simulations.life, for some reason a new instance of my application is created (i.e., a new identical window pops out.)\nI have tried stepping through the commands one-by-one, and although the bug happens only after importing the sub-package, the import statement doesn't directly cause it. Only when control returns to PyApp.MainLoop the second window opens.\nHow do I stop this?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":223,"Q_Id":874856,"Users Score":0,"Answer":"You could create a global boolean variable like g_window_was_drawn and check it in the function that does the work of creating a window. The value would be false at the start of the program and would change to True when first creating a window. The function that creates the window would check if the g_window_was_drawn is already true, and if it is, it would throw an exception. Then You will have a nice stacktrace telling You who is responsible of executing this function.\nI hope that helps You find it. I'm sorry for the verbal solution ;)","Q_Score":0,"Tags":"python,import,wxpython","A_Id":875039,"CreationDate":"2009-05-17T15:45:00.000","Title":"wxPython launches my app twice when importing a sub-package","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"My PyQt application that uses matplotlib takes several seconds to load for the first time, even on a fast machine (the second load time is much shorter as the DLLs are kept in memory by Windows).\nI'm wondering whether it's feasible to show a splash screen while the matplotlib library is being loaded. Where does the actual loading take place - is it when the from line is executed? If so, how can I make this line execute during the splash screen and still be able to use the module throughout the code?\nA related dilemma is how to test this - can I ask Windows to load the DLLs for every execution and not cache them?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3080,"Q_Id":876107,"Users Score":3,"Answer":"Yes, loading the module takes place at the line where the import statement is. If you create your QApplication and show your splash screen before that, you should be able to do what you want -- also you need to call QApplication.processEvents() whenever you need the splash screen to update with a new message.","Q_Score":4,"Tags":"python,performance,matplotlib,pyqt","A_Id":876151,"CreationDate":"2009-05-18T03:15:00.000","Title":"PyQt: splash screen while loading \"heavy\" libraries","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython program with two processes: A primary and a secondary one (I'm using the multiprocessing module.) The primary one runs the wxPython GUI, the secondary one does not. However, there is something I would like to do from the secondary process: Given a string that describes a color, to check whether this would be legitimate color for wxPython. That means, whether I can create a wx.Pen(color_string) or not.\nHow do I do this?\n(I tried making a wx.Pen and comparing its color to the null color, but that required to create a wx.App in the second process, and when I did create one the program raised an error in some special wxPython window.)","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":670,"Q_Id":883348,"Users Score":1,"Answer":"You could make two Queues between the two processes and have the second one delegate wx-related functionality to the first one (by pushing on the first queue the parameters of the task to perform, and waiting for the result on the second one).","Q_Score":0,"Tags":"python,wxpython,multiprocessing","A_Id":883451,"CreationDate":"2009-05-19T15:09:00.000","Title":"wxPython + multiprocessing: Checking if a color string is legitimate","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am creating a custom wxPython dialog by subclassing wx.Dialog. When I press Enter while using it, (and while being focused on one of the form elements,) it just takes the focus to the next form element, while I want it to press the ok button.\nHow do I solve this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1846,"Q_Id":885294,"Users Score":5,"Answer":"That should happen automatically if the button has the wx.ID_OK id. If that's impossible then the wx.StdDialogButtonSizer.SetAffirmativeButton() method could be a solution (using the StdDialogButtonSizer class will help with correct button placement and positioning on the different platforms), and there is also wx.Button.SetDefault().","Q_Score":3,"Tags":"python,keyboard,wxpython","A_Id":885307,"CreationDate":"2009-05-19T22:13:00.000","Title":"wxPython dialogs: \"Enter\" keyboard button would not \"ok\" the dialog","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I posted this in the mailing list, but the reply I got wasn't too clear, so maybe I'll have better luck here.\nI currently have a grid with data in it.\nI would like to know if there is a way to give each generated row an\nID, or at least, associate each row with an object.\nIt may make it more clear if I clarify what i'm doing. It is described\nbelow.\nI pull data from an SQL table and display them in the grid.\nI am allowing for the user to add\/delete rows and edit cells.\nSay the user is viewing a grid that has 3 rows(which is, in turn, a\nmysql table with 3 rows).\nIf he is on the last row and presses the down arrow key, a new row is\ncreated and he can enter data into it and it will be inserted in the\ndatabase when he presses enter.\nHowever, I need a way to find out which rows will use \"insert\" query\nand which will use \"update\" query.\nSo ideally, when the user creates a new row by pressing the down\narrow, I would give that row an ID and store it in a list(or, if rows\nalready have IDs, just store it in a list) and when the user finishes\nentering data in the cells and presses enter, I would check if that\nrow's ID is in the in the list. If it is, i would insert all of that\nrow's cells values into the table, if not, i would update mysql with\nthe values.\nHope I made this clear.","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":1026,"Q_Id":901704,"Users Score":3,"Answer":"What I did when I encountered such a case was to create a column for IDs and set its width to 0.","Q_Score":2,"Tags":"python,wxpython,wxwidgets","A_Id":901806,"CreationDate":"2009-05-23T15:13:00.000","Title":"Give Wxwidget Grid rows an ID","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.\nEDIT:: im on a windows vista 64-bit","AnswerCount":7,"Available Count":6,"Score":0.0285636566,"is_accepted":false,"ViewCount":1819,"Q_Id":913204,"Users Score":1,"Answer":"I would assume it'd be the same as running two versions of 2.x; as long as they're each in their own directory you should be OK.","Q_Score":3,"Tags":"python,python-3.x","A_Id":913212,"CreationDate":"2009-05-26T23:02:00.000","Title":"Is it possible to install python 3 and 2.6 on same PC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.\nEDIT:: im on a windows vista 64-bit","AnswerCount":7,"Available Count":6,"Score":0.0285636566,"is_accepted":false,"ViewCount":1819,"Q_Id":913204,"Users Score":1,"Answer":"You certainly can. On Mac Ports, there's a tool called python_select that lets you switch among python versions; if nothing like it exists on Windows (momentary googling didn't reveal one), it could certainly be written.","Q_Score":3,"Tags":"python,python-3.x","A_Id":913222,"CreationDate":"2009-05-26T23:02:00.000","Title":"Is it possible to install python 3 and 2.6 on same PC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.\nEDIT:: im on a windows vista 64-bit","AnswerCount":7,"Available Count":6,"Score":0.0855049882,"is_accepted":false,"ViewCount":1819,"Q_Id":913204,"Users Score":3,"Answer":"Typically python is installed with a name like python2.6, so you can have more than one. There may be a symlink from python to one of the numbered files. Quite workable.","Q_Score":3,"Tags":"python,python-3.x","A_Id":913225,"CreationDate":"2009-05-26T23:02:00.000","Title":"Is it possible to install python 3 and 2.6 on same PC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.\nEDIT:: im on a windows vista 64-bit","AnswerCount":7,"Available Count":6,"Score":0.057080742,"is_accepted":false,"ViewCount":1819,"Q_Id":913204,"Users Score":2,"Answer":"Yes, it is possible. \nI maintain 3 python installations (2.5, 2.6, 3.0). The only issue that could be confusing is figuring out which Python version takes precedence in PATH variable (if any) . To execute a script for a specific version, you would go into the python directory for that version\nC:\\Python25\\ , C:\\Python26\\, C:\\Python30\\, etc. \nDrop the file in there, and run \"python.exe file.py\" from command-line.\nYou could even rename each python.exe to python25.exe python26.exe python30.exe and have each directory in PATH so it would be easy to execute any script on any version.","Q_Score":3,"Tags":"python,python-3.x","A_Id":913269,"CreationDate":"2009-05-26T23:02:00.000","Title":"Is it possible to install python 3 and 2.6 on same PC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.\nEDIT:: im on a windows vista 64-bit","AnswerCount":7,"Available Count":6,"Score":0.0855049882,"is_accepted":false,"ViewCount":1819,"Q_Id":913204,"Users Score":3,"Answer":"Erm... yes. I just installed Python 3.0 on this computer to test it. You haven't specified your operating system, but I'm running Ubuntu 9.04 and I can explicitly specify the version of Python I want to run by typing python2.5 myscript.py or python3.0 myscript.py, depending on my needs.","Q_Score":3,"Tags":"python,python-3.x","A_Id":913223,"CreationDate":"2009-05-26T23:02:00.000","Title":"Is it possible to install python 3 and 2.6 on same PC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.\nEDIT:: im on a windows vista 64-bit","AnswerCount":7,"Available Count":6,"Score":1.2,"is_accepted":true,"ViewCount":1819,"Q_Id":913204,"Users Score":9,"Answer":"If you are on Windows, then just install another version of Python using the installer. It would be installed into another directory.\nThen if you install other packages using the installer, it would ask you for which python installation to apply. If you use installation from source or easy_install, then just make sure that when you install, you are using the one of the proper version.\nIf you have many packages installed in your current python-3, then just make a zip backup of your current installation just in case.","Q_Score":3,"Tags":"python,python-3.x","A_Id":913216,"CreationDate":"2009-05-26T23:02:00.000","Title":"Is it possible to install python 3 and 2.6 on same PC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":0.0767717131,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":5,"Answer":"The answer to what I think your specific question is, \"... in pure Python ...\" the answer is NO.\nPython is not fast enough to call OpenGL or DirectX efficently enough to re-create World Of Warcraft at an exceptable frame rate.\nLike many others have answered, given some high level frame work, it would be possible to use Python has the scripting language but at a minimum you'd need some kind of graphics system written in another language like C++ to handle the graphics. For networking, given that WoW is not an action game, you might be able to get away with pure python but most likely that part as well would need to be some non-python library.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":1360670,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":0.0307595242,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":2,"Answer":"As a technologist I know:\nIf it can be written in C\\C++ it can be written in assembly (though it will take longer).\nIf it can be written in C\\C++ and is not a low-level code - it can be written in any managed environment.\nWoW is a high-level program that is written in C\\C++\npython is a managed environment\nThere for:\nWoW can be written in python and so any other MMORPG in 3D...\n\nThe hardest part will be the 3d engine for it is the \"heaviest\" part of code - you will need to use an outside engine (written in C\\C++\\Assebly) or to write one and optimize it (not recommended)","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":1656715,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":0.0614608973,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":4,"Answer":"I have been trying my hand at writing 3D games in Python, and given a good rendering framework (my favourite is OGRE) and decent bindings, it is amazing what you can get away with. However, especially with games, you are always trying to squeeze as much as you can out of the hardware. The performance disadvantage of python eventually will make itself felt.\nThe main problem I ran into using python is its massive call overhead. Calling python functions, even from other python functions is very expensive. In a way, it's the price you pay for the dynamic nature of python. When you use the function call operator \"()\" on a symbol, it has to work out whether it's a function or a class, look over the method resolution order, handle the keyword arguments, etc etc. All these things are done ahead of time in less dynamic (compiled) languages.\nI have seen people trying to overcome this problem by manually inlining function calls. I do not have to tell you that this medicine is worse than the ailment.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":1656654,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":0.0307595242,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":2,"Answer":"Just because it might give an interesting read, Civilization is partly written using Python.\nA google on it returns interesting reading material.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":930968,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":0,"Answer":"Because Python is interpreted there would be a performance hit, as opposed to C\/C++, but, you would want to use something like PyOpenGL instead of DirectX though, to run on more operating systems.\nBut, I don't see why you couldn't write such a game in Python.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":916693,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":1.0,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":6,"Answer":"Yes, you could write it in assembly, or Java, or Python, or brainfuck. It's just how much time you are willing to put into it. Language performance's aren't a major issue anymore, it's more about which algorithms you use, not what language you use.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":916704,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":1.0,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":9,"Answer":"Technically, anything is possible in any Turing Complete programming language.\nPractically though, you will run into trouble making the networking stack out of a high level language, because the server will have to be VERY fast to handle so many players. \nThe gaming side of things on the client, there should be no problem, because there is nothing too complicated about GUIs or quests or keyboard input and what have you. \nThe problems will be in whatever is computationally intensive up on the server. Anything that happens in human-time like logging on will probably be just fine, but if somemthing needs to be instantaneous over ten thousand users, you might want to go for an external library done up in C. \nNow some Python guru is going to come out of the woodwork and rip my head off because, as I said at the top, technically, anything can be done with enough effort.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":916701,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":1.0,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":17,"Answer":"Yes. How it will perform is another question.\nA good development pattern would be to develop it in pure python, and then profile it, and rewrite performance-critical bottlenecks, either in C\/C++\/Cython or even python itself but with more efficient code.","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":916686,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?\nAssuming the use of DirectX \/ D3D bindings or OpenGL bindings.\nIf not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit!\nAny information would help satisfy my curiosity.\nEdit:\nWould the GIL post a major issue on 3d client performance? And what is the general performance penalty for using say, OpenGL or DirectX bindings vs natively using the libraries?","AnswerCount":13,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":10718,"Q_Id":916663,"Users Score":0,"Answer":"Python is not interpreted - it is tokenized\/'just in time' bytecode 'interpreted' and it doesn't have a VM like Java does. This means, in english, it can be daaaaaamnfast. Not all the time though, it depends on the problem and the libraries, but python is not slow, this is a common misconception even among knowledgable people (and that includes deep java engine folks who have just not gone and tried python).","Q_Score":12,"Tags":"python,3d,direct3d","A_Id":1316198,"CreationDate":"2009-05-27T16:16:00.000","Title":"Would it be possible to write a 3D game as large as World of Warcraft in pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The tutorials I've found on WxPython all use examples from Linux, but there seem to be differences in some details.\nFor example, in Windows a Panel behind the widgets is mandatory to show the background properly. Additionally, some examples that look fine in the tutorials don't work in my computer.\nSo, do you know what important differences are there, or maybe a good tutorial that is focused on Windows?\nEDIT: I just remembered this: Does anybody know why when subclassing wx.App an OnInit() method is required, rather than the more logical __init__()?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2618,"Q_Id":916987,"Users Score":0,"Answer":"EDIT: I just remembered this: Does anybody know why when subclassing wx.App an OnInit() method is required, rather than the more logical __init__()?\n\nI use OnInit() for symmetry: there's also an OnExit() method.\nEdit: I may be wrong, but I don't think using OnInit() is required.","Q_Score":1,"Tags":"python,windows,linux,user-interface,wxpython","A_Id":917040,"CreationDate":"2009-05-27T17:16:00.000","Title":"WxPython differences between Windows and Linux","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The tutorials I've found on WxPython all use examples from Linux, but there seem to be differences in some details.\nFor example, in Windows a Panel behind the widgets is mandatory to show the background properly. Additionally, some examples that look fine in the tutorials don't work in my computer.\nSo, do you know what important differences are there, or maybe a good tutorial that is focused on Windows?\nEDIT: I just remembered this: Does anybody know why when subclassing wx.App an OnInit() method is required, rather than the more logical __init__()?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2618,"Q_Id":916987,"Users Score":0,"Answer":"I find a number of small differences, but don't remember all of them. Here are two:\n1) The layout can be slightly different, for example, causing things to not completely fit in the window in one OS when the do in the other. I haven't investigated the reasons for this, but it happens most often when I use positions rather than sizers to arrange things.\n2) I have to explicitly call Refresh more in Windows. For example, if you place one panel over another, you won't see it the top panel in Windows until you call Refresh.\nI general, I write apps in Linux and run them in Windows, and things work similarly enough so this is a reasonable approach, but it's rare for me when something runs perfectly straight out of the gate after an OS switch.","Q_Score":1,"Tags":"python,windows,linux,user-interface,wxpython","A_Id":935519,"CreationDate":"2009-05-27T17:16:00.000","Title":"WxPython differences between Windows and Linux","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm am trying to roll out a test application to test the feasibility of righting a Click Once Smart Client app that also uses a rules engine customizable by embedding IronPython.\nSo far all users but me get this error (below) when invoking the script engine.\nDo I need to do something special to force deployment of the IronPython and Scripting assemblies? I thought that would be automatic because they were referenced in my project.\nIs this just not feasible in .NET 2.0? \nThoughts?\n\n************** Exception Text **************\nSystem.MissingMethodException: Method not found: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'.\n at Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes)\n at Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes)\n at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompiler(CompilerScope scope, String methodName, Type returnType, IList`1 paramTypes, IList`1 paramNames, Boolean closure, Boolean emitDebugSymbols, Boolean forceDynamic)\n at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpression lambda, Type delegateType, Boolean emitDebugSymbols, Boolean forceDynamic, MethodInfo& method)\n at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T](LambdaExpression lambda, Boolean emitDebugSymbols)\n at Microsoft.Linq.Expressions.LambdaExpression.Compile[T](Boolean emitDebugSymbols)\n at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope)\n at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink)\n at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)\n at UAP.UI.Form1.button1_Click(Object sender, EventArgs e)\n at System.Windows.Forms.Control.OnClick(EventArgs e)\n at System.Windows.Forms.Button.OnClick(EventArgs e)\n at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\n at System.Windows.Forms.Control.WndProc(Message& m)\n at System.Windows.Forms.ButtonBase.WndProc(Message& m)\n at System.Windows.Forms.Button.WndProc(Message& m)\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\n at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1241,"Q_Id":922681,"Users Score":0,"Answer":"If you right click your project and go to Properties theres a Publish tab, that allows you to specify prerequisite installs for your application.\nPresumably you can supply a path to the IronPython install executable here.","Q_Score":2,"Tags":"c#,.net,scripting,ironpython","A_Id":922701,"CreationDate":"2009-05-28T19:14:00.000","Title":"IronPython, Click Once, .NET 2.0 Error - thoughts?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm am trying to roll out a test application to test the feasibility of righting a Click Once Smart Client app that also uses a rules engine customizable by embedding IronPython.\nSo far all users but me get this error (below) when invoking the script engine.\nDo I need to do something special to force deployment of the IronPython and Scripting assemblies? I thought that would be automatic because they were referenced in my project.\nIs this just not feasible in .NET 2.0? \nThoughts?\n\n************** Exception Text **************\nSystem.MissingMethodException: Method not found: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'.\n at Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes)\n at Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes)\n at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompiler(CompilerScope scope, String methodName, Type returnType, IList`1 paramTypes, IList`1 paramNames, Boolean closure, Boolean emitDebugSymbols, Boolean forceDynamic)\n at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpression lambda, Type delegateType, Boolean emitDebugSymbols, Boolean forceDynamic, MethodInfo& method)\n at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T](LambdaExpression lambda, Boolean emitDebugSymbols)\n at Microsoft.Linq.Expressions.LambdaExpression.Compile[T](Boolean emitDebugSymbols)\n at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope)\n at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink)\n at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)\n at UAP.UI.Form1.button1_Click(Object sender, EventArgs e)\n at System.Windows.Forms.Control.OnClick(EventArgs e)\n at System.Windows.Forms.Button.OnClick(EventArgs e)\n at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\n at System.Windows.Forms.Control.WndProc(Message& m)\n at System.Windows.Forms.ButtonBase.WndProc(Message& m)\n at System.Windows.Forms.Button.WndProc(Message& m)\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\n at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)","AnswerCount":2,"Available Count":2,"Score":0.3799489623,"is_accepted":false,"ViewCount":1241,"Q_Id":922681,"Users Score":4,"Answer":"IronPython requiers .NET 2.0SP1 or later to run. This exception is happening due to an overload that was added in SP1.","Q_Score":2,"Tags":"c#,.net,scripting,ironpython","A_Id":923395,"CreationDate":"2009-05-28T19:14:00.000","Title":"IronPython, Click Once, .NET 2.0 Error - thoughts?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to code up a panel that will be used both in Linux and Windows. Ideally it will be written in Python using PyQT.\nWhat I've found so far is the QSystemTrayIcon widget, and while that is quite useful, that's not quite what I'm looking for. That widget lets you attach a menu to the left and right clicks of an icon on the system tray and then you can have a dialog open in certain situations.\nI'm looking for something that will let me write up something like the tools that Gnome lets you add to the taskbar (they call them panels). Such as a weather feed, or processor usage, right on the taskbar. And also not in the system tray area.\nI'm writing more of a tool than something reflects a status.\nI know that I could write this natively in both OSes using GTK and its ilk, but anyway to write in PyQT or WxWidget so I don't have to deal with dependancy issues?","AnswerCount":2,"Available Count":1,"Score":0.4621171573,"is_accepted":false,"ViewCount":1572,"Q_Id":923701,"Users Score":5,"Answer":"Widgets inside the GNOME panel are called applets, and to my knowledge it's not possible to write them with anything but Gtk, since you have to use the respective GNOME library libpanel-applet (in either C, C++ or Python). \nSystem tray icons are different, because they only allow icons to be displayed inside the notification area, since Windows only supports icons there. \nThe panel mechanism on Windows (Vista, XP does only have the notification area) is quite different, I would assume. Unless somebody already wrote a library that abstracts the differences of the GNOME panel and the Vista side bar, you would have to do that yourself.","Q_Score":4,"Tags":"python,qt4,pyqt","A_Id":923757,"CreationDate":"2009-05-28T23:28:00.000","Title":"Python taskbar applet","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to change the look of my Ironpython windows forms, Is it possible to change the style of the form and for example make it more like a Mac?\nthank you","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":706,"Q_Id":931580,"Users Score":0,"Answer":"As an interface designer, it's important to use an many standard windows controls as possible. The more your app looks like the microsoft ones users are used to, they will become more comfortable with it quicker. \nA good example is how out of place iTunes and Safari look in windows. My tip is to just keep it with the windows look.","Q_Score":0,"Tags":"winforms,ironpython","A_Id":931629,"CreationDate":"2009-05-31T07:44:00.000","Title":"Different styles for Windows forms in Ironpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Is there any way besides Shoes to develop and distribute cross-platform GUI desktop applications written in Ruby?\nI come to believe that general bugginess of _why's applications is exceptionally crippling in case of Shoes, and anything more complex than a two-button form is a pain to maintain.\nRubyGTK, wxRuby, etc seem to be promising, but they do not solve the issue of distributing an app in a way that doesn't require Ruby pre-installed on users' computers \u2014 and libraries like ruby2exe seem to be horribly out-of-date and incomplete.\nGenerally \u2014 what is the current fad?\nBTW: if there is a really easy solution to this in Python, I may consider redoing the stuff I'm up to in Python.","AnswerCount":7,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":3071,"Q_Id":940149,"Users Score":0,"Answer":"I don't think anyone really answered his question.\nAs for me, I use VB to do Shell() calls to Ocra compiled Ruby scripts.\nIt works pretty well and allows me to create apps that run in all modern OS.\nLinux testing is done by using Wine to run and ensuring that I use a pre .NET version of VB for the .exe compilation.","Q_Score":10,"Tags":"python,ruby,user-interface,desktop,software-distribution","A_Id":976069,"CreationDate":"2009-06-02T15:15:00.000","Title":"Distributing Ruby\/Python desktop apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any way besides Shoes to develop and distribute cross-platform GUI desktop applications written in Ruby?\nI come to believe that general bugginess of _why's applications is exceptionally crippling in case of Shoes, and anything more complex than a two-button form is a pain to maintain.\nRubyGTK, wxRuby, etc seem to be promising, but they do not solve the issue of distributing an app in a way that doesn't require Ruby pre-installed on users' computers \u2014 and libraries like ruby2exe seem to be horribly out-of-date and incomplete.\nGenerally \u2014 what is the current fad?\nBTW: if there is a really easy solution to this in Python, I may consider redoing the stuff I'm up to in Python.","AnswerCount":7,"Available Count":3,"Score":0.057080742,"is_accepted":false,"ViewCount":3071,"Q_Id":940149,"Users Score":2,"Answer":"The state of affairs is pretty bad. The most reliable method at present is probably to use JRuby. I know that's probably not the answer you want to hear, but, as you say, ruby2exe is unreliable, and Shoes is a long way off (and isn't even intended to be a full-scale application). Personally, I dislike forcing users to install GTK or Qt or wxWidgets, but the JVM is fairly ubiquitous.","Q_Score":10,"Tags":"python,ruby,user-interface,desktop,software-distribution","A_Id":940214,"CreationDate":"2009-06-02T15:15:00.000","Title":"Distributing Ruby\/Python desktop apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any way besides Shoes to develop and distribute cross-platform GUI desktop applications written in Ruby?\nI come to believe that general bugginess of _why's applications is exceptionally crippling in case of Shoes, and anything more complex than a two-button form is a pain to maintain.\nRubyGTK, wxRuby, etc seem to be promising, but they do not solve the issue of distributing an app in a way that doesn't require Ruby pre-installed on users' computers \u2014 and libraries like ruby2exe seem to be horribly out-of-date and incomplete.\nGenerally \u2014 what is the current fad?\nBTW: if there is a really easy solution to this in Python, I may consider redoing the stuff I'm up to in Python.","AnswerCount":7,"Available Count":3,"Score":-0.057080742,"is_accepted":false,"ViewCount":3071,"Q_Id":940149,"Users Score":-2,"Answer":"I've read about (but not used) Seattlerb's Wilson, which describes itself as a pure x86 assembler, but it doesn't sound like it'd be cross-platform or GUI.","Q_Score":10,"Tags":"python,ruby,user-interface,desktop,software-distribution","A_Id":942712,"CreationDate":"2009-06-02T15:15:00.000","Title":"Distributing Ruby\/Python desktop apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to embed a 3-D editor inside my wxPython application? (I'm thinking Blender, but other suggestions are welcome.)\nMy application opens a wxPython window, and I want to have a 3-D editor inside of it. Of course, I want my program and the 3-D editor to interact with each other.\nPossible? How?","AnswerCount":5,"Available Count":1,"Score":0.0798297691,"is_accepted":false,"ViewCount":1823,"Q_Id":950145,"Users Score":2,"Answer":"Blender has python plugins, you can write a plugin to interract with your program.","Q_Score":1,"Tags":"python,3d,wxpython,embedding,blender","A_Id":950196,"CreationDate":"2009-06-04T12:13:00.000","Title":"Embedding a 3-D editor (such as Blender) in a wxPython application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Continuing on with my Python learning, I just installed Komodo edit, are there any recommended add ins\/extensions that I should include? Any recommendations on using it or another GUI designer (TkInter base)?","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1483,"Q_Id":951974,"Users Score":0,"Answer":"try using eclipse instead with PyDev.","Q_Score":3,"Tags":"python,ide,komodo","A_Id":952842,"CreationDate":"2009-06-04T17:29:00.000","Title":"Komodo Extension","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Continuing on with my Python learning, I just installed Komodo edit, are there any recommended add ins\/extensions that I should include? Any recommendations on using it or another GUI designer (TkInter base)?","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1483,"Q_Id":951974,"Users Score":0,"Answer":"I use to install MoreKomodo and TweakUI after putting Komodo on some machine for me.","Q_Score":3,"Tags":"python,ide,komodo","A_Id":7241975,"CreationDate":"2009-06-04T17:29:00.000","Title":"Komodo Extension","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a macro generator\/ keyboard remapper in python, for xubuntu.\nI've figured out how to intercept and record keystrokes, and send keystrokes I want to record, but I haven't figured out how to block keystrokes. I need to disable keyboard input to remap a key. For example, if I wanted to send 'a' when I press the 's' key, I can currently record the 'a' keystroke, and set it to playback when I press the 's' key. I cannot, however keep the 's' keystroke from being sent alongside it.\nI used the pyxhook module from an open source keyboard-logger for the hooks, and a again, the xtest fake input method from the python x library.\nI remember reading somewhere about somebody blocking all keyboard input by redirecting all keystrokes to an invisible window by using tkinter. If somebody could post that method that'd be great. \nI need something that will block all keystrokes, but not turn off my keyboard hooks.","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":5147,"Q_Id":958491,"Users Score":1,"Answer":"I think it's going to depend heavily on the environment: curses & the activestate recipe are good for command line, but if you want it to run in a DE, you'll need some hooks to that DE. You might look at Qt or GTK bindings for python, or there's a python-xlib library that might let you tie right into the X system.\nSo I guess the answer is \"it depends.\" Are you looking for console noecho functionality, or a text replacement program for a DE, or an xmodmap-style layout changer?","Q_Score":5,"Tags":"python,keyboard","A_Id":981709,"CreationDate":"2009-06-05T22:51:00.000","Title":"Python disable\/redirect keyboard input","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a macro generator\/ keyboard remapper in python, for xubuntu.\nI've figured out how to intercept and record keystrokes, and send keystrokes I want to record, but I haven't figured out how to block keystrokes. I need to disable keyboard input to remap a key. For example, if I wanted to send 'a' when I press the 's' key, I can currently record the 'a' keystroke, and set it to playback when I press the 's' key. I cannot, however keep the 's' keystroke from being sent alongside it.\nI used the pyxhook module from an open source keyboard-logger for the hooks, and a again, the xtest fake input method from the python x library.\nI remember reading somewhere about somebody blocking all keyboard input by redirecting all keystrokes to an invisible window by using tkinter. If somebody could post that method that'd be great. \nI need something that will block all keystrokes, but not turn off my keyboard hooks.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":5147,"Q_Id":958491,"Users Score":0,"Answer":"I've got a keyboard hook that detects X events. I'm looking for a way to globally prevent a single keyboard event from being sent to a window. Something that works by accessing the event queue and removing the keyboard event from it would be ideal. It looks like it should be possible using Python Xlib, but I can't figure it out.","Q_Score":5,"Tags":"python,keyboard","A_Id":993251,"CreationDate":"2009-06-05T22:51:00.000","Title":"Python disable\/redirect keyboard input","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any reason why a QMenu cannot be added from the Qt Designer? I find it weird that you can add other widget types but not this.","AnswerCount":3,"Available Count":3,"Score":0.1973753202,"is_accepted":false,"ViewCount":3989,"Q_Id":960467,"Users Score":3,"Answer":"I have a single main window with a QGraphicsView and lots of QGraphicsItem objects. Each type of the Items have a different context menu.\nI find that not being able to create the contextMenu's, or at least the actions that are in them a serious limitation of QtDesigner. It means that I can create about 10% or so of the actions using the designer, and I have to create 90% programaticaly. Compare that with the Microsoft resource editor which allows all of these things to be created, and maintained effortlessly. \nI hope this will be addressed at some point.","Q_Score":1,"Tags":"python,qt,widget,designer","A_Id":1235766,"CreationDate":"2009-06-06T20:33:00.000","Title":"how can I add a QMenu and QMenuItems to a window from Qt Designer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any reason why a QMenu cannot be added from the Qt Designer? I find it weird that you can add other widget types but not this.","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":3989,"Q_Id":960467,"Users Score":3,"Answer":"When you edit a QMainWindow you can right click the window and then choose \"create menu bar\".\nOr are you talking about a \"context menu\" aka \"right click menu\"?","Q_Score":1,"Tags":"python,qt,widget,designer","A_Id":960506,"CreationDate":"2009-06-06T20:33:00.000","Title":"how can I add a QMenu and QMenuItems to a window from Qt Designer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any reason why a QMenu cannot be added from the Qt Designer? I find it weird that you can add other widget types but not this.","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":3989,"Q_Id":960467,"Users Score":0,"Answer":"Adding menu editing for every widget in the designer would probably make a very awkward and inconvenient UI. There's really no place you can visualize it on.\nIf you're editing a QMainWindow you can edit the menu bar and its popups because there's a proper place for them to be displayed in.","Q_Score":1,"Tags":"python,qt,widget,designer","A_Id":960479,"CreationDate":"2009-06-06T20:33:00.000","Title":"how can I add a QMenu and QMenuItems to a window from Qt Designer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I use gtk.EntryCompletion to implement the autocomletion function.\nBut the list is so long that the pop-up window touches the bottom of screen.\nAnd I cant find the method of set the height of pop-up window in doc of pygtk.\nHow to set the height of pop-up window in gtk.EntryCompletion?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":509,"Q_Id":961735,"Users Score":0,"Answer":"I don't know if this applies to gtk.EntryCompletion widgets, but for cell like widgets you can control their height with the cell.set_fixed_height_from_font(True) method. \nLook at the gtk.CellRendererText API for details.","Q_Score":2,"Tags":"python,gtk,pygtk","A_Id":962054,"CreationDate":"2009-06-07T11:19:00.000","Title":"pygtk: How to set the height of pop-up window in gtk.EntryCompletion","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I use gtk.EntryCompletion to implement the autocomletion function.\nBut the list is so long that the pop-up window touches the bottom of screen.\nAnd I cant find the method of set the height of pop-up window in doc of pygtk.\nHow to set the height of pop-up window in gtk.EntryCompletion?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":509,"Q_Id":961735,"Users Score":0,"Answer":"Maybe you can solve the problem using gtk.EntryCompletion.set_minimum_key_length to prevent long list of suggestions.","Q_Score":2,"Tags":"python,gtk,pygtk","A_Id":7963132,"CreationDate":"2009-06-07T11:19:00.000","Title":"pygtk: How to set the height of pop-up window in gtk.EntryCompletion","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":1.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":13,"Answer":"I've heard these complaints before about C++, but the fact is, programming in any language with which you are unfamiliar is time consuming. \nA good C++ programmer can probably crank out the app much faster than an okay Python programmer and visa versa. \nI think C++ often gets a bad reputation because it allows you get much lower level - pointers, memory management, etc, and if you aren't used to thinking about such things, it can take a bit of time. If you are used to working in that environment, it can become second nature.\nUnless choice of language is something imposed upon you by your company, team, client, etc. I usually recommend that folks go with the language they are most comfortable with OR most interested in learning more about. If speed is the issue you are concerned with, look at the learning curve for each language and your past experience. C++ tends to have a higher learning curve, but that too depends on the person.\nKindof a non-answer I know.","Q_Score":19,"Tags":"c++,python","A_Id":977443,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":1.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":24,"Answer":"There are two things that are relevant between C++ and Python that will affect your time-to-develop any project including a game. There are the languages themselves and the libraries. I've played with the SDL to some extent and peeked at PyGame and for your specific instance I don't think the libraries are going to be much of a factor. So I'll focus on the languages themselves.\nPython is a dynamically-typed, garbage-collected language. C++ is a statically-typed, non-garbage-collected language. What this means is that in C++ a lot of your development time will be spent managing memory and dealing with your type structure. This affords you a lot of power, but the question is do you really need it?\nIf you're looking to write a simple game with some basic graphics and some good gameplay, then I don't think you truly need all the power that C++ will give you. If you're looking to write something that will push the envelope, be the next A-list game, be the next MMO, fit on a console or a handheld device, then you will likely need the power that C++ affords.","Q_Score":19,"Tags":"c++,python","A_Id":977451,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0307595242,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":2,"Answer":"It's time consuming because in C++ you have to deal with more low-level tasks.\nIn Python you are free to focus on the development of the actual game instead of dealing with memory management etc.","Q_Score":19,"Tags":"c++,python","A_Id":977412,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":0,"Answer":"Some people would argue that development time is slower in C++ when compared to Python. \nWouldn't it be the case that the time you saved in developing an application (or game) in python is the time you gonna use in improving performance after its developed? and in the later part when you have least options left?\nIt largely depends upon the purpose for which you are going to develop the application. \nIf you are thinking for an enterprise application in which case it is going to be hit by millions (web-app) or an application with focus on low-footprint, faster loading into memory, faster execution, then your choice is C++. \nIf you are projecting your application for not being use at this level, surely Python is the choice to go for. \nMaintainability is considerable, but disciplined code can overcome this.\nLargely depends upon long term projections. On how serious and critical the application is going to be.","Q_Score":19,"Tags":"c++,python","A_Id":4546946,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":0,"Answer":"Why limit yourself to those two options? With C# or Java you get access to a huge collection of useful libraries plus garbage collection and (in the case of C#) JIT compiling.\nFurthermore, you're saying that you're looking to do game development, but from your task description it sounds like you're also looking at coding your own engine. Is that part of the exercise? Otherwise you should definitely take a look at the available Indie engines out there - lots are cheap of not free and open source.\nNeedless to say, working from an existing engine is definitely faster than going from scratch :)","Q_Score":19,"Tags":"c++,python","A_Id":1079100,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0307595242,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":2,"Answer":"It takes about the same amount of time to write the same code in pretty much all of the high level languages. The win is that in certain languages it is easier to use other peoples code. In a lot of Python\/Ruby\/Perl apps, you write 10% of the code and import libraries to do the other 90%. That is harder in C\/C++ since the libraries have different interfaces and other incompatibilities.\nC++ vs Python is a pretty personal choice. Personally I feel I lose more time with not having the C\/Java class system (more run time errors\/debugging time, don't have anywhere near as good auto completion, need to do more documentation and optimization) than I gain (not having to write interfaces\/stub function and being able to worry less about memory managment). Other people feel the exact opposite.\nIn the end it probably depends on the type of game. If your processor intensive go to C++ (maybe with a scripting language if it makes sense). Otherwise use whatever language you prefer","Q_Score":19,"Tags":"c++,python","A_Id":1009820,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0461211021,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":3,"Answer":"Python has some big advantages over programming languages like C++. I myself have programmed a lot with C++, C and other programming languages. Lately I am also programming in Python and I got to like it very much!\nYou can have a quick start with Python. Since it is rather simple to learn (at least with some programming experience and enough abstract thinking), you can have fast successes. Also the script-like behaviour makes starting easy and it is also possible, to quickly test some things in the integrated shell. This can also be good for debugging.\nThe whole language is packed with powerful features and it has a good and rather complete set of libraries.\nThere was the argument that with the \"right library\" you can develop as quickly with C++ as with Python. This might (partly) be, but I myself have never experienced it, because such libraries are rare. I had also a big library at hand, but still lacked many valuable features in C++. The so called \"standard template library\" STL makes things even worse in my opinion. It is a really powerful library. But it is also that complex, that it adds the complexity of an additional programming language to C++. I really disliked it and in a company I worked in, much worktime was lost, because the compiler was not able to give useful error-output in case of errors in the STL.\nPython is different. Instead of putting the \"speed of the programm\" on the throne -- sacrificing all else (as C++ and especially the STL does) -- it puts \"speed of development\" first. The language gives you a powerful toolkit and it is accompanied by a huge library. When you need speed, you can also implement time critical things in C or C++ and call it from Python.\nThere is also at least one big online Game implemented in Python.","Q_Score":19,"Tags":"c++,python","A_Id":986810,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":0,"Answer":"Do you have any programming experience at all? If not, I would start with Python which is easier to learn, even if it is not a better tool for game development. If you decide you want to program games for living, you'll probably need to switch to C++ at some point.","Q_Score":19,"Tags":"c++,python","A_Id":977759,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":0,"Answer":"Short Answer\nYes python is faster in terms of development time. There are many case studies in real life that show this. However, you don't want to do a 3d graphics engine in Python.","Q_Score":19,"Tags":"c++,python","A_Id":977460,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":0,"Answer":"I'd focus more on choosing a framework to build your game on than trying to pick a language. Unless the goal is to learn how games work inside and out, you're going to want to use a framework. Try out a couple, and pick the one that meets your requirements and feels nice to you.\nOnce you've picked the framework, the language choice becomes easy - use the language for which the framework is written.\nThere are many options for game frameworks in C++ - pygame works for python. There are many that work with other languages\/tools as well (including .NET, Lua, etc.)","Q_Score":19,"Tags":"c++,python","A_Id":977452,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast.\nAnyways, could anyone elaborate on this? What exactly makes development in C++ so time consuming? The programs I've made have been Project Euler-style in that they're very short and math-based, so I have no experience in larger projects.","AnswerCount":13,"Available Count":11,"Score":0.0307595242,"is_accepted":false,"ViewCount":5902,"Q_Id":977404,"Users Score":2,"Answer":"there are many things that make c++ longer to develop in. Its lower level, has pointers, different libraries for different systems, the type system, and there are others I am sure I am missing.","Q_Score":19,"Tags":"c++,python","A_Id":977414,"CreationDate":"2009-06-10T18:33:00.000","Title":"C++ slow, python fast? (in terms of development time)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have to write a desktop application to edit data stored in a XML file. The format is defined by a XML schema file (.xsd). The format is quite complex. \nAre there tools which can generate a basic GUI automatically? It's not yet decided which language to use. I have experience in Python and C++ using wxWidgets and C# (.NET 1) using Windows Forms.","AnswerCount":7,"Available Count":2,"Score":0.0285636566,"is_accepted":false,"ViewCount":19538,"Q_Id":983399,"Users Score":1,"Answer":"One solution could be to write an XSL transformation that converts the XML file into a XAML file.","Q_Score":15,"Tags":"c#,c++,python,xml,schema","A_Id":985246,"CreationDate":"2009-06-11T20:14:00.000","Title":"Create a GUI from a XML schema automatically","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have to write a desktop application to edit data stored in a XML file. The format is defined by a XML schema file (.xsd). The format is quite complex. \nAre there tools which can generate a basic GUI automatically? It's not yet decided which language to use. I have experience in Python and C++ using wxWidgets and C# (.NET 1) using Windows Forms.","AnswerCount":7,"Available Count":2,"Score":0.0285636566,"is_accepted":false,"ViewCount":19538,"Q_Id":983399,"Users Score":1,"Answer":"If the GUI will be simple and you don't bother about the geometry of the components(widgets) in the dialogs, Qt will be a good option. Actually I'm working on a similar task for my project, and my goal was to validate the form data by using an XML file.\nUsing Qt, it is possible to access any widget on the dialog at run-time by using its object name. So that validation can be applied to the dialog contents.\nCreating any dialogs will be even easier, since you will have the widget type and certain information and using layouts, fascinating results can be obtained.","Q_Score":15,"Tags":"c#,c++,python,xml,schema","A_Id":1015238,"CreationDate":"2009-06-11T20:14:00.000","Title":"Create a GUI from a XML schema automatically","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm designing a simple text editor using WxPython, and I want to put the platform's native icons in the toolbar. It seems that the only way to make toolbars is with custom images, which are not good for portability. Is there some kind of (e.g.) GetSaveIcon()?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1725,"Q_Id":984816,"Users Score":4,"Answer":"I don't think wxPython provides native images on each platform\nbut just for consistency sake you can use wx.ArtProvider\ne.g.\nwx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)","Q_Score":2,"Tags":"python,wxpython,icons","A_Id":984833,"CreationDate":"2009-06-12T03:16:00.000","Title":"How to use standard toolbar icons with WxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to explicitly disable the compilation of the _tkinter module when compiling Python 2.4.3. It's easy enough to do by modifying the makefile but I'd rather just append a configuration option to avoid supplying a patch.\nI do not understand the complex interplay between Modules\/Setup*, setup.py and their contribution to the generation of makefile.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":672,"Q_Id":994278,"Users Score":5,"Answer":"Unfortunately I suspect you can't do it without editing some file or other -- it's not a configure option we wrote in as far as I recall (I hope I'm wrong and somebody else snuck it in while I wasn't looking but a quick look at the configure file seems to confirm they didnt'). Sorry -- we never thought that somebody (with all the tk libraries installed, otherwise tkinter gets skipped) would need to deliberately avoid building _tkinter:-(. In retrospect, we clearly were wrong, so I apologize.","Q_Score":3,"Tags":"python,compilation,tkinter","A_Id":994311,"CreationDate":"2009-06-15T02:05:00.000","Title":"How can I explicitly disable compilation of _tkinter.c when compiling Python 2.4.3 on CentOS 5?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a basic program in python using the PyQt4 module. I'd like to be able to use my system theme's icons for things like the preference dialog's icon, but i have no idea how to do this. So my question is, how do you get the location of an icon, but make sure it changes with the system's icon theme? If it matters, i'm developing this under ubuntu 9.04, so i am using the gnome desktop.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3720,"Q_Id":997904,"Users Score":0,"Answer":"I spent a decent amount of researching this myself not long ago, and my conclusion was that, unfortunately, Qt doesn't provide this functionality in a cross-platform fashion. Ideally the QIcon class would have defaults for file open, save, '+', '-', preferences, etc, but considering it doesn't you'll have to grab the appropriate icon for your desktop environment.","Q_Score":8,"Tags":"python,icons,pyqt4","A_Id":999115,"CreationDate":"2009-06-15T19:25:00.000","Title":"System theme icons and PyQt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for a Python framework that will enable me to play video as well as draw on that video (for labeling purposes). \nI've tried Pyglet, but this doesn't seem to work particularly well - when drawing on an existing video, there is flicker (even with double buffering and all of that good stuff), and there doesn't seem to be a way to get the frame index in the video during the per-frame callback (only elapsed time since the last frame).","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":2361,"Q_Id":1003376,"Users Score":2,"Answer":"Qt (PyQt) has Phonon, which might help out. PyQt is available as GPL or payware. (Qt has LGPL too, but the PyQt wrappers don't)","Q_Score":4,"Tags":"python,video,pyglet","A_Id":1003439,"CreationDate":"2009-06-16T19:03:00.000","Title":"Python Video Framework","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can anyone tell me if its possible to redeclare a C# class in IronPython? If I have a C# class, would I be able to monkey-patch it from IronPython?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":324,"Q_Id":1008686,"Users Score":0,"Answer":"You can monkey-patch from IronPython, but IPy is the only environment that will respect your changes; i.e. if you tried to mock out File.Create from IronPython, this would work fine for any IPy code, but if you called a C# method which called File.Create, it would get the real one, not the mock.","Q_Score":1,"Tags":"c#,ironpython,monkeypatching","A_Id":1040151,"CreationDate":"2009-06-17T18:08:00.000","Title":"Redeclare .net classes in IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Can anyone tell me if its possible to redeclare a C# class in IronPython? If I have a C# class, would I be able to monkey-patch it from IronPython?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":324,"Q_Id":1008686,"Users Score":0,"Answer":"You cannot monkey patch from IronPython. IronPython treats all .NET classes just like CPython treats built-in types: they cannot be monkey patched. IronRuby on the other hand does support this.","Q_Score":1,"Tags":"c#,ironpython,monkeypatching","A_Id":3155159,"CreationDate":"2009-06-17T18:08:00.000","Title":"Redeclare .net classes in IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have an interface that has two toolbars, one attached to the frame and one embedded in a notebook tab. The one in the frame dutifully shows longHelp strings in the statusbar, the one in the notebook tab\ndoes not. How do I tell the one on the notebook tab where to display its help, or do I have to manage enter and leave bindings myself?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":948,"Q_Id":1014239,"Users Score":0,"Answer":"from wxPython docs\n\"\"\"\nlongHelpString\nThis string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool\n\"\"\"\nso toolbar in notebook doesn't get any statusbar to display long help, so either thru src we should invertigate how it inquires abt status bar and supply a ref to main frame status bar\nelse i think better way is to just override wxToolBar::OnMouseEnter and display help directly on status bar","Q_Score":2,"Tags":"wxpython,wxwidgets","A_Id":1021396,"CreationDate":"2009-06-18T17:57:00.000","Title":"wxPython: how to make two toolbars use one statusbar for tooltips?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a program that sends and receives images to each other using sockets.\nThe server sends the image data using 'image.tostring()' and the client side receives it and turns it back into an image using 'Image.fromstring', then into a QImage using 'ImageQt.ImageQt(image)', turns it into a QPixmap using 'QPixmap.fromimage(qimage)'then updates my QWidget's QLable's image using 'lable.setPixmap(qpixmap)'\nEverything works fine with small images, but with images larger than 200x200, python.exe crashes and the console only shows \"Process terminated with an exit code of -1073741819\" and doesn't tell me what the problem is.\nI've isolated the problem down to 'setPixmap()' (everything else works as long as I comment out that), but I can't see what the problem is.\nThis only happens on the client side. The server side uses the same steps going from Image to QImage to QPixmap then setPixmap, but that doesn't have any problems.\nAlso tried making it a QBitmap and using setPixmap on the bitmap, which worked (but it's black and white so can't use it). Weird!\nAny help would be appreciated!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1131,"Q_Id":1029033,"Users Score":0,"Answer":"It may be worth dumping the image data to a file and checking that you have all the data by loading it into an image viewer. If you get incomplete data, you may still be able to obtain a QImage and create a QPixmap, but it may be invalid.","Q_Score":4,"Tags":"python,pyqt,qpixmap","A_Id":1116190,"CreationDate":"2009-06-22T19:38:00.000","Title":"\"Python.exe\" crashes when PyQt's setPixmap() is called with a Pixmap","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I make any wxPython widget (like wx.Panel or wx.Button) automatically expand to fill its parent window?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3216,"Q_Id":1034399,"Users Score":0,"Answer":"In the case of a Button, to make a button fill its parent window when the parent window (a frame in my case) changes size, put button.SetSize(parent_window.GetSize()) in the parent window's OnSize event handling routine.","Q_Score":4,"Tags":"python,user-interface,wxpython","A_Id":5628847,"CreationDate":"2009-06-23T18:46:00.000","Title":"wxPython: Making something expand","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.\nRecently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK \/ pyQt on gnome \/ kde. Does such a library exist? If not, what do you think is wrong with this idea?","AnswerCount":9,"Available Count":6,"Score":1.0,"is_accepted":false,"ViewCount":5803,"Q_Id":1037673,"Users Score":8,"Answer":"Tkinter is part of the python standard distribution and is installed by default. Expect to find this on all python installs where there is a graphical display in the first place.","Q_Score":9,"Tags":"python,tkinter,pyqt,pygtk,pyobjc","A_Id":1037851,"CreationDate":"2009-06-24T10:58:00.000","Title":"Pure python gui library?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.\nRecently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK \/ pyQt on gnome \/ kde. Does such a library exist? If not, what do you think is wrong with this idea?","AnswerCount":9,"Available Count":6,"Score":1.0,"is_accepted":false,"ViewCount":5803,"Q_Id":1037673,"Users Score":6,"Answer":"Notion of \"pure python gui library\" is wrong because ultimately you will be using system level calls and widgets, may be thru ctypes but that doesn't change the fact that if you start implementing your idea you will eventually become wxPython","Q_Score":9,"Tags":"python,tkinter,pyqt,pygtk,pyobjc","A_Id":1038265,"CreationDate":"2009-06-24T10:58:00.000","Title":"Pure python gui library?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.\nRecently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK \/ pyQt on gnome \/ kde. Does such a library exist? If not, what do you think is wrong with this idea?","AnswerCount":9,"Available Count":6,"Score":0.0886555158,"is_accepted":false,"ViewCount":5803,"Q_Id":1037673,"Users Score":4,"Answer":"For one thing, all those libraries use different abstractions, so anything that worked with all of them is likely to wind up supporting a least-common-denominator set of functionality, or doing a LOT of work to use each to its fullest.","Q_Score":9,"Tags":"python,tkinter,pyqt,pygtk,pyobjc","A_Id":1037740,"CreationDate":"2009-06-24T10:58:00.000","Title":"Pure python gui library?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.\nRecently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK \/ pyQt on gnome \/ kde. Does such a library exist? If not, what do you think is wrong with this idea?","AnswerCount":9,"Available Count":6,"Score":0.0886555158,"is_accepted":false,"ViewCount":5803,"Q_Id":1037673,"Users Score":4,"Answer":"Not really sure what you mean by \"heavyweight.\"\nwx uses native controls on each platform, and is about as easy to use in Python as I can imagine; after all, GUI APIs are complex because GUIs can get complex.\nI think wx, for the effort required to build a window and the quality of what shows up on screen, is great. I don't think you're likely to roll something better on your own.","Q_Score":9,"Tags":"python,tkinter,pyqt,pygtk,pyobjc","A_Id":1037810,"CreationDate":"2009-06-24T10:58:00.000","Title":"Pure python gui library?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.\nRecently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK \/ pyQt on gnome \/ kde. Does such a library exist? If not, what do you think is wrong with this idea?","AnswerCount":9,"Available Count":6,"Score":0.0444152037,"is_accepted":false,"ViewCount":5803,"Q_Id":1037673,"Users Score":2,"Answer":"I think it's about not inventig the wheel. It would work, but why should you do that? All the GUI libraries you mentioned are stable and more or less bullet proofen.\nI could imagine that there are some experiments implementing a pure python library. But I never saw one. Everything about GUIs is hard work and a pure python library wouldn't have such a big audience.","Q_Score":9,"Tags":"python,tkinter,pyqt,pygtk,pyobjc","A_Id":1037705,"CreationDate":"2009-06-24T10:58:00.000","Title":"Pure python gui library?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.\nRecently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK \/ pyQt on gnome \/ kde. Does such a library exist? If not, what do you think is wrong with this idea?","AnswerCount":9,"Available Count":6,"Score":1.2,"is_accepted":true,"ViewCount":5803,"Q_Id":1037673,"Users Score":10,"Answer":"The path of least effort and best results would be to learn what it takes to deploy an app using those existing GUI libraries.","Q_Score":9,"Tags":"python,tkinter,pyqt,pygtk,pyobjc","A_Id":1037722,"CreationDate":"2009-06-24T10:58:00.000","Title":"Pure python gui library?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How to convert HTML CSS file to wxPython files? That is, how to create slidsheet in wxPython like HTML CSS files?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":677,"Q_Id":1038182,"Users Score":0,"Answer":"stylesheet, not slidesheet.\nf = open('NAMEOFSTYLESHEET.css','w')\nf.write('#ID{}\\n.class{}')","Q_Score":0,"Tags":"wxpython","A_Id":14180592,"CreationDate":"2009-06-24T12:54:00.000","Title":"HTML conversion","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"In my wx.Frame based wxpython application, I draw some lines on a panel when some events occur by creating wx.ClientDC instances when needed. The only problem is, if the window is minimized and then restored, the lines disappear! Is there some kind of method that I should override or event to bind to that will allow me to call the drawing method I created when the window is restored?\nThanks!","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":541,"Q_Id":1046157,"Users Score":0,"Answer":"When the window is restored it is (on some platforms) repainted using EVT_PAINT handler.\nThe solution is e.g. to draw the same lines in OnPaint(). Or buffer what you draw. See the wxBufferedDC class.","Q_Score":1,"Tags":"python,wxpython","A_Id":1046259,"CreationDate":"2009-06-25T20:42:00.000","Title":"wxpython: How can I redraw something when a window is retored?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing an student attendance application in wxpython and I need to know how to ensure that password field doesn't echo characters to the screen.\nForexample :if I give the name as moni means then it should be displayed as in format of ****","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":427,"Q_Id":1048446,"Users Score":1,"Answer":"You need to give your text control the TE_PASSWORD style.\n(As J\u00f8rn's comment points out, this isn't \"encryption\" - I'm assuming you're only talking about the visual presentation of the password.)","Q_Score":0,"Tags":"wxpython","A_Id":1048463,"CreationDate":"2009-06-26T10:44:00.000","Title":"Hiding characters typed into password field","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and calling C from Python.\nI'm considering an approach involving IPC or RPC (I don't mind having multiple processes); that is, having my pure-Python component run in a separate process (on the same machine) and having my C project communicate with it by writing\/reading from a socket (or unix pipe). my python component can read\/write to socket to communicate. Is that a reasonable approach? Is there something better? Like some special RPC mechanism?\nThanks for the answer so far - however, i'd like to focus on IPC-based approaches since I want to have my Python program in a separate process as my C program. I don't want to embed a Python interpreter. Thanks!","AnswerCount":9,"Available Count":3,"Score":0.022218565,"is_accepted":false,"ViewCount":79185,"Q_Id":1056051,"Users Score":1,"Answer":"I haven't used an IPC approach for Python<->C communication but it should work pretty well. I would have the C program do a standard fork-exec and use redirected stdin and stdout in the child process for the communication. A nice text-based communication will make it very easy to develop and test the Python program.","Q_Score":52,"Tags":"python,c,interop,cross-domain","A_Id":1056105,"CreationDate":"2009-06-28T23:37:00.000","Title":"How do you call Python code from C code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and calling C from Python.\nI'm considering an approach involving IPC or RPC (I don't mind having multiple processes); that is, having my pure-Python component run in a separate process (on the same machine) and having my C project communicate with it by writing\/reading from a socket (or unix pipe). my python component can read\/write to socket to communicate. Is that a reasonable approach? Is there something better? Like some special RPC mechanism?\nThanks for the answer so far - however, i'd like to focus on IPC-based approaches since I want to have my Python program in a separate process as my C program. I don't want to embed a Python interpreter. Thanks!","AnswerCount":9,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":79185,"Q_Id":1056051,"Users Score":0,"Answer":"apparently Python need to be able to compile to win32 dll, it will solve the problem\nIn such a way that converting c# code to win32 dlls will make it usable by any development tool","Q_Score":52,"Tags":"python,c,interop,cross-domain","A_Id":1621442,"CreationDate":"2009-06-28T23:37:00.000","Title":"How do you call Python code from C code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and calling C from Python.\nI'm considering an approach involving IPC or RPC (I don't mind having multiple processes); that is, having my pure-Python component run in a separate process (on the same machine) and having my C project communicate with it by writing\/reading from a socket (or unix pipe). my python component can read\/write to socket to communicate. Is that a reasonable approach? Is there something better? Like some special RPC mechanism?\nThanks for the answer so far - however, i'd like to focus on IPC-based approaches since I want to have my Python program in a separate process as my C program. I don't want to embed a Python interpreter. Thanks!","AnswerCount":9,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":79185,"Q_Id":1056051,"Users Score":7,"Answer":"Have you considered just wrapping your python application in a shell script and invoking it from within your C application?\nNot the most elegant solution, but it is very simple.","Q_Score":52,"Tags":"python,c,interop,cross-domain","A_Id":1056087,"CreationDate":"2009-06-28T23:37:00.000","Title":"How do you call Python code from C code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've made a small tool that parses a chunk of text, does some simple processing (retrieves values from a dictionary, a few regex, etc.) and then spits the results.\nIn order to make easier to read the results, I made two graphic ports, one with tkInter and other with wxPython, so the output is nicely displayed in a Text Area with some words having different colours.\nThe tkInter implementation uses Tkinter.Text object and to apply the colours to the words uses tags (configured with the method Tkinter.Text.tag_config and passing them to Tkinter.Text.insert), and the measured while outputting about 400 different coloured words is < 0.02s.\nThe wxPython implementation uses wx.richtext.RichTextCtrl and to apply the colours to the words uses wx.richtext.RichTextCtrl.BeginTextColour and then wx.richtext.RichTextCtrl.AppendText; the performance is ridiculous, it takes abut 1.4s to do the same job that only took 0.02s to the tkInter port.\nIs this an intrinsic problem of the RichTextCtrl widget, the wxPython bindings, or there is some way to speed it up?\nThanks!","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1031,"Q_Id":1059214,"Users Score":0,"Answer":"It kind of avoids the question slightly, but could you use wxStyledTextCtrl instead?","Q_Score":0,"Tags":"python,performance,wxpython,tkinter,richtextediting","A_Id":1070836,"CreationDate":"2009-06-29T16:26:00.000","Title":"wxPython RichTextCtrl much slower than tkInter Text?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've made a small tool that parses a chunk of text, does some simple processing (retrieves values from a dictionary, a few regex, etc.) and then spits the results.\nIn order to make easier to read the results, I made two graphic ports, one with tkInter and other with wxPython, so the output is nicely displayed in a Text Area with some words having different colours.\nThe tkInter implementation uses Tkinter.Text object and to apply the colours to the words uses tags (configured with the method Tkinter.Text.tag_config and passing them to Tkinter.Text.insert), and the measured while outputting about 400 different coloured words is < 0.02s.\nThe wxPython implementation uses wx.richtext.RichTextCtrl and to apply the colours to the words uses wx.richtext.RichTextCtrl.BeginTextColour and then wx.richtext.RichTextCtrl.AppendText; the performance is ridiculous, it takes abut 1.4s to do the same job that only took 0.02s to the tkInter port.\nIs this an intrinsic problem of the RichTextCtrl widget, the wxPython bindings, or there is some way to speed it up?\nThanks!","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1031,"Q_Id":1059214,"Users Score":1,"Answer":"I'm copying here the comment that solved the problem:\n\nHave you tried using Freeze() and\n Thaw() to only update the display\n after you are done appending the\n coloured text? \u2013 mghie Jun 30 at 7:20","Q_Score":0,"Tags":"python,performance,wxpython,tkinter,richtextediting","A_Id":1189222,"CreationDate":"2009-06-29T16:26:00.000","Title":"wxPython RichTextCtrl much slower than tkInter Text?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either\n\nWingIDE\nKomodoIDE\n\nwhich you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself.\nOne con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?)\nI have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates.\nThank you very much all and have a great day!","AnswerCount":9,"Available Count":4,"Score":0.022218565,"is_accepted":false,"ViewCount":4484,"Q_Id":1065964,"Users Score":1,"Answer":"Try Aptana Studio... It's eclipse+pydev+web stuff, it doesnt have any specific pylons stuff or mako support. But eclipse+pydev alone is great + all the nice jscript+html+css stuff aptana adds.","Q_Score":8,"Tags":"python,ide,pylons","A_Id":3596813,"CreationDate":"2009-06-30T20:46:00.000","Title":"Recommended IDE for developing Pylons apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either\n\nWingIDE\nKomodoIDE\n\nwhich you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself.\nOne con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?)\nI have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates.\nThank you very much all and have a great day!","AnswerCount":9,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":4484,"Q_Id":1065964,"Users Score":0,"Answer":"Wow, I've also been looking for a good Pylons web app IDE. Seems like KomodoIDE 5.1 kicks some serious ass. I love the support for Mako and that it supports pretty much all of the SCMs. \nI've been using Textmate, but KomodoIDE will take over from now onwards","Q_Score":8,"Tags":"python,ide,pylons","A_Id":2364669,"CreationDate":"2009-06-30T20:46:00.000","Title":"Recommended IDE for developing Pylons apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either\n\nWingIDE\nKomodoIDE\n\nwhich you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself.\nOne con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?)\nI have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates.\nThank you very much all and have a great day!","AnswerCount":9,"Available Count":4,"Score":0.022218565,"is_accepted":false,"ViewCount":4484,"Q_Id":1065964,"Users Score":1,"Answer":"+1 for Spyder. Never heard of it before reading this page. Working great so far.","Q_Score":8,"Tags":"python,ide,pylons","A_Id":4134659,"CreationDate":"2009-06-30T20:46:00.000","Title":"Recommended IDE for developing Pylons apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either\n\nWingIDE\nKomodoIDE\n\nwhich you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself.\nOne con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?)\nI have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates.\nThank you very much all and have a great day!","AnswerCount":9,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":4484,"Q_Id":1065964,"Users Score":0,"Answer":"after very very careful comparison, KomodoIDE 5.1 is most suitable for my purposes.\nReasons:\n\nExtensibility\nSupport for Mako and YUI (required by me)\nNative interface support (no GTK unfamiliarity)\nSupport for Mercurial SCM (required by me)\n\nthats all I guess. I am extremely satisfied with KomodoIDE and have just shelled out some money to buy it.\nI figured when making a choice of tools, spend a day or two (yes, it takes time) trying them out and choosing what best suits your day-to-day purposes. If its just your first time coding, using a standard free tool or open source tool is far more useful than expending the time to find out the best tool.\nOnly after some degree of expertise is acquired, you have a very narrow spectrum of requirements\/preferences which will make choosing a tool far easier.","Q_Score":8,"Tags":"python,ide,pylons","A_Id":1085987,"CreationDate":"2009-06-30T20:46:00.000","Title":"Recommended IDE for developing Pylons apps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to use Python to access MFC document files generically? Can CArchive be used to query a file and view the structure, or does Python, in opening the document, need to know more about the document structure in order to view the contents?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":216,"Q_Id":1070932,"Users Score":0,"Answer":"I think that the Python code needs to know the document structure. \nMaybe you should make a python wrapper of your c++ code. \nIn this case, I would recommend to use http:\/\/sourceforge.net\/projects\/pycpp\/>pycpp which is my opinion a great library for making python extensions in c++.","Q_Score":1,"Tags":"python,windows,mfc,file","A_Id":1071011,"CreationDate":"2009-07-01T19:37:00.000","Title":"How To: View MFC Doc File in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Developing a project of mine I realize I have a need for some level of persistence across sessions, for example when a user executes the application, changes some preferences and then closes the app. The next time the user executes the app, be it after a reboot or 15 minutes, I would like to be able to retain the preferences that had been changed. \nMy question relates to this persistence. Whether programming an application using the win32 API or the MFC Framework .. or using the newer tools for higher level languages such as wxPython or wxRuby, how does one maintain the type of persistence I refer to? Is it done as a temporary file written to the disk? Is it saved into some registry setting? Is there some other layer it is stored in that I am unaware of?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":729,"Q_Id":1077649,"Users Score":3,"Answer":"I would advice to do it in two steps.\n\nFirst step is to save your prefs. as\nstring, for that you can\na)\nUse any xml lib or output xml by\nhand to output string and read\nsimilarly from string\nb) Just use pickle module to dump your prefs object as a string\nc) Somehow generate a string from prefs which you can read back as prefs e.g. use yaml, config , JSON etc actually JSON is a good option when simplejson makes it so easy.\nOnce you have your methods to convert to and from string are ready, you just need to store it somewhere where it is persisted and you can read back next time, for that you can\na) Use wx.Config which save to registry in windows and to other places depending on platform so you don't have to worry where it saves, you can just read back values in platform independent way. But if you wish you can just use wx.Config for directly saving reading prefs.\nb) Directly save prefs. string to a file in a folder assigned by OS to your app e.g. app data folder in windows.\n\nBenefit of saving to a string and than using wx.Config to save it, is that you can easily change where data is saved in future e.g. in future if there is a need to upload prefs. you can just upload prefs. string.","Q_Score":1,"Tags":"python,windows,wxpython","A_Id":1077697,"CreationDate":"2009-07-03T03:24:00.000","Title":"Windows Application Programming & wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"What's the correct way to prevent invoking (creating an instance of) a C type from Python?\nI've considered providing a tp_init that raises an exception, but as I understand it that would still allow __new__ to be called directly on the type.\nA C function returns instances of this type -- that's the only way instances of this type are intended to be created.\nEdit: My intention is that users of my type will get an exception if they accidentally use it wrongly. The C code is such that calling a function on an object incorrectly created from Python would crash. I realise this is unusual: all of my C extension types so far have worked nicely when instantiated from Python. My question is whether there is a usual way to provide this restriction.","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":339,"Q_Id":1079690,"Users Score":0,"Answer":"There is a fantastically bulletproof way. Let people create the object, and have Python crash. That should stop them doing it pretty efficiently. ;)\nAlso you can underscore the class name, to indicate that it should be internal. (At least, I assume you can create underscored classnames from C too, I haven't actually ever done it.)","Q_Score":2,"Tags":"python,cpython","A_Id":1080330,"CreationDate":"2009-07-03T14:49:00.000","Title":"Preventing invoking C types from Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.","AnswerCount":7,"Available Count":4,"Score":0.057080742,"is_accepted":false,"ViewCount":12921,"Q_Id":1080719,"Users Score":2,"Answer":"There is a way to do this, using the PrintWindow function. It causes the window to redraw itself on another surface.","Q_Score":6,"Tags":"python,windows,screenshot","A_Id":3586035,"CreationDate":"2009-07-03T20:22:00.000","Title":"Screenshot an application, regardless of what's in front of it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.","AnswerCount":7,"Available Count":4,"Score":0.0285636566,"is_accepted":false,"ViewCount":12921,"Q_Id":1080719,"Users Score":1,"Answer":"Maybe you can position the app offscreen, then take the screenshot, then put it back?","Q_Score":6,"Tags":"python,windows,screenshot","A_Id":1270114,"CreationDate":"2009-07-03T20:22:00.000","Title":"Screenshot an application, regardless of what's in front of it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.","AnswerCount":7,"Available Count":4,"Score":0.0285636566,"is_accepted":false,"ViewCount":12921,"Q_Id":1080719,"Users Score":1,"Answer":"If you can, try saving the order of the windows, then move your app to the front, screenshot, and move it back really quickly. Might produce a bit of annoying flicker, but it might be better than nothing.","Q_Score":6,"Tags":"python,windows,screenshot","A_Id":1080741,"CreationDate":"2009-07-03T20:22:00.000","Title":"Screenshot an application, regardless of what's in front of it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.","AnswerCount":7,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":12921,"Q_Id":1080719,"Users Score":0,"Answer":"IIRC, not in Windows pre-vista - with Aero each window has it's own buffer, but before that, you would just use your method, of getting the rectangle. I'm not sure if pywin32 has Aero support or not.","Q_Score":6,"Tags":"python,windows,screenshot","A_Id":1080733,"CreationDate":"2009-07-03T20:22:00.000","Title":"Screenshot an application, regardless of what's in front of it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have neglected my programming skills since i left school and now i want to start a few things that are running around in my head. Qt would be the toolkit for me to use but i am undecided if i should use Python (looks to me like the easier to learn with a few general ideas about programming) or C++ (the thing to use with Qt).\nIn my school we learned the basics with Turbo Pascal, VB and a voluntary C course, though right now i only know a hint of all the things i learned back then.\nCan you recommend me a way and a site or book (or two) that would bring me on that path (a perfect one would be one that teaches the language with help of the toolkit)?\nThank you in advance.","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4290,"Q_Id":1084935,"Users Score":25,"Answer":"Being an expert in both C++ and Python, my mantra has long been \"Python where I can, C++ where I must\": Python is faster (in term of programmer productivity and development cycle) and easier, C++ can give that extra bit of power when I have to get close to the hardware or be extremely careful about every byte or machine cycle I spend. In your situation, I would recommend Python (and the many excellent books and URLs already recommended in other answers).","Q_Score":8,"Tags":"c++,python,qt","A_Id":1084958,"CreationDate":"2009-07-05T22:13:00.000","Title":"C++ or Python as a starting point into GUI programming?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a game in python with pygame and need to render text onto the screen.\nI want to render this text in one colour with an outline, so that I don't have to worry about what sort of background the the text is being displayed over.\npygame.font doesn't seem to offer support for doing this sort of thing directly, and I'm wondering if anyone has any good solutions for achieving this?","AnswerCount":2,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":2637,"Q_Id":1109498,"Users Score":4,"Answer":"A quick and dirty way would be to render your text multiple times with the outline color, shifted by small amounts on a circle around the text position:\n\n 1\n 8 | 2\n \\ | \/\n \\|\/\n 7----*----3\n \/|\\\n \/ | \\ \n 6 | 4\n 5\n\nEdit: Doh you've been faster ! I wont delete my answer though, this ASCII art is just too good and deserves to live !\nEdit 2: As OregonGhost mentioned, you may need more or fewer steps for the outline rendering, depending on your outline width.","Q_Score":7,"Tags":"python,fonts,pygame","A_Id":1109553,"CreationDate":"2009-07-10T13:24:00.000","Title":"What's a good way to render outlined fonts?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What would you use for a brand new cross platform GUI app, CPython or IronPython ?\nWhat about\n - license \/ freedom\n - development\n - - doc\n - - editors\n - - tools\n - libraries\n - performances\n - portability \nWhat can you do best with one or the other ?\n - networking\n - database\n - GUI\n - system\n - multi threading \/ processing","AnswerCount":4,"Available Count":4,"Score":0.1973753202,"is_accepted":false,"ViewCount":5086,"Q_Id":1149692,"Users Score":4,"Answer":"if you like\/need to use .net framework, use ironpython, else CPython it's your choice\n(or you can try PyPy :))","Q_Score":7,"Tags":"python,ironpython,cpython","A_Id":1149740,"CreationDate":"2009-07-19T11:21:00.000","Title":"CPython or IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What would you use for a brand new cross platform GUI app, CPython or IronPython ?\nWhat about\n - license \/ freedom\n - development\n - - doc\n - - editors\n - - tools\n - libraries\n - performances\n - portability \nWhat can you do best with one or the other ?\n - networking\n - database\n - GUI\n - system\n - multi threading \/ processing","AnswerCount":4,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":5086,"Q_Id":1149692,"Users Score":4,"Answer":"Use CPython, with IronPython you are bound to .Net platform which do not have much cross platform support, mono is there on linux but still for a cross platform app, I wouldn't recommend .Net.\nSo my suggestion is use CPython, for GUI use a framework like wxPython\/PyQT and you would be happy.","Q_Score":7,"Tags":"python,ironpython,cpython","A_Id":1149762,"CreationDate":"2009-07-19T11:21:00.000","Title":"CPython or IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What would you use for a brand new cross platform GUI app, CPython or IronPython ?\nWhat about\n - license \/ freedom\n - development\n - - doc\n - - editors\n - - tools\n - libraries\n - performances\n - portability \nWhat can you do best with one or the other ?\n - networking\n - database\n - GUI\n - system\n - multi threading \/ processing","AnswerCount":4,"Available Count":4,"Score":0.0996679946,"is_accepted":false,"ViewCount":5086,"Q_Id":1149692,"Users Score":2,"Answer":"cpython is native runtime based python,,,it has a thin runtime level to the hosting os,\nironpy is soft vm based python,,,it has a heavy soft interpter embeded in the dotnet vm,,which is called clr\noverall,,,cpython is made to be a scripting language natively,,it focus on the language,while ironpy is made to accomplished with clr,,,where clr is the main essisal,,then the ironpy language itself,,,it focus on the clr platform...\ncheck hellogameprogramming.net for more details","Q_Score":7,"Tags":"python,ironpython,cpython","A_Id":11117032,"CreationDate":"2009-07-19T11:21:00.000","Title":"CPython or IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What would you use for a brand new cross platform GUI app, CPython or IronPython ?\nWhat about\n - license \/ freedom\n - development\n - - doc\n - - editors\n - - tools\n - libraries\n - performances\n - portability \nWhat can you do best with one or the other ?\n - networking\n - database\n - GUI\n - system\n - multi threading \/ processing","AnswerCount":4,"Available Count":4,"Score":0.0996679946,"is_accepted":false,"ViewCount":5086,"Q_Id":1149692,"Users Score":2,"Answer":"I can only think of about one \"cross platform\" GUI app that's remotely tolerable (firefox), and people are complaining wildly about it everywhere I look.\nIf you want to do cross platform, build a nice, solid model that can do the work you need done and build platform-specific GUIs that use it.\nI don't know how tolerable wxpython or pyqt are on Windows and Linux, but the further you get from plain cocoa on OS X, the harder it gets to build and the less pleasant it gets to use.","Q_Score":7,"Tags":"python,ironpython,cpython","A_Id":1150371,"CreationDate":"2009-07-19T11:21:00.000","Title":"CPython or IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can anybody help me out in how to activate 'close' button of askquestion() of tkMessageBox??","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1575,"Q_Id":1151770,"Users Score":0,"Answer":"By 'activate', do you mean make it so the user can close the message box by clicking the close ('X') button?\nI do not think it is possible using tkMessageBox. I guess your best bet is to implement a dialog box with this functionality yourself.\nBTW: What should askquestion() return when the user closes the dialog box?","Q_Score":1,"Tags":"python,tkmessagebox","A_Id":1151900,"CreationDate":"2009-07-20T05:00:00.000","Title":"tkMessageBox","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having some issues with the size of qt4 widgets when their content changes.\nI will illustrate my problems with two simple scenarios:\nScenario 1:\nI have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore. I must select the widget and use the arrow keys to scroll the string in both directions in order to see it all.\nScenario 2:\nI have a QTextEdit widget. Sometimes, when I'm changing its content using QTextEdit.setHtml(), the rendered HTML content doesn't fit into the widget at its current size anymore. The widget starts displaying horizontal and\/or vertical scroll bars and I can use them to scroll the HTML content.\nWhat I would want in such scenarios is to have some logic that decides if after a content change, the new content won't fit anymore into the widget and automatically increase the widget size so everything would fit.\nHow are these scenarios handled?\nI'm using PyQt4.\nEdit: after reading both the comment and the first answer (which mentions typing content into the widget), I went over the question one more time. I was unpleasantly surprised to find out a horrible typo. I meant QTextBrowser when I wrote QTextEdit, my apologies for misleading you. That is: I have a widget which renders HTML code that I'm changing and I would want the widget to grow enough to display everything without having scrollbars.\nAs for QLineEdit instead of QLabel - I went for QLineEdit since I've noticed I can't select text from a QLabel with the mouse for copying it. With QLineEdit it is possible.","AnswerCount":5,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":12735,"Q_Id":1153714,"Users Score":8,"Answer":"I'm answering in C++ here, since that's what I'm most familiar with, and your problem isn't specific to PyQt.\nNormally, you just need to call QWidget::updateGeometry() when the sizeHint() may have changed, just like you need to call QWidget::update() when the contents may have changed.\nYour problem, however, is that the sizeHint() doesn't change when text is added to QLineEdit and QTextEdit. For a reason: People don't expect their dialogs to grow-as-they-type :)\nThat said, if you really want grow-as-you-type behaviour in those widgets you need to inherit from them and reimplement sizeHint() and minimumSizeHint() to return the larger size, and potentially setText(), append() etc. to call updateGeometry() so the sizehint change is noticed.\nThe sizehint calculation won't be entirely trivial, and will be way easier for QLineEdit than for QTextEdit (which is secretly a QAbstractScrollArea), but you can look at the sizeHint() and minimumSizeHint() implementations for inspiration (also the one for QComboBox, which has a mode to do exactly what you want: QComboBox::AdjustToContents.\nEDIT: Your two usecases (QTextBrowser w\/o scrollbars and QLineEdit instead of QLabel just for selecting the text in there) can be solved by using a QLabel and a recent enough Qt. QLabel has gained both link-clicking notification and so-called \"text-interaction flags\" (one of which is TextSelectableByMouse) in Qt 4.2. The only difference that I was able to make out is that loading new content isn't automatic, there's no history, and there's no micro focus hinting (ie. tabbing from link to link) in QLabel.","Q_Score":12,"Tags":"c++,python,qt,qt4,pyqt4","A_Id":1166388,"CreationDate":"2009-07-20T13:53:00.000","Title":"PyQt: how to handle auto-resize of widgets when their content changes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having some issues with the size of qt4 widgets when their content changes.\nI will illustrate my problems with two simple scenarios:\nScenario 1:\nI have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore. I must select the widget and use the arrow keys to scroll the string in both directions in order to see it all.\nScenario 2:\nI have a QTextEdit widget. Sometimes, when I'm changing its content using QTextEdit.setHtml(), the rendered HTML content doesn't fit into the widget at its current size anymore. The widget starts displaying horizontal and\/or vertical scroll bars and I can use them to scroll the HTML content.\nWhat I would want in such scenarios is to have some logic that decides if after a content change, the new content won't fit anymore into the widget and automatically increase the widget size so everything would fit.\nHow are these scenarios handled?\nI'm using PyQt4.\nEdit: after reading both the comment and the first answer (which mentions typing content into the widget), I went over the question one more time. I was unpleasantly surprised to find out a horrible typo. I meant QTextBrowser when I wrote QTextEdit, my apologies for misleading you. That is: I have a widget which renders HTML code that I'm changing and I would want the widget to grow enough to display everything without having scrollbars.\nAs for QLineEdit instead of QLabel - I went for QLineEdit since I've noticed I can't select text from a QLabel with the mouse for copying it. With QLineEdit it is possible.","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":12735,"Q_Id":1153714,"Users Score":0,"Answer":"Ok implement sizeHint() method. And every time your content change size call updateGeometry()\nWhen content change without changing size use update(). (updateGeometry() automatically call update()).","Q_Score":12,"Tags":"c++,python,qt,qt4,pyqt4","A_Id":1813475,"CreationDate":"2009-07-20T13:53:00.000","Title":"PyQt: how to handle auto-resize of widgets when their content changes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a tkinter GUI that downloads data from multiple websites at once. I run a seperate thread for each download (about 28). Is that too much threads for one GUI process? because it's really slow, each individual page should take about 1 to 2 seconds but when all are run at once it takes over 40 seconds. Is there any way I can shorten the time it takes to download all the pages? Any help is appreciated, thanks.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":373,"Q_Id":1155404,"Users Score":0,"Answer":"You can try using processes instead of threads. Python has GIL which might cause some delays in your situation.","Q_Score":0,"Tags":"python,user-interface,multithreading,download,tkinter","A_Id":1155479,"CreationDate":"2009-07-20T19:20:00.000","Title":"Python accessing multiple webpages at once","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a tkinter GUI that downloads data from multiple websites at once. I run a seperate thread for each download (about 28). Is that too much threads for one GUI process? because it's really slow, each individual page should take about 1 to 2 seconds but when all are run at once it takes over 40 seconds. Is there any way I can shorten the time it takes to download all the pages? Any help is appreciated, thanks.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":373,"Q_Id":1155404,"Users Score":1,"Answer":"A process can have hundreds of threads on any modern OS without any problem.\nIf you're bandwidth-limited, 1 to 2 seconds times 28 means 40 seconds is about right. If you're latency limited, it should be faster, but with no information, all I can suggest is:\n\nadd logging to your code to make sure it's actually running in parallel, and that you're not accidentally serializing your threads somehow;\nuse a network monitor to make sure that network requests are actually going out in parallel.\n\nIt's hard to give anything better without more information.","Q_Score":0,"Tags":"python,user-interface,multithreading,download,tkinter","A_Id":1155498,"CreationDate":"2009-07-20T19:20:00.000","Title":"Python accessing multiple webpages at once","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any way to detect which keys are currently pressed using Tkinter? I don't want to have to use extra libraries if possible. I can already detect when keys are pressed, but I want to be able to check at any time what keys are pressed down at the moment.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2295,"Q_Id":1181027,"Users Score":4,"Answer":"I think you need to keep track of events about keys getting pressed and released (maintaining your own set of \"currently pressed\" keys) -- I believe Tk doesn't keep track of that for you (and Tkinter really adds little on top of Tk, it's mostly a direct interface to it).","Q_Score":2,"Tags":"python,tkinter,keylistener","A_Id":1181037,"CreationDate":"2009-07-25T02:38:00.000","Title":"How can you check if a key is currently pressed using Tkinter in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?\nI'd appreciate a simple example - Boost::Python will do","AnswerCount":7,"Available Count":6,"Score":0.0855049882,"is_accepted":false,"ViewCount":522,"Q_Id":1181462,"Users Score":3,"Answer":"Here's two possibilities:\n\nPerhaps the C++ code is already written & available for use. \nIt's likely the C++ code is faster\/smaller than equivalent Python","Q_Score":4,"Tags":"c++,python","A_Id":1181468,"CreationDate":"2009-07-25T07:14:00.000","Title":"Practical point of view: Why would I want to use Python with C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?\nI'd appreciate a simple example - Boost::Python will do","AnswerCount":7,"Available Count":6,"Score":0.057080742,"is_accepted":false,"ViewCount":522,"Q_Id":1181462,"Users Score":2,"Answer":"Here's a real-life example: I've written a DLL in C to interface with some custom hardware for work. Then for the very first stage of testing, I was writing short programs in C to verify that the different commands were working properly. The process of write, compile, run took probably 3-5 times as long as when I finally wrote a Python interface to the DLL using ctypes.\nNow, I can write testing scripts much more rapidly with much less regards to proper variable initialization and memory management that I would have to worry about in C. In fact, I've even been able to use unit testing libraries in Python to create much more robust tests than before. Would that have been possible in C? Absolutely, but it would have taken me much longer, and it would have been many more lines of code. \nFewer lines of code in Python means (in general) that there are fewer things with my main logic that can go wrong.\nMoreover, since the hardware communication is almost completely IO bound, there's no need to write any supporting code in C. I may as well program in whatever is fastest to develop.\nSo there you go, real-life example.","Q_Score":4,"Tags":"c++,python","A_Id":1182301,"CreationDate":"2009-07-25T07:14:00.000","Title":"Practical point of view: Why would I want to use Python with C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?\nI'd appreciate a simple example - Boost::Python will do","AnswerCount":7,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":522,"Q_Id":1181462,"Users Score":0,"Answer":"One nice thing about using a scripting language is that you can reload new code into the application without quitting the app, then making changes, recompile, and then relaunching the app. When people talk about quicker development times, some of that refers to this capability.\nA downside of using a scripting languages is that their debuggers are usually not as fully featured as what you would have in C++. I haven't done any Python programming so I don't know what the features are of its debugger, if it has one at all.\nThis answer doesn't exactly answer what you asked but I thought it was relevant. The answer is more the pro\/cons of using a scripting language. Please don't flame me. :)","Q_Score":4,"Tags":"c++,python","A_Id":1182051,"CreationDate":"2009-07-25T07:14:00.000","Title":"Practical point of view: Why would I want to use Python with C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?\nI'd appreciate a simple example - Boost::Python will do","AnswerCount":7,"Available Count":6,"Score":0.0855049882,"is_accepted":false,"ViewCount":522,"Q_Id":1181462,"Users Score":3,"Answer":"Because C++ provides a direct way of calling OS services, and (if used in a careful way) can produce code that is more efficient in memory and time, whereas Python is a high-level language, and is less painful to use in those situations where utter efficiency isn't a concern and where you already have libraries giving you access to the services you need.\nIf you're a C++ user, you may wonder why this is necessary, but the expressiveness and safety of a high-level language has such a massive relative effect on your productivity, it has to be experienced to be understood or believed.\nI can't speak for Python specifically, but I've heard people talk in terms of \"tripling\" their productivity by doing most of their development in it and using C++ only where shown to be necessary by profiling, or to create extra libraries.\nIf you're a Python user, you may not have encountered a situation where you need anything beyond the libraries already available, and you may not have a problem with the performance you get from pure Python (this is quite likely). In which case - lucky you! You can forget about all this.","Q_Score":4,"Tags":"c++,python","A_Id":1181481,"CreationDate":"2009-07-25T07:14:00.000","Title":"Practical point of view: Why would I want to use Python with C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?\nI'd appreciate a simple example - Boost::Python will do","AnswerCount":7,"Available Count":6,"Score":0.1418931938,"is_accepted":false,"ViewCount":522,"Q_Id":1181462,"Users Score":5,"Answer":"Generally, you'd call C++ from python in order to use an existing library or other functionality. Often someone else has written a set of functions that make your life easier, and calling compiled C code is easier than re-writing the library in python.\nThe other reason is for performance purposes. Often, specific functions of an otherwise completely scripted program are written in a pre-compiled language like C because they take a long time to run and can be more efficiently done in a lower-level language.\nA third reason is for interfacing with devices. Python doesn't natively include a lot of code for dealing with sound cards, serial ports, and so on. If your device needs a device driver, python will talk to it via pre-compiled code you include in your app.","Q_Score":4,"Tags":"c++,python","A_Id":1181476,"CreationDate":"2009-07-25T07:14:00.000","Title":"Practical point of view: Why would I want to use Python with C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?\nI'd appreciate a simple example - Boost::Python will do","AnswerCount":7,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":522,"Q_Id":1181462,"Users Score":0,"Answer":"Performance :\n\nFrom my limited experience, Python is about 10 times slower than using C.\nUsing Psyco will dramatically improve it, but still about 5 times slower than C.\nBUT, calling c module from python is only a little faster than Psyco.\n\nWhen you have some libraries in C.\nFor example, I am working heavily on SIP. It's a very complicated protocol stacks and there is no complete Python implementation. So my only choice is calling SIP libraries written in C.\n\nThere are also this kind of cases, like video\/audio decoding.","Q_Score":4,"Tags":"c++,python","A_Id":1181567,"CreationDate":"2009-07-25T07:14:00.000","Title":"Practical point of view: Why would I want to use Python with C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The Python manual says that you can create modules for Python in both C and C++. Can you take advantage of things like classes and templates when using C++? Wouldn't it create incompatibilities with the rest of the libraries and with the interpreter?","AnswerCount":4,"Available Count":2,"Score":0.1488850336,"is_accepted":false,"ViewCount":567,"Q_Id":1185878,"Users Score":3,"Answer":"The boost folks have a nice automated way to do the wrapping of C++ code for use by python.\nIt is called: Boost.Python\nIt deals with some of the constructs of C++ better than SWIG, particularly template metaprogramming.","Q_Score":6,"Tags":"c++,python,c,python-c-api,python-c-extension","A_Id":1185954,"CreationDate":"2009-07-26T23:30:00.000","Title":"Can I use C++ features while extending Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The Python manual says that you can create modules for Python in both C and C++. Can you take advantage of things like classes and templates when using C++? Wouldn't it create incompatibilities with the rest of the libraries and with the interpreter?","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":567,"Q_Id":1185878,"Users Score":9,"Answer":"It doesn't matter whether your implementation of the hook functions is implemented in C or in C++. In fact, I've already seen some Python extensions which make active use of C++ templates and even the Boost library. No problem. :-)","Q_Score":6,"Tags":"c++,python,c,python-c-api,python-c-extension","A_Id":1185907,"CreationDate":"2009-07-26T23:30:00.000","Title":"Can I use C++ features while extending Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a PyShell, which is supposed to be derived from wx.stc.StyledTextCtrl. How do I change the color scheme that it currently uses?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":828,"Q_Id":1211380,"Users Score":0,"Answer":"You can use \nstyledTextCtrl.StyleSetSpec(wx.stc.STC_STYLE_INDENTGUIDE, \"fore:#CDCDCD\")\n(Bunch of .StyleSetSpec properties)\n...\n...\n...\nstyCtrl.SetCaretForeground(\"BLUE\")\nstyCtrl.SetSelBackground(True, wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT))\nstyCtrl.SetSelForeground(True, wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))\n...\n(Bunch of Set*() commands)\nDon't know if there is a way to load a pre-defined color scheme.\nYou could define it in YAML and load it up via the commands above and more.","Q_Score":1,"Tags":"python,user-interface,wxpython,color-scheme","A_Id":1272807,"CreationDate":"2009-07-31T08:51:00.000","Title":"wxPython: Changing the color scheme of a wx.stc.StyledTextCtrl","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pygtk with PIL. I've already figured out a way to convert PIL Images to gtk.gdk.Pixbufs. What I do to display the pixbuf is I create a gtk.gdk.Image, and then use img.set_from_pixbuf. I now want to draw a few lines onto this image. Apparently I need a Drawable to do that. I've started looking through the docs but already I have 8-10 windows open and it is not being straightforward at all. \nSo - what magic do I need to type to get a Drawable representing my picture, draw some things on to it, and then turn it into a gdk.Image so I can display it on my app?","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":5113,"Q_Id":1213090,"Users Score":1,"Answer":"You should connect to the expose-event (GTK 2) or draw (GTK 3) signal. In that handler, simply use image.window to get the widget's gtk.gdk.Window; this is a subclass of gtk.gdk.Drawable, so you can draw on it.","Q_Score":3,"Tags":"python,gtk,drawing,pygtk","A_Id":6578903,"CreationDate":"2009-07-31T15:10:00.000","Title":"pygtk: Draw lines onto a gtk.gdk.Pixbuf","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to be warned when user selects the whole row in a wxGrid but I do not see an event that handles this.What is the best way to do it?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":3008,"Q_Id":1215846,"Users Score":1,"Answer":"Actually, I figured it out. There are events like EVT_GRID_LABEL_LEFT_CLICK and then I test event.GetCol() == -1, to make sure the click is on a whole row, not a whole column.","Q_Score":3,"Tags":"events,wxpython","A_Id":1263720,"CreationDate":"2009-08-01T04:40:00.000","Title":"Detect row selection in wxGrid","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently working on a game engine written in pygame and I wanted to add OpenGL support.\nI wrote a test to see how to make pygame and OpenGL work together, and when it's running in windowed mode, it runs between 150 and 200 fps. When I run it full screen (all I did was add the FULLSCREEN flag when I set up the window), it drops down to 60 fps. I added a lot more drawing functions to see if it was just a huge performance drop, but it always ran at 60 fps.\nIs there something extra I need to do to tell OpenGL that it's running fullscreen or is this a limitation of OpenGL?\n(I am running in Windows XP)","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3949,"Q_Id":1217939,"Users Score":0,"Answer":"If you are not changing your clock.tick() when you change between full screen and windowed mode this is almost certainly a vsync issue. If you are on an LCD then it's 100% certain.\nUnfortunately v-sync can be handled in many places including SDL, Pyopengl, your display server and your video drivers. If you are using windows you can adjust the vsync toggle in the nvidia control panel to test, and there's more than likely something in nvidia-settings for linux as well. I'd guess other manufacturers drivers have similar settings but that's a guess.","Q_Score":2,"Tags":"python,fullscreen,pygame,pyopengl","A_Id":1218011,"CreationDate":"2009-08-02T01:22:00.000","Title":"PyOpenGL + Pygame capped to 60 FPS in Fullscreen","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pyGTK. I want to layout a large element with 2 smaller ones on each side. For aesthetic reasons, I want the 2 smaller ones to be the same size. As it is, they differ by a few pixels, and the middle element is not centered as a result.\nI tried using gtk.Table with 3 cells, but having homogeneous=True doesn't have the desired effect. I tried messing with it by making 8 cells, and then having the center one take up more cells, but it doesn't work well. Is there any way to do this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":238,"Q_Id":1229933,"Users Score":6,"Answer":"You should use GtkSizeGroup for this. Create a GtkSizeGroup, add both widgets to it. This will ensure that both widgets have the same size. If you want that widget have the same size in only one direction (width or height), set the \"mode\" property of SizeGroup.","Q_Score":1,"Tags":"python,layout,gtk,pygtk","A_Id":1229981,"CreationDate":"2009-08-04T21:04:00.000","Title":"How to make two elements in gtk have the same size?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For example, graying out the \"X\" on windows systems.","AnswerCount":2,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":721,"Q_Id":1235417,"Users Score":4,"Answer":"Just call the set_deletable with False on the window in question. It will work as long as GTK can convince the window manager to make the window unclosable.","Q_Score":4,"Tags":"python,windows,gtk,pygtk","A_Id":1235424,"CreationDate":"2009-08-05T19:59:00.000","Title":"In GTK, how do I make a window unable to be closed?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Various examples always use alloc_color() and stuff like gtk.color.parse('red'), etc. I just do gtk.gdk.Color(65535,0,0), and that seems to work. What's the need for alloc_color?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":236,"Q_Id":1242541,"Users Score":2,"Answer":"If you're running on a system that uses a palette display (as opposed to a true-colour display), then you must allocate new colours in the palette before you can use them. This is because palette-based displays can only display a limited number of colours at once (usually 256 or sometimes 65536).\nMost displays these days are capable of true colour display, which can display all available colours simultaneously, so this won't appear to be a problem and you can get away with directly asking for specific colours.","Q_Score":1,"Tags":"python,gtk,colors,pygtk","A_Id":1242550,"CreationDate":"2009-08-07T02:03:00.000","Title":"What's the point of alloc_color() in gtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am assisting with Windows support for a PyGTK app that appears as a system tray applet, but am not so strong on the GTK+ gooey stuff...\nWe have it so when you left-click the systray icon, the window appears right by your tray icon no matter where your system tray is--and on Linux this works great, using the results of gtk.StatusIcon.get_geometry() to calculate the size and position. \nOf course, the docs for gtk.StatusIcon.get_geometry() point out that \"some platforms do not provide this information\"--and this includes MS Windows, as I get NoneType as the result.\nI can make a guess and position the window in the bottom-right corner of the screen, 30 pixels up from the bottom--as this will catch the majority of Windows users who haven't moved the taskbar. But for those that have, it looks all wrong.\nSo is there a Windows-friendly way to get the position of the systray icon so I can place my window there?\n\nPlease note: I am already using gtk_menu_popup() with gtk_status_icon_position_menu for a pop-up menu which works correctly.\nBut what I am trying to position is a separate gtk.Window, which will not accept gtk_status_icon_position_menu (because it's not a menu).\nAny other ideas would be appreciated...","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1237,"Q_Id":1246552,"Users Score":1,"Answer":"Gtk provides function gtk_status_icon_position_menu that can be passed into gtk_menu_popup as a GtkPositionFunc.\nThis seems to provide the requested functionality.","Q_Score":4,"Tags":"python,windows,gtk,pygtk","A_Id":1247303,"CreationDate":"2009-08-07T19:27:00.000","Title":"Getting the position of the gtk.StatusIcon on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am assisting with Windows support for a PyGTK app that appears as a system tray applet, but am not so strong on the GTK+ gooey stuff...\nWe have it so when you left-click the systray icon, the window appears right by your tray icon no matter where your system tray is--and on Linux this works great, using the results of gtk.StatusIcon.get_geometry() to calculate the size and position. \nOf course, the docs for gtk.StatusIcon.get_geometry() point out that \"some platforms do not provide this information\"--and this includes MS Windows, as I get NoneType as the result.\nI can make a guess and position the window in the bottom-right corner of the screen, 30 pixels up from the bottom--as this will catch the majority of Windows users who haven't moved the taskbar. But for those that have, it looks all wrong.\nSo is there a Windows-friendly way to get the position of the systray icon so I can place my window there?\n\nPlease note: I am already using gtk_menu_popup() with gtk_status_icon_position_menu for a pop-up menu which works correctly.\nBut what I am trying to position is a separate gtk.Window, which will not accept gtk_status_icon_position_menu (because it's not a menu).\nAny other ideas would be appreciated...","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1237,"Q_Id":1246552,"Users Score":0,"Answer":"The behavior i experienced in windows with gtk_status_icon_position_menu was that it spawns the window at the location the user clicked in the statusicon","Q_Score":4,"Tags":"python,windows,gtk,pygtk","A_Id":1874016,"CreationDate":"2009-08-07T19:27:00.000","Title":"Getting the position of the gtk.StatusIcon on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've just started working with pygame and I'm trying to make a semi-transparent sprite, and the sprite's source file is a non-transparent bitmap file loaded from the disk. I don't want to edit the source image if I can help it. I'm sure there's a way to do this with pygame code, but Google is of no help to me.","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":7546,"Q_Id":1247921,"Users Score":1,"Answer":"you might consider switching to using png images where you can do any kind of transparency you want directly in the image.","Q_Score":4,"Tags":"python,graphics,sprite,pygame","A_Id":1247984,"CreationDate":"2009-08-08T03:51:00.000","Title":"How to make translucent sprites in pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How to create a non-editable text box with no cursor in wxPython to dump text in?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4502,"Q_Id":1254819,"Users Score":7,"Answer":"wx.StaticText\nYou could also use a regular TextCtrl with the style TE_READONLY but that shows a cursor and the text looks editable, but it isn't.","Q_Score":5,"Tags":"python,textbox,wxpython,wxwidgets","A_Id":1254881,"CreationDate":"2009-08-10T13:16:00.000","Title":"Non-editable text box in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How to change only hight of an object in wxPython, leaving its width automatic? In my case it's a TextCtrl.\nHow to make the height of the window available for change and lock the width?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":258,"Q_Id":1265821,"Users Score":6,"Answer":"For the width or height to be automatically determined based on context you use for it the value of -1, for example (-1, 100) for a height of 100 and automatic width.\nThe default size for controls is usually (-1, -1).\nIf a width or height is specified and the sizer item for the control doesn't have wx.EXPAND flag set (note that even if this flag is set some sizers won't expand in both directions by default) you might call it \"locked\" as it won't chage that dimension.\nMake sure to study the workings of sizers in depth as it is one of the most important things in GUI design.","Q_Score":2,"Tags":"python,wxpython,size","A_Id":1265988,"CreationDate":"2009-08-12T12:22:00.000","Title":"Changing height of an object in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In GTK, how can I scale an image? Right now I load images with PIL and scale them beforehand, but is there a way to do it with GTK?","AnswerCount":6,"Available Count":1,"Score":-0.0333209931,"is_accepted":false,"ViewCount":18745,"Q_Id":1269320,"Users Score":-1,"Answer":"actually when we use\ngdk_pixbuf_scale_simple(pb,700,700,GDK_INTERP_BILINEAR); this function causes memory leakage (If we monitor task manager the memory requirement goes on increasing till it kills the process) when used with a timer event. How to solve that","Q_Score":22,"Tags":"python,user-interface,image,gtk,pygtk","A_Id":64004356,"CreationDate":"2009-08-12T23:44:00.000","Title":"Scale an image in GTK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a top-down view 2d game at the moment and I am learning a ton about sprites and sprite handling. My question is how to handle a set of sprites that can be rotated in as many as 32 directions.\nAt the moment a given object has its sprite sheet with all of the animations oriented with the object pointing at 0 degrees at all times. Now, since the object can rotate in as many as 32 directions, what is the best way to work with that original sprite sheet. My current best guess is to have the program basically dynamically create 32 more sprite sheets when the object is first loaded into the game, and then all subsequent instances of that type of object will share those sprite sheets.\nAnyways, any advice in this regard would be helpful. Let me know if I need to rephrase the question, I know its kindof an odd one. Thanks\nEdit: I guess for more clarification. If I have, for instance an object that has 2 animations of 5 frames a peice, that is a pretty easy sprite sheet to create and organize, its a simple 2x5 grid (or 5x2 depending on how you lay it out). But the problem is that now those 2 animations have to be rotated in 32 directions. This means that in the end there will be 320 individual sprites. I am going to say that (and correct me if im wrong) since I'm concerned about performance and frame-rate, rotating the sprites on the fly every single frame is not an option. So, how should these 320 sprites that make up these 2 animations be organized? Would it be better to\n\nThink of it as 32 2x5 sprite sheets\nsplit the sprite sheet up into individual frames, and then have an array the 32 different directions per frame (so 10 arrays of 32 directional sprites)\nOther....?\nDoesn't matter?\n\nThanks","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1381,"Q_Id":1275482,"Users Score":1,"Answer":"Typically you will sacrifice either processor time or memory, and you need to balance between the two. Unless you've got some great limit to your processor or you're computing a lot of expensive stuff, there's no real reason to put all that into the memory. Rotating a few sprites with a transform is cheap enough that it is definitely not worth it to store 32x as much information in memory - especially because that information is a bunch of images, and images use up a lot of memory, relatively speaking.","Q_Score":2,"Tags":"python,pygame,sprite","A_Id":1296881,"CreationDate":"2009-08-14T00:47:00.000","Title":"What is the best way to handle rotating sprites for a top-down view game","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a top-down view 2d game at the moment and I am learning a ton about sprites and sprite handling. My question is how to handle a set of sprites that can be rotated in as many as 32 directions.\nAt the moment a given object has its sprite sheet with all of the animations oriented with the object pointing at 0 degrees at all times. Now, since the object can rotate in as many as 32 directions, what is the best way to work with that original sprite sheet. My current best guess is to have the program basically dynamically create 32 more sprite sheets when the object is first loaded into the game, and then all subsequent instances of that type of object will share those sprite sheets.\nAnyways, any advice in this regard would be helpful. Let me know if I need to rephrase the question, I know its kindof an odd one. Thanks\nEdit: I guess for more clarification. If I have, for instance an object that has 2 animations of 5 frames a peice, that is a pretty easy sprite sheet to create and organize, its a simple 2x5 grid (or 5x2 depending on how you lay it out). But the problem is that now those 2 animations have to be rotated in 32 directions. This means that in the end there will be 320 individual sprites. I am going to say that (and correct me if im wrong) since I'm concerned about performance and frame-rate, rotating the sprites on the fly every single frame is not an option. So, how should these 320 sprites that make up these 2 animations be organized? Would it be better to\n\nThink of it as 32 2x5 sprite sheets\nsplit the sprite sheet up into individual frames, and then have an array the 32 different directions per frame (so 10 arrays of 32 directional sprites)\nOther....?\nDoesn't matter?\n\nThanks","AnswerCount":3,"Available Count":2,"Score":0.2605204458,"is_accepted":false,"ViewCount":1381,"Q_Id":1275482,"Users Score":4,"Answer":"The 32 directions for the sprite translate into 32 rotations by 11.25 degrees. \nYou can reduce the number of precalculated images to 8 you only calculate the first 90 degrees (11.25, 22.5, 33.75, 45.0, 56.25, 67.5, 78.75, 90.0) and use the flip operations dynamically. Flips are much faster because they essentially only change the order an image is copied from the buffer. \nFor example, when you display an image that is rotated by 101.25 degrees, load the precalculated image of 67.5 degrees and flip it vertically.\nI just realized that this only works if your graphic is symmetrical ;-)\nWhen talking about a modern computer, you might not need to optimize anything. The memory used by precalculating the sprites is certainly negligible, and the cpu usage when rotating the image probably too. When you are programming for a embedded device however, it does matter.","Q_Score":2,"Tags":"python,pygame,sprite","A_Id":1277181,"CreationDate":"2009-08-14T00:47:00.000","Title":"What is the best way to handle rotating sprites for a top-down view game","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.\nSome things I'm looking for:\n\nIt has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the \"public slots:\" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.\nThe less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.\n\nI'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on \"fun stuff\" (e.g. less boilerplate, more meat of the app).\nAny tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":10487,"Q_Id":1289941,"Users Score":0,"Answer":"Having looked several ones, like django, pylos, web2py, wt. My recommendation is web2py. It's a python version of \"ruby on rails\" and easy to learn.","Q_Score":12,"Tags":"c++,python,wt","A_Id":1475164,"CreationDate":"2009-08-17T19:33:00.000","Title":"Web Application Frameworks: C++ vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.\nSome things I'm looking for:\n\nIt has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the \"public slots:\" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.\nThe less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.\n\nI'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on \"fun stuff\" (e.g. less boilerplate, more meat of the app).\nAny tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.","AnswerCount":7,"Available Count":2,"Score":0.0285636566,"is_accepted":false,"ViewCount":10487,"Q_Id":1289941,"Users Score":1,"Answer":"I think you better go firt python in your case, meanwhile you can extend cppCMS functionalities and write your own framework arround it.\nwt was a good idea design, but somehow not that suitable.","Q_Score":12,"Tags":"c++,python,wt","A_Id":1290620,"CreationDate":"2009-08-17T19:33:00.000","Title":"Web Application Frameworks: C++ vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have a wx.Frame that has only a single child. While setting up the child's wx.Sizer, I can use the wx.SHAPED flag, which keeps the aspect ratio of the child locked. However, the Frame still has complete freedom in it's aspect ratio, and will leave a blank space in the area that is left unused by the child.\nHow can I lock the aspect ratio of the wx.Frame during resizing?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":5993,"Q_Id":1291991,"Users Score":5,"Answer":"Sizers cannot be applied to top-level windows (in order to define properties of the windows themselves as opposed to their contents), so unfortunately there is no \"true\" way to lock in the aspect ratio. Your best bet would be to catch your window's OnSize event, get the size that the user wants the window to be (which is stored in the wxSizeEvent), calculate the new width and height according to the aspect ratio and then immediately call SetSize with the new size. \nThis technique has the drawback of visual artifacts during resizing (the operating system will initially paint the window according to how the user has dragged it but then immediately redraw it after you call SetSize, leading to a flickering effect) so it isn't a great solution, however since you cannot lock top-level windows into aspect ratios (and prevent the need to resize with SetSize at all) you'll have to decide whether the flickering is worth it.","Q_Score":2,"Tags":"wxpython,resize,wxwidgets,frame,aspect-ratio","A_Id":1292083,"CreationDate":"2009-08-18T05:37:00.000","Title":"wxwidgets\/wxPython: Resizing a wxFrame while keeping aspect ratio","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have two PNGs that I am trying to combine into a PDF using ReportLab 2.3 on Python 2.5. When I use canvas.drawImage(ImageReader) to write either PNG onto the canvas and save, the transparency comes out black. If I use PIL (1.1.6) to generate a new Image, then paste() either PNG onto the PIL Image, it composits just fine. I've double checked in Gimp and both images have working alpha channels and are being saved correctly. I'm not receiving an error and there doesn't seem to be anything my google-fu can turn up. \nHas anybody out there composited a transparent PNG onto a ReportLab canvas, with the transparency working properly? Thanks!","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":11462,"Q_Id":1308710,"Users Score":2,"Answer":"I've found that mask='auto' has stopped working for me with reportlab 3.1.8. In the docs it says to pass the values that you want masked out. So what works for me now is mask=[0, 2, 0, 2, 0, 2, ]. Basically it looks like this `mask=[red_start, red_end, green_start, green_end, blue_start, blue_end, ]\n\nThe mask parameter lets you create transparent images. It takes 6\n numbers and defines the range of RGB values which will be masked out\n or treated as transparent. For example with [0,2,40,42,136,139], it\n will mask out any pixels with a Red value from 0 or 1, Green from 40\n or 41 and Blue of 136, 137 or 138 (on a scale of 0-255). It's\n currently your job to know which color is the 'transparent' or\n background one.\n\nUPDATE: That masks out anything that is rgb(0, 0, 0) or rgb(1, 1, 1) which obviously might not be the right solution. My problem was people uploading png images with a gray color space. So I need to still figure out a way to detect the color space of the image. and only apply that mask on gray space images.","Q_Score":29,"Tags":"python,python-imaging-library,reportlab","A_Id":28385327,"CreationDate":"2009-08-20T20:45:00.000","Title":"Transparency in PNGs with reportlab 2.3","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have two PNGs that I am trying to combine into a PDF using ReportLab 2.3 on Python 2.5. When I use canvas.drawImage(ImageReader) to write either PNG onto the canvas and save, the transparency comes out black. If I use PIL (1.1.6) to generate a new Image, then paste() either PNG onto the PIL Image, it composits just fine. I've double checked in Gimp and both images have working alpha channels and are being saved correctly. I'm not receiving an error and there doesn't seem to be anything my google-fu can turn up. \nHas anybody out there composited a transparent PNG onto a ReportLab canvas, with the transparency working properly? Thanks!","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":11462,"Q_Id":1308710,"Users Score":1,"Answer":"ReportLab uses PIL for managing images. Currently, PIL trunk has patch applied to support transparent PNGs, but you will have to wait for a 1.1.6 release if you need stable package.","Q_Score":29,"Tags":"python,python-imaging-library,reportlab","A_Id":1311056,"CreationDate":"2009-08-20T20:45:00.000","Title":"Transparency in PNGs with reportlab 2.3","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I started using Wing IDE and it's great. I'm building a wxPython app, and I noticed that Wing IDE catches exceptions that are usually caught by wxPython and not really raised. This is usually useful, but I would like to disable this behavior occasionally. How do I do that?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":175,"Q_Id":1323361,"Users Score":0,"Answer":"There is a Ignore this exception location check box in the window where the exception is reported in wing, or you could explicitly silence that specific exception in you code with a try except block.","Q_Score":0,"Tags":"python,wxpython,wing-ide","A_Id":1323458,"CreationDate":"2009-08-24T16:21:00.000","Title":"Getting Wing IDE to stop catching the exceptions that wxPython catches","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":3879,"Q_Id":1327105,"Users Score":1,"Answer":"I maybe don't understand the question well but copying IronMath.dll and IronPython.dll to the folder with main.exe and main.dll should work for Ironpython 1.x. These .dlls are different for IronPython 2.x.\nEdit: Well, I tried PYC with IP 1.1 and it does not work. That means you have to use it with at least IP 2.0.2 (it is located in Samples\\pyc folder). For simple script 'print 'hello' you need to ship (along with hello.dll and hello.exe).\n\nIronPython.dll\nMicrosoft.Scripting.Core.dll\nMicrosoft.Scripting.dll\nMicrosoft.Scripting.ExtensionAttribute.dll\n\nFor more complicated script you will probably need IronPython.Modules.dll as well.","Q_Score":0,"Tags":"ironpython,ironpython-studio","A_Id":1330323,"CreationDate":"2009-08-25T09:25:00.000","Title":"Generating EXE out of IronPython script","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":3879,"Q_Id":1327105,"Users Score":0,"Answer":"A DLL is a dynamically linked library. It's required for your application to run properly. All applications written in .NET use them. You just don't know it, because support is built into the .NET framework, which most everyone has installed on their systems. Yay, way to go Microsoft. The DLR (Dynamic Language Runtime) isn't built into any .NET destributable at this time, however (this will change in .NET 4.0). That's why you get the dll file. \nAre you writing software that utilizes any .NET libraries? If not, just write it in good 'ol cpython (the way you're supposed to). Then, uou should look into a program called py2exe. Have you ever used uTorrent? I'm assuming you have. It's build using strait up cpython + py2exe.\nEnjoy. :)","Q_Score":0,"Tags":"ironpython,ironpython-studio","A_Id":1344862,"CreationDate":"2009-08-25T09:25:00.000","Title":"Generating EXE out of IronPython script","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":3879,"Q_Id":1327105,"Users Score":2,"Answer":"I have created a C# application that uses the IronPython.dll and IronMath.dll to convert the IronPython scripts to executables. This doesn't require IronPython studio to be present. Only the DLLs are enough. The behavior of exe is same as that created by IronPython studio(Integrated with VS2008)","Q_Score":0,"Tags":"ironpython,ironpython-studio","A_Id":1389659,"CreationDate":"2009-08-25T09:25:00.000","Title":"Generating EXE out of IronPython script","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want main window to \"gray, freeze, stop working\", when some other window is opened. Is there some default way to do it? Pretty much the same as gtk.Dialog is working.\nEDIT: Currently I'm just replacing all contents by a text line, but I guess there should be better way.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":310,"Q_Id":1329076,"Users Score":3,"Answer":"You really shouldn't try to make a program become unresponsive.\nIf what you want to do is stop the user from using the window, make the dialog modal: gtk.Dialog.set_modal(True)","Q_Score":0,"Tags":"python,window,pygtk,freeze","A_Id":1329140,"CreationDate":"2009-08-25T15:33:00.000","Title":"How to freeze\/grayish window in pygtk?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Quick question.\nI'm using Linux and I want to try making a GUI with Python. I've heard about something like Qt, GTK+ and PyGTK but I don't know what they are exactly and what the difference between them is.\nIs there any difference on how they work with different DEs like GNOME, KDE, XFCE etc.? Is there any IDE that allows you to create GUI like Microsoft Visual Studio does (for C#, C, Visual Basic etc.)?\nOr should I maybe use another language other than Python to make GUI applications?","AnswerCount":5,"Available Count":1,"Score":0.0798297691,"is_accepted":false,"ViewCount":48034,"Q_Id":1355918,"Users Score":2,"Answer":"Each desktop environment uses a specific toolkit to build it's components. For example, KDE uses Qt and GNOME uses Gtk. \nYour use of a toolkit will be dependent upon what type of desktop environment you're targeting at, and if you want to target a wide range of desktops then use a toolkit which will work on many desktop environments, like Wx widgets which will work on Linux, Mac OS and Windows. For building simple GUI applications, Tkinter will do.","Q_Score":14,"Tags":"python,linux,user-interface,gtk,pygtk","A_Id":1355948,"CreationDate":"2009-08-31T05:25:00.000","Title":"Creating GUI with Python in Linux","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am creating a simple tool to add album cover images to mp3 files in python. So far I am just working on sending a request to amazon with artist and album title, and get the resulting list, as well as finding the actual images for each result. What I want to do is to display a simple frame with a button\/link for each image, and a skip\/cancel button.\nI have done some googling, but I can't find examples that I can use as a base.\n\nI want to display the images directly from the web. Ie. using urllib to open and read the bytes into memory, rather than go via a file on disk\nI want to display the images as buttons preferably\n\nAll examples seems to focus on working on files on disk, rather with just a buffer. The TK documentation in the python standard library doesn't seem to cover the basic Button widget. This seems like an easy task, I have just not had any luck in finding the proper documentation yet.","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":7084,"Q_Id":1356255,"Users Score":-1,"Answer":"For displaying jpgs in Python check out PIL","Q_Score":5,"Tags":"python,tkinter","A_Id":1356882,"CreationDate":"2009-08-31T07:32:00.000","Title":"Display jpg images in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me.\nI want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck.\nI would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me.\nThanks in advance for the help!\nUpdate: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers.\nUnfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. \nThis summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular.\nSorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!","AnswerCount":6,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":4914,"Q_Id":1359227,"Users Score":18,"Answer":"Allow me to echo what has already been said. I too am a student who just started a Cocoa development project, and at the beginning I thought \"Well, I already know Python, I'll just use PyObjC and save myself from having to learn Objective-C, which looks beyond my grasp.\" I learned quickly that it can't be done. You can develop for OS X without learning Objective-C, but not without learning the Cocoa libraries, which constitute 99% of what you need to learn to write a Cocoa app in Objective-C. Objective-C itself isn't that hard; it's the Cocoa libraries that you need to invest in learning.\nPyObjC basically uses Cocoa libraries and Python syntax. I gave up with it quickly and decided that if I was going to have to learn Cocoa, I may as well use Objective-C.\nIf you're looking to learn, Aaron Hillegass's book is a good place to start. Good luck!","Q_Score":12,"Tags":"python,cocoa,xcode,osx-snow-leopard,pyobjc","A_Id":1359605,"CreationDate":"2009-08-31T20:19:00.000","Title":"PyObjc and Cocoa on Snow Leopard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me.\nI want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck.\nI would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me.\nThanks in advance for the help!\nUpdate: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers.\nUnfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. \nThis summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular.\nSorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!","AnswerCount":6,"Available Count":4,"Score":0.1325487884,"is_accepted":false,"ViewCount":4914,"Q_Id":1359227,"Users Score":4,"Answer":"And as one of the Checkout developers I'll weigh in too (hi Quinn!). From what we've seen PyObjC runs fairly well on Snow Leopard. We've built one of the latest SVN revisions 2.2b with some customizations on Leopard and just moved over the site-packages folder.\nTheoretically you should be able to use the built in Python\/PyObjC (just do import objc, Foundation, AppKit) but as we ship\/work with custom versions of both Python and PyObjC I'm not sure what the status exactly is. The mailing list doesn't mention a lot of people having issues (just a few) so that could be a good sign.\nGood luck with the project, and if you have specific POS questions shoot me an email ;-)","Q_Score":12,"Tags":"python,cocoa,xcode,osx-snow-leopard,pyobjc","A_Id":1359575,"CreationDate":"2009-08-31T20:19:00.000","Title":"PyObjc and Cocoa on Snow Leopard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me.\nI want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck.\nI would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me.\nThanks in advance for the help!\nUpdate: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers.\nUnfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. \nThis summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular.\nSorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!","AnswerCount":6,"Available Count":4,"Score":0.0996679946,"is_accepted":false,"ViewCount":4914,"Q_Id":1359227,"Users Score":3,"Answer":"I'm a long time python developer who's been doing iPhone apps for awhile now (and only using my python knowledge to package up build files for the apps in run scripts), then who started making some PyObjC apps.\nI'd have to say, PyObjC is pretty much STILL having to learn objective C (which I already know via iPhone dev), however you get several pretty cool benefits if you use it instead\n\nEasy use of python libraries you know (faster for you)\nOption to drop it and go to wxPython if styimied by Cocoa\nSomewhat faster development time (you're writing less code, and the translation between the two languages is pretty darn easy to get used to).\n\nAdditionally, interface builder is a little tricky to get used to comparatively speaking, but if you're a python dev, it's not like you're exactly used to a functional gui builder anyhow :oP","Q_Score":12,"Tags":"python,cocoa,xcode,osx-snow-leopard,pyobjc","A_Id":1905283,"CreationDate":"2009-08-31T20:19:00.000","Title":"PyObjc and Cocoa on Snow Leopard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me.\nI want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck.\nI would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me.\nThanks in advance for the help!\nUpdate: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers.\nUnfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. \nThis summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular.\nSorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!","AnswerCount":6,"Available Count":4,"Score":0.0996679946,"is_accepted":false,"ViewCount":4914,"Q_Id":1359227,"Users Score":3,"Answer":"I hardly use PyObjC myself, but I believe you need to run the Xcode installer on the Snow Leopard DVD in order to use PyObjC.\nAlso, as Quinn said, you will need to understand at least some Objective-C in order to use a Cocoa bridge like PyObjC without tearing your hair out. It just doesn't insulate you that completely.","Q_Score":12,"Tags":"python,cocoa,xcode,osx-snow-leopard,pyobjc","A_Id":1359428,"CreationDate":"2009-08-31T20:19:00.000","Title":"PyObjc and Cocoa on Snow Leopard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to have a text control that only accepts numbers. (Just integer values like 45 or 366)\nWhat is the best way to do this?","AnswerCount":7,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":11475,"Q_Id":1369086,"Users Score":5,"Answer":"IntCtrl, Masked Edit Control, and NumCtrl are all designed to do just this, with different levels of control. Checkout the wx demo under \"More Windows\/Controls\" to see how they work.\n(Or, if you're instead really looking forward to doing this directly with a raw TextCtrl, I think you'd want to catch EVT_CHAR events, test the characters, and call evt.Skip() if it was an allowed character.)","Q_Score":10,"Tags":"wxpython,textctrl","A_Id":1370281,"CreationDate":"2009-09-02T17:27:00.000","Title":"Is it possible to limit TextCtrl to accept numbers only in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to have a text control that only accepts numbers. (Just integer values like 45 or 366)\nWhat is the best way to do this?","AnswerCount":7,"Available Count":2,"Score":-0.0285636566,"is_accepted":false,"ViewCount":11475,"Q_Id":1369086,"Users Score":-1,"Answer":"Please check \"Validator.py\" script in wxpython demo. it is exactly what you need","Q_Score":10,"Tags":"wxpython,textctrl","A_Id":23052986,"CreationDate":"2009-09-02T17:27:00.000","Title":"Is it possible to limit TextCtrl to accept numbers only in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently working on an application written in C#, which I'm embedding IronPython in. I generally have no problems about it, but there's one thing that I don't know how to deal with. \nI want to import an external module into the script. How can I do that? Simple import ext_lib doesn't work. Should I add a path to the lib to sys.path? \nMaybe it is possible to copy the lib's .py file into app directory and import from there?\nEDIT:\nI finally chosen another solution - compiled my script with py2exe and I'm just running it from main C# app with Process (without using IronPython).\nAnyway, thanks for help ;)","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":34961,"Q_Id":1371994,"Users Score":3,"Answer":"If you have installed IronPython from NuGet packages and you want modules from the CPython Standard Library then the best way to do it is by installing the IronPython.StdLib NuGet package which is from the same authors of IronPython.","Q_Score":20,"Tags":"python,import,ironpython","A_Id":67905932,"CreationDate":"2009-09-03T07:50:00.000","Title":"Importing external module in IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to remove border on a gtk.Button and also set its size fixed. How can I accomplish that?\nMy button looks like that:\n\n b = gtk.Button()\n b.set_relief(gtk.RELIEF_NONE)\n\nThanks!\np.d: I'm using pygtk","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":2081,"Q_Id":1383663,"Users Score":-1,"Answer":"I don't think the EventBox can send button events like \"activated\" and \"clicked\".","Q_Score":0,"Tags":"python,gtk,pygtk","A_Id":1507847,"CreationDate":"2009-09-05T16:01:00.000","Title":"remove inner border on gtk.Button","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing on Windows, and I've searched everywhere without finding anyone talking about this kind of thing.\nI made a C++ app on my desktop that embedded Python 3.1 using MSVC. I linked python31.lib and included python31.dll in the app's run folder alongside the executable. It works great. My extension and embedding code definitely works and there are no crashes.\nI sent the run folder to my friend who doesn't have Python installed, and the app crashes for him during the scripting setup phase.\nA few hours ago, I tried the app on my laptop that has Python 2.6 installed. I got the same crash behavior as my friend, and through debugging found that it was the Py_Initialize() call that fails.\nI installed Python 3.1 on my laptop without changing the app code. I ran it and it runs perfectly. I uninstalled Python 3.1 and the app crashes again. I put in code in my app to dynamically link from the local python31.dll, to ensure that it was using it, but I still get the crash.\nI don't know if the interpreter needs more than the DLL to start up or what. I haven't been able to find any resources on this. The Python documentation and other guides do not seem to ever address how to distribute your C\/C++ applications that use Python embedding without having the users install Python locally. I know it's more of an issue on Windows than on Unix, but I've seen a number of Windows C\/C++ applications that embed Python locally and I'm not sure how they do it.\nWhat else do I need other than the DLL? Why does it work when I install Python and then stop working when I uninstall it? It sounds like it should be so trivial; maybe that's why nobody really talks about it. Nevertheless, I can't really explain how to deal with this crash issue.\nThank you very much in advance.","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":11259,"Q_Id":1387906,"Users Score":24,"Answer":"In addition to pythonxy.dll, you also need the entire Python library, i.e. the contents of the lib folder, plus the extension modules, i.e. the contents of the DLLs folder. Without the standard library, Python won't even start, since it tries to find os.py (in 3.x; string.py in 2.x). On startup, it imports a number of modules, in particular site.py.\nThere are various locations where it searches for the standard library; in your cases, it eventually finds it in the registry. Before, uses the executable name (as set through Py_SetProgramName) trying to find the landmark; it also checks for a file python31.zip which should be a zipped copy of the standard library. It also checks for a environment variable PYTHONHOME.\nYou are free to strip the library from stuff that you don't need; there are various tools that compute dependencies statically (modulefinder in particular).\nIf you want to minimize the number of files, you can\n\nlink all extension modules statically into your pythonxy.dll, or even link pythonxy.dll statically into your application\nuse the freeze tool; this will allow linking the byte code of the standard library into your pythonxy.dll.\n(alternatively to 2.) use pythonxy.zip for the standard library.","Q_Score":23,"Tags":"python,c++,dll,embed","A_Id":1387977,"CreationDate":"2009-09-07T06:56:00.000","Title":"C++ with Python embedding: crash if Python not installed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing on Windows, and I've searched everywhere without finding anyone talking about this kind of thing.\nI made a C++ app on my desktop that embedded Python 3.1 using MSVC. I linked python31.lib and included python31.dll in the app's run folder alongside the executable. It works great. My extension and embedding code definitely works and there are no crashes.\nI sent the run folder to my friend who doesn't have Python installed, and the app crashes for him during the scripting setup phase.\nA few hours ago, I tried the app on my laptop that has Python 2.6 installed. I got the same crash behavior as my friend, and through debugging found that it was the Py_Initialize() call that fails.\nI installed Python 3.1 on my laptop without changing the app code. I ran it and it runs perfectly. I uninstalled Python 3.1 and the app crashes again. I put in code in my app to dynamically link from the local python31.dll, to ensure that it was using it, but I still get the crash.\nI don't know if the interpreter needs more than the DLL to start up or what. I haven't been able to find any resources on this. The Python documentation and other guides do not seem to ever address how to distribute your C\/C++ applications that use Python embedding without having the users install Python locally. I know it's more of an issue on Windows than on Unix, but I've seen a number of Windows C\/C++ applications that embed Python locally and I'm not sure how they do it.\nWhat else do I need other than the DLL? Why does it work when I install Python and then stop working when I uninstall it? It sounds like it should be so trivial; maybe that's why nobody really talks about it. Nevertheless, I can't really explain how to deal with this crash issue.\nThank you very much in advance.","AnswerCount":4,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":11259,"Q_Id":1387906,"Users Score":6,"Answer":"A zip of the Python standard library worked for me with Python27.\nI zipped the contents of Lib and dll, and made sure there was no additional python27-subfolder or Lib or dll subfolder. i.e. just a zip named python27.zip containing all the files.\nI copied that zip and the python27.dll alongside the executable.","Q_Score":23,"Tags":"python,c++,dll,embed","A_Id":9115925,"CreationDate":"2009-09-07T06:56:00.000","Title":"C++ with Python embedding: crash if Python not installed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do you embed a vpython plot (animated) within your Qt GUI? so that it has its own display area and would not need to created a new window anymore.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1265,"Q_Id":1397553,"Users Score":1,"Answer":"I contacted maintainer of VPython and he confirmed, that he is not aware of any working solution where Visual is embedded into QT window.\nThat turned me to try VTK and so far I'm pretty happy, no problem with using VTK within PyQT framework.","Q_Score":2,"Tags":"python,user-interface,qt","A_Id":1414819,"CreationDate":"2009-09-09T04:40:00.000","Title":"embedding plot within Qt gui","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using a wxPython wx.html.HtmlWindow to display part of my interface. The user can scroll down a list of links in a window smaller than the list. When they click on a link, I need to repaint the web page, but I want to return the page position back to where they clicked it. \nI've tried MouseEvent.GetLogicalPosition() on the event, but it wants a DC and the best I've been able to do is get the same information as GetPosition(), so I must not be feeding it the right one.\nI also tried HtmlWindow.CalcScrolledPosition(), but apparently that isn't available in HtmlWindow because I get a NotImplementedError...\nWhat I would like is a scroll position that can be derived from the MouseEvent, or the OnLinkClicked information.\nI know about HtmlWindow.ScrollToAnchor(), but it's flaky and unaesthetic -- I would prefer to bypass it if possible so that I can scroll back exactly to where the user clicked.\nThanks!","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1216,"Q_Id":1400179,"Users Score":0,"Answer":"Usually, click events are trigged by MouseUp events. If you track the mouse position by capturing any MouseDown events, you will know where the last click (MouseUp) happened, and that should allow you to reconstruct things.\nFor this particular problem, you might have to do a bit more work in MouseDown like checking if they are within the wxHtmlWindow control and if so, then saving something like a line number.","Q_Score":2,"Tags":"python,wxpython","A_Id":1579014,"CreationDate":"2009-09-09T14:45:00.000","Title":"How do I scroll a wxPython wx.html.HtmlWindow back down to where it was when the user clicked a link?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm starting to study Python, and for now I like it very much. But, if you could just answer a few questions for me, which have been troubling me, and I can't find any definite answers to them:\n\nWhat is the relationship between Python's C implementation (main version from python.org) and IronPython, in terms of language compatibility ? Is it the same language, and do I by learning one, will be able to smoothly cross to another, or is it Java to JavaScript ?\nWhat is the current status to IronPython's libraries ? How much does it lags behind CPython libraries ? I'm mostly interested in numpy\/scipy and f2py. Are they available to IronPython ?\nWhat would be the best way to access VB from Python and the other way back (connecting some python libraries to Excel's VBA, to be exact) ?","AnswerCount":5,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":3658,"Q_Id":1403103,"Users Score":18,"Answer":"1) IronPython and CPython share nearly identical language syntax. There is very little difference between them. Transitioning should be trivial.\n2) The libraries in IronPython are very different than CPython. The Python libraries are a fair bit behind - quite a few of the CPython-accessible libraries will not work (currently) under IronPython. However, IronPython has clean, direct access to the entire .NET Framework, which means that it has one of the most extensive libraries natively accessible to it, so in many ways, it's far ahead of CPython. Some of the numpy\/scipy libraries do not work in IronPython, but due to the .NET implementation, some of the functionality is not necessary, since the perf. characteristics are different.\n3) Accessing Excel VBA is going to be easier using IronPython, if you're doing it from VBA. If you're trying to automate excel, IronPython is still easier, since you have access to the Execl Primary Interop Assemblies, and can directly automate it using the same libraries as C# and VB.NET.","Q_Score":15,"Tags":"python,excel,vba,ironpython,python.net","A_Id":1403134,"CreationDate":"2009-09-10T02:30:00.000","Title":"Python - IronPython dilemma","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting to study Python, and for now I like it very much. But, if you could just answer a few questions for me, which have been troubling me, and I can't find any definite answers to them:\n\nWhat is the relationship between Python's C implementation (main version from python.org) and IronPython, in terms of language compatibility ? Is it the same language, and do I by learning one, will be able to smoothly cross to another, or is it Java to JavaScript ?\nWhat is the current status to IronPython's libraries ? How much does it lags behind CPython libraries ? I'm mostly interested in numpy\/scipy and f2py. Are they available to IronPython ?\nWhat would be the best way to access VB from Python and the other way back (connecting some python libraries to Excel's VBA, to be exact) ?","AnswerCount":5,"Available Count":2,"Score":0.0399786803,"is_accepted":false,"ViewCount":3658,"Q_Id":1403103,"Users Score":1,"Answer":"1) The language implemented by CPython and IronPython are the same, or at most a version or two apart. This is nothing like the situation with Java and Javascript, which are two completely different languages given similar names by some bone-headed marketing decision.\n2) 3rd-party libraries implemented in C (such as numpy) will have to be evaluated carefully. IronPython has a facility to execute C extensions (I forget the name), but there are many pitfalls, so you need to check with each library's maintainer\n3) I have no idea.","Q_Score":15,"Tags":"python,excel,vba,ironpython,python.net","A_Id":1403118,"CreationDate":"2009-09-10T02:30:00.000","Title":"Python - IronPython dilemma","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pygame with python 2.6 right now, But I want to use python 3.1.1 instead. The normal pygame only works with 2.x, but the subversion ones work with 3.x I think. But what about pgreloaded? Is that useable yet? The normal pygame actually works with 3.1 too, but not for os x (at least there isn't a download). Does anyone actually use pgreloaded or subversion pygames? So anyway, should I use pygame subversion, pgreloaded, or stick with the current pygame? I don't really care about being compatible with other things or distribution.\nThanks!\nEDIT: Ok, I got rid of python 2.6, installed 3.1, used svn command to get pygame, tried running python3 setup.py, didn't work, changed raw_input in setup.py to input(), worked, now my pygames (that were so simple that they work the same under 2.6 and 3.1) run with python 3.1. :) I didn't get pgreloaded because there's no documentation for it.","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1917,"Q_Id":1414258,"Users Score":1,"Answer":"Just stick with Python 2.6.","Q_Score":3,"Tags":"python,python-3.x,pygame","A_Id":1416509,"CreationDate":"2009-09-12T04:16:00.000","Title":"Should I use pgreloaded? Or subversion of pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a computer game I'm working on, and I'm wanting to give the user an option to turn off alpha compositing for speed purposes. Rather than doing checks everywhere, does Pygame have a global option to say \"Don't use alpha\" such that it would just ignore all my calls to set_alpha and the likes?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":570,"Q_Id":1424734,"Users Score":1,"Answer":"Considering the pygame docs I would say \"no, there is no global way to disable alpha\".\nHowever there are at least two 'local' ways to do it: \n\nFirst would be to subclass pygame.Surface and provide your own implementation of set_alpha\nwhich in turn could honor your global alpha settings. \nSecond one is a bit more tricky as it depends on the pixel-format in use.\nTo quote the pygame docs: \n\n\nSurface.set_alpha\nset the alpha value for the whole surface\n[...]\n This value is different than the per pixel Surface alpha. If the Surface format contains\n per pixel alphas, then this alpha value will be ignored. If the Surface contains per pixel\n alphas, setting the alpha value to None will disable the per pixel transparency.\n[...]\n\nWith this you could provide two sets of textures: \n\none with an opaque (per-pixel) alpha channel which will overwrite all your calls to set_alpha()\none which has no per-pixel alpha and thus will honor your set_alpha()\n\nHope this will help!","Q_Score":1,"Tags":"python,pygame,alphablending","A_Id":1429443,"CreationDate":"2009-09-15T01:49:00.000","Title":"Turn off Pygame alpha","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. \nIs there a way to catch this event, or do I need to modify the library to handle error cases differently ? \nThank you very much,","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1407,"Q_Id":1439533,"Users Score":0,"Answer":"You can override the library linking with LD_LIBRARY_PATH and make your own exit function. Works fine.","Q_Score":7,"Tags":"python,exception,binding,exit","A_Id":8099938,"CreationDate":"2009-09-17T15:19:00.000","Title":"How to catch exit() in embedded C++ module from python code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. \nIs there a way to catch this event, or do I need to modify the library to handle error cases differently ? \nThank you very much,","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1407,"Q_Id":1439533,"Users Score":7,"Answer":"You must modify the source of the library. There is no \"exception handling\" in C and exit() does not return to the calling code under any circumstances.","Q_Score":7,"Tags":"python,exception,binding,exit","A_Id":1439585,"CreationDate":"2009-09-17T15:19:00.000","Title":"How to catch exit() in embedded C++ module from python code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wx.TextCtrl that I am using to represent a display with a fixed number of character rows and columns. I would like to hide the vertical scrollbar that is displayed to the right of the text pane since it is entirely unnecessary in my application. Is there a way to achieve this?\nAlso...I would like to hide the blinking cursor that is displayed in the pane. Unfortunately, wx.TextCtrl.GetCaret() is returning None so I cannot call wx.Caret.Hide().\nEnvironment info:\n\nWindows XP\nPython 2.5\nwxPython 2.8","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2839,"Q_Id":1441502,"Users Score":4,"Answer":"How about setting the style wx.TE_NO_VSCROLL for the wx.TxtCtrl?","Q_Score":4,"Tags":"python,wxpython,wxtextctrl","A_Id":1442312,"CreationDate":"2009-09-17T21:47:00.000","Title":"Hiding Vertical Scrollbar in wx.TextCtrl","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Accelerators on wxPython do not seem to work with nested panels. In other words:\n -----------------------------------------------\n | Main panel |\n | ----------------- ----------------- |\n | | Subpanel 1 | | Subpanel 2 | |\n | | accelerator | | accelerator | |\n | | key for 'a' | | key for 'b' | |\n | ----------------- ----------------- |\n -----------------------------------------------\nWhen a control in subpanel 1 has focus, I want Alt+b to still trigger the control in subpanel 2 that uses b as its accelerator key. How do I do this?\nIf it matters, I'm loading the panel with xrc into a plain old wx.Frame.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":336,"Q_Id":1446672,"Users Score":0,"Answer":"If the main panel has the accelerator table with Alt+b, this should work. Maybe the sub-panels have their own accelerator tables that are conflicting? You might try inactivating these with subpanel.SetAcceleratorTable(wx.NullAcceleratorTable) for each subpanel.","Q_Score":2,"Tags":"wxpython","A_Id":1483678,"CreationDate":"2009-09-18T20:28:00.000","Title":"wxPython, nested panels and accelerators","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to Python and I'm trying to create a simple GUI using Tkinter. \nSo often in many user interfaces, hitting the tab button will change the focus from one Text widget to another. Whenever I'm in a Text widget, tab only indents the text cursor.\nDoes anyone know if this is configurable?","AnswerCount":3,"Available Count":1,"Score":-1.0,"is_accepted":false,"ViewCount":13443,"Q_Id":1450180,"Users Score":-5,"Answer":"It is really simple in PyQt4 simply use this one single line below and you will be able to change focus by pressing tab button:\nself.textEdit.setTabChangesFocus(True)","Q_Score":15,"Tags":"python,tkinter","A_Id":41727157,"CreationDate":"2009-09-20T03:06:00.000","Title":"Change the focus from one Text widget to another","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm far from a python expert but I hear this one all the time, about its C\/C++ bindings. How does this concept work, and how does Python (and Java) bind to C-based APIs like OpenGL? This stuff has always been a mystery to me.","AnswerCount":6,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":3183,"Q_Id":1475637,"Users Score":12,"Answer":"Interpreters Written in C89 with Reflection, Who Knew?\n\nI have a feeling you are looking for an explanation of the mechanism and not a link to the API or instructions on how to code it. So, as I understand it . . .\nThe main interpreter is typically written in C and is dynamically linked. In a dynamically linked environment, even C89 has a certain amount of reflective behavior. In particular, the dlopen(3) and dlsym(3) calls will load a dynamic (typically ELF) library and look up the address of a symbol named by a string. Give that address, the interpreter can call a function. Even if statically linked, the interpreter can know the address of C functions whose names are compiled into it.\nSo then, it's just a simple matter of having the interpreted code tell the interpreter to call a particular native function in a particular native library.\nThe mechanism can be modular. An extension library for the interpreter, written in the script, can itself invoke the bare hooks for dlopen(3) and dlsym(3) and hook up to a new library that the interpreter never knew about.\nFor passing simple objects by value, a few prototype functions will typically allow various calls. But for structured data objects (imagine stat(2)) the wrapper module needs to know the layout of the data. At some point, either when packaging the extension module or when installing it, a C interface module includes the appropriate header files and in conjunction with handwritten code constructs an interface object. This is why you may need to install something like libsqlite3-dev even if you already had sqlite3 on your system; only the -dev package has the .h files needed to recompile the linkage code.\nI suppose we could sum this up by saying: \"it's done with brute force and ignorance\". :-)","Q_Score":16,"Tags":"java,python,binding","A_Id":1475717,"CreationDate":"2009-09-25T05:55:00.000","Title":"How do you bind a language (python, for example) to another (say, C++)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to display search result data quickly. I have all absolute file paths for files on my network drive(s) in a single, ~50MB text file. The python script makes a single pass over every line in this file [kept on the local drive] in a second or less, and that is acceptable. That is the time it takes to gather results.\nHowever, the results are given in a wx.TextCtrl widget. Appending them line by line to a wx TextCtrl would be ridiculous. The best method I have come up with is to write the results to a text file, and call wx.TextCtrl's LoadFile native, which, depending on the number of results, loads the lines of text into the pane in between 0.1 to 5 seconds or so. However there must be a faster way for 10+MB of text inbound. The results are immediately calculated and available in the same process as the GUI... so please, tell me is there any way I can pipe\/proxy\/hack that data directly into the TextCtrl? Would mmap help this transfer?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1831,"Q_Id":1507075,"Users Score":0,"Answer":"Are people really going to read (or need) all 10MB in a text control? Probably not.\nSuggest that, you load on demand by paging in portions of the data.\nOr better still, provide some user search functionality that narrows down the results to the information of interest.","Q_Score":0,"Tags":"python,file-io,wxpython,wxwidgets,mmap","A_Id":1507087,"CreationDate":"2009-10-01T23:44:00.000","Title":"wx.TextCtrl.LoadFile()","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":0,"Answer":"As someone familiar with C# and .NET you should consider IronPython. Python for .NET. This would be a good way to leverage what you know and learn a new dynamic language at the same time.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534470,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":1.0,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":7,"Answer":"I Am a little scared of C++ because developing anything in it takes ages.\n\nI'm not sure how you can say that when you say yourself that you have no experience in the language. C++ is a good tool for some things, Python is good for other things. What you want to do should be driving this decision, not the technology in and of itself.\nC# programmer or not, I would assume that you can pick up any language, but a language is just a tool, so your question is difficult to answer.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534460,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0996679946,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":5,"Answer":"Python may be easier to get started with, but a dynamically typed scripting language is a very different language from C# or C++. You will learn more about programming learning it than you will by hopping to a close cousin of a language you already know. Really, solid familiarity with at least one scripting language (Python, Perl and Ruby are the favorites) should be a requirement for all programmers.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534467,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":1.2,"is_accepted":true,"ViewCount":1673,"Q_Id":1534450,"Users Score":2,"Answer":"C# is a little closer to Java and C++ than it is to Python, so learn Python first out of the two.\nHowever, my advice would be:\n\nStick with your current language and learn more techniques, such as a wider range of algorithms, functional programming, design by contract, unit testing, OOAD, etc.\nlearn C (focus on figuring out pointers, multi-dimensional arrays, data structures like linked lists, and resource management like memory allocation\/deallocation, file handles, etc)\nlearn Assembly (on a modern platform with a flat memory architecture, but doing low-level stuff like talking to hardware or drawing on a canvas)\nlearn Python or Ruby. Chances are, you'll stick with one of these for a while, knowing all of the above, unless some hot new language has come along by then.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534729,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0599281035,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":3,"Answer":"If you want to apply to Google then Python might be the one to go for, surely MS would like the C# already. If nothing else the competition would not be as fierce as there are much more folk out there with multi years of C++ experience. Also Python gives you a broader language skill and would be a good path to more languages and scripting.\nBut as said and will be said again, choose your tool wisely and see whether it's a nail or a screw you're trying to secure.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534483,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":0,"Answer":"You might be interested in looking at Windows Powershell. It's the latest scripting technology from Microsoft, built on .NET, and can be extended via C#.\nGranted, it's not as portable as C++ or Python, but it would leverage your C#\/.NET experience more readily. Otherwise, I would suggest C++ (and possibly C). Microsoft builds a lot more of its products with C\/C++ than with Python.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534589,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0199973338,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":1,"Answer":"C++ is usually used when speed, and low-level OS access is involved.\nIt's a good skill to have if you want to expand.\nPython allows you to do thing quickly, and it's quite easy to learn, and provides more power than you'd expect from a scripting language, and probably one of the fastest ones out there.\nC++ isn't exactly slow to develop, if you've got an IDE, it's not hard to write per-se, but the syntax is going to get you.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534645,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0199973338,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":1,"Answer":"If you want to apply to Google and\/ or Microsoft then I'd say that of the two you need both!\nGiven more choice, probably C++ and one other language - either dynamic, functional, or both (Scala might be a good choice too).\nIt's not necessarily about whether you'd use the languages themselves but more about the different approaches they require and encourage.\nIf you continue to be \"scared\" by C++ you're probably going to struggle applying as a dev at either of those organisations - unless you are highly specialised elsewhere.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534651,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#\/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.\nSo: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool\/language.\nAny C# developers having same dilemma?","AnswerCount":10,"Available Count":9,"Score":0.0199973338,"is_accepted":false,"ViewCount":1673,"Q_Id":1534450,"Users Score":1,"Answer":"Why not learn some of each. Studying a language for a week or so won't make you an expert, but it will answer a lot of questions in your head and plant a seed for the future.\nIt's important to not just read through exercises. Find some simple problems that can be programmed in a page or two at most and solve them with each language. That will help you to learn the strengths and weaknesses in the context of the way you think and how you solve problems.","Q_Score":2,"Tags":"c#,c++,python","A_Id":1534556,"CreationDate":"2009-10-07T21:52:00.000","Title":"C++ or Python for C# programmer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a background in C++ and Java and Objective C programming, but i am finding it hard to learn python, basically where its \"Main Function\" or from where the program start executing. So is there any tutorial\/book which can teach python to people who have background in C++ or Java. Basically something which can show if how you were doing this in C++ and how this is done in Python.\nOK i think i did not put the question heading or question right, basically i was confused about the \"Main\" Function, otherwise other things are quite obvious from python official documentation except this concept.\nThanks to all","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":463,"Q_Id":1548620,"Users Score":0,"Answer":"I started Python over a year ago too, also C++ background. \nI've learned that everything is simpler in Python, you don't need to worry so much if you're doing it right, you probably are. Most of the things came natural.\nI can't say I've read a book or anything, I usually pested the guys in #python on freenode a lot and looked at lots of other great code out there.\nGood luck :)","Q_Score":4,"Tags":"python","A_Id":1548641,"CreationDate":"2009-10-10T17:56:00.000","Title":"Python for C++ or Java Programmer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a background in C++ and Java and Objective C programming, but i am finding it hard to learn python, basically where its \"Main Function\" or from where the program start executing. So is there any tutorial\/book which can teach python to people who have background in C++ or Java. Basically something which can show if how you were doing this in C++ and how this is done in Python.\nOK i think i did not put the question heading or question right, basically i was confused about the \"Main\" Function, otherwise other things are quite obvious from python official documentation except this concept.\nThanks to all","AnswerCount":7,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":463,"Q_Id":1548620,"Users Score":0,"Answer":"The pithiest comment I guess is that the entry point is the 1st line of your script that is not a function or a class. You don't necessarily need to use the if hack unless you want to and your script is meant to be imported.","Q_Score":4,"Tags":"python","A_Id":1548801,"CreationDate":"2009-10-10T17:56:00.000","Title":"Python for C++ or Java Programmer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to do this? Also, I need this to work with pygame, since I want audio in my game. I'm asking this because I didn't see any tone change function in pygame.. Anyone knows?\nUpdate:\nI need to do something like the noise of a car accelerating. I don't really know if it is timbre or tone.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1240,"Q_Id":1561104,"Users Score":1,"Answer":"Well, it depends on how you're doing your sounds: I'm not sure if this is possible with pygame, but SDL (which pygame is based off of) lets you have a callback to retrieve data for the sound buffer, and it's possible to change the frequency of the sine wave (or whatever) to get different tones in the callback, given that you generate the sound there.\nIf you're using a pre-rendered tone, or sound file, then you'll probably have to resample it to get it to play at different frequencies, although it'd be difficult to keep the same length. If you're talking about changing the timbre of the sound, then that's a whole different ballpark...\nAlso, it depends on how fast the sound needs to change: if you can accept a little lag in response, you could probably generate a few short sounds, and play\/loop them as necessary. I'm not sure how constant replaying of sounds would impact performance\/the overall audio quality, though: you'd have to make sure the ends of all the waveform ends smoothly transition to the beginning of the next one (maybe).","Q_Score":1,"Tags":"python,pygame,pitch","A_Id":1561314,"CreationDate":"2009-10-13T15:44:00.000","Title":"Playing sounds with python and changing their tone during playback?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"After upgrading to Snow Leopard, I'm having trouble building my application. It looks like py2app is building and copying over wxPython, but when I run from the buld app, it can't find wx.","AnswerCount":1,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":997,"Q_Id":1562483,"Users Score":7,"Answer":"I solved this by doing a clean Snow Leopard install, and installing python from Python.org, then the corresponding wxPython. py2app I built from source.","Q_Score":4,"Tags":"macos,wxpython,osx-snow-leopard,py2app","A_Id":1583793,"CreationDate":"2009-10-13T19:39:00.000","Title":"py2app dropping wxpython (Snow Leopard)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am probably looking for the wrong thing in the handbook, but I am looking to take an image object and expand it without resizing (stretching\/squishing) the original image. \nToy example: imagine a blue rectangle, 200 x 100, then I perform some operation and I have a new image object, 400 x 300, consisting of a white background upon which a 200 x 100 blue rectangle rests. Bonus if I can control in which direction this expands, or the new background color, etc.\nEssentially, I have an image to which I will be adding iteratively, and I do not know what size it will be at the outset. \nI suppose it would be possible for me to grab the original object, make a new, slightly larger object, paste the original on there, draw a little more, then repeat. It seems like it might be computationally expensive. However, I thought there would be a function for this, as I assume it is a common operation. Perhaps I assumed wrong.","AnswerCount":4,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":13934,"Q_Id":1572691,"Users Score":6,"Answer":"You might consider a rather different approach to your image... build it out of tiles of a fixed size. That way, as you need to expand, you just add new image tiles. When you have completed all of your computation, you can determine the final size of the image, create a blank image of that size, and paste the tiles into it. That should reduce the amount of copying you're looking at for completing the task.\n(You'd likely want to encapsulate such a tiled image into an object that hid the tiling aspects from the other layers of code, of course.)","Q_Score":26,"Tags":"python,python-imaging-library","A_Id":1573679,"CreationDate":"2009-10-15T14:23:00.000","Title":"In Python, Python Image Library 1.1.6, how can I expand the canvas without resizing?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've got a library written in C++ which I wrap using SWIG and use in python. Generally there is one class with few methods. The problem is that calling these methods may be time consuming - they may hang my application (GIL is not released when calling these methods). So my question is: \nWhat is the simplest way to release GIL for these method calls? \n(I understand that if I used a C library I could wrap this with some additional C code, but here I use C++ and classes)","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3393,"Q_Id":1576737,"Users Score":0,"Answer":"You can use the same API call as for C. No difference. Include \"python.h\" and call the appoproate function.\nAlso, see if SWIG doesn't have a typemap or something to indicate that the GIL shuold not be held for a specific function.","Q_Score":7,"Tags":"c++,python,swig,gil","A_Id":1576959,"CreationDate":"2009-10-16T08:07:00.000","Title":"Releasing Python GIL while in C++ code","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to create a desktop app that will work with Windows and Gnome(Ubuntu). I would like to use Python to do this. The GUI part of the app will be a single form with a message area and a couple of buttons.\nThe list of GUI's for Python seems overwhelming. I am looking for something simple if possible, the main requirements is it must work with Gnome(2.26 and up) and Windows XP\/Vista\/7.","AnswerCount":4,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":895,"Q_Id":1577175,"Users Score":4,"Answer":"You might want to check out wxPython. It's a mature project and should work on Windows\nand Linux (Gnome).","Q_Score":4,"Tags":"python,user-interface,cross-platform","A_Id":1577197,"CreationDate":"2009-10-16T09:53:00.000","Title":"Python GUI Library for Windows\/Gnome","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm sure others have run into this problem too...\nI often watch videos in a small VLC window while working on other tasks, but no matter where the window is placed, I eventually need to access something in the GUI behind it, and have to manually reposition the video window first.\nThis could be solved by having the VLC window snap to another corner whenever the mouse pointer is moved over it. I haven't found an app that does this, so would like to write one. What technologies could I use to do this? Cross platform might be harder... so what if just on Windows?\nI'd prefer something in C# (or Python), but am willing to learn something new if need be.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":565,"Q_Id":1581782,"Users Score":0,"Answer":"This is a bit OOT, but in Windows 7, shaking the active window will hide others to reveal the desktop (and so will clicking\/hovering the rightmost taskbar button). Instead of hiding\/moving vlc, you could just temporarily reveal the whole desktop. Shaking the active window again brings everything back.","Q_Score":2,"Tags":"c#,python,windows,cross-platform,vlc","A_Id":1582934,"CreationDate":"2009-10-17T09:04:00.000","Title":"Reposition a VLC window programmatically","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C\/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. \nhere's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython.\nbear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython.\n1) PLEASE don't recommend psyco \nedit: ANY information that will help understand the oficial cython docs is useful information","AnswerCount":7,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":8650,"Q_Id":1582105,"Users Score":0,"Answer":"Cython does not support threads well at all. It holds the GIL (Global Intrepreter Lock) the entire time! This makes your code thread-safe by (virtually) disabling concurrent execution. So I wouldn't use it for general purpose development.","Q_Score":20,"Tags":"python,c,cython","A_Id":4445452,"CreationDate":"2009-10-17T12:33:00.000","Title":"Noob-Ready Cython Tutorials","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C\/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. \nhere's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython.\nbear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython.\n1) PLEASE don't recommend psyco \nedit: ANY information that will help understand the oficial cython docs is useful information","AnswerCount":7,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":8650,"Q_Id":1582105,"Users Score":0,"Answer":"About all the C that you really need to know is:\n\nC types are much faster than Python types (adding to C ints or doubles can be done in a single clock cycle) but less safe (they are not arbitrarily sized and may silently overflow).\nC function (cdef) calls are much faster than Python (def) function calls (but are less flexible). \n\nThis will get you most of the way there. If you want to eke out that last 10-20% speedup for most applications, there's no getting around knowing C, and how modern processes work (pointers, cache, ...).","Q_Score":20,"Tags":"python,c,cython","A_Id":2582450,"CreationDate":"2009-10-17T12:33:00.000","Title":"Noob-Ready Cython Tutorials","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C\/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. \nhere's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython.\nbear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython.\n1) PLEASE don't recommend psyco \nedit: ANY information that will help understand the oficial cython docs is useful information","AnswerCount":7,"Available Count":4,"Score":0.0285636566,"is_accepted":false,"ViewCount":8650,"Q_Id":1582105,"Users Score":1,"Answer":"You can do a lot of very useful things with Cython if you can answer the following C quiz...\n(1) What is a double? What is an int?\n(2) What does the word \"compile\" mean?\n(3) What is a header (.h) file?\nTo answer these questions you don't need to read a whole C book! ...maybe chapter 1.\nOnce you can pass that quiz, try again with the tutorial.\nWhat I usually do is start with pure python code, and add Cython elements bit by bit. In that situation, you can learn the Cython features bit by bit. For example I don't understand C strings, because so far I have not tried to cythonize code that involves strings. When I do, I will first look up how strings work in C, and then second look up how strings work in Cython.\nAgain, once you've gotten started with Cython, you will now and then run into some complication that requires learning slightly more C. And of course the more C you know, the more dextrous you will be with taking full advantage of Cython, not to mention troubleshooting if something goes wrong. But that shouldn't make you reluctant to start!","Q_Score":20,"Tags":"python,c,cython","A_Id":11103468,"CreationDate":"2009-10-17T12:33:00.000","Title":"Noob-Ready Cython Tutorials","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C\/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. \nhere's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython.\nbear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython.\n1) PLEASE don't recommend psyco \nedit: ANY information that will help understand the oficial cython docs is useful information","AnswerCount":7,"Available Count":4,"Score":0.0285636566,"is_accepted":false,"ViewCount":8650,"Q_Id":1582105,"Users Score":1,"Answer":"Cython does support concurrency (you can use native POSIX threads with c, that can be compiled in extent ion module) , you just need to be careful enough to not to modify any python objects when GIL is released and keep in mind the interpreter itself is not thread safe. You can also use multiprocessing with python to use more cores for parallelism which can in turn use your compiled cython extensions to speed up even more. But all in all you definitely have to know c programming model , static types etc","Q_Score":20,"Tags":"python,c,cython","A_Id":10643399,"CreationDate":"2009-10-17T12:33:00.000","Title":"Noob-Ready Cython Tutorials","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to do panning or 3d sound in Pygame? The only way I've found to control sound playback is to set the volume for both the left and right channels.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2176,"Q_Id":1583284,"Users Score":0,"Answer":"I think setting the separate channel volume is the only way. Pygame doesn't seem to have any notion of world space or positioning for sounds.","Q_Score":2,"Tags":"python,audio,pygame","A_Id":1583298,"CreationDate":"2009-10-17T21:32:00.000","Title":"positioning sound with pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"What would be the best library for multithreaded harvesting\/downloading with multiple proxy support? I've looked at Tkinter, it looks good but there are so many, does anyone have a specific recommendation? Many thanks!","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":940,"Q_Id":1597093,"Users Score":0,"Answer":"Is this something you can't just do by passing a URL to newly spawned threads and calling urllib2.urlopen in each one, or is there a more specific requirement?","Q_Score":0,"Tags":"python,proxy,download,multithreading,harvest","A_Id":1597142,"CreationDate":"2009-10-20T20:27:00.000","Title":"Multithreaded Downloading Through Proxies In Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"what I want to do is a image recognition for a simple app:\n\ngiven image (500 x 500) pxs ( 1 color background )\nthe image will have only 1 geometric figure (triangle or square or smaleyface :) ) of (50x50) pxs.\npython will do the recognition of the figure and display what geometric figure is.\n\nany links? any hints? any API? thxs :)","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":38079,"Q_Id":1603688,"Users Score":2,"Answer":"If you know the statespace of your data, you can use Principal Component Analysis. With PCA all of the objects must be posed (in the center of the screen). PCA will not do detection, but it will seperate objects into unique layers in which you can identify as being a triangle, etc. Also note: this is not scale or rotation invariant. \n[I can't remember what this technique is called, but its similar to how the postoffice does handwritting rec]\nIf you can handle only non-curved curvfaces, you could do edge detection, and then do sampling at intersections to get an approximation of similarity.","Q_Score":36,"Tags":"python,algorithm,image,image-processing,python-imaging-library","A_Id":1603723,"CreationDate":"2009-10-21T21:13:00.000","Title":"python image recognition","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using the Python\/C API with my app and am wondering how you can get console output with a gui app. When there is a script error, it is displayed via printf but this obviously has no effect with a gui app. I want to be able to obtain the output without creating a console. Can this be done?\nEdit - Im using Windows, btw.\nEdit - The Python\/C library internally calls printf and does so before any script can be loaded and run. If there is an error I want to be able to get it.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":173,"Q_Id":1604811,"Users Score":1,"Answer":"If by printf you mean exactly thqt call from C code, you need to redirect (and un-buffer) your standard output (file descriptor 0) to somewhere you can pick up the data from -- far from trivial, esp. in Windows, although maybe doable. But why not just change that call in your C code to something more sensible? (Worst case, a geprintf function of your own devising that mimics printf to build a string then directs that string appropriately).\nIf you actually mean print statements in Python code, it's much easier -- just set sys.stdout to an object with a write method accepting a string, and you can have that method do whatever you want, including logging, writing on a GUI windows, whatever you wish. Ah were it that simple at the C level!-)","Q_Score":0,"Tags":"python,user-interface","A_Id":1604842,"CreationDate":"2009-10-22T03:06:00.000","Title":"How to get output?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to compile my python script into a single .exe using gui2exe (which uses py2exe to create a .exe). My program is using wxWidgets and everytime I try to compile it I get the following error message:\n\nerror MSVCP90.dll: No such file or directory. \n\nI have already downloaded and installed the VC++ redistributable package, so I should have this .dll shouldn't I?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":3149,"Q_Id":1605006,"Users Score":1,"Answer":"what you need is to go to microsoft's download site and get visual C++ 2008 redistributed package. Tell it to do a repair and search for the driver. Copy the driver to the DLL folder in the python directory","Q_Score":9,"Tags":"python,dll,wxwidgets,py2exe,gui2exe","A_Id":5768777,"CreationDate":"2009-10-22T04:20:00.000","Title":"Making a Windows .exe with gui2exe does not work because of missing MSVCP90.dll","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an app that uses the python\/c api and I was wondering what files I need to distribute with it? The app runs on Windows and links with libpython31.a Are there any other files? I tried the app on a seperate Win2k system and it said that python31.dll was needed so theres at least one.\nEdit - My app is written in C++ and uses the Python\/C api as noted below.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":260,"Q_Id":1605022,"Users Score":2,"Answer":"The best way to tell is to try it on 'clean' installations of windows and see what it complains about. Virtual machines are a good way to do that.","Q_Score":2,"Tags":"python,file,runtime","A_Id":1605039,"CreationDate":"2009-10-22T04:29:00.000","Title":"What files do I need to include with my Python app?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing a python app using Tkinter for buttons and graphics and having trouble getting a timer working, what I need is a sample app that has three buttons and a label.\n[start timer] [stop timer] [quit]\nWhen I press the start button a function allows the label to count up from zero every 5 seconds, the stop button stops the timer and the quit button quits the app.\nI need to be able to press stop timer and quit at any time, and the time.sleep(5) function locks everything up so I can't use that.\ncurrently i'm using threading.timer(5,do_count_function) and getting nowhere !\nI'm a vb.net programmer, so python is a bit new to me, but hey, i'm trying.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":1711,"Q_Id":1606700,"Users Score":2,"Answer":"Check the .after method of your Tk() object. This allows you to use Tk's timer to fire events within the gui's own loop by giving it a length of time and a callback method.","Q_Score":1,"Tags":"python,tkinter","A_Id":1606815,"CreationDate":"2009-10-22T11:53:00.000","Title":"Timer in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Does anyone know of a automated GUI testing package for that works with PyQT besides Squish? Nothing against Squish I am just looking for other packages. It would be cool if there were an open source package. I am doing my testing under Linux.","AnswerCount":4,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":3768,"Q_Id":1616228,"Users Score":4,"Answer":"It looks like PyQT4 includes a QtTest object that can be used for unit testing.","Q_Score":18,"Tags":"python,testing,pyqt","A_Id":1829332,"CreationDate":"2009-10-23T22:19:00.000","Title":"PyQT GUI Testing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a C++ app that uses Python to load some scripts. It calls some functions in the scripts, and everything works fine until the app exits and calls Py_Finalize. Then it displays the following: (GetName is a function in one of the scripts)\nException AttributeError: \"'module' object has no attribute 'GetName'\" in 'garbage collection' ignored\nFatal Python error: unexpected exception during garbage collection\nThen the app crashes.\nI'm using Python 3.1 on Windows. Any advice would be appreciated.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1194,"Q_Id":1619908,"Users Score":4,"Answer":"From the docs to Py_Finalize():\n\nBugs and caveats: The destruction of\n modules and objects in modules is done\n in random order; this may cause\n destructors (__del__() methods) to\n fail when they depend on other objects\n (even functions) or modules.\n Dynamically loaded extension modules\n loaded by Python are not unloaded.\n Small amounts of memory allocated by\n the Python interpreter may not be\n freed (if you find a leak, please\n report it). Memory tied up in circular\n references between objects is not\n freed. Some memory allocated by\n extension modules may not be freed.\n Some extensions may not work properly\n if their initialization routine is\n called more than once; this can happen\n if an application calls\n Py_Initialize() and Py_Finalize() more\n than once.\n\nMost likely a __del__ contains a call to .GetName(), but that module has already been destroyed by the time __del__ is called.","Q_Score":2,"Tags":"python,exception,attributes","A_Id":1619944,"CreationDate":"2009-10-25T03:24:00.000","Title":"What is causing this Python exception?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know python and I'm a newibe with wx python but I would like to make a card game. \nHowever I have no idea how to make a image follow the mouse and put it in the middle of the screen when the program running. It will be nice if you guys can help me out.","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":877,"Q_Id":1622884,"Users Score":2,"Answer":"Going through the wxPython demo and looking at all the examples would be a good start. You'll likely find page Using Images | DragImage to be useful, since you'll probably want cards that you can drag.\nGenerally, the demo can help you do most things in wxPython, and also show you what wxPython can do, and it's worth the time to see every demo. This approach works for everything except the very first step of getting an app running and putting a frame in it (since the demo itself is an app, but not a simple one). Any of the basic tutorials can help you get started with an app and frame in just a very lines of code.","Q_Score":0,"Tags":"wxpython,drag,playing-cards","A_Id":1623027,"CreationDate":"2009-10-26T02:52:00.000","Title":"wx python card game","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on an adventure game in Python using Pygame. My main problem is how I am going to define the boundaries of the room and make the main character walk aroud without hitting a boundary every time. Sadly, I have never studied algorithms so I have no clue on how to calculate a path. I know this question is quite general and hard to answer but a point in the right direction would be very appreciated. Thanks!","AnswerCount":4,"Available Count":1,"Score":0.1488850336,"is_accepted":false,"ViewCount":1431,"Q_Id":1623331,"Users Score":3,"Answer":"Sadly, I have never studied algorithms so I have no clue on how to calculate a path.\n\nBefore you start writing games, you should educate yourself on those. This takes a little more effort at the beginning, but will save you much time later.","Q_Score":0,"Tags":"python,pygame","A_Id":1623346,"CreationDate":"2009-10-26T06:16:00.000","Title":"Adventure game - walking around inside a room","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm now thinking, is it possible to integrate Python, Perl and C\/C++ and also doing a GUI application with this very nice mix of languages?","AnswerCount":5,"Available Count":3,"Score":0.1973753202,"is_accepted":false,"ViewCount":735,"Q_Id":1628001,"Users Score":5,"Answer":"Anything is \"possible\", but whether it is necessary or beneficial is debatable and highly depends on your requirements. Don't mix if you don't need to. Use the language that best fits the domain or target requirements. \nI can't think of a scenario where one needs to mix Python and Perl as their domain is largely the same.\nUsing C\/C++ can be beneficial in cases where you need hardcore system integration or specialized machine dependent services. Or when you need to extend Python or Perl itself (both are written in C\/C++).\nEDIT: if you want to do a GUI application, it is probably easier to choose a language that fits the OS you want your GUI to run in. I.e. something like (but not limited to) C# for Windows, Objective-C for iPhone or Mac, Qt + C++ for Linux etc.","Q_Score":1,"Tags":"c++,python,c,perl,integration","A_Id":1628011,"CreationDate":"2009-10-27T00:04:00.000","Title":"Python, Perl And C\/C++ With GUI","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm now thinking, is it possible to integrate Python, Perl and C\/C++ and also doing a GUI application with this very nice mix of languages?","AnswerCount":5,"Available Count":3,"Score":0.0399786803,"is_accepted":false,"ViewCount":735,"Q_Id":1628001,"Users Score":1,"Answer":"Everything is possible - but why add two and a half more levels of complexity?","Q_Score":1,"Tags":"c++,python,c,perl,integration","A_Id":1628012,"CreationDate":"2009-10-27T00:04:00.000","Title":"Python, Perl And C\/C++ With GUI","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm now thinking, is it possible to integrate Python, Perl and C\/C++ and also doing a GUI application with this very nice mix of languages?","AnswerCount":5,"Available Count":3,"Score":0.0399786803,"is_accepted":false,"ViewCount":735,"Q_Id":1628001,"Users Score":1,"Answer":"Python & Perl? together?\nI can only think of an editor.","Q_Score":1,"Tags":"c++,python,c,perl,integration","A_Id":1628013,"CreationDate":"2009-10-27T00:04:00.000","Title":"Python, Perl And C\/C++ With GUI","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If you have a QImage wrapped inside a QLabel, is it possible to scale it up or down when you resize the window and maintain the aspect ratio (so the image doesn't become distorted)? I figured out that it can scale using setScaledContents(), and you can set a minimum and maximum size, but the image still loses its aspect. \nIt would be great if this could be explained using Python (since I don't know c++), but I'll take what I can get. :-)\nThanks in advance!","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2384,"Q_Id":1631574,"Users Score":2,"Answer":"I'm showing this as C++, which is what the documentation I'm looking at is in. It shouldn't be too difficult to convert to python.\nYou need to create a custom derivative of QLayoutItem, which overrides bool hasHeightForWidth() and int heightForWidth( int width) to preserve the aspect ratio somehow. You could either pass the image in and query it, or you could just set the ratio directly. You'll also need to make sure the widget() function returns a pointer to the proper label.\nOnce that is done, you can add a layout item to a layout in the same manner you would a widget. So when your label gets added, change it to use your custom layout item class.\nI haven't actually tested any of this, so it is a theoretical solution at this point. I don't know of any way to do this solution through designer, if that was desired.","Q_Score":1,"Tags":"python,user-interface,qt,pyqt","A_Id":1632726,"CreationDate":"2009-10-27T15:23:00.000","Title":"How to allow scaling with uniform aspect ratio in (Py)Qt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)\nI know of wxPython but I have read that it's support on Mac OS X is fairly limited\nJava sounds good & it looks good but it seems almost too difficult to program in\nAny help?","AnswerCount":11,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":3320,"Q_Id":1653419,"Users Score":0,"Answer":"Java seems better for what you want.\nWell what about the web application in Javascript?","Q_Score":3,"Tags":"java,python,cross-platform,wxpython,multiplatform","A_Id":1653442,"CreationDate":"2009-10-31T04:34:00.000","Title":"Cross-Platform Programming Language with a decent gui toolkit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)\nI know of wxPython but I have read that it's support on Mac OS X is fairly limited\nJava sounds good & it looks good but it seems almost too difficult to program in\nAny help?","AnswerCount":11,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":3320,"Q_Id":1653419,"Users Score":0,"Answer":"I would suggest going the wxPython route, I know that wxWidgets (which is what wxPython is using) can be made to have great looking Mac apps (look at PgAdmin3 from postgresql). While PgAdmin3 is not done in python, it was done with wxWidgets and looks fine on a mac.","Q_Score":3,"Tags":"java,python,cross-platform,wxpython,multiplatform","A_Id":1681376,"CreationDate":"2009-10-31T04:34:00.000","Title":"Cross-Platform Programming Language with a decent gui toolkit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)\nI know of wxPython but I have read that it's support on Mac OS X is fairly limited\nJava sounds good & it looks good but it seems almost too difficult to program in\nAny help?","AnswerCount":11,"Available Count":6,"Score":0.0181798149,"is_accepted":false,"ViewCount":3320,"Q_Id":1653419,"Users Score":1,"Answer":"I think wxPython is pretty good, though I am not sure what you mean by \"support on Mac OS X is fairly limited\" but I have been porting a wxPython app (www.mockupscreens.com) to Mac and it wasn't that difficult with few tweaks e.g. some UI elements may not come up as you expected, as wxPython uses native UI elements, which can be an advanatage or disadvantage based on your requirements.\nOther good option is PyQT which will give you consistent look on all platforms.","Q_Score":3,"Tags":"java,python,cross-platform,wxpython,multiplatform","A_Id":1656477,"CreationDate":"2009-10-31T04:34:00.000","Title":"Cross-Platform Programming Language with a decent gui toolkit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)\nI know of wxPython but I have read that it's support on Mac OS X is fairly limited\nJava sounds good & it looks good but it seems almost too difficult to program in\nAny help?","AnswerCount":11,"Available Count":6,"Score":0.0181798149,"is_accepted":false,"ViewCount":3320,"Q_Id":1653419,"Users Score":1,"Answer":"I work on a program that has to run on Windows, Linux and OS X (and OS X is my development platform), and wxPython is what we use.\nIf I had a chance to start again, I'd probably go with PyQT (based on advice from friends), but wxPython will get the job done.","Q_Score":3,"Tags":"java,python,cross-platform,wxpython,multiplatform","A_Id":1653436,"CreationDate":"2009-10-31T04:34:00.000","Title":"Cross-Platform Programming Language with a decent gui toolkit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)\nI know of wxPython but I have read that it's support on Mac OS X is fairly limited\nJava sounds good & it looks good but it seems almost too difficult to program in\nAny help?","AnswerCount":11,"Available Count":6,"Score":0.0,"is_accepted":false,"ViewCount":3320,"Q_Id":1653419,"Users Score":0,"Answer":"I use three cross-platform tools regularly: Realbasic from Realsoftware which is what Visual Basic v6 would have been if allowed to grow; Revolution from Runrev which is what Hypercard would have been if allowed to survive (and its neat using a scripting language whose syntax is basically English); and finally, Delphi Prism with Mono.\nAll are quite mature and yet expanding at a great rate. For instance, Revolution is just introducing a web-application feature to its language that is really easy to use.","Q_Score":3,"Tags":"java,python,cross-platform,wxpython,multiplatform","A_Id":1681426,"CreationDate":"2009-10-31T04:34:00.000","Title":"Cross-Platform Programming Language with a decent gui toolkit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)\nI know of wxPython but I have read that it's support on Mac OS X is fairly limited\nJava sounds good & it looks good but it seems almost too difficult to program in\nAny help?","AnswerCount":11,"Available Count":6,"Score":1.2,"is_accepted":true,"ViewCount":3320,"Q_Id":1653419,"Users Score":6,"Answer":"I used Python with wxPython for quite a while and found it very easy to use. I now use Java with both Swing and SWT.\nI prefer Java but that's just a personal preference so you shouldn't let that sway you.\nI didn't find the transition from Python to Java that difficult. In terms of GUI, they both have the layout manager paradigm - the managers are different but not so different you'll have trouble switching.\nJava has an absolute huge class library to the point where you probably don't need to write your own version of anything, just string together the components. I never really got that deep into Python but it may well be similar. One thing I did notice is that all the really good stuff I used in Python (e.g., s[-4:-1]) could still be done quite easily in Java. Both languages were a step up from C where I had to manage strings with my own libraries.\nIf you think wxPython is limited on MacOS, you should try Java. I run my Java code on Windows, Linux and other UNIXes without compatibility problems. Sadly, not Mac, so I can't really advise you there.\nMy advice, pick a smallish project - do it in both Python and Java - see how it runs on all the platforms you're interested in.","Q_Score":3,"Tags":"java,python,cross-platform,wxpython,multiplatform","A_Id":1653433,"CreationDate":"2009-10-31T04:34:00.000","Title":"Cross-Platform Programming Language with a decent gui toolkit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to design an MVC-pattern with PyQt.\nI want to split all programs into 3 parts:\n\nclasses abstracted from all Qt classes (model)\nclasses providing data from the model to a Qt app (controller)\nthe Qt app itself with defined method SignalsToSlots that connects signals with controller.\n\nIs this optimally? What scheme is recommended for use in PyQt development?","AnswerCount":3,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":29014,"Q_Id":1660474,"Users Score":9,"Answer":"Yes, PyQt uses Model\/View concept (officially without the \"Controller\" part), but may be you have a somewhat distorted picture what does it mean in PyQt.\nThere are two parts:\n\nModels, subclassed from appropriate PyQt base abstract model classes (QAbstractItemModel, QAbstractTableModel, QAbstractListModel, etc.). These models can talk to your data sources directly (files, databases), or proxy your own PyQt-agnostic models which were written before.\nViews, which are implemented in Qt library, and often do not require any modifications (examples: QTreeView, QTableView and others). Even some simpler controls, like QComboBox can act as a view for a PyQt model.\n\nAll other parts of you application, which react to signals, etc. may be considered as \"Controller\".\nPyQt also provides a set of predefined \"universal\" models which can be subclassed or used directly if you need only simple functionality from the model, like QStringListModel, QStandardItemModel, etc. And there are also models which can talk to databases directly, like QSqlTableModel.","Q_Score":35,"Tags":"python,qt,pyqt","A_Id":1692893,"CreationDate":"2009-11-02T10:27:00.000","Title":"PyQt and MVC-pattern","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am looking for an example application written in Python and PyGTK.\nThere should be an editor out there somewhere that already does this.\nSome app with a text editor row of buttons:\n- Font\n- Bold\/italic\/underline\n- etc\nI am hoping to avoid reinventing the wheel on this one! \nthanks","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1341,"Q_Id":1665288,"Users Score":2,"Answer":"I found some related examples: KeepNote, which has a custom rich edit, and Rednotebook which implements KeepNote's richedit.","Q_Score":1,"Tags":"python,pygtk,pango","A_Id":1772990,"CreationDate":"2009-11-03T04:40:00.000","Title":"Are there any examples of a Python PyGTK Pango editor toolbar?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In Gnome, whenever an application is started, the mouse cursor changes from normal to an activity indicator (a spinning wheel type thing on Ubuntu). Is there any way to inform Gnome (through some system call) when the application has finished launching so that the mouse cursor returns to normal without waiting for the usual timeout of 30 seconds to occur.\nI have a program in Pythong using GTK+ that is showing the icon even after launching, so what system call do I make?","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":840,"Q_Id":1680311,"Users Score":0,"Answer":"This normally happens automatically when calling the gtk.main() function","Q_Score":7,"Tags":"python,linux,ubuntu,gnome","A_Id":1680360,"CreationDate":"2009-11-05T12:39:00.000","Title":"GTK+ Startup Notification Icon","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have a lot of APIs\/Classes that I have developed in Ruby and Python that I would like to use in my .NET apps. Is it possible to instantiate a Ruby or Python Object in C# and call its methods?\nIt seems that libraries like IronPython do the opposite of this. Meaning, they allow Python to utilize .NET objects, but not the reciprocal of this which is what I am looking for... Am I missing something here?\nAny ideas?","AnswerCount":4,"Available Count":1,"Score":-0.049958375,"is_accepted":false,"ViewCount":5027,"Q_Id":1684145,"Users Score":-1,"Answer":"I have seen ways to call into Ruby \/ Python from c#. But it's easier the other way around.","Q_Score":8,"Tags":"c#,.net,python,ruby","A_Id":1684168,"CreationDate":"2009-11-05T22:37:00.000","Title":"Call Ruby or Python API in C# .NET","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a widget that displays a filesystem hierarchy for convenient browsing (basically a tree control and some associated toolbar buttons, such as \"refresh\"). Each of these widgets has a set of base directories for it to display (recursively). Assume that the user may instantiate as many of these widgets as they find convenient. Note that these widgets don't correspond to any business data -- they're independent of the model.\nWhere should the (per-widget) set of base directories live in good MVC design?\nWhen the refresh button is pushed, an event is trapped by the controller, and the event contains the corresponding filesystem-browser widget. The controller determines the base directories for that particular widget (somehow), walks that directory path, and passes the widget some data to render.\nTwo places I can think to store the base directories:\n\nThe easy solution: make the base directories an instance variable on the widget and have the controller manipulate it to retain state for that widget. There's a conceptual issue with this, though: since the widget never looks at that instance variable, you're just projecting one of the responsibilities of the controller onto the widget.\nThe more (technically, maybe conceptually) complex solution: Keep a {widget: base_directory_set} mapping in the controller with weak key references.\n\nThe second way allows for easy expansion of controller responsibilities later on, as putting things in the controller tends to do -- for example, if I decided I later wanted to determine the set of all the base directories for all those widgets.\nThere may be some piece of MVC knowledge I'm missing that solves this kind of problem well.","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":519,"Q_Id":1686235,"Users Score":2,"Answer":"The anomaly (from the MVC viewpoint) that makes this design difficult to make MVC-conformant is that you want to display information that, by your conceptualization, \"does not live in a model\". There is no such thing as \"information that does not live in a model\" in MVC: its conceptual root is \"the models hold all the information, the views just do presentation tasks, the controllers mediate user interaction\".\nIt's quite possible that the information you're displaying doesn't \"correspond to any business data\", but (in an MVC worldview) this does not mean that info is \"independent of the model\", because there is no such thing -- it just means you need another model class (beyond whatever you're using to hold \"business data\"), to hold this \"non-business\" data!-)\nSo when the user \"instantiates a widget\" (creates a directory-display view, presumably by some user action on some master\/coordinating view, possibly on another existing widget if \"cloning\" is one of the ways to instantiate a widget), the controller's responsible for creating both a widget object and an instance of the \"directory-display model class\", and establish connection between them (normally by setting on the widget a reference to the relevant model instance), as well as telling the model to do its initial loading of information. When the user action on the widget implies an action on the model, the controller retrieves from the widget involved in the event the reference to the model instance, and sends that instance the appropriate request(s) (it's the model's business to let the view[s] interested in it know about changes to information -- typically by some observer pattern; it's definitely not the controller's business to feed the view with information -- that's really a very different approach from MVC!).\nIs the architectural investment required by MVC worth it, in your case, compared to a rougher approach where the information flows are less pristine and the model that should be there just doesn't exist? I'm a pragmatist and I definitely don't worship at the altar of MVC, but I think in this case the (relatively small) investment in sound, clear architecture may indeed repay itself in abundance. It's a question of envisioning the likely directions of change -- for example, what functionality that you don't need right now (but may well enter the picture soon afterwards) will be trivial to add if you go the proper MVC route, and would be a nightmare of ad-hoc kludges otherwise (or require a somewhat painful refactoring of the whole architecture)? All sort of likely things, from wanting to display the same directory information in different widgets to having a smarter \"directory-information watching\" model that can automatically refresh itself when needed (and supply the new info directly to interested views via the usual observer pattern, with no involvement by the controller), are natural and trivially easy with MVC (hey, that's the whole point of MVC, after all, so this is hardly surprising!-), kludgy and fragile with an ad-hoc corner-cutting architecture -- small investment, large potential returns, go for it!\nYou may notice from the tone of the previous paragraph that I don't worship at the \"extreme programming\" altar either -- as a pragmatist, I will do a little \"design up front\" (especially in terms of putting in place a clean, flexible, extensible architecture, from the start, even if it's not indispensable right now) -- exactly because, in my experience, a little forethought and very modest investment, especially on the architectural front, pays back for itself many times over during a project's life (in such varied currencies as scalability, flexibility, extensibility, maintainability, security, and so forth, though not all of them will apply to every project -- e.g., in your case, security and scalability are not really a concern... but the other aspects will likely be!-).\nJust for generality, let me point out that this pragmatic attitude of mine does not justify excessive energy and time spent on picking an architecture (by definition of the word \"excessive\";-) -- being familiar with a few fundamental architectural patterns (and MVC is surely one of those) often reduces the initial investment in terms of time and effort -- once you recognize that such a classic architecture will serve you well, as in this case, it's really easy to see how to embody it (e.g., reject the idea of an \"MVC without a M\"!-), and it doesn't really take much more code compared to the kludgiest, ad-hoccest shortcuts!-)","Q_Score":4,"Tags":"python,model-view-controller,user-interface","A_Id":1738316,"CreationDate":"2009-11-06T08:37:00.000","Title":"wxPython: How should I organize per-widget data in the controller?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I need an IronPython\\Python example that would show C#\/VB.NET developers how awesome this language really is. \nI'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities.\nAny thoughts?","AnswerCount":13,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":1848,"Q_Id":1708103,"Users Score":10,"Answer":"Rewrite any small C# app in IronPython, and show them how many lines of code it took you. If that's not impressing, I don't know what is.\nI'm referring to one of your internal apps.","Q_Score":10,"Tags":"python,ironpython","A_Id":1708382,"CreationDate":"2009-11-10T13:49:00.000","Title":"How to impress developers with IronPython\/Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need an IronPython\\Python example that would show C#\/VB.NET developers how awesome this language really is. \nI'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities.\nAny thoughts?","AnswerCount":13,"Available Count":2,"Score":0.0461211021,"is_accepted":false,"ViewCount":1848,"Q_Id":1708103,"Users Score":3,"Answer":"I have to agree Geo. Show a C# or VB app next to the same app written in IronPython. When I've done my IronPython talks, I've had a lot of success morphing C# code into Python. It makes for a very dramatic presentation.\nI'm also a big fan of showing off how duck typing makes your code more testable.","Q_Score":10,"Tags":"python,ironpython","A_Id":1711358,"CreationDate":"2009-11-10T13:49:00.000","Title":"How to impress developers with IronPython\/Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":5231,"Q_Id":1709528,"Users Score":0,"Answer":"If you want to have Yes\/No translated into the current language, usually setting the system language should be enough. Otherwise try with Natim's suggestion. \nIf you want custom texts: The static methods like question() etc. don't allow custom button texts. That's unfortunate, as \"Yes\"\/\"No\" dialogs are considered bad style (they are not descriptive, one has to read the whole message, and its easy to misunderstand what means Yes and what means No and accidentally negating them). For custom texts, you have to use QMessageBox directly. I'd suggest to write your own static methods accepting optional button texts.","Q_Score":4,"Tags":"python,qt,pyqt,translation,button","A_Id":4627449,"CreationDate":"2009-11-10T17:03:00.000","Title":"PyQt: translating standard buttons","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?","AnswerCount":4,"Available Count":2,"Score":0.1488850336,"is_accepted":false,"ViewCount":5231,"Q_Id":1709528,"Users Score":3,"Answer":"Are you sure you have to translate them yourself? In other toolkits, standard buttons are automatically translated to the language that the user is using.","Q_Score":4,"Tags":"python,qt,pyqt,translation,button","A_Id":1709930,"CreationDate":"2009-11-10T17:03:00.000","Title":"PyQt: translating standard buttons","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a couple of questions.\nI have an algorithm that will generate a couple of pictures in python that must be displayed on a form. I am using PyGt for this. My question is: where should I run my code? Right from the initializer? In that case from what I tested, the form won't show up. \n\nShould I set up a timer in the\nconstructor that starts my algorithm\nhalf a second later?\nWill running the algorithm freeze my\nform making it impossible to see the\npicture itself? I don't mind that the\nbuttons, checkboxes, etc freeze while\nit is computing, as long as the\ncurrent picture is still visible.\nShould I use something like c#'s\nOnFormLoad()? If yes, how can I set\nit? Through connect()?\nHow does threading work on python?\nI've heard, but I'm not too sure\nabout it, that it was a pain to deal\nwith. Is it? In c# it is as easy as\nwriting 4 lines. I'd like to use it\nif possible, but if it is going to be\nhard to implement it I can live\nwithout it.\n\nThanks","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":155,"Q_Id":1715098,"Users Score":1,"Answer":"You can run the algorithm in a separate thread, placing the data into a Queue when finished. The main thread (GUI) will periodically sample the queue and display the data when it arrives.","Q_Score":1,"Tags":"python,pyqt,pyqt4","A_Id":1715113,"CreationDate":"2009-11-11T13:12:00.000","Title":"Couple of questions regarding PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project.\nRequierements:\n\nno reliance on fully standard compliant STL - i might use uSTL though.\nas little overhead as possible. Aim for a solution so good. that it could be used on the original Playstation, and yet as modern and elegant as possible.\nno backward\/forward compatibility necessary.\nno copying of large chunks around - preferably files get loaded into RAM in background, and all large chunks accessed directly from there later.\nshould not rely on the target having the same endianness and alignment, i.e. a C plugin in Python which dumps its structs to disc would not be a very good idea.\nshould allow to move the loaded data around, as with individual files 1\/3 the RAM size, fragmentation might be an issue. No MMU to abuse.\nrobustness is a great bonus, as my attention span is very short, i.e. i'd change saving part of the code and forget the loading one or vice versa, so at least a dumb safeguard would be nice.\nexchangeability between loaded data and runtime-generated data without runtime overhead and without severe memory management issues would be a nice bonus.\n\nI kind of have a semi-plan of parsing in Python trivial, limited-syntax C headers which would use structs with offsets instead of pointers, and convenience wrapper structs\/classes in the main app with getters which would convert offsets to properly typed pointers\/references, but i'd like to hear your suggestions.\nClarification: the request is primarily about data loading framework and memory management issues.","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":270,"Q_Id":1727594,"Users Score":0,"Answer":"Consider storing your data as BLOBs in a SQLite DB. SQLite is extremely portable and lighweight, ANSI C, has both C++ and Python interfaces. This will take care of large files, no fragmentation, variable-length records with fast access, and so on. The rest is just serialization of structs to these BLOBs.","Q_Score":3,"Tags":"c++,python,embedded,playstation","A_Id":1727732,"CreationDate":"2009-11-13T06:56:00.000","Title":"Optimal datafile format loading on a game console","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project.\nRequierements:\n\nno reliance on fully standard compliant STL - i might use uSTL though.\nas little overhead as possible. Aim for a solution so good. that it could be used on the original Playstation, and yet as modern and elegant as possible.\nno backward\/forward compatibility necessary.\nno copying of large chunks around - preferably files get loaded into RAM in background, and all large chunks accessed directly from there later.\nshould not rely on the target having the same endianness and alignment, i.e. a C plugin in Python which dumps its structs to disc would not be a very good idea.\nshould allow to move the loaded data around, as with individual files 1\/3 the RAM size, fragmentation might be an issue. No MMU to abuse.\nrobustness is a great bonus, as my attention span is very short, i.e. i'd change saving part of the code and forget the loading one or vice versa, so at least a dumb safeguard would be nice.\nexchangeability between loaded data and runtime-generated data without runtime overhead and without severe memory management issues would be a nice bonus.\n\nI kind of have a semi-plan of parsing in Python trivial, limited-syntax C headers which would use structs with offsets instead of pointers, and convenience wrapper structs\/classes in the main app with getters which would convert offsets to properly typed pointers\/references, but i'd like to hear your suggestions.\nClarification: the request is primarily about data loading framework and memory management issues.","AnswerCount":4,"Available Count":3,"Score":0.1488850336,"is_accepted":false,"ViewCount":270,"Q_Id":1727594,"Users Score":3,"Answer":"I note that nowhere in your description do you ask for \"ease of programming\". :-)\nThus, here's what comes to mind for me as a way of creating this:\n\nThe data should be in the same on-disk format as it would be in the target's memory, such that it can simply pull blobs from disk into memory with no reformatting it. Depending on how much freedom you want in putting things into memory, the \"blobs\" could be the whole file, or could be smaller bits within it; I don't understand your data well enough to suggest how to subdivide it but presumably you can. Because we can't rely on the same endianness and alignment on the host, you'll need to be somewhat clever about translating things when writing the files on the host-side, but at least this way you only need the cleverness on one side of the transfer rather than on both.\nIn order to provide a bit of assurance that the target-side and host-side code matches, you should write this in a form where you provide a single data description and have some generation code that will generate both the target-side C code and the host-side Python code from it. You could even have your generator generate a small random \"version\" number in the process, and have the host-side code write this into the file header and the target-side check it, and give you an error if they don't match. (The point of using a random value is that the only information bit you care about is whether they match, and you don't want to have to increment it manually.)","Q_Score":3,"Tags":"c++,python,embedded,playstation","A_Id":1728074,"CreationDate":"2009-11-13T06:56:00.000","Title":"Optimal datafile format loading on a game console","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project.\nRequierements:\n\nno reliance on fully standard compliant STL - i might use uSTL though.\nas little overhead as possible. Aim for a solution so good. that it could be used on the original Playstation, and yet as modern and elegant as possible.\nno backward\/forward compatibility necessary.\nno copying of large chunks around - preferably files get loaded into RAM in background, and all large chunks accessed directly from there later.\nshould not rely on the target having the same endianness and alignment, i.e. a C plugin in Python which dumps its structs to disc would not be a very good idea.\nshould allow to move the loaded data around, as with individual files 1\/3 the RAM size, fragmentation might be an issue. No MMU to abuse.\nrobustness is a great bonus, as my attention span is very short, i.e. i'd change saving part of the code and forget the loading one or vice versa, so at least a dumb safeguard would be nice.\nexchangeability between loaded data and runtime-generated data without runtime overhead and without severe memory management issues would be a nice bonus.\n\nI kind of have a semi-plan of parsing in Python trivial, limited-syntax C headers which would use structs with offsets instead of pointers, and convenience wrapper structs\/classes in the main app with getters which would convert offsets to properly typed pointers\/references, but i'd like to hear your suggestions.\nClarification: the request is primarily about data loading framework and memory management issues.","AnswerCount":4,"Available Count":3,"Score":0.1973753202,"is_accepted":false,"ViewCount":270,"Q_Id":1727594,"Users Score":4,"Answer":"On platforms like the Nintendo GameCube and DS, 3D models are usually stored in a very simple custom format:\n\nA brief header, containing a magic number identifying the file, the number of vertices, normals, etc., and optionally a checksum of the data following the header (Adler-32, CRC-16, etc).\nA possibly compressed list of 32-bit floating-point 3-tuples for each vector and normal.\nA possibly compressed list of edges or faces.\nAll of the data is in the native endian format of the target platform.\nThe compression format is often trivial (Huffman), simple (Arithmetic), or standard (gzip). All of these require very little memory or computational power.\n\nYou could take formats like that as a cue: it's quite a compact representation.\nMy suggestion is to use a format most similar to your in-memory data structures, to minimize post-processing and copying. If that means you create the format yourself, so be it. You have extreme needs, so extreme measures are needed.","Q_Score":3,"Tags":"c++,python,embedded,playstation","A_Id":1728071,"CreationDate":"2009-11-13T06:56:00.000","Title":"Optimal datafile format loading on a game console","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having an issue with an embedded 64bit Python instance not liking PIL. Before i start exhausting more methods to get a compiled image editor to read the pixels for me (such as ImageMagick) i am hoping perhaps anyone here can think of a purely Python solution that will be comparable in speeds to the compiled counterparts.\nNow i am aware that the compiled friends will always be much faster, but i am hoping that because i \"just\" want to read the alpha of a group of pixels, that perhaps a fast enough pure Python solution can be conjured up. Anyone have any bright ideas?\nThough, i have tried PyPNG and that is far too slow, so i'm not expecting any magic solutions. None the less, i had to ask.\nThanks to any replies!\nAnd just for reference, the images i'll be reading will be on average around 512*512 to 2048*2048, and i'll be reading anywhere from one to all of the pixels alpha (multiplied by a few million times, but the values can be stored so reading twice isn't done).","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":955,"Q_Id":1732761,"Users Score":2,"Answer":"Getting data out of a PNG requires unpacking data and decompressing it. These are likely going to be too slow in Python for your application. One possibility is to start with PyPNG and get rid of anything in it that you don't need. For example, it is probably storing all of the data it reads from the PNG, and some of the slow speed you see may be due to the memory allocations.","Q_Score":1,"Tags":"python,png","A_Id":1732962,"CreationDate":"2009-11-14T00:30:00.000","Title":"Reading Alpha of a PNG Pixel. Fast way via pure Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using PyQt to capture my screen with QPixmap.grabWindow(QApplication.desktop().winId()) and I was wondering if there was a way I could display my screengrab fullscreen (no window borders, etc.) I'm trying to find a way to desaturate my display with PyQt","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3562,"Q_Id":1732935,"Users Score":9,"Answer":"Passing QtCore.Qt.FramelessWindowHint to the QWidget constructor in symphony with self.showFullScreen() in the image widget's code achieves this.","Q_Score":4,"Tags":"python,pyqt,screenshot,fullscreen","A_Id":1733241,"CreationDate":"2009-11-14T01:36:00.000","Title":"PyQt display fullscreen image","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know this is a long shot, but I was wondering if Python had a way to manipulate the screen buffer. Specifically, I want to be able to gray-out my desktop and highlight my windows when I press a key combination. Is this in the realm of possibility?","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1923,"Q_Id":1734575,"Users Score":2,"Answer":"Instead of \"graying out\" the desktop, try to overlay a gray, semi-transparent image over the entire screen and then make sure your window is on top of that. You may face a couple of minor limitations; for example, I don't know off the top of my head if it's possible to overlay the mac menubar (and I'm not sure you'd want to).","Q_Score":1,"Tags":"python,screen,buffer","A_Id":1737577,"CreationDate":"2009-11-14T15:34:00.000","Title":"Manipulate screen buffer in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How to put QGraphicsScene's (0,0) to top-left corner of QGraphicsView?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1081,"Q_Id":1737624,"Users Score":1,"Answer":"Try doing setCenterOn(0,0) on the QGraphicsView?","Q_Score":2,"Tags":"python,qt,pyqt","A_Id":4600372,"CreationDate":"2009-11-15T14:17:00.000","Title":"QGraphicsScene and positioning","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have some project about game programming, which have to use blender with phanthom ,Don't know possible to do it","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":305,"Q_Id":1740299,"Users Score":0,"Answer":"If you mean Phantom Omni, the haptic feedback device, and you mean Blender, the rendering program, then I don't see any reason why you can't use the API for both of them in a program, together to make a game.\nIn short, if your questions means what I think it does, of course.","Q_Score":0,"Tags":"python,blender","A_Id":1740306,"CreationDate":"2009-11-16T05:48:00.000","Title":"Can i integrate Blender with Phanthom Omni","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm not familiar with PowerBuilder but I have a task to create Automatic UI Test Application for PB. We've decided to do it in Python with pywinauto and iaccesible libraries. The problem is that some UI elements like newly added lists record can not be accesed from it (even inspect32 can't get it). \nAny ideas how to reach this elements and make them testable?","AnswerCount":4,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":3825,"Q_Id":1741023,"Users Score":2,"Answer":"I'm experimenting with code for a tool for automating PowerBuilder-based GUIs as well. From what I can see, your best bet would be to use the PowerBuilder Native Interface (PBNI), and call PowerScript code from within your NVO.\nIf you like, feel free to send me an email (see my profile for my email address), I'd be interested in exchanging ideas about how to do this.","Q_Score":6,"Tags":"python,testing,powerbuilder","A_Id":1741142,"CreationDate":"2009-11-16T09:23:00.000","Title":"How to make PowerBuilder UI testing application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm not familiar with PowerBuilder but I have a task to create Automatic UI Test Application for PB. We've decided to do it in Python with pywinauto and iaccesible libraries. The problem is that some UI elements like newly added lists record can not be accesed from it (even inspect32 can't get it). \nAny ideas how to reach this elements and make them testable?","AnswerCount":4,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":3825,"Q_Id":1741023,"Users Score":1,"Answer":"I've seen in AutomatedQa support that they a recipe recommending using msaa and setting some properties on the controls. I do not know if it works.","Q_Score":6,"Tags":"python,testing,powerbuilder","A_Id":2328021,"CreationDate":"2009-11-16T09:23:00.000","Title":"How to make PowerBuilder UI testing application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"From the web I've gleaned that WSGI is a CGI for python web development\/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C\/++.","AnswerCount":2,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":25057,"Q_Id":1747266,"Users Score":27,"Answer":"They are two different things. WSGI is a Python specific interface for writing web applications. There are wrappers for about any web server protocol to provide the WSGI interface. FastCGI (FCGI) is one of such web server protocols. So, WSGI is an abstraction layer, while CGI \/ FastCGI \/ mod_python are how the actual web servers talk to the application. Some code has to translate the native interface to WSGI (there is a CGI module in wsgiref, there is flup for FastCGI, etc.). There is also mod_wsgi for Apache, which does the translation directly in an Apache module, so you don't need any Python wrapper.","Q_Score":39,"Tags":"python,wsgi,fastcgi","A_Id":1747336,"CreationDate":"2009-11-17T07:59:00.000","Title":"Is there a speed difference between WSGI and FCGI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"From the web I've gleaned that WSGI is a CGI for python web development\/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C\/++.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":25057,"Q_Id":1747266,"Users Score":80,"Answer":"Correct, WSGI is a Python programmatic API definition and FASTCGI is a language agnostic socket wire protocol definition. Effectively they are at different layers with WSGI being a higher layer. In other words, one can implement WSGI on top of something that so happened to use FASTCGI to communicate with a web server, but not the other way around.\nIn general, FASTCGI being a socket wire protocol means that you always need some type of programmatic interface on top to use it. For Python one such option is WSGI. As FASTCGI is just a means to an end, one can't really compare its performance to WSGI in that case because WSGI isn't a comparable socket wire protocol, but a user of FASTCGI itself.\nOne could try and compare performance of different language interfaces on top of FASTCGI, but in general that is quite meaningless in itself as the lower network layer and server request handling aren't the bottleneck. Instead your application code and database will be.","Q_Score":39,"Tags":"python,wsgi,fastcgi","A_Id":1748161,"CreationDate":"2009-11-17T07:59:00.000","Title":"Is there a speed difference between WSGI and FCGI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"What experiences do you have with Stackless Python and PyQt?\nIssues i would be happy if people address:\n\nCompilation of PyQt for Stackless: does PyQt need to be compiled especially for Stackless? is the compilation smooth? problems with bindings etc.\nStability: any unexpected crashes, freezes, pauses and other weirdities?\nMemory Management: any hints of memory leaks. comparison of RAM needed for a Stackless\/Plain Vanilla PyQt applications\nSoftware Engineering Empowerment: very short outline of flow-of-control models for Stackless-powered PyQt applications\nLessons learned: any painful lesson learned, traps to be avoided, problems to tackle you might have experienced\n\nBe Happy","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1679,"Q_Id":1749818,"Users Score":0,"Answer":"I tried to go down this path several months ago and decided it was not worth the effort.\nI was able to run a binary install of PyQt (on Windows) against a stackless version of Python, but I found that I had to manually go in and change some of the files. I was getting an error message (sorry, I forget what it was), and google search led to a solution from several years ago. Newer code did not include the old fix, so the change was not too difficult and (if I remember correctly) it was in python, so no recompile was necessary.\nBut that was a deal breaker for me. Qt updates come out regularly, as do updates to PyQt, and I didn't want to be continually fixing the code. Stackless and PyQt are simply not used enough together to be checked out thoroughly. I found the risk of difficult to debug issues pretty high. This is especially true given the author of stackless has moved on to PyPy. Let me apologize in advance - I wish I had the references I found for the author stopping development on stackless python and more detail on the errors I had to fix - I wasn't expecting to regurgitate the details on Stack Overflow.\nSo I chose to run PyQt on a vanilla Python instead of stackless.\nBTW, I also thought that mixing signals\/slots with stackless code would be confusing, as they are completely different methods of solving multi-threading problems.\nGood luck!","Q_Score":4,"Tags":"python,pyqt,pyqt4,stackless,python-stackless","A_Id":2047183,"CreationDate":"2009-11-17T15:52:00.000","Title":"Stackless Python and PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The documentation for pyWebKitGTK is pretty scarce. I've looked through their python .def files but they don't seem to contain the words cookie, session, (lib)soup or (lib)curl.. so maybe it isn't possible, huh. I've also looked through the WebKitGTK docs (for the C-based library) and aside from a brief mention of libsoup there doesn't appear to be anything there either. But on the other hand cookie support seems like pretty fundamental stuff. Could anyone confirm \/ deny PyWebKitGTK's support of cookies?\nNote: am currently using the GTK version, but I don't mind switching to the Qt one if the feature is there.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2065,"Q_Id":1761473,"Users Score":-1,"Answer":"webkit is a html renderer, not a complete browser. I guess you must deal with persisting the cookies yourself.","Q_Score":2,"Tags":"python,cookies,webkit","A_Id":1762266,"CreationDate":"2009-11-19T07:20:00.000","Title":"How to enable cookie support with pyWebKit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The problem I have is that I have this Python script to launch a application. After the application is launched (the GUI is shown on screen), I want to make it de-activated. It can be done manually by activating another window, or minimizing this app, or pressing the Show Desktop key for WindowsXP.\nSo is there any way that I can do this by Python? Core or 3rd party library would be all ok.\nThanks!","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1789,"Q_Id":1767575,"Users Score":0,"Answer":"I've used AutoIt (via it's COM interface) a lot of times","Q_Score":2,"Tags":"python,windows,keyboard","A_Id":1773644,"CreationDate":"2009-11-20T00:24:00.000","Title":"Are there any libraries for Python to simulate keyboard action?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an existing Python 2.4 and it is working properly with tkinter as I tested it using \npython\nimport _tkinter\n\n\n\nimport Tkinter\n Tkinter._test() \n\n\n\nNow, I have installed python 2.5.2 but when I try the same tests (with the newer version), it returns (but the same tests are working for the previous version)\nImportError: No module named _tkinter\nI know that tcl8.5 and tk8.5 are installed on my machine as the following commands return there locations\nwhereis tcl\ntcl: \/usr\/lib\/tcl8.4 \/usr\/local\/lib\/tcl8.5 \/usr\/local\/lib\/tcl8.4 \/usr\/share\/tcl8.4\nwhereis tk\ntk: \/usr\/lib\/tk8.4 \/usr\/local\/lib\/tk8.5 \/usr\/share\/tk8.4\nAny ideas how do I make my newer python version work with tkinter?","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":1073,"Q_Id":1773222,"Users Score":3,"Answer":"The files you found are for linking directly to tcl\/tk. Python depends on another library as well: _tkinter.so. It should be in \/usr\/lib\/python2.5\/lib-dynload\/_tkinter.so.\nHow did you install python2.5? If you are using Debian or Ubuntu you need to install the python-tk package to get Tkinter support.\nIf the _tkinter.so file is there, your environment could be causing problems.\nIf \n\npython -E -c \"import\n Tkinter;Tkinter._test()\"\n\nsuceeds, but \n\npython -c \"import\n Tkinter;Tkinter._test()\"\n\nfails, then the problem is with how your environment is set up. Check the value of PYTHONPATH is set correctly.","Q_Score":0,"Tags":"python,tcl,tkinter,tk","A_Id":1773435,"CreationDate":"2009-11-20T21:02:00.000","Title":"Linking Tcl\/Tk to Python 2.5","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons.\nWhat do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice.\nSorry for the subjective question.","AnswerCount":4,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":3384,"Q_Id":1779004,"Users Score":13,"Answer":"I've written reasonably large apps in both PyGTK and PyQt. On balance, my personal opinion is that PyQt is superior, but not by so much that it's worth worrying about. If you're only worried about supporting Ubuntu, then use PyGTK; it'll give a better look and feel. If you think you may want to port this app to other platforms, then use PyQt; PyQt is far and away the superior crossplatform solution.","Q_Score":9,"Tags":"python,ubuntu,pyqt,pygtk","A_Id":1818306,"CreationDate":"2009-11-22T15:21:00.000","Title":"Is PyGTK or PyQT preferred for making GTK-native Python apps?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons.\nWhat do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice.\nSorry for the subjective question.","AnswerCount":4,"Available Count":4,"Score":0.049958375,"is_accepted":false,"ViewCount":3384,"Q_Id":1779004,"Users Score":1,"Answer":"In my experience, having made both PyGTK and PyQT apps, there is little difference on the underlying programming side of things. PyQT seems more consistent across different flavors of Linux, where GTK is constantly changing and breaking on older distributions.\nPyQT has QTCreator, which is a great GUI designer. PyGTK has Glade3, which is getting better, but not as good. Until recently Glade was a bad joke. If you need to draw GUIs in an editor, PyQT is probably the better choice. Otherwise, I'd go with PyGTK for coding because the online PyGTK documentation is excellent.\nOne bizarre thing I've found is PyQT has poor support for dynamic menu item callbacks. Maybe I just didnt use it right, but PyGTK is a bit more flexible in comparison. \nIt's a tough choice, really. But if you design your application right, the interface should be irrelevant; you could design your app with multiple interfaces...","Q_Score":9,"Tags":"python,ubuntu,pyqt,pygtk","A_Id":1901957,"CreationDate":"2009-11-22T15:21:00.000","Title":"Is PyGTK or PyQT preferred for making GTK-native Python apps?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons.\nWhat do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice.\nSorry for the subjective question.","AnswerCount":4,"Available Count":4,"Score":0.049958375,"is_accepted":false,"ViewCount":3384,"Q_Id":1779004,"Users Score":1,"Answer":"In my opinion use PYQT as its definately superior for a few reasons. There is no worries with pixmaps ever, there is only one library coded in the same style and conventions. In pygtk you need to learn up to 4 libraries coded in a different style. You have to learn GLIB constants at least if not GLIB variable names as well even though they are a complete 1 to 1 swap with the stdlib C type itself, but why use standard types everyone else uses when as the master of your toolkit you can use pretty useless special purpose types which then can be forced onto everyone else. Gnome developers need a serious wake up. \nGo with PYQT its sane easy to use and wont make you constantly look up documentation to find out why you cant use standard code.","Q_Score":9,"Tags":"python,ubuntu,pyqt,pygtk","A_Id":13670093,"CreationDate":"2009-11-22T15:21:00.000","Title":"Is PyGTK or PyQT preferred for making GTK-native Python apps?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons.\nWhat do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice.\nSorry for the subjective question.","AnswerCount":4,"Available Count":4,"Score":0.2449186624,"is_accepted":false,"ViewCount":3384,"Q_Id":1779004,"Users Score":5,"Answer":"PyGTK application will look more native on a Gnome system. PyQt application will look more native on a KDE system.\nAs I found PyGTK have better documentation then PyQt.\nIt will take the same time to write a program on PyQt and PyGTK.","Q_Score":9,"Tags":"python,ubuntu,pyqt,pygtk","A_Id":1779036,"CreationDate":"2009-11-22T15:21:00.000","Title":"Is PyGTK or PyQT preferred for making GTK-native Python apps?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to make a StaticText red, what should I use?","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":28120,"Q_Id":1785227,"Users Score":3,"Answer":"Depending on which color you would need to set, look into SetForegroundColour() or SetBackgroundColour() method.","Q_Score":23,"Tags":"wxpython,static-text","A_Id":1786334,"CreationDate":"2009-11-23T18:57:00.000","Title":"Change the colour of a StaticText, wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Greetings, everybody.\nI'm trying to import the following libraries in python: cx_Oracle and kinterbasdb.\nBut, when I try, I get a very similar message error.\n*for cx_Oracle:\nTraceback (most recent call last):\n File \"\", line 1, in \nImportError: DLL load failed: N\u00e3o foi poss\u00edvel encontrar o procedimento especificado.\n(translation: It was not possible to find the specified procedure)\n*for kinterbasdb:\nTraceback (most recent call last):\n File \"C:\\\", line 1, in \n File \"c:\\Python26\\Lib\\site-packages\\kinterbasdb__init__.py\", line 119, in \n import _kinterbasdb as _k\nImportError: DLL load failed: N\u00e3o foi poss\u00edvel encontrar o m\u00f3dulo especificado.\n(translation: It was not possible to find the specified procedure)\nI'm using python 2.6.4 in windows XP. cx_Oracle's version is 5.0.2. kinterbasdb's version is 3.3.0.\nEdit: I've solved it for cx_Oracle, it was a wrong version problem. But I believe I'm using the correct version, and I downloaded it from the Firebird site ( kinterbasdb-3.3.0.win32-setup-py2.6.exe ). Still need assistance with this, please.\nCan anyone lend me a hand here?\nMany Thanks\nDante","AnswerCount":1,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":767,"Q_Id":1799475,"Users Score":-1,"Answer":"oracle is a complete pain. i don't know the details for windows, but for unix you need ORACLE_HOME and LD_LIBRARY_PATH to both be defined before cx_oracle will work. in windows this would be your environment variables, i guess. so check those.\nalso, check that they are defined in the environment in which the program runs (again, i don't know windows specific details, but in unix it's possible for everything to work when you run it from your account by hand, but still not work when run as a batch job because the environment is different).","Q_Score":2,"Tags":"python,cx-oracle,kinterbasdb","A_Id":1803407,"CreationDate":"2009-11-25T19:43:00.000","Title":"importing cx_Oracle and kinterbasdb returns error","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to develop a desktop application framework in Python, much like QT, but how to go about it? Any tutorials or links related to it would be helpful!","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":813,"Q_Id":1811940,"Users Score":2,"Answer":"Well the best way to start is to look at the source code of the framework the other answers are talking about.\nFirst, try to use them all to build the same application with the functionalities you expect from a framework. Them, look at how it works under the hood.\nSecondly, build your framework, starting by writing your first widgets, then notice the problems with your current architecture, and re factor. Start again, until you have something stable and usable.\nEventually, find out this was nice as training experience, but useless as a contribution to the software communities since you will never reach out the qualities of existing tools.\nThen give up and try to code your own MMORPG.","Q_Score":2,"Tags":"python,frameworks,desktop","A_Id":1813171,"CreationDate":"2009-11-28T08:04:00.000","Title":"I want to develop a framework in Python for desktop based applications. How should I go about it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The usual way to use Qt widgets from Python seems to be to subclass them.\nQt widget classes have a great many methods, so inevitably I'm going to end up adding a method to the subclass, with the same name as one inherited from the Qt widget. In Python, all methods are virtual, so what I'm concerned about is that some Qt code might end up calling my method instead of the expected Qt one - in the worst-case scenario, breaking some edge case that doesn't easily show up in testing.\nOn the other hand, maybe all the PyQt methods are just wrappers for C++ code, which would of course be unaffected by anything I do in terms of Python subclassing.\nAnyone know offhand which is the case?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1972,"Q_Id":1828567,"Users Score":3,"Answer":"If the underlaying C++ methods are virtual, your Python methods that override them will be called any time C++ code calls them. If they are just regular methods, any C++ code will call the original C++ methods by default (Python code will call the Python methods though, because it sees the Python object and all methods are \"virtual\" there).","Q_Score":4,"Tags":"python,qt,qt4,pyqt,pyqt4","A_Id":1828607,"CreationDate":"2009-12-01T20:10:00.000","Title":"PyQt subclassing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to render wikitext (pulled from the database of a mediawiki of it's relevant) and display in some other format (ultimately to be rendered as a PDF, but basically any other format will do).\nI can definately hack together something that does the job but ultimately I'll be writing it as I go along, and I can see that the overhead of implementing new tags as people in my team use them will eat up a lot of my time.\nIs there a project to do this?\nI saw TiddlyWiki which is written in python, which I will look into borrowing their library, but in the meantime I figured there may be a project that's a bit more niche that someone knows?\nCheers","AnswerCount":3,"Available Count":1,"Score":-0.0665680765,"is_accepted":false,"ViewCount":2209,"Q_Id":1836884,"Users Score":-1,"Answer":"pywikipedia i have found to be best","Q_Score":1,"Tags":"python,mediawiki,wikitext","A_Id":2321542,"CreationDate":"2009-12-03T00:29:00.000","Title":"Render wikitext with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In PyQt 4.5, I have a layout inside another layout. I'd like to remove the sublayout from its parent, and hide it. I can say parent_layout.removeItem(child_layout) to remove the layout from its parent, but it still shows on the widget. I can't find any way to hide it in one step, as QLayout doesn't have a hide() method like QWidget does.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2317,"Q_Id":1844630,"Users Score":4,"Answer":"The easy solution would be to have an interior widget, not an interior layout. You could assign the layout you desire to the widget, then just remove\/hide the widget when you want to do so. A good rule of thumb is if you just want to arrange how widgets appear, then use a layout; if you want to hide\/show them as a group, use a widget.","Q_Score":3,"Tags":"python,qt4,pyqt","A_Id":1844678,"CreationDate":"2009-12-04T03:19:00.000","Title":"Remove a sublayout in qt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a GTK layout with a widget on the left of an HBox deciding the maximum height I want, and a VBox on the right containing three buttons, each containing only an image and no text. The images are a GTK stock icon, and so have the stock storage type.\nUsing expand=True, fill=True packing the buttons without images are exactly the height I want - some arbitrary small width, and 1\/3 each the height of the left half of the HBox. However with an image, they are either too tall - 3 * ICON_SIZE_MENU is too tall in many themes - or if I force the button's height request, they get clipped. I would rather scale them to the size of the parent button.\nDo I have to make my own pixbufs for each of the stock icons I'm using (and regenerate them if the size changes)? Or can GTK automatically size the image to fit the button, rather than the other way around? Since the images are only a few pixels off from fitting in every theme I've tried, is there a way to just disable the button's clipping?\nThis application is written in Python using PyGTK, but solutions in any language are appreciated.\n(I tried just making it an icon name storage type, but one of the icons is REVERT_TO_SAVED, which turned into the broken stock image when I tried to force it to a particular pixel height. Plus, I'd rather not force it to any fixed pixel height.)","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2476,"Q_Id":1851862,"Users Score":2,"Answer":"There's no way to automatically do you want you want. You might want to subclass gtk.Image and in your subclass, scale a pixbuf to your widget's allocation size. The advantage of this is that you'll have a reusable widget and you'll be able to have it resize your image on the fly.\nThe downside is that you'll have an ugly, scaled up pixmap. You may want to look into scalable vector graphics.","Q_Score":2,"Tags":"python,user-interface,pygtk,gtk","A_Id":1872356,"CreationDate":"2009-12-05T10:48:00.000","Title":"Scaling an image to its parent button size in GTK?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know that IronPython is a dynamically typed language so what I am asking sounds pretty stupid, but is it possible to do something with an IronPython script to make sure the changing of the CLR libraries it references will not result in a runtime error when the script is executed?\nThe reason I ask is that I have written a library referenced by IronPython scripts in C#, and I want a way to know if I've broken any of the interfaces used by the IronPhon scripts when I change the C# library. This is easy to do with another C# project by just compiling the code and seeing compile errors, but this doesn't seem to work when compiling the IronPython scripts.\nAny ideas?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":244,"Q_Id":1852897,"Users Score":2,"Answer":"No, there is no way to statically verify at compile time that the interface changes have not broken your IronPython code. This is the nature of dynamic languages. Such errors are instead presented at runtime","Q_Score":4,"Tags":"ironpython,dynamic-language-runtime","A_Id":1852956,"CreationDate":"2009-12-05T17:51:00.000","Title":"IronPython compile-time checks against CLR libraries?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know that IronPython is a dynamically typed language so what I am asking sounds pretty stupid, but is it possible to do something with an IronPython script to make sure the changing of the CLR libraries it references will not result in a runtime error when the script is executed?\nThe reason I ask is that I have written a library referenced by IronPython scripts in C#, and I want a way to know if I've broken any of the interfaces used by the IronPhon scripts when I change the C# library. This is easy to do with another C# project by just compiling the code and seeing compile errors, but this doesn't seem to work when compiling the IronPython scripts.\nAny ideas?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":244,"Q_Id":1852897,"Users Score":1,"Answer":"A good set of fast running unit tests would be a good alternative to compile time checking.","Q_Score":4,"Tags":"ironpython,dynamic-language-runtime","A_Id":1866436,"CreationDate":"2009-12-05T17:51:00.000","Title":"IronPython compile-time checks against CLR libraries?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to pyglet and i have a problem with video..\nI'm trying to play a video using pyglet .. but instead of playing the video in the window it just exits immediately and terminates ..\ndo you guys have any solution for this problem how can i hold the window to play vedio?? \n i use windows vista 64x with python 2.5\nplease help \nand here is the code :\n\n\n\n\nvidPath=\"vid.avi\"\n widnow = pyglet.window.Window()\n source = pyglet.media.StreamingSource()\n MediaLoad = pyglet.media.load(vidPath)\n player = pyglet.media.Player()\n player.queue(MediaLoad)\n player.play()\n@window.event\n ...def on_draw():\n ... player.get_texture.blit(0,0)\n\n\n\n\nthank u very much for your time","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4199,"Q_Id":1859195,"Users Score":0,"Answer":"I think calling \"pyglet.app.run()\" is missing.","Q_Score":1,"Tags":"python,video,pyglet","A_Id":1860559,"CreationDate":"2009-12-07T10:38:00.000","Title":"problem with pyglet playing video","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks!","AnswerCount":3,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":5646,"Q_Id":1871672,"Users Score":6,"Answer":"If this is your first Pygame application, don't spend time worrying about \"object oriented design patterns for managing levels\". What you need to do now is to figure out how to make Pygame do what you want it to do.\n\nCan you display everything you want to?\nIs your display flicker-free?\nCan you read the user input controls properly?\netc.\n\nObject oriented patterns for managing levels comes later, much later.","Q_Score":3,"Tags":"python,design-patterns,oop,pygame","A_Id":1871698,"CreationDate":"2009-12-09T05:01:00.000","Title":"Level Design in Pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks!","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":5646,"Q_Id":1871672,"Users Score":1,"Answer":"Generally speaking, a simple way to do it is using matrices (or multidimensional arrays - they work the same way here).\nBasically, each Map is an Array, with each item in the array being a square on the grid. \nFor example a 3 by 3 grid would be as follows:\n(Psuedocode)\nvar Map = [[1,2,3][1,2,3][1,2,3]];\nIn place of numbers, you could put strings for a function to parse and draw or take action based on what the value of the cell is.","Q_Score":3,"Tags":"python,design-patterns,oop,pygame","A_Id":1871700,"CreationDate":"2009-12-09T05:01:00.000","Title":"Level Design in Pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks!","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":5646,"Q_Id":1871672,"Users Score":7,"Answer":"With this type of game your maps are in terms of tiles (I'm assuming that by level you mean an individual level, not managing all of your levels). Each tile has\n\nan associated picture (what it looks like on the display)\na type (ie, a wall, the ground, a trap, etc.)\n\nWhen I create tile-based games in Pygame, I usually have a Map class which contains the current map:\n\nthe pygame.Surface of the map (what you'll be blitting to the display)\na list of lists (ie, a matrix) where each item is a Tile object (I've also done games where you just have a string that tells you what type of tile it is, and then you don't need a separate Tile class)\n\nThe map should be relatively static - you could have that traps become normal tiles after you step on them (this is pretty easy - when you do collision detection and it's a hit, just change that tile to a different Tile object (presumably the one for an empty tile)), but you don't want characters or movable blocks in the map if you can help it. Since the movable blocks have their own rules for how they can be moved, it's not as simple as just changing a tile - you'd have a whole set of logic, and at least two tiles would have to be changed (and what if you could move the blocks onto traps - you'd then have to remember, separately, what was below it - bleh). In my opinion it's easier to just have a class for each moving object and item.\nIn short, you have:\n\nTile\nMap\nBlock\nother movable objects\/sprites\n\nAnd that's basically your whole level. For multiple levels, if individual levels are always the same, you can just have a list of Map objects, one for each level.","Q_Score":3,"Tags":"python,design-patterns,oop,pygame","A_Id":1873480,"CreationDate":"2009-12-09T05:01:00.000","Title":"Level Design in Pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython program where I want to be able to drag groups of controls around to reorder them. Each group of controls is on a panel, and I want the panel object to handle the drag-and-drop.\nCurrently it works if you click and drag on the panel itself, but it doesn't work if you click on any control inside the panel. This is because the wx.EVT_LEFT_DOWN event that I am using to trigger the drag is not a command event, so is not propagated up to the parent panel.\nThe only way I can think of to get round this is to bind that event to the panel's handler for every control on the panel.\nThis does not seem very elegant to me - either I have to explicitly do it when I create each child event, which breaks encapsulation, or the panel recurses through the child controls and does the binding - this seems dangerous, since the individual controls may already be using that event for other purposes. Ideally I would like the controls on the panel to not need to know anything about the DnD.\nDoes anyone know of any alternative solutions? Are there any command events that I could use to initiate dragging? Or anything else I haven't thought of?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1099,"Q_Id":1877402,"Users Score":1,"Answer":"IMO the best way is, Panel should bind to control's wx.EVT_LEFT_DOWN and drag only when special key combination e.g. cntrl-alt-d are pressed\nPanel can do it recursively or have a function in Panel, addControl and only such control will be hooked.\nYour point that \"individual controls may already be using that event for other purposes\" is not valid because either you can use that event for dragging or not, you can't have both way.\nIf you want drag on control to be used as drag of whole group, then you MUST override such event, but with doing dragging only inspecial key combination or modes you can let child control have their behaviour too.","Q_Score":0,"Tags":"python,drag-and-drop,wxpython","A_Id":1935002,"CreationDate":"2009-12-09T22:32:00.000","Title":"wxPython: Handling drag-and-drop in a parent object - problem with event propagation","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an application in which I would like to connect whatever signal is emitted when a pyqt4 dialog is displayed in order to do execute an initial method. I don't want the method to be called in the __init__ method for a number of reasons. I've spent quite some time searching but I have yet to find an answer. I'm sure there is a simple solution that because of my inexperience I am overlooking as I can do this in wxPython. Suggestions?","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":114,"Q_Id":1878353,"Users Score":3,"Answer":"There is no signal emitted on first display, instead, you will have to intercept the first resizeEvent or paintEvent by overloading these methods (as you don't want to initialize from the __init__ method).\nAnother option would be to add your own showAndInit method, that initializes and then calls show.","Q_Score":1,"Tags":"python,qt,pyqt4","A_Id":1879368,"CreationDate":"2009-12-10T02:49:00.000","Title":"What signal can be connected to an initial dialog display in pyqt4 (qt)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been programming in Python for a while now, and I'd like to learn a more \"hireable\" language like Java or the C\/C++\/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. \nComing from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?","AnswerCount":9,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":18209,"Q_Id":1883455,"Users Score":8,"Answer":"Java and C# will be less of a step away from Python than would C or C++ because Java, C#, and Python all have automatic memory management. A good Java book is Thinking in Java by Bruce Eckel. It starts at an introductory level, but also has a lot of depth.\nThe big difference with the language coming from Python is the fact that all variables are typed. The other hard thing with Java has to do with the bewildering array of Java APIs out there. The fact that you are interested in Android is an advantage here. After becoming comfortable with the core language, I suggest you start learning the Android API and focus on becoming an Android expert. I think Android will be a growing market for a while.\nGood luck!","Q_Score":20,"Tags":"java,python","A_Id":1883690,"CreationDate":"2009-12-10T19:41:00.000","Title":"Learn Java from Python background","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been programming in Python for a while now, and I'd like to learn a more \"hireable\" language like Java or the C\/C++\/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. \nComing from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?","AnswerCount":9,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":18209,"Q_Id":1883455,"Users Score":0,"Answer":"I don't think you should use a special way to learn Java because you know Python. Just start with HelloWorld.java and move on step by step. Your basic skills in programming will help you.","Q_Score":20,"Tags":"java,python","A_Id":1883538,"CreationDate":"2009-12-10T19:41:00.000","Title":"Learn Java from Python background","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been programming in Python for a while now, and I'd like to learn a more \"hireable\" language like Java or the C\/C++\/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. \nComing from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?","AnswerCount":9,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":18209,"Q_Id":1883455,"Users Score":0,"Answer":"I suppose one could ease his\/her way into .NET and Java by starting with IronPython and Jython respectively. This will not teach you the new language syntax but open up respective libraries so you can explore what is \"out there\", learn development tools, build process etc. Syntax is by far the easiest to switch but the know-how and best practices in each language are not.","Q_Score":20,"Tags":"java,python","A_Id":1884743,"CreationDate":"2009-12-10T19:41:00.000","Title":"Learn Java from Python background","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been programming in Python for a while now, and I'd like to learn a more \"hireable\" language like Java or the C\/C++\/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. \nComing from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?","AnswerCount":9,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":18209,"Q_Id":1883455,"Users Score":0,"Answer":"1) It depends what you would do with an \"hireable\" language. For instance, if you were interested in programming web applications and distributed\/client\/server app, Java would be a good choice. \nC# is maybe a bit less client \/ server oriented, and maybe more valuable for small non IT companies and for most retail software companies.\nC and C++ are still great languages, but are more \"system\", embeded and \"critical apps\" oriented. And they are not suitable to be runned on differents mobile phones.\n2) The best way to learn java, according to me, is firstable to learn the basics, then look for more specialized stuff like J2ME and Android software framework.","Q_Score":20,"Tags":"java,python","A_Id":1883705,"CreationDate":"2009-12-10T19:41:00.000","Title":"Learn Java from Python background","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been programming in Python for a while now, and I'd like to learn a more \"hireable\" language like Java or the C\/C++\/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. \nComing from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?","AnswerCount":9,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":18209,"Q_Id":1883455,"Users Score":9,"Answer":"I would take a project you've implemented in Python and try converting it to Java. Since you already know basic programming fundamentals, it'll probably be easier if you take things you know how to do and figure out how you'd do the same sort of operations in Java (or whatever new language you want to learn).\nIn the end, the only way to learn to write code, is to write more code.","Q_Score":20,"Tags":"java,python","A_Id":1883585,"CreationDate":"2009-12-10T19:41:00.000","Title":"Learn Java from Python background","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a python script that should run in the background and notify a user of changes, and I'd quite like it to work cross-platform. Main problem is, I don't have access to a mac at all, so coding specifically for it could be very difficult. wxPython seems like massive overkill for simple popups, so is there anything with a lighter footprint?","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2853,"Q_Id":1893213,"Users Score":4,"Answer":"Does Python on Windows and Mac also ship with Tk wrappers? If so, you might be able to roll your own notification box. I do not think they have a dead-simple notification API (i.e. you pass it a string and a cute box pops up for 5 seconds) however at least you will only have one codebase to maintain.\nI am thinking about other cross-platform apps such as Skype, Dropbox, and Thunderbird. Skype and Thunderbird seem to have rolled their own, and Dropbox went the platform-specific route.","Q_Score":9,"Tags":"python,cross-platform,notifications","A_Id":1893404,"CreationDate":"2009-12-12T12:06:00.000","Title":"Cross-Platform Python Notification Library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've started building an app with Flex\/Air but am getting sick of it's clunkyness.\nThe app that I'm building has similar behaviour to Prezi (www.prezi.com) but in a completely different field.\nI'm looking for something on the desktop which has flex like capabilities, such as drawing vectors then zooming in\/out, rotating etc, gui widgets would be a bonus but not essential.\nIf it was written in Python\/Ruby or had an abstraction in either language that would be great.\nI've had a quick look at PyGame and Pyglet but am not sure of their suitability.\nAny ideas?\nCheers,\nChris","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":384,"Q_Id":1907736,"Users Score":0,"Answer":"If you have any .NET experience I would recommend Silverlight. I have worked with it in the academic setting and it has impressed me very much. Some of the examples are pretty mind blowing, for the web applications at least. I also know they did focus on making silverlight into exactly what your question asks, a framework for building \"visually rich\" desktop applications also. There is a set of tools called expression blend that interact directly with visual studio to build the GUI and it's pretty impressive the control their GUI gives you in making your GUI. At least worth a look.","Q_Score":0,"Tags":"python,vector,svg","A_Id":1907972,"CreationDate":"2009-12-15T14:13:00.000","Title":"Framework for building visually rich desktop applications?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a scrollbar widget that ALWAYS hides the last 15 px under the resize button, is there an option to stop this happening on mac or a padding \"under\" the widget option?\\\nthanks!","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":204,"Q_Id":1927475,"Users Score":0,"Answer":"No, there isn't an option. You need to adjust your padding so that the scrollbar doesn't extend all the way to the bottom of the window. Perhaps the easiest way is to add a statusbar that extends across the bottom of the window.","Q_Score":1,"Tags":"python,user-interface,tkinter","A_Id":1927946,"CreationDate":"2009-12-18T10:44:00.000","Title":"Python - Tkinter - Padding woes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a scrollbar widget that ALWAYS hides the last 15 px under the resize button, is there an option to stop this happening on mac or a padding \"under\" the widget option?\\\nthanks!","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":204,"Q_Id":1927475,"Users Score":0,"Answer":"Or, you could also try switching to the place() layout manager.","Q_Score":1,"Tags":"python,user-interface,tkinter","A_Id":1927968,"CreationDate":"2009-12-18T10:44:00.000","Title":"Python - Tkinter - Padding woes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a python application that has a glade gui. Using subprocess to execute some shell commands in the background.\nUsing a glade GUI which has a scrolledwindow widget and a textview widget inside the scrolledwindow widget. The textview gets populated as the subprocess.Popen object run and display their stdout and stderr to this textview.\nMy problem is that the textview is constantly populated, but stays still @ scroll position 0, 0 (top-most, left-most)\nI want this scrolledwindow widget to stays at bottom-most, left-most at all times... \nDoes anyone have any idea which method I need to call scroll this thing downwards?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2933,"Q_Id":1940957,"Users Score":0,"Answer":"look at gtk.ScrolledWindow.set_placement.\n(never tried)","Q_Score":3,"Tags":"python,pygtk,subprocess,glade","A_Id":1941109,"CreationDate":"2009-12-21T16:03:00.000","Title":"howto scroll a gtk.scrolledwindow object from python code","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I want to make the background of a textview widget black and the foreground white.\nBeen trying the .modify_bg and .modify_fg methods, but none affect the way this thing looks.\nCan anyone suggest anything or is this just not possible?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1612,"Q_Id":1948396,"Users Score":2,"Answer":"Use gtk.Widget.modify_text and gtk.Widget.modify_base instead of fg and bg.","Q_Score":0,"Tags":"python,gtk,pygtk","A_Id":1948993,"CreationDate":"2009-12-22T18:52:00.000","Title":"pygtk: howto change background of a gtk.TextView widget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have installed PyQt GPL v4.6.2 for Python v3.1 and Qt by Nokia v4.6.0 (OpenSource), but the documentation in PyQt is not coming up. Example docs are all blank, too.\nWould anyone mind writing a step-by-step guide on what links to visit and what procedures must be executed in order to get text to come up for the PyQt documentation?\nEdit: The programs are running on Windows, and the documentation is not coming up in PyQt GPL v4.6.2 for Python v3.1 > Examples > PyQt Examples and Demos and PyQt GPL v4.6.2 for Python v3.1 > Assistant. What needs to done to let both programs access the docs?","AnswerCount":5,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":16124,"Q_Id":1962273,"Users Score":1,"Answer":"The PyQt documentation is exactly as provided on the website, and as\nincluded in the installer. It is not integrated with Assistant (it will be\nin a future version). If you want to use Assistant then you can use the Qt\ndocumentation instead (a lot of people do) and translate between C++ and\nPython as you read it.","Q_Score":7,"Tags":"python,qt,pyqt","A_Id":1966523,"CreationDate":"2009-12-25T23:56:00.000","Title":"PyQt documentation","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have installed PyQt GPL v4.6.2 for Python v3.1 and Qt by Nokia v4.6.0 (OpenSource), but the documentation in PyQt is not coming up. Example docs are all blank, too.\nWould anyone mind writing a step-by-step guide on what links to visit and what procedures must be executed in order to get text to come up for the PyQt documentation?\nEdit: The programs are running on Windows, and the documentation is not coming up in PyQt GPL v4.6.2 for Python v3.1 > Examples > PyQt Examples and Demos and PyQt GPL v4.6.2 for Python v3.1 > Assistant. What needs to done to let both programs access the docs?","AnswerCount":5,"Available Count":2,"Score":0.0399786803,"is_accepted":false,"ViewCount":16124,"Q_Id":1962273,"Users Score":1,"Answer":"If you installed the Qt documentation, you should have an app named Assistant. This is a simple-minded browser for a local copy of the Qt doc as found at doc.qt.nokia.com. It is written for C++ but the mental translation to Python is not difficult, and it is nicely formatted and richly cross-linked. I keep Assistant running all the time I'm coding in PyQt4 and find it very helpful.\nThe PyQt doc, as given at www.riverbankcomputing.co.uk\/static\/Docs\/PyQt4\/html\/classes.html, is merely this same Nokia text with its formatting and many of the internal links stripped out and edited to python class and function syntax.","Q_Score":7,"Tags":"python,qt,pyqt","A_Id":8174151,"CreationDate":"2009-12-25T23:56:00.000","Title":"PyQt documentation","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting to learn both Python and wxPython and as part of the app I'm doing, I need to have a simple browser on the left pane of my app. I'm wondering how do I do it? Or at least point me to the right direction that'll help me more on how to do one. Thanks in advance!\nEDIT:\na sort of side question, how much of wxPython do I need to learn? Should I use tools like wxGlade?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":6299,"Q_Id":1962592,"Users Score":1,"Answer":"You can take a look at the wxPython examples, they also include code samples for almost all of the widgets supported by wxPython. If you use Windows they can be found in the Start Menu folder of WxPython.","Q_Score":4,"Tags":"python,wxpython","A_Id":1962595,"CreationDate":"2009-12-26T04:02:00.000","Title":"How do I make a simple file browser in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to extend Python interpreter by a few C functions I wrote. From reading docs, to expose those function the user has to import the module encompassing the functions.\nIs it possible to load pre-load or pre-import via C API the module so that the user doesn't have to type import ? Or even better, from import ?\nEdit: I can do PyRun_SimpleString(\"from mymodule import myfunction\") just after Py_Initialize(); - I was just wondering if there is another way of doing this..?\nEdit 2: In other words, I have an application written in C which embeds a Python interpreter. That application provides some functionality which I want to expose to the users so they can write simple Python scripts for the app. All I want is to remove the need of writing from mymodule import myfunction1, myfunction2 because, since it is very specialized app and the script wont work without the app anyway, it doesn't make sense to require to import ... all the time.","AnswerCount":5,"Available Count":2,"Score":0.1194272985,"is_accepted":false,"ViewCount":697,"Q_Id":1963453,"Users Score":3,"Answer":"Even if you implement a module in Python, the user would have to import it. This is the way Python works, and it's actually a good thing - it's one of the great pluses of Python - the namespace\/module system is robust, easy to use and simple to understand.\nFor academic exercises only, you could of course add your new functionality to Python itself, by creating a custom interpreter. You could even create new keywords this way. But for any practical purpose, this isn't recommended.","Q_Score":1,"Tags":"python,c,import,python-c-api,python-embedding","A_Id":1963510,"CreationDate":"2009-12-26T14:05:00.000","Title":"Extending Python: pre-load my C module","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to extend Python interpreter by a few C functions I wrote. From reading docs, to expose those function the user has to import the module encompassing the functions.\nIs it possible to load pre-load or pre-import via C API the module so that the user doesn't have to type import ? Or even better, from import ?\nEdit: I can do PyRun_SimpleString(\"from mymodule import myfunction\") just after Py_Initialize(); - I was just wondering if there is another way of doing this..?\nEdit 2: In other words, I have an application written in C which embeds a Python interpreter. That application provides some functionality which I want to expose to the users so they can write simple Python scripts for the app. All I want is to remove the need of writing from mymodule import myfunction1, myfunction2 because, since it is very specialized app and the script wont work without the app anyway, it doesn't make sense to require to import ... all the time.","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":697,"Q_Id":1963453,"Users Score":0,"Answer":"Nope. You could add it to the Python interpreter itself, but that would mean creating a custom Python version, which, I guess, is not what you want.\nThat import is not just for loading the module, it's also for making this module visible in the (main|current) namespace. Being able to do that, w\/o hacking the actual Python interpreter, would run against \"Explicit is better than implicit\" very strongly.","Q_Score":1,"Tags":"python,c,import,python-c-api,python-embedding","A_Id":1963505,"CreationDate":"2009-12-26T14:05:00.000","Title":"Extending Python: pre-load my C module","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":-0.0285636566,"is_accepted":false,"ViewCount":724,"Q_Id":1967888,"Users Score":-1,"Answer":"If you're used to a more command line approach, this would be a bad idea. Responding to user input is a completely different paradigm, and you're not likely to get it right the first time.\nIf you're just talking about the difference between wxPython and another GUI, don't worry about it.","Q_Score":12,"Tags":"python,wxpython","A_Id":1967976,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":0.0,"is_accepted":false,"ViewCount":724,"Q_Id":1967888,"Users Score":0,"Answer":"Since you are new to GUI programming, your approach is perfectly valid. It will likely result in a less than optimal UI, but that's OK for now. And in fact, there are some very successful multi-million dollar commercial projects that are built this way.\nArguably a better approach is to first design the UI since that is the most important part. After that is completel you can then create a back-end that can support that UI. This approach still results in separate front- and back-ends but puts the emphasis on the needs of the user, where it should be.","Q_Score":12,"Tags":"python,wxpython","A_Id":1970144,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":-0.0285636566,"is_accepted":false,"ViewCount":724,"Q_Id":1967888,"Users Score":-1,"Answer":"What level of interactivity do you need? If you need rich feedback and interaction, then you need an OO program model, then you can ad the GUI on top of the objects.\nIf you just have filters and functions (no real feedback, or just a results window) than a library or component model would be better.\nEither way, you are better off coding your logic separate to the GUI, so you can test it more easily.","Q_Score":12,"Tags":"python,wxpython","A_Id":1967968,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":0.0285636566,"is_accepted":false,"ViewCount":724,"Q_Id":1967888,"Users Score":1,"Answer":"Separation of the user interface from the engine code is the unixy way to do it and there's a lot of merit to doing it that way. It results in modular re-usable programs and code that can play nicely with other programs and fit into a larger tool chain.\nHaving said that, such an approach tends to discount the value of creating a really usable UI experience. It's very difficult and rare for a program's internal model to match the user model when you design your program's functionality first and then the user interface later. As a result, you need to impedance-match the two sides after creating them independently. This results in either creating a compromise in usability (your ui becomes nothing more than a front-end to the command line switches your program takes) or a large glue layer between the UI and the core program which tends to be messy and buggy.\nIf your program is primarily designed to be run through a user interface interactively with a user, then it probably makes sense to design the user interface in parallel with your actual functionality. \nSo:\n\nit would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app\n\nIf your UI is the main means of operating your program, then that UI is part of the program design. Not something to be painted over the program when its done.","Q_Score":12,"Tags":"python,wxpython","A_Id":1968045,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":0.057080742,"is_accepted":false,"ViewCount":724,"Q_Id":1967888,"Users Score":2,"Answer":"That depends on the problem domain. An image processing tool would be rather difficult to implement without reference to a GUI. For most apps, though, I would argue strongly in favour of separating the two parts. It is much, much easier to develop, test and evolve a UI-free back-end. The gains will vastly outweigh the cost of defining a clean API between the front and back end. In fact, the process of defining the API will yield a better design overall.","Q_Score":12,"Tags":"python,wxpython","A_Id":1967904,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":0.0,"is_accepted":false,"ViewCount":724,"Q_Id":1967888,"Users Score":0,"Answer":"IMHO, that would rather be a better idea. To keep the underlying business logic not tied down to the UI is a better approach that we can worry more about the underlying logic than bogging down too much about the interface. \nAt the same time, it is also important to have some basic design for your interface so that it helps you have an idea about what kind of inputs and outputs are involved, and making the underlying logic support a wide range of inputs\/outputs or simply wide range of interfaces.","Q_Score":12,"Tags":"python,wxpython","A_Id":1967905,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?","AnswerCount":7,"Available Count":7,"Score":1.2,"is_accepted":true,"ViewCount":724,"Q_Id":1967888,"Users Score":16,"Answer":"This is a viable approach. In fact, some programmers use it for the advantages it brings:\n\nModular non-GUI code can then be tied in with different GUIs, not just a single library\nIt can also be used for a command-line application (or a batch interface to a GUI one)\nIt can be reused for a web application\nAnd most importantly: it can make unit-testing of the code easier.\n\nHowever keep in mind that it requires some careful design. You'll want your \"logic code\" to be free from GUI constraints, and sometimes it is difficult (especially when the code relies on GUI idioms like an event loop).","Q_Score":12,"Tags":"python,wxpython","A_Id":1967900,"CreationDate":"2009-12-28T03:53:00.000","Title":"Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have downloaded python 2.5. I would like to know if Tkinter is included with python or is it a separate download?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1047,"Q_Id":1994760,"Users Score":0,"Answer":"If you are using linux just open your terminal and type python and in the python interpreter type from Tkinter import* if it doesn't show any error messages you are good to go. You can try this to check every package of python like Pygame just replace Tkinter by Pygame","Q_Score":0,"Tags":"python,tkinter","A_Id":27392691,"CreationDate":"2010-01-03T11:58:00.000","Title":"Is Tkinter included with Python 2.5?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently writing a fsm editor with tkinter. But, I stuck on connecting two states. I have two questions:\n1) How can make the transition arrow growable according to mouse movement?\n2) How can I stick the starting point of the arrow on a state and the end point of the arrow on another state?\nPS. Do you think the documentation of tkinter is good enough?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":2543,"Q_Id":1996377,"Users Score":3,"Answer":"Tkinter is perfectly fine for this sort of application. In the past I've worked on tools that were boxes connected with arrows that stayed connected as you move the boxes around (which is what I think you are asking about). Don't let people who don't know much about Tkinter sway you -- it's a perfectly fine toolkit and the canvas is very flexible. \nThe solution to your problem is simple math. You merely need to compute the coordinates of the edges or corners of boxes to know where to anchor your arrows. To make it \"grow\" as you say, simply make a binding on mouse movements and update the coordinates appropriately.\nTo make the line growable all you have to do is adjust the coordinates of the line each time the mouse moves. The easiest thing to do is make liberal use of canvas tags. With the tags you can know which arrows connect to which boxes so that when you move the box you adjust the coordinates of any arrows that point to or from it.","Q_Score":3,"Tags":"python,tkinter,fsm","A_Id":1997043,"CreationDate":"2010-01-03T21:25:00.000","Title":"How to connect two state circles with an arrow in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can anyone tell me why my app quits with:\n\npygame error: display Surface quit.","AnswerCount":9,"Available Count":3,"Score":0.0886555158,"is_accepted":false,"ViewCount":28022,"Q_Id":1997710,"Users Score":4,"Answer":"Replace if event.type == pygame.quit(): by if event.type == pygame.QUIT:","Q_Score":8,"Tags":"python,pygame","A_Id":52403647,"CreationDate":"2010-01-04T05:49:00.000","Title":"Pygame error: display surface quit: Why?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can anyone tell me why my app quits with:\n\npygame error: display Surface quit.","AnswerCount":9,"Available Count":3,"Score":0.0444152037,"is_accepted":false,"ViewCount":28022,"Q_Id":1997710,"Users Score":2,"Answer":"Make sure if you write pygame.QUIT: and not pygame.quit():\nI know it sounds weird, but I had the same problem.","Q_Score":8,"Tags":"python,pygame","A_Id":59687711,"CreationDate":"2010-01-04T05:49:00.000","Title":"Pygame error: display surface quit: Why?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can anyone tell me why my app quits with:\n\npygame error: display Surface quit.","AnswerCount":9,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":28022,"Q_Id":1997710,"Users Score":11,"Answer":"I had similar problem and discovered that Surface objects don't like to be deepcopied. When I used copy.deepcopy() on such object and then accessed the copy, I got that strange error message (without calling pygame.quit()). Maybe you experience similar behavior?","Q_Score":8,"Tags":"python,pygame","A_Id":4317744,"CreationDate":"2010-01-04T05:49:00.000","Title":"Pygame error: display surface quit: Why?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython application that uses pyinotify (via ThreadedNotifier) to check when a certain file gets modified. When this happens, the application stops watching the file and does some stuff. Everything works fine, except that often the call to ThreadedNotifier.stop() takes a noticeable time, about 4 seconds... Other times, it exits immediately.\nAnyone else experienced this? Is this expected?\n(Xubuntu 9.04)","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":408,"Q_Id":2005443,"Users Score":1,"Answer":"Could it be that it is a polling mechanism with a timeout of about 4 seconds? And that the thread is only really stopped when it is entering the run() stage?\nThat might have something to do with the threading library. \nYou could test that by using a notifier with a different timeout.","Q_Score":0,"Tags":"python,inotify,pyinotify","A_Id":2005571,"CreationDate":"2010-01-05T10:46:00.000","Title":"Slow pyinotify.ThreadedNotifier.stop()","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a project that has a glade GUI.\nI need the main window to have 2 section, divided by a gtk.Hpaned widget (horizontal panes).\nThe left pane would have a tool-bar like layout of buttons, maybe 3 or more.\nWhat I need is a way to create different windows and display them on the right pane of the main window. This way, when I click button 1, subwindow1 will appear in the right pane. Click button2, subwindow2 will appear on the right pane.\nInstead of having windows pop-up left and right, I want to reparent them to the right pane of this gtk.Hpaned widged.\nHow do you do this in python with pygtk?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1643,"Q_Id":2007299,"Users Score":0,"Answer":"Instead of creating windows you could put a notebook in the right pane. Then create all the previous windows as pages. Click on the button can then show the appropriate page in the notebook.","Q_Score":2,"Tags":"python,pygtk","A_Id":2016770,"CreationDate":"2010-01-05T16:09:00.000","Title":"pygtk: cannot set parent on toplevel widget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a cherrypy application with a wxpython ui. The problem is both libraries use closed loop event handlers. Is there a way for this to work? If I have the wx ui start cherrypy is that going to lock up the ui?","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":1519,"Q_Id":2022376,"Users Score":1,"Answer":"One way to decouple them would be to start them up as two separate processes and have them communicate via some kind of IPC mechanism. You might have to write a small adaptor to have them speak a common protocol.\nSince you're doing CherryPy, you might also be able to expose a control interface via HTTP which the wx GUI can use to drive your server.","Q_Score":7,"Tags":"python,wxpython,cherrypy","A_Id":2022467,"CreationDate":"2010-01-07T17:48:00.000","Title":"cherrypy and wxpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need a tile\/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile\/sprite editor?","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":8722,"Q_Id":2028025,"Users Score":2,"Answer":"So, the fact is that creating a complex app with a nice UI takes time - I am just expanding a little bit on the answer by THC4k. \nPIL, at least PIL alone is useless for this: it does have some functions to manipulate images, but the complicate task here is creating and tunning your desired UI. \nThat's where the widgets toolkits come in: You would have to pick a toolkit platform that can offer you buttons, images, load and save the image files, maybe some specialzed widgets you can use to create your color swatches, etc.\nboth GTK+ and QT4.5 have a liberal license, are very complete and very unpythonic on their use :-( \n(While you are at it, when using these libraries and toolkits our app can easily be multiplatform: you don't have to make it windows specific, it is equally easy to create an app that will run on Windows, Linux and Mac using python and either GTK+ or Qt4)\nOne thing I would suggest is for you to learn to proper use GIMP: it is an Image editor, and certainly it will lack a lot of tools you are needing for sprites: but you can expand it's capabilities with Python plug-ins. On the other hand GIMP does have thousands of features that you'd no longer will need to create for your stand-alone app. (think on layer support, color filters, image rotation etc...)\nCheck around on how to install GIMP with Python support on Windows, then spend some hours learning the app, with some book-like text around preferably so you can find the hidden features. \nAh, ok, finally:\nIf you want a very simple thing, just for the taste of \"i did it\" - you can use Pygame: You have to do all the drawing on the window, including text - but have straighter access to pixels, colors, mouse clicks and coordinates than with GTK+ or Qt, in a sense it would be a lot less of overhead for you to learn in terms of API's and internal working.","Q_Score":6,"Tags":"python,image-editor","A_Id":2029356,"CreationDate":"2010-01-08T14:01:00.000","Title":"Creating an image editing application in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need a tile\/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile\/sprite editor?","AnswerCount":4,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":8722,"Q_Id":2028025,"Users Score":6,"Answer":"You just need a gui toolkit (gtk, qt, wx) a image library (PIL) and 500 hours of free time ...","Q_Score":6,"Tags":"python,image-editor","A_Id":2028056,"CreationDate":"2010-01-08T14:01:00.000","Title":"Creating an image editing application in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm downloading Python 3.1.1 and that comes with the IDLE correct?\nI'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. \nWhat projects should I try to make in order to grasp some of the goodies Python brings to the table?\nThanks a bunch SO.","AnswerCount":9,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":44661,"Q_Id":2034932,"Users Score":0,"Answer":"A project I wish someone would write: a friendly GUI that wraps around the scanner library and the PDF library, and lets the user easily scan and file documents.\nIt would have a toolbar with big buttons: \"scan letter\", \"scan brochure\", \"scan photo\". These would respectively choose high-resolution black-and-white, medium-resolution color, and high-resolution color.\nThe user would plop down the document and hit one of those buttons. Python would wake up the scanner and have it scan, and then would use Python Image Library or something to auto-detect the size of the actual scanned document and auto-crop down to minimal size.\nFor \"scan photo\" you would get a JPEG. For the others, you would get a PDF. And it would have an option where you could scan several pages and then select the scanned pages, and say \"group\" and it would make a single PDF out of them.\nOther useful toolbar buttons would be: \"Copy Letter\", \"Copy Brochure\", \"Copy Photo\". These would scan and then immediately print on an appropriate output device (or just on the default output device for your first version).\nIf you want to go crazy, you could add an OCR function to try to recover searchable text from the scanned images, and put that in the PDF as tags or something.\nSomeday I will write this if nobody else does...","Q_Score":7,"Tags":"python","A_Id":2035429,"CreationDate":"2010-01-09T21:00:00.000","Title":"What are some good projects to make for a newbie Python (but not new to programming) developer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm downloading Python 3.1.1 and that comes with the IDLE correct?\nI'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. \nWhat projects should I try to make in order to grasp some of the goodies Python brings to the table?\nThanks a bunch SO.","AnswerCount":9,"Available Count":4,"Score":0.0665680765,"is_accepted":false,"ViewCount":44661,"Q_Id":2034932,"Users Score":3,"Answer":"Do the next project you intended to program with your prefered language with Python.","Q_Score":7,"Tags":"python","A_Id":2035296,"CreationDate":"2010-01-09T21:00:00.000","Title":"What are some good projects to make for a newbie Python (but not new to programming) developer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm downloading Python 3.1.1 and that comes with the IDLE correct?\nI'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. \nWhat projects should I try to make in order to grasp some of the goodies Python brings to the table?\nThanks a bunch SO.","AnswerCount":9,"Available Count":4,"Score":0.022218565,"is_accepted":false,"ViewCount":44661,"Q_Id":2034932,"Users Score":1,"Answer":"Write a simple Text Editor.\nThat was one of the projects i started when i first learned python. It gets you used to the GUI framework, file IO, many types, OOP, lots... It's something that you can grow over time as your confidence builds and it's cross platform so it's handy.","Q_Score":7,"Tags":"python","A_Id":2035019,"CreationDate":"2010-01-09T21:00:00.000","Title":"What are some good projects to make for a newbie Python (but not new to programming) developer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm downloading Python 3.1.1 and that comes with the IDLE correct?\nI'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. \nWhat projects should I try to make in order to grasp some of the goodies Python brings to the table?\nThanks a bunch SO.","AnswerCount":9,"Available Count":4,"Score":0.022218565,"is_accepted":false,"ViewCount":44661,"Q_Id":2034932,"Users Score":1,"Answer":"If you are new to python, why not start with some simpler command line projects? I know you said you are not new to development, but maybe you should spend some time with the core python stuff before tacking on a GUI framework. Just a suggestion. \nAlso, I would point out that Python 3+ code looks a bit different than a lot of the python 2.x code samples you will see around the internet. I have found Python 3 to be not the best in terms of backward compatibility. You might want to start out with a 2.x version of Python to get the most out of the plethora of Python tutorials on the internet, then move to Python 3 if you need it.","Q_Score":7,"Tags":"python","A_Id":2034997,"CreationDate":"2010-01-09T21:00:00.000","Title":"What are some good projects to make for a newbie Python (but not new to programming) developer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct?\nHaving said that, if I create my application in QT For Windows, will it run flawlessly in Linux\/Mac as well?\nThanks.","AnswerCount":6,"Available Count":5,"Score":0.1651404129,"is_accepted":false,"ViewCount":1271,"Q_Id":2035249,"Users Score":5,"Answer":"As other posters mentioned, the key issue is making sure you never touch a different non-Qt non-cross-platform API. Or really even a different non-Qt crossplatform API, if you use Qt you kind of need to commit to it, it's a comprehensive framework and for the most part sticking with Qt is easier than going to anything else. There's some nice advantages as the basic primitives in your program will work the same way all over the place. (i.e. a QString in your networking code will be the same as a QString in your interface code.) Portability-wise, if you stay within the API Qt provides you, it should work on multiple platforms.\nThere will be areas where you may need to call some Qt functions which provide specific cross-platform tweaks more important to some platforms than others (e.g. dock icons) and you won't immediately have a polished application on all three platforms. But in general, you should remain very close to an application that compiles and runs on all three. (Try to use qmake or a similar build system too, as the build process for Qt applications varies depending on the platform. Different flags, etc.)\nThere's some odd issues that come up when you mix Qt with other APIs like OpenGL, in particular the way windows locks GL contexts differs from the way OS X and Linux does, so if you intend to use OpenGL with multiple threads, try to periodically compile on the other platforms to make sure nothing is completely busted. This will also quickly point out areas where you might have inadvertently used a non-cross-platform system API.\nI've used Qt with a team to build a multi-threaded 3-d multiplayer real-time networked game (read: non-trivial application that fully utilized many many areas of Qt) and we were nothing but blown away by the effectiveness of Qt's ability to support multiple platforms. (We developed on OS X while targeting Windows and I regularly made sure it still ran on Linux as well.) We encountered only a few platform specific bugs, almost all of which arose from the use of non-Qt APIs such as OpenGL. (Which should really tell you something, that OpenGL was more of a struggle to use cross platform than Qt was.)\nAt the end of the experience we were pleased at how little time we needed to spend dealing with platform-specific bugs. It was surprising how well we could make a GUI app for windows given almost none of the team actually used it as a primary development platform through the project.\nBut do test early and often. I don't think your approach of writing an entire application and then testing is a good idea. It's possible with Qt, but unlikely if you don't have experience writing portable code and\/or are new to Qt.","Q_Score":5,"Tags":"python,qt,cross-platform","A_Id":2040550,"CreationDate":"2010-01-09T22:40:00.000","Title":"If I use QT For Windows, will my application run great on Linux\/Mac\/Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct?\nHaving said that, if I create my application in QT For Windows, will it run flawlessly in Linux\/Mac as well?\nThanks.","AnswerCount":6,"Available Count":5,"Score":0.0333209931,"is_accepted":false,"ViewCount":1271,"Q_Id":2035249,"Users Score":1,"Answer":"Generally - as long as you don't use code that is not covered by Qt classes - yes.\nI have several time just recompiled applications I wrote in Linux(64bit) under Windows, and the other way arround. It works for me every time.\nDepends on your needs, you might also find compiler problems, but I am sure you will know how to work around them. Other people mentioned some issues you should look for, just read the other posts in the question.","Q_Score":5,"Tags":"python,qt,cross-platform","A_Id":2035284,"CreationDate":"2010-01-09T22:40:00.000","Title":"If I use QT For Windows, will my application run great on Linux\/Mac\/Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct?\nHaving said that, if I create my application in QT For Windows, will it run flawlessly in Linux\/Mac as well?\nThanks.","AnswerCount":6,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":1271,"Q_Id":2035249,"Users Score":0,"Answer":"It might run well, but it will take some testing, and of course Qt only handles the GUI portability, not the myriad of other things that might cause portability problems.\nQt apps generally don't fit in very well on MacOS because they don't have Applescript support by default and don't necessarily have the right keybindings. But if you do the work to fix those issues, they work, but not nicely. On the Mac, it's far better to build a native UI. If this is an in-house app, Qt is probably OK, but if it's for sale, you won't make many sales and will create yourself some support hassles.","Q_Score":5,"Tags":"python,qt,cross-platform","A_Id":2035265,"CreationDate":"2010-01-09T22:40:00.000","Title":"If I use QT For Windows, will my application run great on Linux\/Mac\/Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct?\nHaving said that, if I create my application in QT For Windows, will it run flawlessly in Linux\/Mac as well?\nThanks.","AnswerCount":6,"Available Count":5,"Score":1.2,"is_accepted":true,"ViewCount":1271,"Q_Id":2035249,"Users Score":8,"Answer":"Yes. No. Maybe. See also: Java and \"write once, run anywhere\".\nFilesystem layout, external utilities, anything you might do with things like dock icons, character encoding behaviors, these and more are areas you might run into some trouble.\nUsing Qt and Python, and strenuously avoiding anything that seems tied to Windows-specific libraries or behaviors whenever possible will make running the application on Mac and Linux much easier, but for any non-trivial application, the first time someone tries it, it will blow up in their face.\nBut through careful choice of frameworks and libraries, making the application work cross-platform will be much more like bug fixing than traditional \"porting\".","Q_Score":5,"Tags":"python,qt,cross-platform","A_Id":2035272,"CreationDate":"2010-01-09T22:40:00.000","Title":"If I use QT For Windows, will my application run great on Linux\/Mac\/Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct?\nHaving said that, if I create my application in QT For Windows, will it run flawlessly in Linux\/Mac as well?\nThanks.","AnswerCount":6,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":1271,"Q_Id":2035249,"Users Score":0,"Answer":"As the others said, everything which is done using Qt-Functionality will most likely run quite flawlessly, WHEN you dont use platform specific functionality of qt.\nThere isnt that much (most of it has to do with window-manager stuff) , but some things might not work on other systems. \nBut such things are surely mentiond in the documentation of Qt.\nStill there are things which cant be done using Qt, so you will have to do that yourself using plain Python...\nYeah \"Python\" itself is platform-independent (well it should), but there are lots of other things involved ... well mainly the OS.\nAnd how the OS reacts you will plainly have to findout yourself by testing the application on all target OS.\nRecently i wrote an quite simple GUI-application, while it ran flawlessy on Windows, it didnt run on Linux, because on Linux Python interpreted files encoded in unicode differently than on Windows.\nAdditionally a small script which should return the hostname of the machine, which it did on Windows, only returned \"localhost\" on Linux, which was obviously not what i wanted.","Q_Score":5,"Tags":"python,qt,cross-platform","A_Id":2035601,"CreationDate":"2010-01-09T22:40:00.000","Title":"If I use QT For Windows, will my application run great on Linux\/Mac\/Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I try to explain the situation:\n\nI have a QT application written in C++ and QT.\nThis QT application starts a separate console C++ application that runs in the background.\nThese two communicate using perhaps sockets, don't know yet.\nConsole C++ application needs to start and stop my gnuradio python script. Also it needs to send parameters to it.\nOnce started, this gnuradio script runs independedly in infinite loop sending information to either the console or the QT application using sockets perhaps.\nMy console application needs to stop this gnuradio script from running when the order is given by the QT application.\n\nThe question is how can I stop this separate python script from my C++ console application ? Also is there anything I could do to make this more simple ?\nRegards,\nSpitz","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":903,"Q_Id":2040769,"Users Score":2,"Answer":"Spawn python script as a new process using fork() and execv(). execv() (or any other function of the exec family) lets you pass arguments to the Python script. Use the child process ID to send a kill signal when you are done with the Python script.","Q_Score":3,"Tags":"c++,python,qt,gnuradio","A_Id":2040813,"CreationDate":"2010-01-11T09:05:00.000","Title":"Best way to start, stop and send parameters to separate Python script from C++ application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im trying to embed a display from an alien application (python OCC) into (Py)Qt using the winId of the widget. But when i pass it to OCC i get an overflow error.\nInspecting the winId qt returns its 4318283408 which is more than a 32bit number. Im running 64bits (osx) and both libraries are compiled for 64bit, but i have a hunch that OCC only likes 32bit numbers still. So my question is, is there any way to control the range of the winId that Qt return?\nThanks\nHenrik","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":394,"Q_Id":2053949,"Users Score":0,"Answer":"Looking in Qt's source code, in the file src\/gui\/kernel\/qwindowdefs.h, you'll find that WId is typedef'd to long for 64-bits OSX (it's int for 32-bits OSX). A long on 64-bits OSX is 8 bytes long (or 64 bits), and therefore 4318283408 is a valid value.\nIf you want to force winId() to return a 32 bits value, you will need to link to a 32-bits version of the Qt's library.","Q_Score":0,"Tags":"python,qt,pyqt4","A_Id":2060398,"CreationDate":"2010-01-13T02:16:00.000","Title":"Qt winId() forcing 32bit values","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I currently develop many applications in a Qt heavy C++\/Python environment on Linux, porting to PC\/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing\/event handling\/GUI\/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone views PySide. I'm interested because it is in house and as such should support more components with hopefully better integration. What are your experiences?\nI know this has been asked before, but I want to revive the conversation.","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":9387,"Q_Id":2058492,"Users Score":8,"Answer":"We were recently thinking about using PySide, but we haven't found any information about whether it is supported by py2exe. That's why we kept to PyQt. If you need to develop for Windows, it's safer to use good ol' PyQt :-)","Q_Score":18,"Tags":"c++,python,qt,pyqt,pyside","A_Id":2058512,"CreationDate":"2010-01-13T16:45:00.000","Title":"PyQt vs PySide comparison","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I currently develop many applications in a Qt heavy C++\/Python environment on Linux, porting to PC\/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing\/event handling\/GUI\/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone views PySide. I'm interested because it is in house and as such should support more components with hopefully better integration. What are your experiences?\nI know this has been asked before, but I want to revive the conversation.","AnswerCount":3,"Available Count":3,"Score":-0.0665680765,"is_accepted":false,"ViewCount":9387,"Q_Id":2058492,"Users Score":-1,"Answer":"PySide currently does not run on Windows, which limits your capability. If you were developing on Linux and needed to avoid pure GPL, then PySide is a candidate. \nFrom an API standpoint, I find the signal\/slots capability feels more \"Pythonic\".","Q_Score":18,"Tags":"c++,python,qt,pyqt,pyside","A_Id":2058548,"CreationDate":"2010-01-13T16:45:00.000","Title":"PyQt vs PySide comparison","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I currently develop many applications in a Qt heavy C++\/Python environment on Linux, porting to PC\/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing\/event handling\/GUI\/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone views PySide. I'm interested because it is in house and as such should support more components with hopefully better integration. What are your experiences?\nI know this has been asked before, but I want to revive the conversation.","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":9387,"Q_Id":2058492,"Users Score":0,"Answer":"As of PySide 1.0 beta (Qt 4.7.1), there is an official Windows installer that works. It doesn't include QtDesigner and other tools, only uic.","Q_Score":18,"Tags":"c++,python,qt,pyqt,pyside","A_Id":4828827,"CreationDate":"2010-01-13T16:45:00.000","Title":"PyQt vs PySide comparison","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using PyGTK to build a GUI application. I want to update the textview widget from another thread but the widget is not getting updated everytime i try an update. What should i do to get a reliable GUI updating?","AnswerCount":4,"Available Count":2,"Score":-0.049958375,"is_accepted":false,"ViewCount":3639,"Q_Id":2066767,"Users Score":-1,"Answer":"the same may be achieved using gobject.idle_add method whose syntax is same as above,you have to import the module gobject","Q_Score":8,"Tags":"python,multithreading,pygtk","A_Id":2069788,"CreationDate":"2010-01-14T19:04:00.000","Title":"GUI not updated from another thread when using PyGtk","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using PyGTK to build a GUI application. I want to update the textview widget from another thread but the widget is not getting updated everytime i try an update. What should i do to get a reliable GUI updating?","AnswerCount":4,"Available Count":2,"Score":-0.049958375,"is_accepted":false,"ViewCount":3639,"Q_Id":2066767,"Users Score":-1,"Answer":"What Johannes said is correct, however since GTK is a wrapper for the glib and gobject things, you would actually want to use gtk.idle_add(). No need for the unnecessary imports.","Q_Score":8,"Tags":"python,multithreading,pygtk","A_Id":3030804,"CreationDate":"2010-01-14T19:04:00.000","Title":"GUI not updated from another thread when using PyGtk","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I don't know if this is a stupid question, but is there any way to not show focus in wxPython? For example, I built a simple GUI with a few buttons and I don't want the dotted rectangle to show up on the button I have just clicked. \nIf I remember correctly in Excel VBA you could just set TakeFocusOnClick tag to False. What would be the equivalent in wxPython?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":197,"Q_Id":2069739,"Users Score":0,"Answer":"You could also give the focus to another control in your event handler for the buttons. Just call the SetFocus() method on any other control. This might make your application more usable as a side effect if you for example return focus to a text field that is likely to be typed in next.","Q_Score":0,"Tags":"wxpython,focus","A_Id":2135083,"CreationDate":"2010-01-15T05:46:00.000","Title":"Not showing focus in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython window. How can I check its event handler table? (i.e. which handler is handling each event.)","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":230,"Q_Id":2088175,"Users Score":1,"Answer":"Even though you got your answer from the mailing list, we may as well replicate the answer here:\nRobin Dunn wrote:\n\nThere isn't a way to access the event\n table currently, although I've often\n thought that it would be a good idea.\n\nShame.","Q_Score":1,"Tags":"event-handling,wxpython,wxwidgets","A_Id":2097941,"CreationDate":"2010-01-18T18:13:00.000","Title":"Listing the event handlers for a wxPython window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We embed ironpython in our app sob that scripts can be executed in the context of our application.\nI use Python.CreateEngine() and ScriptScope.Execute() to execute python scripts.\nWe have out own editor(written in C#) that can load ironpython scripts and run it.\nThere are 2 problems I need to solve.\n\nIf I have a print statement in ironpython script, how can i show it my editor(how will I tell python engine to redirect output to some handler in my C# code)\nI plan to use unittest.py for running unittest. When I run the following \nrunner = unittest.TextTestRunner()\nrunner.run(testsuite)\n\nthe output is redirected to standard output but need a way for it to be redirected to my C# editor output window so that user can see the results.\nThis question might be related to 1\nAny help is appreciated\nG","AnswerCount":3,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":4586,"Q_Id":2089998,"Users Score":6,"Answer":"You can provide a custom Stream or TextWriter which will be used for all output. You can provide those by using one of the ScriptRuntime.IO.SetOutput overloads. Your implementation of Stream or TextWriter should receive the strings and then output them to your editor window (potentially marshalling back onto the UI thread if you're running the script on a 2ndary execution thread).","Q_Score":4,"Tags":"ironpython","A_Id":2090745,"CreationDate":"2010-01-18T23:31:00.000","Title":"Streaming Ironpython output to my editor","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"In a game that I am writing, I use a 2D vector class which I have written to handle the speeds of the objects. This is called a large number of times every frame as there are a lot of objects on the screen, so any increase I can make in its speed will be useful.\nIt is pretty simple, consisting mostly of wrappers to the related math functions. It would be quite trivial to rewrite in C, but I am not sure whether doing so will make any significant difference as all it really does is call the underlying math functions, add, multiply or divide.\nSo, my question is under what circumstances does it make sense to rewrite in C? Where will you see a significant speed boost, and where can you see a reasonable speed boost without rewriting an extensive amount of the program?","AnswerCount":5,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":429,"Q_Id":2096334,"Users Score":9,"Answer":"First measure then optimize","Q_Score":4,"Tags":"python,c,optimization","A_Id":2096358,"CreationDate":"2010-01-19T19:19:00.000","Title":"When Does It Make Sense To Rewrite A Python Module in C?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app.\nI'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external \"agents\"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable? \nAlso, are there any other interpreted languages I can use other than Python?","AnswerCount":7,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":2474,"Q_Id":2103728,"Users Score":0,"Answer":"you could probably create an embedded language using C++ templates and operator overloading, see for example ublas or ftensor matrix languages. i do not think python or other interpreted languages of is suitable for having numbercrunching\/data processing.","Q_Score":7,"Tags":"c++,python,perl,performance,lua","A_Id":2103784,"CreationDate":"2010-01-20T18:04:00.000","Title":"Selecting An Embedded Language","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app.\nI'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external \"agents\"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable? \nAlso, are there any other interpreted languages I can use other than Python?","AnswerCount":7,"Available Count":3,"Score":0.0285636566,"is_accepted":false,"ViewCount":2474,"Q_Id":2103728,"Users Score":1,"Answer":"For millions of calls (from I'm assuming c++, because you mentioned boost) into python, yes: you will notice a performance hit. This may or may not be significant - perhaps the speed gain of trying out new 'agents' would be greater than the hit. Python does have fast numerical libraries (such as numpy) that might help, but you'll still incur overhead of marshalling data, calling into python, the gil, etc.\nYes, you can embed many other languages: check out lua. Also, check out swig.org, which can connect to many other languages besides python.","Q_Score":7,"Tags":"c++,python,perl,performance,lua","A_Id":2103831,"CreationDate":"2010-01-20T18:04:00.000","Title":"Selecting An Embedded Language","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app.\nI'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external \"agents\"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable? \nAlso, are there any other interpreted languages I can use other than Python?","AnswerCount":7,"Available Count":3,"Score":0.1418931938,"is_accepted":false,"ViewCount":2474,"Q_Id":2103728,"Users Score":5,"Answer":"Tcl was designed from the ground up to be an embedded language.","Q_Score":7,"Tags":"c++,python,perl,performance,lua","A_Id":2104152,"CreationDate":"2010-01-20T18:04:00.000","Title":"Selecting An Embedded Language","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I successfully installed PyQt in both mac and PC. To do so I had to install mingw (on PC), Xcode (on MAC) and Qt4.6 library. Now that I have PyQt working perfectly, I would like to uninstall mingw, Xcode and Qt Library from both mac and PC. \nI know I can remove Xcode and mingw, but what care should I take before removing Qt library. I know PyQt is still using it but it is not using whole 1.5Gig of files installed by Qt installer. So which files should I copy before removing Qt and where should I copy it to.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":148,"Q_Id":2106178,"Users Score":1,"Answer":"You can remove the demos and examples directories inside your qt installation directory... they take up over 1GB of space and are not required. I would leave the rest there, unless you are really worried about space.\nIf you do try to clean up the QT installation directory, start by renaming larger files\/directories (e.g. add a .old suffix to the name), and see if the features you use in QT still function. If it breaks, just rename the files\/directories back (remove .old).","Q_Score":3,"Tags":"python,pyqt4","A_Id":2184315,"CreationDate":"2010-01-21T00:50:00.000","Title":"PyQt post installation question","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing an application working with plugins. There are two types of plugins: Engine and Model. Engine objects have an update() method that call the Model.velocity() method.\nFor performance reasons these methods are allowed to be written in C. This means that sometimes they will be written in Python and sometimes written in C.\nThe problem is that this forces to do an expensive Python function call of Model.velocity() in Engine.update() (and also reacquiring the GIL). I thought about adding something like Model.get_velocity_c_func() to the API, that would allow Model implementations to return a pointer to the C version of their velocity() method if available, making possible for Engine to do a faster C function call.\nWhat data type should I use to pass the function pointer ? And is this a good design at all, maybe there is an easier way ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":366,"Q_Id":2106324,"Users Score":1,"Answer":"The CObject (PyCOBject) data type exists for this purpose. It holds a void*, but you can store any data you wish. You do have to be careful not to pass the wrong CObject to the wrong functions, as some other library's CObjects will look just like your own.\nIf you want more type security, you could easily roll your own PyType for this; all it has to do, after all, is contain a pointer of the right type.","Q_Score":0,"Tags":"python,c,function-pointers","A_Id":2106391,"CreationDate":"2010-01-21T01:29:00.000","Title":"Passing C function pointers between two python modules","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In the 'old days' when there was just cpython, most extensions were written in c (as platform independent as possible) and compiled into pyd's (think PyCrypto for example). Now there is Jython, IronPython and PyPy and the pyd\u2019s do not work with any of them (Ironclad aside). It seems they all support ctypes and that the best approach MIGHT be to create a platform independent dll or shared library and then use ctypes to interface to it.\nBut I think this approach will be a bit slower than the old fashion pyd approach. You could also program a pyd for cpython, a similar c# dll for IronPython and a java class or jar for Jython (I'm not sure about PyPy. But while this approach will appeal to platform purists it is very labor intensive. So what is the best route to take today?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":501,"Q_Id":2114627,"Users Score":1,"Answer":"If you're wrapping an existing native library, the ctypes is absolutely the way to go.\nIf you're trying to speed up the hot spots in a Python extension, then making a custom extension for each interpreter (and a pure-Python fallback) is tractable because the bulk of the code is pure Python that can be shared, but undesirable and labour-intensive, as you said. You could use ctypes in this case as well.","Q_Score":4,"Tags":"python,ironpython,jython","A_Id":2119710,"CreationDate":"2010-01-22T02:44:00.000","Title":"Python extensions that can be used in all varieties of python (jython \/ IronPython \/ etc.)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In the 'old days' when there was just cpython, most extensions were written in c (as platform independent as possible) and compiled into pyd's (think PyCrypto for example). Now there is Jython, IronPython and PyPy and the pyd\u2019s do not work with any of them (Ironclad aside). It seems they all support ctypes and that the best approach MIGHT be to create a platform independent dll or shared library and then use ctypes to interface to it.\nBut I think this approach will be a bit slower than the old fashion pyd approach. You could also program a pyd for cpython, a similar c# dll for IronPython and a java class or jar for Jython (I'm not sure about PyPy. But while this approach will appeal to platform purists it is very labor intensive. So what is the best route to take today?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":501,"Q_Id":2114627,"Users Score":2,"Answer":"Currently, it seems the ctypes is indeed the best approach. It works today, and it's so convenient that it's gonna conquer (most of) the world.\nFor performance-critical APIs (such as numpy), ctypes is indeed problematic. The cleanest approach would probably be to port Cython to produce native IronPython \/ Jython \/ PyPy extensions.\nI recall that PyPy had plans to compile ctypes code to efficient wrappers, but as far as I google, there is nothing like that yet...","Q_Score":4,"Tags":"python,ironpython,jython","A_Id":2116557,"CreationDate":"2010-01-22T02:44:00.000","Title":"Python extensions that can be used in all varieties of python (jython \/ IronPython \/ etc.)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am attempting to create my first OS-level GUI using wxPython. I have the book wxPython in Action and have looked at the code demos. I have no experience with event-driven programming (aside from some Javascript), sizers, and all of the typical GUI elements. The book is organized a little strangely and assumes I know far more about OS GUI programming than I actually do. I'm fairly recent to object-oriented programming, as well. I'm aware that I am clearly out of my depth. \nMy application, on the GUI side, is simple: mostly a set of reminder screens (\"Turn on the scanner,\" \"Turn on the printer,\" etc) and background actions in Python either in the filesystem or from hitting a web service, but it is just complex enough that the Wizard class does not quite seem to cover it. I have to change the names on the \"Back\" and \"Next\" buttons, disable them at times, and so forth.\nWhat is the standard process for an application such as mine? \n1) Create a single wxFrame, then put all of my wxPanels inside of it, hiding all but one, then performing a sequence of hides and shows as the \"Next\" button (or the current equivalent) are triggered? \n2) Create multiple wxFrames, with one wxPanel in each, then switch between them? \n3) Some non-obvious fashion of changing the names of the buttons in wxWizard and disabling them?\n4) Something I have not anticipated in the three categories above.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":290,"Q_Id":2119067,"Users Score":1,"Answer":"I don't have a good understanding of your application, but trying to force wxWizard to suit your needs sounds like a bad idea.\nI suggest checking out the Demos available from the wxPython website. Go through each demo and I bet you'll find one that suits your needs.\nI've personally never used wxWizard as I find it too cumbersome. Instead, I create a sequence of dialogs that do what I need.","Q_Score":3,"Tags":"python,wxpython","A_Id":2120967,"CreationDate":"2010-01-22T17:16:00.000","Title":"In wxPython, What is the Standard Process of Making an Application Slightly More Complex Than a Wizard?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for a way to lock the window. I found window.set_resizable(False), but that resizes the window to its requested size and then locks it. I would like to be able to resize my window, and then lock it into the size I have resized it to.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1153,"Q_Id":2124296,"Users Score":3,"Answer":"Perhaps you could set_size_request() with the current window size (from window_get_size()) before you call set_resizable()?","Q_Score":0,"Tags":"python,gtk,window,pygtk,resizable","A_Id":2124325,"CreationDate":"2010-01-23T18:58:00.000","Title":"PyGTK, how can I lock a window so it cannot be resized?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for a way to lock the window. I found window.set_resizable(False), but that resizes the window to its requested size and then locks it. I would like to be able to resize my window, and then lock it into the size I have resized it to.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1153,"Q_Id":2124296,"Users Score":0,"Answer":"You can use this:\nwindow.set_geometry_hints(window, min_width, min_height, max_width, max_height)","Q_Score":0,"Tags":"python,gtk,window,pygtk,resizable","A_Id":15961711,"CreationDate":"2010-01-23T18:58:00.000","Title":"PyGTK, how can I lock a window so it cannot be resized?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Pygame\/SDL's joystick module to get input from a gamepad. Every time I call its get_hat() method it prints to the console. This is problematic since I use the console to help me debug and now it gets flooded with SDL_JoystickGetHat value:0: 60 times every second. Is there a way I can disable this? Either through an option in Pygame\/SDL or suppress console output while the function calls? I saw no mention of this in the Pygame documentation.\nedit: This turns out to be due to debugging being turned on when the SDL library was compiled.","AnswerCount":8,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":97342,"Q_Id":2125702,"Users Score":2,"Answer":"I use pythonw.exe (on Windows) instead of python.exe.\nIn other OSes, you could also redirect output to \/dev\/nul.\nAnd in order to still see my debug output, I am using the logging module.","Q_Score":47,"Tags":"python,sdl,pygame","A_Id":5063983,"CreationDate":"2010-01-24T02:43:00.000","Title":"How to suppress console output in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a application written in PyGtk. I need to convert a particular line number into its corresponding window co-ordinates in a GtkTextView. How can this be done?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":131,"Q_Id":2137517,"Users Score":0,"Answer":"It can't be done, in general. If you're talking about a line of your pygtk program, then you would need an API for your IDE (development environment) to find out where a particular source code line is currently displayed on the screen, if anywhere. If by \"line number\" you mean something else, then as Ignacio says, you'll need to provide a lot more detail.","Q_Score":0,"Tags":"python,pygtk,gtk","A_Id":2137653,"CreationDate":"2010-01-26T04:26:00.000","Title":"Convert Line Number Into its corresponding co-ordinates","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. \n\nImportError: DLL load failed: The specified module could not be found.\n\nI've checked my System Path, and C:\\Python31\\Lib\\site-packages\\PyQt4\\bin is on there.\nI can't run any of the examples, but the Designer, Assistant and Linguist run fine.\nI am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed.\n\nEdit:\nI've copied the QtCore4 and GtGui4 dlls to C:\\Python31\\Lib\\site-packages\\PyQt4. That fixes some of the examples, but I still can't use the example browser.","AnswerCount":8,"Available Count":5,"Score":0.024994793,"is_accepted":false,"ViewCount":24135,"Q_Id":2140836,"Users Score":1,"Answer":"PyQt installation also depends on the version of python installed on your platform.Python3.+ is incompatible with Python version < 3.x.\nI was facing the same problem as I have Python 2.7 installed on my machine but I downloaded the latest binary which was PyQt-Py3.2-x86-gpl-4.9.exe. If you see here the binary has python version also mentioned in name after PyQt which is Py3.2. I uninstalled PyQt and installed PyQt-Py2.7-x86-gpl-4.9.exe which points to Python 2.7 and it fixed the problem.\nProbably they could have mentioned the naming convention online or in some documentation to be more simpler.","Q_Score":11,"Tags":"python,windows,pyqt,importerror","A_Id":10279385,"CreationDate":"2010-01-26T16:33:00.000","Title":"PyQt 4.7 - ImportError after installing on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. \n\nImportError: DLL load failed: The specified module could not be found.\n\nI've checked my System Path, and C:\\Python31\\Lib\\site-packages\\PyQt4\\bin is on there.\nI can't run any of the examples, but the Designer, Assistant and Linguist run fine.\nI am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed.\n\nEdit:\nI've copied the QtCore4 and GtGui4 dlls to C:\\Python31\\Lib\\site-packages\\PyQt4. That fixes some of the examples, but I still can't use the example browser.","AnswerCount":8,"Available Count":5,"Score":0.049958375,"is_accepted":false,"ViewCount":24135,"Q_Id":2140836,"Users Score":2,"Answer":"Just wanted to chime in that I had the same problem on a WinXP install of:\n\npython 2.7 \nQt 4.7.1 (10.05)\nPyQt 4.8.1\n\nI used the windows installer version of all 3 of those items.\nCopying the contents of the C:\\Python27\\Lib\\site-packages\\PyQt4\\bin folder up to the main PyQt folder (C:\\Python27\\Lib\\site-packages\\PyQt4) stopped the 'dll not found' errors that python was throwing.","Q_Score":11,"Tags":"python,windows,pyqt,importerror","A_Id":4452810,"CreationDate":"2010-01-26T16:33:00.000","Title":"PyQt 4.7 - ImportError after installing on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. \n\nImportError: DLL load failed: The specified module could not be found.\n\nI've checked my System Path, and C:\\Python31\\Lib\\site-packages\\PyQt4\\bin is on there.\nI can't run any of the examples, but the Designer, Assistant and Linguist run fine.\nI am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed.\n\nEdit:\nI've copied the QtCore4 and GtGui4 dlls to C:\\Python31\\Lib\\site-packages\\PyQt4. That fixes some of the examples, but I still can't use the example browser.","AnswerCount":8,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":24135,"Q_Id":2140836,"Users Score":0,"Answer":"I think there are at least two possible error conditions\n1. ImportError: DLL load failed: The specified module could not be found.\nthen you have to check your PyQT version is comptible with your python. In other words, if you use python 3.3, then you can only use PyQT for python3.3 and python 3.3 will not work with PyQT for python3.4\nThis was the problem I met. I solved it with re-install it\n2. Import Error: DLL load failed: %1 then something strange on a different encoding Win32.\nthen it would be a OS problem. If you use 32bit Python then you have to use 32bit PyQt, so do 64bit","Q_Score":11,"Tags":"python,windows,pyqt,importerror","A_Id":27086381,"CreationDate":"2010-01-26T16:33:00.000","Title":"PyQt 4.7 - ImportError after installing on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. \n\nImportError: DLL load failed: The specified module could not be found.\n\nI've checked my System Path, and C:\\Python31\\Lib\\site-packages\\PyQt4\\bin is on there.\nI can't run any of the examples, but the Designer, Assistant and Linguist run fine.\nI am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed.\n\nEdit:\nI've copied the QtCore4 and GtGui4 dlls to C:\\Python31\\Lib\\site-packages\\PyQt4. That fixes some of the examples, but I still can't use the example browser.","AnswerCount":8,"Available Count":5,"Score":0.024994793,"is_accepted":false,"ViewCount":24135,"Q_Id":2140836,"Users Score":1,"Answer":"I had the same problem. I got my program running from within Eclipse but when I tried running it directly from the command line I still got the same error.\nI solved it by renaming the C:\\Users\\Me\\AppData\\Roaming\\Python\\Python27\\site-packages\\PyQt4 directory. (I'm guessing leftovers from a previous PyQt install)\nI am using ActivePython.","Q_Score":11,"Tags":"python,windows,pyqt,importerror","A_Id":11774820,"CreationDate":"2010-01-26T16:33:00.000","Title":"PyQt 4.7 - ImportError after installing on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. \n\nImportError: DLL load failed: The specified module could not be found.\n\nI've checked my System Path, and C:\\Python31\\Lib\\site-packages\\PyQt4\\bin is on there.\nI can't run any of the examples, but the Designer, Assistant and Linguist run fine.\nI am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed.\n\nEdit:\nI've copied the QtCore4 and GtGui4 dlls to C:\\Python31\\Lib\\site-packages\\PyQt4. That fixes some of the examples, but I still can't use the example browser.","AnswerCount":8,"Available Count":5,"Score":0.024994793,"is_accepted":false,"ViewCount":24135,"Q_Id":2140836,"Users Score":1,"Answer":"Also chiming in. I installed both python 2.6 and PyQt 4.8.3 on a Windows 7 machine using the windows installers (I did NOT run 'python setup.py install').\nI tried to run spyder (which requires PyQt 4.4 or greater) and failed because it couldn't find the PyQt .dlls. I copied all the .dlls from the \\Lib\\site-packages\\PyQt4\\bin folder to the \\Lib\\site-packages\\PyQt4 folder, and spyder launches just fine.","Q_Score":11,"Tags":"python,windows,pyqt,importerror","A_Id":5795870,"CreationDate":"2010-01-26T16:33:00.000","Title":"PyQt 4.7 - ImportError after installing on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I convert a .wav file to some other format such as .mp3 in pygame? \nUpdate:\nWhy not Gstreamer or Pygame: \nI want to use native Windows environment to install a package that can do this (i.e. don't want to install cygwin). I am searching for a package which has a binary installer available for windows (with Python 2.6) or atleast where I can do \"python setup.py install\" without a need to install any dependencies.","AnswerCount":2,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":410,"Q_Id":2141315,"Users Score":-2,"Answer":"Pygame is an SDL wrapper. Not a multimedia framework. Why do you want to do audio format conversions in Pygame? Can't you use something else like maybe the gstreamer bindings for Python?","Q_Score":3,"Tags":"python,pygame","A_Id":2141369,"CreationDate":"2010-01-26T17:39:00.000","Title":"pygame saving audio files","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a game which uses procedurally generated levels, and when I'm testing I'll often want to reproduce a level. Right now I haven't made any way to save the levels, but I thought a simpler solution would be to just reuse the seed used by Python's random module. However I've tried using both random.seed() and random.setstate() and neither seem to reliably reproduce results. Oddly, I'll sometimes get the same level a few times in a row if I reuse a seed, but it's never completely 100% reliable. Should I just save the level normally (as a file containing its information)?\nEdit:\nThanks for the help everyone. It turns out that my problem came from the fact that I was randomly selecting sprites from groups in Pygame, which are retrieved in unordered dictionary views. I altered my code to avoid using Pygame's sprite groups for that part and it works perfectly now.","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2510,"Q_Id":2143463,"Users Score":0,"Answer":"At the point when you want another level, you should initially create another levelRandom object, and give that object to a level-generator to produce the level (if you are using one)","Q_Score":4,"Tags":"python,random,pygame","A_Id":64776255,"CreationDate":"2010-01-26T23:19:00.000","Title":"What's the easiest way to reproduce a randomly generated level in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a game which uses procedurally generated levels, and when I'm testing I'll often want to reproduce a level. Right now I haven't made any way to save the levels, but I thought a simpler solution would be to just reuse the seed used by Python's random module. However I've tried using both random.seed() and random.setstate() and neither seem to reliably reproduce results. Oddly, I'll sometimes get the same level a few times in a row if I reuse a seed, but it's never completely 100% reliable. Should I just save the level normally (as a file containing its information)?\nEdit:\nThanks for the help everyone. It turns out that my problem came from the fact that I was randomly selecting sprites from groups in Pygame, which are retrieved in unordered dictionary views. I altered my code to avoid using Pygame's sprite groups for that part and it works perfectly now.","AnswerCount":4,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":2510,"Q_Id":2143463,"Users Score":1,"Answer":"Best would be to create a levelRandom class with a data slot for every randomly produced result when generating a level. Then separate the random-generation code from the level-construction code. When you want a new level, first generate a new levelRandom object, then hand that object to the level-generator to produce your level. Later, to get the same level again, you can just reuse the levelRandom instance.","Q_Score":4,"Tags":"python,random,pygame","A_Id":2143490,"CreationDate":"2010-01-26T23:19:00.000","Title":"What's the easiest way to reproduce a randomly generated level in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Using Python and PyGTK I've got a GtkMenu with various GtkCheckMenuItems in it. When the user clicks one of the checkboxes the menu closes. I'd like for the user to be able to check a series of checkboxes without the menu closing each time.\nI've looked at using the activate callback to show the menu but this doesn't seem to work. Any suggestions?","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":749,"Q_Id":2150899,"Users Score":-1,"Answer":"Try digging into source and it's documentation. I have found this to be the easiest way and best shortcut.","Q_Score":6,"Tags":"python,menu,gtk,pygtk","A_Id":2152012,"CreationDate":"2010-01-27T22:46:00.000","Title":"Making a Python\/GTK CheckMenuItem, when clicked, not close the menu","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In my Python2_6\/include directory is a folder with pygame headers. I assumed that my python C module can access pygame stuff directly in C. Is this the case? How do I integrate a C module that wants to use pygame, with a python script using pygame? Right now my brain sees:\npygame <-- MyCModule <-- MyScript --> pygame\nie. Two pygame instances. So is it possible to integrate them so that my module and my app use the same instance? Why are there pygame headers in my python include directory, can I use those somehow, for direct access?\nThanks for any help.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":390,"Q_Id":2171746,"Users Score":0,"Answer":"I assumed that my python C module can\n access pygame stuff directly in C. Is\n this the case?\n\nNo, that stuff is most likely just there because it was necessary to compile the pygame Python extension.\nI don't understand what you mean when you say you see 2 pygame instances. There are as many instances as you create, no more, no less. If you have script that creates pygame objects, and your extension also creates pygame objects, then of course you will have 2 sets of objects. As the writer of the application you need to decide which part of it will have responsibility for interfacing with pygame. If the other part requires access to those pygame objects, then you pass them in as arguments.","Q_Score":1,"Tags":"python,module,pygame","A_Id":2176010,"CreationDate":"2010-01-31T13:07:00.000","Title":"Integrating pygame with a C module","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a program and I need some extra functionality from the gtk.Notebook widget, so I have taken to creating my own.\nMy only problem is styling my tabs so that they look like the tabs in gtk.Notebook and will change according to the user's theme.\nI really don't know where to start so any advice would be much appreciated, thanks :)","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":682,"Q_Id":2174873,"Users Score":0,"Answer":"Just for the record, if you are going to create something similar to a gtk.Notebook, I'll recomment you to subclass gtk.Notebook to save a lot of work.","Q_Score":1,"Tags":"python,coding-style,tabs,pygtk","A_Id":2786548,"CreationDate":"2010-02-01T05:43:00.000","Title":"PyGTK: How do I make a custom widget look like a gtk.Notebook tab?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a program and I need some extra functionality from the gtk.Notebook widget, so I have taken to creating my own.\nMy only problem is styling my tabs so that they look like the tabs in gtk.Notebook and will change according to the user's theme.\nI really don't know where to start so any advice would be much appreciated, thanks :)","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":682,"Q_Id":2174873,"Users Score":0,"Answer":"I solved the problem eventually by getting the colours from gtk.Notebook's style.","Q_Score":1,"Tags":"python,coding-style,tabs,pygtk","A_Id":2212682,"CreationDate":"2010-02-01T05:43:00.000","Title":"PyGTK: How do I make a custom widget look like a gtk.Notebook tab?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I currently have a dual-monitor setup with Eclipse on monitor 2. When I run the code that launches the wxPython GUI, I would like for this GUI to appear on monitor 1. Currently, the GUI consistently appears on monitor 2, covering Eclipse, and I have to drag it to monitor 1 every time. Is there a solution to this problem -- either a configuration change I can make in Eclipse or some addition I can make to the GUI code?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":441,"Q_Id":2174904,"Users Score":0,"Answer":"The best kludge I found was the Kubuntu global shortcut \"Ctrl-Shift-Space\". This moves a window to the other screen, mitigating the hassle of dragging with the mouse.","Q_Score":0,"Tags":"python,eclipse,wxpython","A_Id":2182198,"CreationDate":"2010-02-01T05:50:00.000","Title":"Making wxPython GUI launch on a different screen from Eclipse","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I currently have a dual-monitor setup with Eclipse on monitor 2. When I run the code that launches the wxPython GUI, I would like for this GUI to appear on monitor 1. Currently, the GUI consistently appears on monitor 2, covering Eclipse, and I have to drag it to monitor 1 every time. Is there a solution to this problem -- either a configuration change I can make in Eclipse or some addition I can make to the GUI code?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":441,"Q_Id":2174904,"Users Score":0,"Answer":"Kludge #2: If I run the code from Eclipse on screen 2 then click someplace on screen 1 before the GUI appears, the GUI will appear on screen 1.","Q_Score":0,"Tags":"python,eclipse,wxpython","A_Id":2189730,"CreationDate":"2010-02-01T05:50:00.000","Title":"Making wxPython GUI launch on a different screen from Eclipse","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Often times when we're drawing a GUI, we want our GUI to update based on the data changing in our program. At the start of the program, let's say I've drawn my GUI based on my initial data. That data will be changing constantly, so how can I redraw my GUI constantly?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1096,"Q_Id":2192993,"Users Score":0,"Answer":"You could create a thread to update the GUI constantly, just pass to it references to the graphical widgets that need to be updated","Q_Score":1,"Tags":"python,pyqt","A_Id":2193028,"CreationDate":"2010-02-03T15:21:00.000","Title":"How to start a \"drawing loop\" in PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"QGraphicsView is often hooked up to a QGraphicsScene. What if I want to swap that QGraphicsScene for a new one? How can I accomplish this? Doing it right now is just drawing over the old one.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":249,"Q_Id":2194829,"Users Score":0,"Answer":"To swap the scene just call your view's setScene() again with a different QGraphicsScene object.","Q_Score":1,"Tags":"python,pyqt","A_Id":2194899,"CreationDate":"2010-02-03T19:31:00.000","Title":"How to swap the QGraphicsScene from a QGraphicsView?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a trick to sizing controls for wx.lib.CUstomTreeCtrl? I've been trying to create my own custom controls (just panels with sub-controls in them) and add them as items in my CustomTreeCtrl, but when the tree renders, it's as if the panels aren't expanded to the appropriate size. I can set the panel size manually by using SetSize() but if I do that, the tree doesn't seem to be aware of the size (the rows aren't scaled to the appropriate size) and the items are rendered on top of each other. I've tried to override DoGetBestSize() but it seems to not have any effect.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":143,"Q_Id":2219514,"Users Score":0,"Answer":"Can you put a self contained sample code and we can try to fix that.\nHave you tried adding custom items which return correct height for your panel?","Q_Score":0,"Tags":"python,wxpython","A_Id":2309469,"CreationDate":"2010-02-08T04:05:00.000","Title":"Sizing controls for items in wx.lib.CustomTreeCtrl","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to write a small gui app in pygtk which needs an html-rendering widget. I'd like to be able to use it in a windows environment.\nCurrently I'm using pywebkitgtk on my GNU\/Linux system, and it works extremely well, but it seems it's not possible to use this on Windows at this time.\nCan anyone give me any suggestions on how to proceed? Do I need to work out how to embed IE using COM objects under Windows, and stick with pywebkitgtk on GNU\/Linux?\nI'm at an early stage, and am prepared to jettison pygtk in favour of another toolkit, say pyqt, if it affords a simpler solution (though I'd sooner stick with pygtk if possible).","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1076,"Q_Id":2227770,"Users Score":2,"Answer":"In my experience, having developed cross-platform applications with both PyQt and PyGTK, you should consider moving to PyQt. It comes with a browser widget by default which runs fine on all platforms, and support for non-Linux platforms is outstanding compared to PyGTK. For PyGTK, you will have to be prepared building PyGObject\/PyCairo\/PyGTK, or even the full stack, yourself on Windows and Mac OS X.","Q_Score":0,"Tags":"python,cross-platform,pyqt,pygtk,html-rendering","A_Id":2227957,"CreationDate":"2010-02-09T08:48:00.000","Title":"cross-platform html widget for pygtk","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm having a class library. I'm able to access that assembly from iron python console as normal. \nMy goal is to create a Silverlight class library which uses a python script to access that WPF class library what I'm having. Is it possible? Is there any other way to achieve this or any work around.\nI can provide a sample of what I'm doing now, If more details are needed.\nThanks","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":433,"Q_Id":2251296,"Users Score":2,"Answer":"You will not be able to use the class library unless its code is compatible with Silverlight libraries and is re-compiled targeting the Silverlight ones.","Q_Score":1,"Tags":"c#,silverlight,ironpython","A_Id":2253386,"CreationDate":"2010-02-12T11:05:00.000","Title":"How to access WPF class library from Silverlight using iron python. Is it possible?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a treeview and I am watching for the cursor-changed and row-activated signals. The problem is that in order to trigger the row-activate I first have to click on the row (triggering cursor-changed) and then do the double click, requiring 3 clicks.\nIs there a way to respond to both signals with 2 clicks?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":3862,"Q_Id":2256794,"Users Score":3,"Answer":"The cursor-changed signal is emitted even when single clicking on the same (selected) row. Still, the row-activated signal is emitted when you double click on a row, whether it was selected before the double click or not. Thus you don't need 3 clicks to trigger a row-activated.\nAs Jon mentioned, you want to connect to the selection's changed signal in stead of cursor-changed.","Q_Score":1,"Tags":"python,gtk,pygtk,gtktreeview","A_Id":3100214,"CreationDate":"2010-02-13T07:09:00.000","Title":"GtkTreeView's row-activated and cursor-changed signals","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing a timer program in Python using PyGTK. It is precise to the hundredths place. Right now, I am using a constantly updated label. This is a problem, because if I resize the window while the timer is running, Pango more often than not throws some crazy error and my program terminates. It's not always the same error, but different ones that I assume are some form of failed draw. Also, the label updates slower and slower as I increase the font size.\nSo, I am wondering if there is a more correct way to display the timer. Is there a more stable method than constantly updating a label?","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1048,"Q_Id":2259386,"Users Score":2,"Answer":"Updating a label should work perfectly reliably, so I suspect you're doing something else wrong. Are you using threads? What does your code look like? How small can you condense your program (by removing functionality, not by obfuscating the code), without making the problem go away?","Q_Score":1,"Tags":"python,gtk,pygtk,pango","A_Id":2259437,"CreationDate":"2010-02-13T22:41:00.000","Title":"How should I display a constantly updating timer using PyGTK?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to write a code that runs similar to normal calculators in such a way that it displays the first number I type in, when i press the operand, the entry widget still displays the first number, but when i press the numbers for my second number, the first one gets replaced. I'm not to the point in writing the whole code yet, but I'm stuck at the point where when I press the 2nd number(s), the first set gets replaced. I was thinking about if key == one of the operands, than I set the num on the entry as variable first, then I do ent.delete(0,end) to clear the screen and ent.insert(0,first) to display the first num in the entry widget. Now I don't know what to do to clear the entry widget when the 2nd number(s) is pressed.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1214,"Q_Id":2264371,"Users Score":2,"Answer":"What you need here is a concept of state. Each time a key is pressed, you check the state and determine what action to take.\nIn the initial state, you take input of numbers.\nWhen an operand button is pressed, you store the operand, and change the state.\nWhen another number is pressed, you store the number, clear the numeric input, and start the number input again.\nThen when the equals button is pressed, you perform the operation, using your stored number and operand with the current number in the numeric input.\nNote that with a dynamic language like Python, instead of using a variable and if statements to check the state, you can just change the function that handles key\/button pressed depending on what the state is.","Q_Score":1,"Tags":"python,user-interface,calculator","A_Id":2264618,"CreationDate":"2010-02-15T06:41:00.000","Title":"Creating a GUI Calculator in python similar to MS Calculator","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a PyQt application. Currently, there's a status panel (defined as a QWidget) which contains a QHBoxLayout. This layout is frequently updated with QPushButtons created by another portion of the application.\nWhenever the buttons which appear need to change (which is rather frequently) an update effect gets called. The existing buttons are deleted from the layout (by calling layout.removeWidget(button) and then button.setParent(None)) and the new buttons are added to the layout.\nGenerally, this works. But occasionally, when I call button.setParent(None) on the button to delete, it causes it to pop out of the application and start floating in its own stand-alone frame.\nHow can I remove a button from the layout and ensure it doesn't start floating?","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":304,"Q_Id":2264482,"Users Score":2,"Answer":"Try calling QWidget::hide() on the button before removing from the layout if you don't want to delete your button.","Q_Score":3,"Tags":"python,qt,qt4,pyqt,pyqt4","A_Id":2265975,"CreationDate":"2010-02-15T07:26:00.000","Title":"How do I prevent Qt buttons from appearing in a separate frame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to create an application that has 3-4 frames (or windows) where each frame is attached\/positioned to a side of the screen (like a task bar). When a frame is inactive I would like it to auto hide (just like the Windows task bar does; or the dock in OSX). When I move my mouse pointer to the position on the edge of the screen where the frame is hidden, I would like it to come back into focus.\nThe application is written in Python (using wxPython for the basic GUI aspects). Does anyone know how to do this in Python? I'm guessing it's probably OS dependent? If so, I'd like to focus on Windows first.\nI don't do GUI programming very often so my apologies if this makes no sense at all.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":877,"Q_Id":2268315,"Users Score":0,"Answer":"I think you could easily just make a window that is the same size as the desktop then do some while looping for an inactivity variable based on mouse position, then thread off a timer for loop for the 4 inactivity variables. I'd personally design it so that when they reach 0 from 15, they change size and position to become tabular and create a button on them to reactivate. lots of technical work on this one, but easily done if you figure it out","Q_Score":1,"Tags":"python,animation,wxpython,mouseevent","A_Id":44916099,"CreationDate":"2010-02-15T19:11:00.000","Title":"Can you auto hide frames\/dialogs using wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to create an application that has 3-4 frames (or windows) where each frame is attached\/positioned to a side of the screen (like a task bar). When a frame is inactive I would like it to auto hide (just like the Windows task bar does; or the dock in OSX). When I move my mouse pointer to the position on the edge of the screen where the frame is hidden, I would like it to come back into focus.\nThe application is written in Python (using wxPython for the basic GUI aspects). Does anyone know how to do this in Python? I'm guessing it's probably OS dependent? If so, I'd like to focus on Windows first.\nI don't do GUI programming very often so my apologies if this makes no sense at all.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":877,"Q_Id":2268315,"Users Score":0,"Answer":"Personally, I would combine the EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW that FogleBird mentioned with a wx.Timer. Then whenever it the frame or dialog is inactive for x seconds, you would just call its Hide() method.","Q_Score":1,"Tags":"python,animation,wxpython,mouseevent","A_Id":9066380,"CreationDate":"2010-02-15T19:11:00.000","Title":"Can you auto hide frames\/dialogs using wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When starting up a new project, as a beginner, which would you use? \nFor example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there will be some QObjects that will be used to updated parameters within that infinite loop. So these need to be on separate threads, if I'm not mistaken. Which choice would give the most\/least hassle?","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":445,"Q_Id":2268853,"Users Score":1,"Answer":"If I understood your question correctly, updating the GUI has a little to do with the way you programmed it.\nFrom my experience, it's easier to design a main window (or whatever your top level object is) in Designer, and add some dynamically updated content in a widget(s) created in your code. In most cases, it saves your time spent on digging through QT documentation, and additionally, you are able to visually inspect positioning, aligning etc.\nYou don't lose anything by using a Designer, every part of the GUI can be modified in your code afterwards, if it needs some custom behavior.\nHaving said that, without knowing all the details of your project is hard to tell which option (QT or in-code) is faster.","Q_Score":2,"Tags":"python,user-interface,pyqt","A_Id":2271799,"CreationDate":"2010-02-15T20:58:00.000","Title":"QtDesigner or doing all of the Qt boilerplate by hand?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When starting up a new project, as a beginner, which would you use? \nFor example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there will be some QObjects that will be used to updated parameters within that infinite loop. So these need to be on separate threads, if I'm not mistaken. Which choice would give the most\/least hassle?","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":445,"Q_Id":2268853,"Users Score":0,"Answer":"Your right threading is your answer. Use the QT threads they work very well. \nWhere I work when people start out using QT a lot of them start with designer but eventually end up hand coding it. I think you will end up hand coding it but if you are someone who really likes GUIs you may want to start with Designer. I know that isn't a definitive answer but it really depends.","Q_Score":2,"Tags":"python,user-interface,pyqt","A_Id":2269180,"CreationDate":"2010-02-15T20:58:00.000","Title":"QtDesigner or doing all of the Qt boilerplate by hand?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When starting up a new project, as a beginner, which would you use? \nFor example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there will be some QObjects that will be used to updated parameters within that infinite loop. So these need to be on separate threads, if I'm not mistaken. Which choice would give the most\/least hassle?","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":445,"Q_Id":2268853,"Users Score":0,"Answer":"First of all, the requirements that you've mentioned don't (or shouldn't) have much affect on this decision.\nEither way, you're going to have to learn something. You might as well investigate both options, and make the decision yourself. Write a couple of \"Hello, World!\" apps, then start adding some extra widgets\/behavior to see how each approach scales.\nSince you asked, I would probably use Qt Designer. But I'm not you, and I'm not working on (nor do I know much of anything about) your project.","Q_Score":2,"Tags":"python,user-interface,pyqt","A_Id":2269317,"CreationDate":"2010-02-15T20:58:00.000","Title":"QtDesigner or doing all of the Qt boilerplate by hand?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was thinking of trying OpenCV for a project and noticed that it had C, C++ and Python.\nI am trying to figure out whether I should use C++, C or Python -- and would like to use whatever has the best OpenCV support. \nJust from looking at the index page for the various documentation it looks like the C++ bindings might have more features than the others? Is this true?\nIf C++ has more bindings, it seems that would be a more obvious choice for me, but I was just curious if it really has more features, etc than the others?\nThanks!","AnswerCount":4,"Available Count":3,"Score":0.1973753202,"is_accepted":false,"ViewCount":7757,"Q_Id":2278228,"Users Score":4,"Answer":"I think it depends how proficient you are in C++. The Mat interface does appear more modern than the old IPLImage C interface. The problem I'm having is that most of the examples you'll find on the web, or even here on stackoverflow are for the C interface (e.g. cvCvtColor), not for the C++ interface. So I'm really struggling to port the C examples to C++.","Q_Score":27,"Tags":"c++,python,c,opencv","A_Id":10057553,"CreationDate":"2010-02-17T04:04:00.000","Title":"OpenCV Image Processing -- C++ vs C vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was thinking of trying OpenCV for a project and noticed that it had C, C++ and Python.\nI am trying to figure out whether I should use C++, C or Python -- and would like to use whatever has the best OpenCV support. \nJust from looking at the index page for the various documentation it looks like the C++ bindings might have more features than the others? Is this true?\nIf C++ has more bindings, it seems that would be a more obvious choice for me, but I was just curious if it really has more features, etc than the others?\nThanks!","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":7757,"Q_Id":2278228,"Users Score":13,"Answer":"The Python interface is still being developed whereas the C++ interface (especially with the new Mat class) is quite mature. If you're comfortable in C++, I would highly recommend using it - else, you can start using Python and contribute back any features you think OpenCV needs :)","Q_Score":27,"Tags":"c++,python,c,opencv","A_Id":2278331,"CreationDate":"2010-02-17T04:04:00.000","Title":"OpenCV Image Processing -- C++ vs C vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was thinking of trying OpenCV for a project and noticed that it had C, C++ and Python.\nI am trying to figure out whether I should use C++, C or Python -- and would like to use whatever has the best OpenCV support. \nJust from looking at the index page for the various documentation it looks like the C++ bindings might have more features than the others? Is this true?\nIf C++ has more bindings, it seems that would be a more obvious choice for me, but I was just curious if it really has more features, etc than the others?\nThanks!","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":7757,"Q_Id":2278228,"Users Score":1,"Answer":"Even if you're very proficient in C or C++, you should use python to speed up your development (I should guess a 4x factor). Performance are really quite the same.","Q_Score":27,"Tags":"c++,python,c,opencv","A_Id":16210061,"CreationDate":"2010-02-17T04:04:00.000","Title":"OpenCV Image Processing -- C++ vs C vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I set a gtk.Button enabled or disabled in PyGTK?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":12047,"Q_Id":2281373,"Users Score":0,"Answer":"If you don't want to see the object then you could button.set_visible(False) to hide it or button.set_visible(True) to show it. This will prevent users from seeing the button.","Q_Score":18,"Tags":"python,pygtk","A_Id":70261450,"CreationDate":"2010-02-17T14:23:00.000","Title":"Enable or disable gtk.Button in PyGTK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've a PyQt 4 installed (I can't find PyQt 3 for Windows) and I would like to open a QtDesigner ui file which has been created with QtDesigner 3.3.\nWhen I open this file I've the following message:\nPlease use uic3 -convert to convert to Qt4\nUnfortunately, I don't see the uic3 tool in the bin folder of my install.\nDoes anybody know how can I can convert this file to QtDesigner 4?\nAdditional quastion: Where to download PyQy3 binaries for Windows?\nThanks in advance","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":900,"Q_Id":2294956,"Users Score":1,"Answer":"Try finding pyuic3 or rather pyuic4. Since you are using PyQt all your qt tools have py in front (like pyrcc4 or pyuicc4).\nI am not sure, that there are pyqt3 binaries for windows. Are you sure that Phil Thompson did PyQt3 also for windows at the time? If so, they would be on riverbank site, I guess, but I can't find them there. Tried compiling the source yourself?","Q_Score":0,"Tags":"python,qt,pyqt,qt-designer","A_Id":2296460,"CreationDate":"2010-02-19T08:41:00.000","Title":"How to open a Pyqt 3.3 ui file with QtDesigner 4?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If Python was so fast as C, the latter would be present in python apps\/libraries?\nExample: if Python was fast as C would PIL be written completely in Python?","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":196,"Q_Id":2303683,"Users Score":2,"Answer":"It makes sense to use C modules in Python for:\n\nPerformance\nLibraries that won't be ported to Python (because of performance reasons, for example) or that use OS-specific functions\nScripting. For example, many games use Python, Lua and other languages as scripting languages. Therefore they expose C\/C++ functions to Python.\n\nAs to your example: Yes, but Python is inherently slower than C. If both were equally fast, it would make sense to use Python because C code is often more prone to attacks (buffer overflows and stuff).","Q_Score":1,"Tags":"python,c,performance,bytecode","A_Id":2303703,"CreationDate":"2010-02-20T20:55:00.000","Title":"Is there any purpose for a python application use C other than performance?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If Python was so fast as C, the latter would be present in python apps\/libraries?\nExample: if Python was fast as C would PIL be written completely in Python?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":196,"Q_Id":2303683,"Users Score":0,"Answer":"To access hardware.","Q_Score":1,"Tags":"python,c,performance,bytecode","A_Id":2303876,"CreationDate":"2010-02-20T20:55:00.000","Title":"Is there any purpose for a python application use C other than performance?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If Python was so fast as C, the latter would be present in python apps\/libraries?\nExample: if Python was fast as C would PIL be written completely in Python?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":196,"Q_Id":2303683,"Users Score":7,"Answer":"To access \"legacy\" C libraries and OS facilities.","Q_Score":1,"Tags":"python,c,performance,bytecode","A_Id":2303685,"CreationDate":"2010-02-20T20:55:00.000","Title":"Is there any purpose for a python application use C other than performance?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"In Python using tkinter, what is the difference between root.destroy() and root.quit() when closing the root window?\nIs one prefered over the other? Does one release resources that the other doesn't?","AnswerCount":4,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":35380,"Q_Id":2307464,"Users Score":30,"Answer":"root.quit() causes mainloop to exit. The interpreter is still intact, as are all the widgets. If you call this function, you can have code that executes after the call to root.mainloop(), and that code can interact with the widgets (for example, get a value from an entry widget).\nCalling root.destroy() will destroy all the widgets and exit mainloop. Any code after the call to root.mainloop() will run, but any attempt to access any widgets (for example, get a value from an entry widget) will fail because the widget no longer exists.","Q_Score":39,"Tags":"python,tkinter","A_Id":42928131,"CreationDate":"2010-02-21T21:09:00.000","Title":"What is the difference between root.destroy() and root.quit()?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In Python using tkinter, what is the difference between root.destroy() and root.quit() when closing the root window?\nIs one prefered over the other? Does one release resources that the other doesn't?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":35380,"Q_Id":2307464,"Users Score":0,"Answer":"My experience with root.quit() and root.destroy() ...\nI have a dos python script, which calls a tkinter script (to choose from set of known values from combobox), then returns to the dos script to complete other things. \nThe TKinter script I've added onto the parent script. I may convert all to tkinter, but a combo works for the time being. It works in the following way:\nTo get rid of the windows box after selection was implemented, I needed to\n1) root.quit() inside the callback function where all my keypresses were being processed.\n2) root.destroy() after mainloop to destroy the windows box.\nIf I used root.destroy() inside the callback, I got an error message saying tkinter objects were no longer accessable.\nWithout the root.destroy() after mainloop, the windows box STAYED ONSCREEN until the whole parent script had completed.","Q_Score":39,"Tags":"python,tkinter","A_Id":61423826,"CreationDate":"2010-02-21T21:09:00.000","Title":"What is the difference between root.destroy() and root.quit()?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to try to write a GUI application in Python. I found out that there are a lot of ways to do it (different toolkits). And, in this context, I have several basic (and I think simple) question?\n\nIs it, in general, a good idea to write a GUI application in Python?\nWhat is the standard (easiest and most stable) way to create a GUI applications in Python?\nDoes anybody can give me a link to a simple Hello World GUI application written in Python?","AnswerCount":6,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":20880,"Q_Id":2310130,"Users Score":2,"Answer":"As an answer for #1: Yes. It is quite good for this; scripting languages with GUI toolkits are often a good way to put a GUI on an application. They can also be used to wrap applications written in low level languages such as C or C++. Python offers good integration to quite a few toolkits. The posting linked above gives a pretty good cross section of the options with code samples.\nFor #2: TkInter comes with the standard distribution. It is easy to use but not as sophisticated as (say) QT or WxWidgets.","Q_Score":11,"Tags":"python,user-interface","A_Id":2310200,"CreationDate":"2010-02-22T10:11:00.000","Title":"How to write GUI in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to use NLTK (Natural Language Toolkit) for Python using IronPython and call from an exisiting WPF\/c# project.\nIs it possible to reference NLTK from within WPF in this way. For example to use Named Entity Recognition from NTLK?\nAny advice or guidance appreciated.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":1242,"Q_Id":2318335,"Users Score":2,"Answer":"It definitely is possible, as long as NLTK doesn't use any C extensions. It will be much easier if you use VS2010 though, because of the dynamic keyword. Look at the Microsoft.Scripting.Hosting library from IronPython, it will get you started towards loading the NLTK code and executing methods on it.","Q_Score":5,"Tags":"wpf,nltk,ironpython","A_Id":2320322,"CreationDate":"2010-02-23T13:16:00.000","Title":"NLTK in IronPython from WPF","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I print contents of a Python Tkinter.Canvas widget?\nI've read that it's possible to print to a postscript printer from this control but examples are hard to come by.\nSo, any ideas what is needed to print the contents (including images)?\nIf you've got a cross-platform method all the better!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1143,"Q_Id":2326753,"Users Score":0,"Answer":"AFAIK it can only be done using the postscript method from the Canvas. This generates a postscript file with the canvas contents.\nCheck the documentation for details about this method.","Q_Score":1,"Tags":"python,printing,tkinter-canvas","A_Id":2326802,"CreationDate":"2010-02-24T14:40:00.000","Title":"How to print contents of a tkinter.Canvas widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?","AnswerCount":12,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":135115,"Q_Id":2398800,"Users Score":3,"Answer":"in pyqt5 to convert from a ui file to .py file\npyuic5.exe youruifile.ui -o outputpyfile.py -x","Q_Score":83,"Tags":"python,user-interface,qt,pyqt,qt-designer","A_Id":54119368,"CreationDate":"2010-03-08T01:27:00.000","Title":"Linking a qtDesigner .ui file to python\/pyqt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?","AnswerCount":12,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":135115,"Q_Id":2398800,"Users Score":0,"Answer":"Using Anaconda3 (September 2018) and QT designer 5.9.5.\nIn QT designer, save your file as ui.\nOpen Anaconda prompt. Search for your file: cd C:.... (copy\/paste the access path of your file).\nThen write: pyuic5 -x helloworld.ui -o helloworld.py (helloworld = name of your file). Enter.\nLaunch Spyder. Open your file .py.","Q_Score":83,"Tags":"python,user-interface,qt,pyqt,qt-designer","A_Id":52304139,"CreationDate":"2010-03-08T01:27:00.000","Title":"Linking a qtDesigner .ui file to python\/pyqt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to create a 'kiosk mode' in wxpython under Windows (98 - 7) where the application disables you from breaking out of the app using Windows keys, alt-tab, alt-f4, and ctrl+alt+delete?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":753,"Q_Id":2399812,"Users Score":0,"Answer":"wxPython alone cannot be done with that. \nYou need to do Low Level Keyboard Hook with C\/C++ or with equivalent ctypes, for\nWindows keys, alt-tab, alt-f4, \nbut Ctrl-Alt-Del, I don't think so for Windows XP and above.","Q_Score":0,"Tags":"python,wxpython,mode,kiosk","A_Id":2399853,"CreationDate":"2010-03-08T07:12:00.000","Title":"Kiosk mode in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Some friends and I wanted to develop a game. Any language will do. I've been programming in C for years, but never wrote a game before. One of us knows SDL a little bit. It would also be a nice excuse to learn Python+pygame.\nWe wish our game to be 'standalone'. By standalone, I mean most users (at least Linux, Mac and Windows) will not have to manually download and install anything else apart from a package. It is ok if the installation automatically handles missing dependencies. If the packages contain binaries, we wish to be able to generate them using cross-compilation from Linux.\nHow should we package and structure the project, and what language is best suited?","AnswerCount":6,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1603,"Q_Id":2401599,"Users Score":0,"Answer":"For casual gaming I would recommend Flash","Q_Score":6,"Tags":"python,c,cross-platform,packaging,cross-compiling","A_Id":2467317,"CreationDate":"2010-03-08T13:34:00.000","Title":"Game cross-compiling and packaging","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any UI widgets available to the python side of Google App Engine? I'd like something like the collapsed\/expanded views of Google Groups threads. Are these type things limited to the GWT side?","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":2260,"Q_Id":2402128,"Users Score":3,"Answer":"There is no difference in the amount of built in widgets available to the python and java sides of app engine. Neither side has any! App Engine is primarily a back end technology. It allows you to use pretty much whatever web framework you want for your presentation layer, subject to constraints that Alex mentions.\nGWT is completely unrelated to App Engine, besides being developed by Google. It is a client side toolkit, and can be used just fine with any web app as a backend, whether created in java, python or [your favorite language]. (Admittedly, you get a few bonus features if your backend is in java.)","Q_Score":5,"Tags":"python,user-interface,google-app-engine","A_Id":2404551,"CreationDate":"2010-03-08T14:52:00.000","Title":"Google App Engine UI Widgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look for ONLY this item with no variances at all.\nHow can I do this?\nOh and to explain my issue a bit further, I am writing a loop for a game, once a progress bar has reached 100% - it needs to allow the loop to finish (And start over again), however the progress bar is just a plain bar - so when sikuli looks for it on the screen, it finds the partially complete bar (Since apparently it matches different lengths\/widths\/sizes of the image it is looking for), and triggers.","AnswerCount":4,"Available Count":2,"Score":0.1488850336,"is_accepted":false,"ViewCount":6449,"Q_Id":2407212,"Users Score":3,"Answer":"If you are using Sikuli IDE click image miniature, for which you want to change sensitivity. You will be presented screenshot of your desktop with and occurrences of pattern(your image). Below there is a slider witch changes sensitivity. While changing it you will notice that highlighted occurrences of the pattern increase or decrease accordingly.\nThis method assumes that you have your game on screen (so windowed mode, not fullscreen), but even if you don't you still can adjust sensitivity, just you won't see 'live' results of search. \nIf you call sikuli from Java code, you have to use Pattern(image.png).similar(y.xx)\nwhere the argument of simmilar is something between 0.00 and 1.00.\nI haven't used second method so you may need to experiment with it.","Q_Score":5,"Tags":"python,sikuli","A_Id":3884131,"CreationDate":"2010-03-09T07:10:00.000","Title":"Change Sikuli's sensitivity?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look for ONLY this item with no variances at all.\nHow can I do this?\nOh and to explain my issue a bit further, I am writing a loop for a game, once a progress bar has reached 100% - it needs to allow the loop to finish (And start over again), however the progress bar is just a plain bar - so when sikuli looks for it on the screen, it finds the partially complete bar (Since apparently it matches different lengths\/widths\/sizes of the image it is looking for), and triggers.","AnswerCount":4,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":6449,"Q_Id":2407212,"Users Score":7,"Answer":"You can do the following in the Sikuli IDE:\n\nClick on the image\nIn Pattern Settings > Matching Preview, drag the Similarity bar to 1.0 (all the way to the right)\nClick OK","Q_Score":5,"Tags":"python,sikuli","A_Id":3885229,"CreationDate":"2010-03-09T07:10:00.000","Title":"Change Sikuli's sensitivity?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering what options are available for Python 3.x? I know Tkinter is available as well as qt, but what about the other libraries? Any word on when some of them may be ported over to 3.x?","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":968,"Q_Id":2411886,"Users Score":0,"Answer":"I use exclusively Tkinter, and though it's somewhat limited in terms of images, it's remarkably easy to work with and follows the standard easy-to-read Python syntax very nicely. I'm not familiar with other GUI options, but Tkinter is great from my experience.","Q_Score":4,"Tags":"python,user-interface,python-3.x","A_Id":29502724,"CreationDate":"2010-03-09T19:21:00.000","Title":"GUI options with python 3.x","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've wrote a piece of code in python and pygtk for an embeded mplayer in a gui.\nI assume I use GtkSocket and the slave mode of mplayer with the -wid option.\nBut I've got an issue, when the size of my GTK window is smaller than my stream, the stream appears to be cropped. And when the size of my window is bigger than my stream, the stream appear centred inside the widget which embed MPlayer. (a gtk.Frame but I've also try with a gtk.DrawingArea)\nI would like to know how I can get my stream resize dynamically depending on the window's size.\nI don't want to use Glade or any GUI builder.\nThanks in advance for any help, and please excuse my poor english.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1512,"Q_Id":2417705,"Users Score":1,"Answer":"You need to tell mplayer to zoom video according to window size. This can be done either in command line (-zoom) or in the configuration file (zoom = 1).","Q_Score":0,"Tags":"python,gtk,pygtk,mplayer","A_Id":2944206,"CreationDate":"2010-03-10T14:39:00.000","Title":"Dynamic resize with MPlayer and PyGTK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i am using PyQt but my question is a general Qt one:\nI have a QTableWidget that is set up by the function updateTable. It writes the data from DATASET to the table when it is called. Unfortunately this causes my QTableWidget to emit the signal cellChanged() for every cell.\nThe signal cellChanged() is connected to a function on_tableWidget_cellChanged that reads the contents of the changed cell and writes it back to DATASET. This is necessary to allow the user to change the data manually.\nSo everytime the table is updated, its contents are written back to DATASET.\nIs there a way to distinguish if the cell was changed by the user or by updateTable?\ni thought of disconnecting on_tableWidget_cellChanged by updateTable temporarily but that seems to be a little dirty.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":5819,"Q_Id":2431844,"Users Score":1,"Answer":"It seems, that this is the only signal in QTableWidget at least for 4.6. You could post a feature request, but I don't know if it is accepted and you might wait for long time ;-)\nMaybe you could try to write a subclass of QTableWidget and emit own signals, when cell is changed internally.\nAnyway, disconnecting for the time of updating the cell isn't that bad, since you can't connect to specific signal.","Q_Score":4,"Tags":"python,qt,pyqt,signals,qtablewidget","A_Id":2432210,"CreationDate":"2010-03-12T10:02:00.000","Title":"QTableWidget signal cellChanged(): distinguish between user input and change by routines","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i am using PyQt but my question is a general Qt one:\nI have a QTableWidget that is set up by the function updateTable. It writes the data from DATASET to the table when it is called. Unfortunately this causes my QTableWidget to emit the signal cellChanged() for every cell.\nThe signal cellChanged() is connected to a function on_tableWidget_cellChanged that reads the contents of the changed cell and writes it back to DATASET. This is necessary to allow the user to change the data manually.\nSo everytime the table is updated, its contents are written back to DATASET.\nIs there a way to distinguish if the cell was changed by the user or by updateTable?\ni thought of disconnecting on_tableWidget_cellChanged by updateTable temporarily but that seems to be a little dirty.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":5819,"Q_Id":2431844,"Users Score":1,"Answer":"I would recommend changing from a QTableWidget to a QTableView with an appropriate model. From the sounds of it, you have a database or other data object holding and arranging the data anyway, so it would hopefully be fairly easy to do. This would then allow you to distinguish between edits (setData is called on your model) and updates (data is called on your model).","Q_Score":4,"Tags":"python,qt,pyqt,signals,qtablewidget","A_Id":2449334,"CreationDate":"2010-03-12T10:02:00.000","Title":"QTableWidget signal cellChanged(): distinguish between user input and change by routines","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"On a click of a button named \"Add Textbox\" it calls a function which creates a single textbox using (gtk.Entry) function. So each time i click that button it creates a textbox. I have a submit button which should fetches all the values of the text boxes(say 10 textboxes) generated with the name of \"entry\". It works for one textbox but not for multiple. In php we can create dynamix textboxes mentioning as an array name=entry[]. Do we have similar functionality in python ?\nEnviroment : FC10 , Glade 3 , Python 2.5 , GTK.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1035,"Q_Id":2432468,"Users Score":1,"Answer":"You could be a bit clearer, it's not obvious what you do with your GtkEntry after creating it. The easiest thing would be to just add it to a Python list, so you can iterate over all created GtkEntry widgets later.\nOr, you could \"tag\" the widgets with something to make them identifiable, and iterate over the containing widgets (assuming you really do add the widget to a window or something).","Q_Score":0,"Tags":"python,gtk,pygtk,glade","A_Id":2432881,"CreationDate":"2010-03-12T11:55:00.000","Title":"Getting values from Multiple Text Entry using Pygtk and Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a Python+Qt4 application that would ideally need to pop up a window every once in a while, to display pdf documents and allow very basic operations, namely scrolling through the different pages and printing the document.\nI've found the reportLab to create pdf files, but nothing about pdf viewers. Does anyone knows anything that might help. i was really hoping for the existence of something like the QWebView widget...\nthanks in advance to all","AnswerCount":3,"Available Count":1,"Score":-0.0665680765,"is_accepted":false,"ViewCount":6219,"Q_Id":2435470,"Users Score":-1,"Answer":"what about okular? It is a full app, but it can always be call from another app.","Q_Score":8,"Tags":"python,pdf,qt4,pyqt4","A_Id":2435561,"CreationDate":"2010-03-12T19:59:00.000","Title":"pdf viewer for pyqt4 application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to show a webpage (a complex page with script and stuff, no static html) in a frame or something. It's for a desktop application, I'm using python 2.6 + wxPython 2.8.10.1. I need to catch some events too (mostly about changing page). I've found some samples using the webview module in a gtk application, but I couldn't have it works on wx.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":788,"Q_Id":2439039,"Users Score":1,"Answer":"You can embed IE, but I think that's about it. wxWebKit is working on a wx add-on to use WebKit as an embedded browser in wx, but I think it's still a work in progress.","Q_Score":0,"Tags":"python,wxwidgets","A_Id":2439208,"CreationDate":"2010-03-13T16:22:00.000","Title":"how to embed a webpage using wx?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a newbie with a little experience writing in BASIC, Python and, of all things, a smidgeon of assembler (as part of a videogame ROM hack). I wanted to create small tool for modifying the hex values at particular points, in a particular file, that would have a GUI interface.\nWhat I'm looking for is the ability to create small GUI program, that I can distribute as an EXE (or, at least a standalone directory). I'm not keen on the idea of the .NET languages, because I don't want to force people to download a massive .NET framework package. I currently have Python with IDLE and Boa Constructor set up, and the application runs there. I've tried looking up information on compiling a python app that relies on Wxwidgets, but the search results and the information I've found has been confusing, or just completely incomprehensible. \nMy questions are:\n\nIs python a good language to use for this sort of project?\nIf I use Py2Exe, will WxWidgets already be included? Or will my users have to somehow install WxWidgets on their machines? Am I right in thinking at Py2Exe just produces a standalone directory, 'dist', that has the necessary files for the user to just double click and run the application?\nIf the program just relies upon Tkinter for GUI stuff, will that be included in the EXE Py2Exe produces? If so, are their any 'visual' GUI builders \/ IDEs for Python with only Tkinter?\n\nThankyou for your time,\nJBMK","AnswerCount":4,"Available Count":2,"Score":0.1488850336,"is_accepted":false,"ViewCount":640,"Q_Id":2439520,"Users Score":3,"Answer":"If you're not afraid to learn a new language, consider Tcl\/Tk. The reason I mention this is Tcl's superior-to-almost-everything distribution mechanism which makes it really easy to wrap up a single file exe that includes everything you need -- the Tcl\/Tk runtime, your program, icons, sound files, etc. inside an embedded virtual filesystem. And the same technique you use for one platform works for all. You don't have to use different tools for different platforms. \nIf that intrigues you, google for starpack (single file that has it all), starkit (platform-independent application) and tclkit (platform-specific runtime). \nTcl\/Tk isn't everyone's cup of tea, but as a getting-started GUI language it's hard to beat IMO. If it has an Achilles heel is that it has no printing support. It's surprising, though, how many GUIs don't need printing support these days.","Q_Score":7,"Tags":"python,wxwidgets,tkinter,py2exe","A_Id":2440302,"CreationDate":"2010-03-13T18:40:00.000","Title":"As a newbie, where should I go if I want to create a small GUI program?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a newbie with a little experience writing in BASIC, Python and, of all things, a smidgeon of assembler (as part of a videogame ROM hack). I wanted to create small tool for modifying the hex values at particular points, in a particular file, that would have a GUI interface.\nWhat I'm looking for is the ability to create small GUI program, that I can distribute as an EXE (or, at least a standalone directory). I'm not keen on the idea of the .NET languages, because I don't want to force people to download a massive .NET framework package. I currently have Python with IDLE and Boa Constructor set up, and the application runs there. I've tried looking up information on compiling a python app that relies on Wxwidgets, but the search results and the information I've found has been confusing, or just completely incomprehensible. \nMy questions are:\n\nIs python a good language to use for this sort of project?\nIf I use Py2Exe, will WxWidgets already be included? Or will my users have to somehow install WxWidgets on their machines? Am I right in thinking at Py2Exe just produces a standalone directory, 'dist', that has the necessary files for the user to just double click and run the application?\nIf the program just relies upon Tkinter for GUI stuff, will that be included in the EXE Py2Exe produces? If so, are their any 'visual' GUI builders \/ IDEs for Python with only Tkinter?\n\nThankyou for your time,\nJBMK","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":640,"Q_Id":2439520,"Users Score":0,"Answer":"Python would fit your needs.\nwxWidgets and Python are completely different things. I think you mean wxPython, which is a GUI toolkit for Python. I am not sure whether Py2Exe would include this, as I have never used Py2Exe - I build the packages and their dependencies manually.\nPretty sure tkinter would be included. I use tkinter a bit and it works well enough.","Q_Score":7,"Tags":"python,wxwidgets,tkinter,py2exe","A_Id":2440232,"CreationDate":"2010-03-13T18:40:00.000","Title":"As a newbie, where should I go if I want to create a small GUI program?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to know if it's possible to put a frame or a panel over a menubar using wxpython?\nThanks in advance!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":123,"Q_Id":2439677,"Users Score":1,"Answer":"Your only chance is to write some Custom Menu, which could be bit difficult but doable. So basically instead of using system menu etc, you create windows inside your main frame which look like menu.","Q_Score":0,"Tags":"python,wxpython","A_Id":2463869,"CreationDate":"2010-03-13T19:21:00.000","Title":"Is it possible to put a wx.window (frame\/panel) over a wx.MenuBar?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to change the wxpython menubar colours.\nHow can I do it?","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":1776,"Q_Id":2439708,"Users Score":-1,"Answer":"don't think it's doable -- it defaults to the platform's native look","Q_Score":1,"Tags":"python,wxpython","A_Id":2440868,"CreationDate":"2010-03-13T19:30:00.000","Title":"How can we change a wx.MenuBar background and foreground colour using wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have been trying to add some check boxes in a pylons mako. However I don't know how to get their values in the controller. It seems that it can only get the first value of the check boxes. I tried using form encode but i got several errors. Is there an easier way to do this?\nThanks","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1306,"Q_Id":2456926,"Users Score":0,"Answer":"I'm assuming that \"I can only get the first value\" means you've got a series of checkboxes with the same value for the 'name' attribute within your form? \nNow, if that's the case and you're wanting a list of boolean values based on whether or not the boxes are checked or not, you'll need to do two things:\nFirst, when you define your form elements using form encode on your checkbox, set it up such that a missing value on a checkbox element returns 'False.' This way, as the browser won't send a value over unless a checkbox is \"on\", you validation coerces the missing value to False.\n\n\n class Registration(formencode.Schema): \n box = formencode.validators.StringBoolean(if_missing=False)\n\n\nNext, assuming you want a list returned, you'll not be able to name all of your elements the same. Pylons supports a nested structure, though. Look at formencode.variabledecode.NestedVariables. In short, you'll need to define a NestedVariables instance as one of your class attributes and your form 'name' attributes will need to change in order to contain explicit indexes. \nEdit.. here's a complete example I did real quick:\n\n\nimport logging\nimport pprint\n\nimport formencode\nfrom pylons import request, response, session, tmpl_context as c, url\nfrom pylons.controllers.util import abort, redirect\nfrom pylons.decorators import validate\n\nfrom testproj.lib.base import BaseController, render\n\nlog = logging.getLogger(__name__)\n\nclass CheckList(formencode.Schema):\n box = formencode.validators.StringBoolean(if_missing=False)\n hidden = formencode.validators.String()\n\nclass EnclosingForm(formencode.Schema):\n pre_validators = [formencode.NestedVariables()]\n boxes = formencode.ForEach(CheckList())\n\nclass MyformController(BaseController):\n\n def index(self):\n schema = EnclosingForm()\n v = schema.to_python(dict(request.params))\n # Return a rendered template\n #return render('\/myform.mako')\n # or, return a response\n response.content_type = 'text\/plain'\n return pprint.pformat(v)\n\n\n\nAnd then the query string?\n\nboxes-0.box=true&boxes-0.hidden=hidden&boxes-1.box=true&\nboxes-1.hidden=hidden&boxes-2.hidden=hidden\nAnd lastly, the response:\n\n{'boxes': [{'box': True, 'hidden': u'hidden'},\n {'box': True, 'hidden': u'hidden'},\n {'box': False, 'hidden': u'hidden'}]}\n\nHTH","Q_Score":1,"Tags":"python,pylons","A_Id":2457303,"CreationDate":"2010-03-16T18:11:00.000","Title":"Checkboxes with pylons","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I've got a pile of C code that I'd like to unit test using Python's unittest library (in Windows), but I'm trying to work out the best way of interfacing the C code so that Python can execute it (and get the results back). Does anybody have any experience in the easiest way to do it?\nSome ideas include:\n\nWrapping the code as a Python C extension using the Python API\nWrap the C code using SWIG\nAdd a DLL wrapper to the C code and load it into Python using ctypes\nAdd a small XML-RPC server to the c-code and call it using xmlrpclib (yes, I know this seems a bit far-out!)\n\nIs there a canonical way of doing this? I'm going to be doing this quite a lot, with different C modules, so I'd like to find a way which is least effort.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":12704,"Q_Id":2482270,"Users Score":8,"Answer":"I think that the exact solution depends on your code. Not all libraries are easily suitable for wrapping as a DLL. If your is, then ctypes is certainly the easiest way - just make a DLL out of your library and then test it with ctypes. An added bonus is that you now have your library conveniently wrapped as a standalone DLL which helps to decouple your application.\nSometimes, however, a more thorough interaction will be required between your C code and the testing Python code. Then, it's probably best to hook it as an extension, for which SWIG is a pretty good tool that will automate away most things you'll find boring about the process.","Q_Score":25,"Tags":"python,c,unit-testing,swig","A_Id":2489948,"CreationDate":"2010-03-20T07:12:00.000","Title":"Easiest way of unit testing C code with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting a computer graphics course, and I have to choose a language.\nChoices are between C++ and Python. I have no problem with C++, python is a work in progress. So i was thinking to go down the python road, using pyopengl for graphics part.\nI have heard though, that performance is an issue.\nIs python \/ pyopengl mature enough to challenge C++ on performance?\nI realize its a long shot, but I'd like to hear your thoughts, experiences on uses of pyopengl.","AnswerCount":5,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":10480,"Q_Id":2488730,"Users Score":30,"Answer":"It depends a LOT on the contents of your computer graphics course. If you are doing anything like the introductory course I've taught in the past, it's basically spinning cubes and spheres, some texture mapping and some vertex animation, and that's about it. In this case, Python would be perfectly adequate, assuming you can get around the Unpythonic (and, lets be honest, un-C++) OpenGL state-machine paradigm.\nFor things like doing your matrix maths you can use Numpy, the core of which is written in C and is really quite quick. You'll be up and running faster, iterate faster and most likely have more fun.\nIf, however, you are doing some hardcore, cutting edge, millions-of-triangles-per-scene-skinned-animated-everything computer graphics course, stick with C++.\nIf your class has given you the choice it's probably a safe bet that Python will be ok.\nIf you want to leverage your knowledge into a real job in computer graphics though, pretty much every game and graphics engine is written in C or C++, while Python (or Lua) is left as a scripting language.","Q_Score":15,"Tags":"python,c++,opengl,3d,pyopengl","A_Id":2489409,"CreationDate":"2010-03-21T21:10:00.000","Title":"pyopengl: Could it replace c++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm starting a computer graphics course, and I have to choose a language.\nChoices are between C++ and Python. I have no problem with C++, python is a work in progress. So i was thinking to go down the python road, using pyopengl for graphics part.\nI have heard though, that performance is an issue.\nIs python \/ pyopengl mature enough to challenge C++ on performance?\nI realize its a long shot, but I'd like to hear your thoughts, experiences on uses of pyopengl.","AnswerCount":5,"Available Count":2,"Score":0.0798297691,"is_accepted":false,"ViewCount":10480,"Q_Id":2488730,"Users Score":2,"Answer":"Python is an awesome language, but it's not the right tool for graphics. And if you want to do anything remotely advanced you'll have to use unpythonic libraries and will end up with ugly C code written in Python.","Q_Score":15,"Tags":"python,c++,opengl,3d,pyopengl","A_Id":2488775,"CreationDate":"2010-03-21T21:10:00.000","Title":"pyopengl: Could it replace c++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to Python and am starting to teach myself GUI programming (hopefully) using PyQT4.7 and Python 2.6\nI just downloaded the whole PyQT\/QT4 package (including QTDesigner) from the PyQT website, however it seems QTDesigner, which looks amazing to use as a newbie (since you can see all the attributes\/properties\/defaults etc) of each widget and visually edit the properties is great, but PyQT seems not to set QTDesigner to integrate directly with with PyQT and PyQTs python code generation scripts: \ni.e.: Hitting \"View Code\", tries to run the Designer->C++ script called (uic) instead of the pyuic.py script, etc.\nIs there a way to get QTDesigner to integrate closely with PyQT for code generation on the fly like it does with C++?\nIf not, does that mean I have to code the entire QT GUI within my Python IDE and lookup all the documentation and boilerplate code for every widget? (seems very inefficient and inelegant compared to just having QTDesigner+Python integration).\nWhat is the customary toolchain\/\/production flow of using Designer with PyQT? (If no direct integration is possible -- do python+pyQT users just skip using QTDesigner all together and manually write all the QT GUI code in python?)\nAny additional tips\/suggestions for a PyQT newbie would be appreciated. Thanks!\nps I know a bunch of you are probably going to tell me to just suck it up and code all the QT UI by hand, but if I use Designer while learning as asked above, please provide a way to do that so I can learn it more easily, thanks!","AnswerCount":4,"Available Count":2,"Score":0.049958375,"is_accepted":false,"ViewCount":11299,"Q_Id":2489643,"Users Score":1,"Answer":"You can run pyuic (or rather pyuic4) from hand, in your console. You can make your GUI using designer with Python, just as you would do it with C++.\nBy the way: I have written all GUI stuff for my app (10k of code) by hand. I don't really like GUI designers and working with generated code, when you need to tweak something.","Q_Score":20,"Tags":"python,qt4,pyqt4,qt-designer","A_Id":2494652,"CreationDate":"2010-03-22T02:08:00.000","Title":"Using QTDesigner with PyQT and Python 2.6","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to Python and am starting to teach myself GUI programming (hopefully) using PyQT4.7 and Python 2.6\nI just downloaded the whole PyQT\/QT4 package (including QTDesigner) from the PyQT website, however it seems QTDesigner, which looks amazing to use as a newbie (since you can see all the attributes\/properties\/defaults etc) of each widget and visually edit the properties is great, but PyQT seems not to set QTDesigner to integrate directly with with PyQT and PyQTs python code generation scripts: \ni.e.: Hitting \"View Code\", tries to run the Designer->C++ script called (uic) instead of the pyuic.py script, etc.\nIs there a way to get QTDesigner to integrate closely with PyQT for code generation on the fly like it does with C++?\nIf not, does that mean I have to code the entire QT GUI within my Python IDE and lookup all the documentation and boilerplate code for every widget? (seems very inefficient and inelegant compared to just having QTDesigner+Python integration).\nWhat is the customary toolchain\/\/production flow of using Designer with PyQT? (If no direct integration is possible -- do python+pyQT users just skip using QTDesigner all together and manually write all the QT GUI code in python?)\nAny additional tips\/suggestions for a PyQT newbie would be appreciated. Thanks!\nps I know a bunch of you are probably going to tell me to just suck it up and code all the QT UI by hand, but if I use Designer while learning as asked above, please provide a way to do that so I can learn it more easily, thanks!","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":11299,"Q_Id":2489643,"Users Score":0,"Answer":"QtDesigner uses uic.exe to generate on the fly C++ code. uic.exe is a command-line tool, it gets file names as input parameters. For integration with python, you can write a python program that uses pyuic.py, match it inputs with uic.exe's input (order, switchs etc.), convert it to an executable (using py2exe) and rename the executable to uic.exe. then replace it with uic.exe in Qt's bin directory (uic.exe dont exist in PyQt as I know). You should just be careful about input arguments of uic.exe and your hand-written macro (they should match together).\nI think your program will need to know python's path (in order to use pyuic). if you are using windows, you could obtain the path from registry.","Q_Score":20,"Tags":"python,qt4,pyqt4,qt-designer","A_Id":3595979,"CreationDate":"2010-03-22T02:08:00.000","Title":"Using QTDesigner with PyQT and Python 2.6","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am dealing with image buffers, and I want to be able to access data a few lines into my image for analysis with a c library. I have created my 8-bit pixel buffer in Python using create_string_buffer. Is there a way to get a pointer to a location within that buffer without re-creating a new buffer? My goal is to analyze and change data within that buffer in chunks, without having to do a lot of buffer creation and data copying.\nIn this case, ultimately, the C library is doing all the manipulation of the buffer, so I don't actually have to change values within the buffer using Python. I just need to give my C function access to data within the buffer.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3210,"Q_Id":2494288,"Users Score":0,"Answer":"You can also use ctypes.cast(buf, ctypes.c_void_p)","Q_Score":5,"Tags":"python,ctypes","A_Id":2494539,"CreationDate":"2010-03-22T17:18:00.000","Title":"ctypes and pointer manipulation","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Hello fellow software developers.\nI want to distribute a C program which is scriptable by embedding the Python interpreter.\nThe C program uses Py_Initialize, PyImport_Import and so on to accomplish Python embedding.\nI'm looking for a solution where I distribute only the following components: \n\nmy program executable and its libraries\nthe Python library (dll\/so) \na ZIP-file containing all necessary Python modules and libraries.\n\nHow can I accomplish this? Is there a step-by-step recipe for that?\nThe solution should be suitable for both Windows and Linux.\nThanks in advance.","AnswerCount":6,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5060,"Q_Id":2494468,"Users Score":0,"Answer":"There's a program called py2exe. I don't know if it's only available for Windows. Also, the latest version that I used does not wrap everything up into one .exe file. It creates a bunch of stuff that has to be distributed - a zip file, etc..","Q_Score":11,"Tags":"python,c,dll,distribution","A_Id":2540638,"CreationDate":"2010-03-22T17:43:00.000","Title":"How to create an application which embeds and runs Python code without local Python installation?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Any ideas how I can display an image file (bmp or png) centered on the screen as an application splash screen when running a Windows console script based on a batch file, vbscript\/wscript or Python console script?\nI'm not interested in a wxPython solution - that's too much overhead just to implement a cosmetic feature like a splash screen.\nThank you,\nMalcolm","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5541,"Q_Id":2502385,"Users Score":0,"Answer":"Try TK, it is included with python. Also, PyGtk is lighter than wxPython, but I ended up bitting the bullet and using wxPython for the same purpose recently, it is heavy, but it didn't have any affect on the script performance.","Q_Score":2,"Tags":"python,image,vbscript,batch-file,console-application","A_Id":2502963,"CreationDate":"2010-03-23T18:02:00.000","Title":"Display an image as a splash screen when running Windows batch file, vbscript\/wscript or Python console script","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"How to create pygtk entry with placeholder like in HTML 5 input element?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":981,"Q_Id":2503562,"Users Score":1,"Answer":"You can use PyGobject instead of pygtk, and then setting a placeholder is a piece of cake:\n entry.set_placeholder_text(\"some string\")","Q_Score":3,"Tags":"python,pygtk","A_Id":14070047,"CreationDate":"2010-03-23T20:56:00.000","Title":"Pygtk entry placeholder","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have FigureCanvasWxAgg instance with a figure displayed on a frame. If user clicks on the canvas another frame with a new FigureCanvasWxAgg containing the same figure will be shown. By now closing the new frame can result in destroying the C++ part of the figure so that it won't be available for the first frame. \nHow can I save the figure? Python deepcopy from copy module does't work in this case.\nThanks in advance.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1759,"Q_Id":2513786,"Users Score":1,"Answer":"I'm not familiar with the inner workings, but could easily imagine how disposing of a frame damages the figure data. Is it expensive to draw? Otherwise I'd take the somewhat chickenish approach of simply redrawing it ;)","Q_Score":8,"Tags":"python,wxpython,copy,matplotlib","A_Id":3120753,"CreationDate":"2010-03-25T07:45:00.000","Title":"How to copy matplotlib figure?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running python 2.6.5 and pygame 1.9.1 It seems to me I've tried everything but it keeps showing 'module not found' errors... Please help!","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":997,"Q_Id":2541254,"Users Score":1,"Answer":"Well I've just finished installing it on my Mac - you have to watch out for the Python Platform under Tools and File. The default is Jython, but you want to change it to point to your python version in the Frameworks file of your Library.\nDoes that make sense?","Q_Score":0,"Tags":"python,netbeans,import,module,pygame","A_Id":2908642,"CreationDate":"2010-03-29T21:01:00.000","Title":"Can't import pygame to Netbeans on Mac","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know how to reference an existing .dll to IronPython, but is there any way to add my project as a reference like I can between Visual Studio projects?\nOr is it best practice to create a separate class library?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1069,"Q_Id":2550370,"Users Score":3,"Answer":"You can't add reference to a project since it's a Visual Studio thing. \nI suggest that during the development process, call import (IronPython) or require (IronRuby) with the full path of your project assembly like c:\\dev\\MyProject\\bin\\Debug\\MyProject.dll.","Q_Score":2,"Tags":"c#,visual-studio,ironpython,ironruby","A_Id":2550627,"CreationDate":"2010-03-31T03:45:00.000","Title":"Any way to add my C# project as a reference in IronPython \/ IronRuby?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been browsing documentation, but haven't been able to find a straightforward tutorial, so I apologize if this is a really simple question.\nAnyway, I have eclipse with pydev installed on MAC OSX, and I want configure wxPython to work with eclipse, how do I do this? Once I've downloaded wxpython, what steps do I take to allow wxPython development from eclipse?\nThanks!","AnswerCount":3,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":8700,"Q_Id":2561542,"Users Score":3,"Answer":"wxPython install by default to the following path \/usr\/local\/lib\/wxPython-2.9.4.0\nWhen adding a path to the Interpreter libraries section in the eclipse preferences add this path: \n\/usr\/local\/lib\/wxPython-2.9.4.0\/lib\/python2.7\/site-packages\/wx-2.9.4-osx_cocoa","Q_Score":3,"Tags":"python,eclipse,wxpython","A_Id":12983874,"CreationDate":"2010-04-01T15:28:00.000","Title":"Configuring Eclipse with wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I've been browsing documentation, but haven't been able to find a straightforward tutorial, so I apologize if this is a really simple question.\nAnyway, I have eclipse with pydev installed on MAC OSX, and I want configure wxPython to work with eclipse, how do I do this? Once I've downloaded wxpython, what steps do I take to allow wxPython development from eclipse?\nThanks!","AnswerCount":3,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":8700,"Q_Id":2561542,"Users Score":7,"Answer":"Vinay's answer above is correct. However, if code completion is not picking it up, you might need to add the WX directory to the Pydev's interpreter library path.\n\nWindow | Preferences | Pydev |\n Interpreter - Python | Libraries\n\nIf wx is not present, New Folder and select the install directory.","Q_Score":3,"Tags":"python,eclipse,wxpython","A_Id":2562141,"CreationDate":"2010-04-01T15:28:00.000","Title":"Configuring Eclipse with wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm using gtk.combo_box_new_text() to make combobox list, this uses a gtk.ListStore to store only strings, so there are some way to add a separator between items without use a complex gtk.TreeModel? \nIf this is not possible, what is the simplest way to use a gtk.TreeModel to able secuential widget addition?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":825,"Q_Id":2571202,"Users Score":4,"Answer":"I think that you should use ComboBox.set_row_separator_func to set a separator function where you would determine which items of your list will be separators. Since ListStore implements TreeModel interface, you should have no problem simply using it in your case.\nP.S.: nothing is easy in GTK :)","Q_Score":4,"Tags":"python,user-interface,gtk,pygtk,gnome","A_Id":2571279,"CreationDate":"2010-04-03T12:07:00.000","Title":"How to add a separator in a PyGTK combobox?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. \nIn Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods. I have no problems being able to create a single selection of text. I am, however, unable to find a way to create multiple selections. The methods in Qt4 do not have an argument which allows you to set a selection id, nor can i find any other function in the QTextCursor or QTextEdit which looks like it might allow me to do so. \nHas this feature been completely removed from Qt4? or has is there a new and different way of doing it?\nThanks.\nRonny","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1173,"Q_Id":2574195,"Users Score":0,"Answer":"How about creating multiple cursors (QTextCursor), each selection a different portion of the text. Would that work for you?","Q_Score":1,"Tags":"python,qt,qt4,pyqt","A_Id":2574214,"CreationDate":"2010-04-04T10:55:00.000","Title":"how to create multiple selections in text edit box in qt4?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. \nIn Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods. I have no problems being able to create a single selection of text. I am, however, unable to find a way to create multiple selections. The methods in Qt4 do not have an argument which allows you to set a selection id, nor can i find any other function in the QTextCursor or QTextEdit which looks like it might allow me to do so. \nHas this feature been completely removed from Qt4? or has is there a new and different way of doing it?\nThanks.\nRonny","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1173,"Q_Id":2574195,"Users Score":1,"Answer":"The solution, i realise now is actually quite simple. \nTo graphically visualise all the various selections (separate QTextCursor objects), instead of calling the setTextCursor() method for the QTextEdit widget for each of the selections, i change the background color of each of those sections of text by calling the setCharFormat() method for each of those QTextCursor objects.","Q_Score":1,"Tags":"python,qt,qt4,pyqt","A_Id":2574559,"CreationDate":"2010-04-04T10:55:00.000","Title":"how to create multiple selections in text edit box in qt4?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to display a gtk.Image with a high level of zoom, but scale the image to a new pixbuf with the gtk.gdk.Pixbuf methods waste a lot of memory and processor.\nAre there some simply way to display a zoomed image?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":822,"Q_Id":2581687,"Users Score":1,"Answer":"it is not possible with gdk, i'm afraid.\ntry cairo or opengl.","Q_Score":1,"Tags":"python,gtk,pygtk,gnome","A_Id":2586546,"CreationDate":"2010-04-05T23:00:00.000","Title":"Zoomed PyGTK image without scale pixbuf","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know what Cythons purpose is. It's to write compilable C extensions in a Python-like language in order to produce speedups in your code. What I would like to know (and can't seem to find using my google-fu) is if Cython can somehow compile into an executable format since it already seems to break python code down into C.\nI already use Py2Exe, which is just a packager, but am interested in using this to compile down to something that is a little harder to unpack (Anything packed using Py2EXE can basically just be extracted using 7zip which I do not want)\nIt seems if this is not possible my next alternative would just be to compile all my code and load it as a module and then package that using py2exe at least getting most of my code into compiled form, right?","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":37475,"Q_Id":2581784,"Users Score":1,"Answer":"Aftershock's answer is good, what I want to say is about run app without console. Most like Aftershock's answer, if you want your application run without console, two points are important:\n\nReplace all the main() function in the \".c\" file made by cython --embed with wmain()\nAdd \/subsystem:windows \/entry:wmainCRTStartup to the end of cl.exe ... command","Q_Score":53,"Tags":"python,compilation,cython","A_Id":50452413,"CreationDate":"2010-04-05T23:34:00.000","Title":"Can Cython compile to an EXE?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"A line created using the DrawLine method of wx.DC has the onClick and onMouseOver events?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":81,"Q_Id":2583646,"Users Score":0,"Answer":"No wx.DC just draw to a device and those are all plain pixels, wx.DC doesn't track mouse events or any other events.\nIf you want such behavior you will have to track mouse movement on your drawing area and on click check which area it may have clicked e.g. if near by the line show a msg etc.","Q_Score":0,"Tags":"python,wxpython","A_Id":2583745,"CreationDate":"2010-04-06T08:58:00.000","Title":"Does wx.DC line has events?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For some code as follows, \n\n opts, args = getopt.getopt(sys.argv[1:], \"c:\", ...\n for o,v in opts:\n...\n elif o in (\"-c\", \"--%s\" % checkString):\n kCheckOnly = True\n clientTemp = v\n\nIf I don't give the parameter after the -c, I get the error messages as follows.\n\nTraceback (most recent call last):\n File \"niFpgaTimingViolationMain.py\", line 100, in \n opts, args = getopt.getopt(sys.argv[1:], \"hdc:t:\",[helpString, debugString, checkString, twxString])\n File \"\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.6\/lib\/python2.6\/getopt.py\", line 91, in getopt\n opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])\n File \"\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.6\/lib\/python2.6\/getopt.py\", line 195, in do_shorts\n opt)\ngetopt.GetoptError: option -c requires argument\n\nIs there any way to catch this error, and process it to print something like this? It seems that just wrapping the code in try\/except doesn't work.\n\nERROR: You forgot to give the file name after -c option","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":752,"Q_Id":2585803,"Users Score":3,"Answer":"You can catch getopt.GetoptError and check the 'opt' and 'msg' attributes yourself:\n\ntry:\n opts, args = getopt.getopt(sys.argv[1:], \"c:\", ...\nexcept getopt.GetoptError, e:\n if e.opt == 'c' and 'requires argument' in e.msg:\n print >>sys.stderr, 'ERROR: You forgot to give the file name after -c option'\n sys.exit(-1)","Q_Score":2,"Tags":"python,getopt","A_Id":2585839,"CreationDate":"2010-04-06T14:52:00.000","Title":"How to process python generated error messages my own way?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For some code as follows, \n\n opts, args = getopt.getopt(sys.argv[1:], \"c:\", ...\n for o,v in opts:\n...\n elif o in (\"-c\", \"--%s\" % checkString):\n kCheckOnly = True\n clientTemp = v\n\nIf I don't give the parameter after the -c, I get the error messages as follows.\n\nTraceback (most recent call last):\n File \"niFpgaTimingViolationMain.py\", line 100, in \n opts, args = getopt.getopt(sys.argv[1:], \"hdc:t:\",[helpString, debugString, checkString, twxString])\n File \"\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.6\/lib\/python2.6\/getopt.py\", line 91, in getopt\n opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])\n File \"\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.6\/lib\/python2.6\/getopt.py\", line 195, in do_shorts\n opt)\ngetopt.GetoptError: option -c requires argument\n\nIs there any way to catch this error, and process it to print something like this? It seems that just wrapping the code in try\/except doesn't work.\n\nERROR: You forgot to give the file name after -c option","AnswerCount":2,"Available Count":2,"Score":0.2913126125,"is_accepted":false,"ViewCount":752,"Q_Id":2585803,"Users Score":3,"Answer":"the correct answer is to use the OptionParser module instead of trying to \"roll your own\".","Q_Score":2,"Tags":"python,getopt","A_Id":2585858,"CreationDate":"2010-04-06T14:52:00.000","Title":"How to process python generated error messages my own way?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Looking at Python modules and at code in the \"lib-dnyload\" directory in the Python framework, I noticed whenever code is creating some kind of GUI or graphic it imports a non-Python file with a .so extension. And there are tons .so files in \"lib-dnyload\". \nFrom googling things I found that these files are called shared objects and are written in C or C++. I have a Mac and I use GCC. How do I make shared object files that are accessible via Python? Mainly just how to make shared objects with GCC using Mac OS X.","AnswerCount":5,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":4363,"Q_Id":2610421,"Users Score":0,"Answer":"You can write python extensions in many ways, including Cython, SWIG, boost.python ...\nYou can also write a shared library and use the \"ctypes\" library to access it.","Q_Score":1,"Tags":"python,macos,gcc,distutils,shared-objects","A_Id":2611684,"CreationDate":"2010-04-09T19:44:00.000","Title":"How to create make .so files from code written in C or C++ that are usable from Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"There is a python module called \"_Qt\". PyQt is not what I want. I was wondering if there was any documentation for the _Qt module installed with python as a standard module. I have a mac.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":232,"Q_Id":2611593,"Users Score":0,"Answer":"That's QuickTime, nothing to do with Qt.\nIn your question it's not really clear if you intended to use Qt or QuickTime.","Q_Score":0,"Tags":"python,qt,module","A_Id":2611862,"CreationDate":"2010-04-09T23:28:00.000","Title":"How to use the _Qt python module?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to put together a simple program that will let me visualize a series of consecutive cuts on a wood panel using a router with a particular cutting head. I'm trying to find a geometry library that is capable of subtractively modifying 3D shapes or solids by sweeping other 3D solids through them.\nSpecifically, I'd like to be able to define a rectangular solid (the wood panel) and then define a bit profile shape, and take cuts through the rectangular solid (sometimes on a straight line, sometimes on a circular arc). Does anyone know of anything that will do this?","AnswerCount":8,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2504,"Q_Id":2611606,"Users Score":0,"Answer":"While not exactly a library, one way of doing this might be to build on top of the 2D-to-3D extrusion ability that most of these libraries do support. A tentative algorithm for doing this might be:\n\nGet bit profile as a 2D shape (you're likely to have this already).\nExtrude that profile along the line or arc that is the toolpath, creating a 3D solid that is the shape of the cut.\nAt each vertex (say, where a straight path joins a curved one), do a \"rotate extrude\" or \"revolve extrude\" of the bit profile to generate the corner radius -- most libraries should support this operation as well.\nRepeat from 2 until done with all toolpaths.\nDo a CSG boolean subtraction of (workpiece - set_of_toolpaths).\n\nThat algorithm seems like it might be fraught with edge cases, but I haven't been able to think of any so far. I'm wondering why, if it's this simple, there aren't more packages already doing it.","Q_Score":2,"Tags":"c++,python,geometry,cad","A_Id":10033868,"CreationDate":"2010-04-09T23:31:00.000","Title":"Subtractively sweep a solid through another in python (or C++)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I do understand that this topic has been covered in some way at StackOverflow but I'm still not able to figure out the exact answer: can I treat IronPython as a Pythonic replacement to C#?\nI use CPython every day, I love the Zen :) but my current task is a Windows-only application with a complex GUI and some other features which I would like to implement using .NET.","AnswerCount":6,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":1073,"Q_Id":2617007,"Users Score":13,"Answer":"IronPython is NOT equivalent to \"other languages that run on .NET\", as the language has support for substantially fewer CLR runtime features.\nIronPython classes are not \"real\" .NET classes, and DLR APIs need to be used when calling IronPython code from traditional CLR-based languages; this means that if you want genuinely easy interoperability, you're stuck writing glue to \"hide\" the DLR.\nBoo is a much more complete Pythonically-inspired language targeting the CLR. Its (dynamically inferrable) static typing (which can be replaced with duck typing on a variable-by-variable basis) also allows libraries written in Boo to be natively used from C# and other CLR-based languages, without needing to make any allowances for the language in use.","Q_Score":12,"Tags":"python,.net,ironpython,cpython,python.net","A_Id":2617936,"CreationDate":"2010-04-11T12:38:00.000","Title":"Can I treat IronPython as a Pythonic replacement to C#?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I do understand that this topic has been covered in some way at StackOverflow but I'm still not able to figure out the exact answer: can I treat IronPython as a Pythonic replacement to C#?\nI use CPython every day, I love the Zen :) but my current task is a Windows-only application with a complex GUI and some other features which I would like to implement using .NET.","AnswerCount":6,"Available Count":4,"Score":0.0333209931,"is_accepted":false,"ViewCount":1073,"Q_Id":2617007,"Users Score":1,"Answer":"The question \"Can I treat IronPython as a Pythonic replacement for C#?\" has been answered pretty well by jalf. If the question were \"Is IronPython a Pythonic .NET Language?\" though, then the answer would absolutely be yes. The principles of Zen - esp. least surprise - absolutely apply to IronPython's integration with the CLR as well.","Q_Score":12,"Tags":"python,.net,ironpython,cpython,python.net","A_Id":2617900,"CreationDate":"2010-04-11T12:38:00.000","Title":"Can I treat IronPython as a Pythonic replacement to C#?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I do understand that this topic has been covered in some way at StackOverflow but I'm still not able to figure out the exact answer: can I treat IronPython as a Pythonic replacement to C#?\nI use CPython every day, I love the Zen :) but my current task is a Windows-only application with a complex GUI and some other features which I would like to implement using .NET.","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1073,"Q_Id":2617007,"Users Score":0,"Answer":"\"Complex\" UI usually entails not \"writing\" it but building it within Visual Studio with point and click. All the callbacks and eventing code is inserted by itself. There is almost nothing like that on python side. I'd say go for C# straight out.\nThere is one nagging thing though. If you are true Pythonista, the static typing will get to you very very quickly and you will want to start throwing heavy objects at random people.\nIf that point comes think about building out the UI with C# and embedding IronPython as a scripting engine for implementing your business logic. That could be a tolerable middle ground.","Q_Score":12,"Tags":"python,.net,ironpython,cpython,python.net","A_Id":3042636,"CreationDate":"2010-04-11T12:38:00.000","Title":"Can I treat IronPython as a Pythonic replacement to C#?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I do understand that this topic has been covered in some way at StackOverflow but I'm still not able to figure out the exact answer: can I treat IronPython as a Pythonic replacement to C#?\nI use CPython every day, I love the Zen :) but my current task is a Windows-only application with a complex GUI and some other features which I would like to implement using .NET.","AnswerCount":6,"Available Count":4,"Score":1.0,"is_accepted":false,"ViewCount":1073,"Q_Id":2617007,"Users Score":10,"Answer":"That depends on what it is about C# that you need, and which needs replacing.\nIf the reason you use C# is that you need a reasonably high performance statically typed language then no, IronPython is likely not going to be a replacement.\nIf the reason you use it is simply \"I need something that runs on .NET and can access .NET libraries\", then yes, any language that runs on .NET can be used to replace it.\nIf you use C# because you're working with a team of programmers who only know C-like languages, C# might also be difficult to replace with IronPython.\nIt depends on what characteristics about C# it is that you care about, and need to find replacements for.","Q_Score":12,"Tags":"python,.net,ironpython,cpython,python.net","A_Id":2617019,"CreationDate":"2010-04-11T12:38:00.000","Title":"Can I treat IronPython as a Pythonic replacement to C#?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The PyQt4 QTableWidget has both cellPressed and cellClicked signals. From the name, and the little experimentation I did with them, they appear to do exactly the same thing. Is there a difference between the two?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1577,"Q_Id":2619446,"Users Score":3,"Answer":"These signals on cells are not sharply documented (that I can find) but I'd interpret them by analogy with the pressed, clicked, and released signals on buttons:\npressed means the mouse's left button's been pressed down inside the widget,\nreleased means the mouse's left button's been released (let up) inside the widget,\nclicked means the mouse's left button's been pressed, then released (let up), both inside the widget\nSo if you press the button down inside the widget, hold it down, move the mouse elsewhere, and only then release the mouse's button, then you should only see the pressed signal, but neither of the other two; while any clicked signal always implies both pressed and released have also been signaled.\nI believe that normal UI behavior should be to respond to clicked only, unless you want to do something special if the button's pressed and not released for a certain time (i.e., held down for a prolonged time).","Q_Score":1,"Tags":"python,pyqt4","A_Id":2619472,"CreationDate":"2010-04-12T01:43:00.000","Title":"Difference between cellPressed and cellClicked signals of PyQt4 QTableWidget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"As per the title, is there any way to programatically change the selected item in a ComboBox and have it raise an event?\nI am setting the selected item using myComboBox.SetSelection(index), but this doesn't raise the wx.EVT_COMBOBOX event.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1192,"Q_Id":2629841,"Users Score":0,"Answer":"I use C++ version of wxWidget. Look up documentation on these two functions:\nvoid wxPostEvent(wxEvtHandler *dest, wxEvent& event)\nvoid AddPendingEvent(wxEvent& event)","Q_Score":1,"Tags":"combobox,wxpython,wxwidgets","A_Id":2629895,"CreationDate":"2010-04-13T13:23:00.000","Title":"Triggering wx.EVT_COMBOBOX after programatically changing ComboBox selection?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I always see people mention that \"Python binding\" and \"C Sharp binding\" etc. when I am actually using their C++ libraries. What does binding mean? If the library is written in C, and does Python binding means that they use SWIG kind of tool to mock a Python interface?\nNewbie in this field, and any suggestion will be welcomed.","AnswerCount":4,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1840,"Q_Id":2632466,"Users Score":0,"Answer":"In short, yes. A binding is just that, an interface to a library or program written in another language, though it need not be generated using SWIG.\nSWIG is just a tool for automatic generation of the same...","Q_Score":6,"Tags":"c++,python,binding","A_Id":2632489,"CreationDate":"2010-04-13T19:11:00.000","Title":"What does binding mean exactly?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I always see people mention that \"Python binding\" and \"C Sharp binding\" etc. when I am actually using their C++ libraries. What does binding mean? If the library is written in C, and does Python binding means that they use SWIG kind of tool to mock a Python interface?\nNewbie in this field, and any suggestion will be welcomed.","AnswerCount":4,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":1840,"Q_Id":2632466,"Users Score":2,"Answer":"When someone talks about something like a \"C# binding\" of a library, they are indicating that you and API is being provided in C# for a library written in a different language. This may or may not involve an autogeneration tool like SWIG.","Q_Score":6,"Tags":"c++,python,binding","A_Id":2632491,"CreationDate":"2010-04-13T19:11:00.000","Title":"What does binding mean exactly?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I always see people mention that \"Python binding\" and \"C Sharp binding\" etc. when I am actually using their C++ libraries. What does binding mean? If the library is written in C, and does Python binding means that they use SWIG kind of tool to mock a Python interface?\nNewbie in this field, and any suggestion will be welcomed.","AnswerCount":4,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1840,"Q_Id":2632466,"Users Score":0,"Answer":"You're right, for a general library, a \"binding\" essentially means \"easily callable from\". The binding may or may not have been created with SWIG, that's just one way to do it.","Q_Score":6,"Tags":"c++,python,binding","A_Id":2632492,"CreationDate":"2010-04-13T19:11:00.000","Title":"What does binding mean exactly?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I always see people mention that \"Python binding\" and \"C Sharp binding\" etc. when I am actually using their C++ libraries. What does binding mean? If the library is written in C, and does Python binding means that they use SWIG kind of tool to mock a Python interface?\nNewbie in this field, and any suggestion will be welcomed.","AnswerCount":4,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":1840,"Q_Id":2632466,"Users Score":0,"Answer":"If the library is written in C, and\n does Python binding means that they\n use SWIG kind of tool to mock a Python\n interface?\n\nYes, you are right. That will be called a Python binding of the respective library.","Q_Score":6,"Tags":"c++,python,binding","A_Id":2632493,"CreationDate":"2010-04-13T19:11:00.000","Title":"What does binding mean exactly?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I'm going through the beginning stages of producing a game in Python, and I'm looking for a library that is able to manipulate pixels and blit them relatively fast.\nMy first thought was pygame, as it deals in pure 2D surfaces, but it only allows pixel access through pygame.get_at(), pygame.set_at() and pygame.get_buffer(), all of which lock the surface each time they're called, making them slow to use. I can also use the PixelArray and surfarray classes, but they are locked for the duration of their lifetimes, and the only way to blit them to a surface is to either copy the pixels to a new surface, or use surfarray.blit_array, which requires creating a subsurface of the screen and blitting it to that, if the array is smaller than the screen (if it's bigger I can just use a slice of the array, which is no problem).\nI don't have much experience with PyOpenGL or Pyglet, but I'm wondering if there is a faster library for doing pixel manipulation in, or if there is a faster method, in Pygame, for doing pixel manupilation. I did some work with SDL and OpenGL in C, and I do like the idea of adding vertex\/fragment shaders to my program.\nMy program will chiefly be dealing in loading images and writing\/reading to\/from surfaces.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2106,"Q_Id":2633900,"Users Score":0,"Answer":"I checked out pyglet, and saw that it works well for static per pixel collision, when the image is not manipulated too much; however, I'm not sure how well it works with a dynamic image.\nIn short, I'm looking for a library that's able to quickly display a buffer of pixels. This buffer will be constantly changing, so fast access and blitting is essential. This could be done in C with relative ease using SDL; however, I'm looking for a similar method in Python. I'm not even too worried about hardware acceleration at this point, although it would certainly be nice.","Q_Score":2,"Tags":"python","A_Id":2634849,"CreationDate":"2010-04-13T23:28:00.000","Title":"Python pixel manipulation library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Frustrated by lack of a simple ACDSee equivalent for OS X, I'm looking to hack one up for myself. I'm looking for a gui library that accommodates:\n\nFull screen image display\nHigh quality image fit-to-screen (for display)\nLow memory usage\nFast display\nReasonable learning curve (the simpler the better)\n\nLooks like there are several choices, so which is the best? Here are some I've run across:\n\nPyOpenGL\nPyGame\nPyQT\nwxpython\n\nI don't have any particular experience with any of these, nor any strong desire to become an expert - I'm looking for the simplest solution.\nWhat do you recommend?\n[Update]\nFor those not familiar with ACDSee, here's what it does that I care about:\n\nSimple list\/thubmnail display of images in a directory\nSort by name\/size\/type\nAbility to view images full screen\nSingle-key delete while viewing full screen\nMove to next\/previous image while viewing full screen\nAbility to select a group of images for: \n\n\nmove to \/ copy to directory\ndelete\nresize\n\n\nACDSee has a bunch of niceties as well, such as remembering directories you've moved images to in the past, remembering your resize settings, displaying the total size of the images you've selected, etc.\nI've tried most of the options I could find (including Xee) and none of them quite get there. Please keep in mind that this is a programming\/library question, not a criticism of any of the existing tools.","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1562,"Q_Id":2634119,"Users Score":0,"Answer":"Use an App like Picasa (now available on mac). Use AppleScript through Python to control it from your application.\nFailing that, use PyObjC to create Cocoa image display component and dialogs, and so on.","Q_Score":3,"Tags":"python,macos,opengl,wxpython,pyqt","A_Id":2999881,"CreationDate":"2010-04-14T00:24:00.000","Title":"Python: OSX Library for fast full screen jpg\/png display","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Frustrated by lack of a simple ACDSee equivalent for OS X, I'm looking to hack one up for myself. I'm looking for a gui library that accommodates:\n\nFull screen image display\nHigh quality image fit-to-screen (for display)\nLow memory usage\nFast display\nReasonable learning curve (the simpler the better)\n\nLooks like there are several choices, so which is the best? Here are some I've run across:\n\nPyOpenGL\nPyGame\nPyQT\nwxpython\n\nI don't have any particular experience with any of these, nor any strong desire to become an expert - I'm looking for the simplest solution.\nWhat do you recommend?\n[Update]\nFor those not familiar with ACDSee, here's what it does that I care about:\n\nSimple list\/thubmnail display of images in a directory\nSort by name\/size\/type\nAbility to view images full screen\nSingle-key delete while viewing full screen\nMove to next\/previous image while viewing full screen\nAbility to select a group of images for: \n\n\nmove to \/ copy to directory\ndelete\nresize\n\n\nACDSee has a bunch of niceties as well, such as remembering directories you've moved images to in the past, remembering your resize settings, displaying the total size of the images you've selected, etc.\nI've tried most of the options I could find (including Xee) and none of them quite get there. Please keep in mind that this is a programming\/library question, not a criticism of any of the existing tools.","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1562,"Q_Id":2634119,"Users Score":0,"Answer":"it's not an answer to your coding question but for (a big part of) the lack of ACDsee equivalent (requires OSX 10.5+):\n\nSimple list\/thubmnail display of images in a directory: Finder.app\nSort by name\/size\/type: Finder.app will do name & type, not image size (but does file size)\nAbility to view images full screen: quick preview (spacebar \/ eye icon)\nSingle-key delete while viewing full screen: command-backspace while viewing in quickpreview, both windowed and fullscreen\nMove to next\/previous image while viewing full screen: both quickprewiew (after selecting a group of images or whole directory with cmd-a) and Preview.app\nAbility to select a group of images for[...]: Finder.app will does all but resize\n\nseems like you have everything except resize just pressing the spacebar while in finder.\nPreview.app will resize both a single image or multiple ones in one batch.","Q_Score":3,"Tags":"python,macos,opengl,wxpython,pyqt","A_Id":2647147,"CreationDate":"2010-04-14T00:24:00.000","Title":"Python: OSX Library for fast full screen jpg\/png display","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to use boost.python library in a C++ project (Windows + VS9) but it always tries to link against pyton25.lib.\nIs it possible to link with version 2.6.x of python?\nthanks","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":712,"Q_Id":2635933,"Users Score":0,"Answer":"You could try putting -lpython26 when linking","Q_Score":2,"Tags":"python,boost","A_Id":2636724,"CreationDate":"2010-04-14T08:35:00.000","Title":"boost python version","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to use boost.python library in a C++ project (Windows + VS9) but it always tries to link against pyton25.lib.\nIs it possible to link with version 2.6.x of python?\nthanks","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":712,"Q_Id":2635933,"Users Score":1,"Answer":"You need to recompile boost-python library pointing Boost.Build to needed python version.\nP.S. This heals a problem of undefined references while linking with library needed. I beleive you've already turned of autolinking.","Q_Score":2,"Tags":"python,boost","A_Id":2636711,"CreationDate":"2010-04-14T08:35:00.000","Title":"boost python version","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Where can I download this programm?","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":324,"Q_Id":2640880,"Users Score":4,"Answer":"Any recent version of Python should come with Tkinter support. To my knowledge, you shouldn't need to install anything else.","Q_Score":0,"Tags":"python,installation,download,tkinter","A_Id":2640895,"CreationDate":"2010-04-14T20:41:00.000","Title":"Installation of Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I haven't gotten far enough into Python to make GUIs yet, so I thought I'd ask here. Can a python app be made with the windows default style GUI, or will it have its own style? The only screenshots I've seen of a python app running with a GUI had this ugly win95 look to it.","AnswerCount":5,"Available Count":1,"Score":0.1194272985,"is_accepted":false,"ViewCount":6722,"Q_Id":2649882,"Users Score":3,"Answer":"Yes, you can use PyQt, or PySide (another Qt binding), or wxPython. They all support native look & feel.\nThere's also PyGTK, but gtk apps don't to look so native ..\nI personally prefer Qt, so I'd suggest PyQt. If you have issues with the GPL, then you can use PySide (LGPL).","Q_Score":16,"Tags":"python,user-interface","A_Id":2649957,"CreationDate":"2010-04-16T00:34:00.000","Title":"Can a native-looking GUI be made with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking to do some basic encryption of server messages which would be encrypted with C++ and decrypted using Python server side. I was wondering if anyone knew if there were good solutions that were simpler or more lightweight than Keyczar. I see that supports both C++ and python, but would using Crypto++ and PyCrypto be simpler for a newbie that just wants to get something up and running for the time being?\nOr should I use Keyczar for python and Crypto++ for the C++ end? The C++ libraries seem to have dependencies to hundreds of files.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":942,"Q_Id":2650073,"Users Score":2,"Answer":"The C++ libraries seem to have dependencies to hundreds of files.\nI don't know much about Python, but that is absolutely normal for C++. I'd recommend Crypto++ -- it's a great easy to use library, and it's public domain, meaning you won't have any license problems with it.\nEDIT: Keep in mind a large library with lots of code does not mean that you're going to pay in terms of object code. If there are functions you don't use (Crypto++ supports hundreds of algorithms) they won't be compiled into the resulting binary.","Q_Score":1,"Tags":"python,c++,encryption,cryptography","A_Id":2650311,"CreationDate":"2010-04-16T01:41:00.000","Title":"Lightweight cryptography toolkit(s) for C++ and Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to include a rich text editor in a pygtk drawing area for an application i am developing. The editor ( a small resizable widget ) should be able to move around the drawing area like a rectangle. I am not sure how to start as I am pretty new to PyGTK. thank you !","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2291,"Q_Id":2650591,"Users Score":0,"Answer":"gtk.TextView is \"rich\", in that it can display all types of formatting and even embedded widgets.\nIf you want the functionality of editing rich text, you will have to write something yourself, though others have tried in applications like BloGTK. From which you could steal codes.","Q_Score":1,"Tags":"python,pygtk","A_Id":2788540,"CreationDate":"2010-04-16T04:21:00.000","Title":"Py GTK Drawing area and Rich Text Editor","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there something similar to scene.mouse.getclick in the visual module (VPython)?\nI need it for a rollover.\nThanks in advance.\nEDIT: I need a function for doing something when the mouse moves inside a special area without clicking.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":594,"Q_Id":2655747,"Users Score":0,"Answer":"scene.mouse.getclick will tell you where the mouse was when it was last clicked. This is different from scene.mouse.clicked which tells you if someone clicked.\nThere is no correspoding way to see if someone had their mouse over a particular object. One thing you can do is use a while loop that continually checks scene.mouse.pick to see if it is the mouse is currently over an object of interest.","Q_Score":2,"Tags":"python,mouseevent,rollover,vpython","A_Id":2718009,"CreationDate":"2010-04-16T19:52:00.000","Title":"mouse rollover event in Python (VPython)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there something similar to scene.mouse.getclick in the visual module (VPython)?\nI need it for a rollover.\nThanks in advance.\nEDIT: I need a function for doing something when the mouse moves inside a special area without clicking.","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":594,"Q_Id":2655747,"Users Score":1,"Answer":"As mentioned by mathmike, it would seem that you could use scene.mouse.pick to get the object that is currently under the mouse, and as for the 'scene-position', I think scene.mouse.pickpos is what you're looking for - if not, you should be able to calculate it from the global mouse position (through getEvent()). \nOtherwise, look at getting your information from the getEvent() function, and possibly writing an event loop for yourself.","Q_Score":2,"Tags":"python,mouseevent,rollover,vpython","A_Id":2726099,"CreationDate":"2010-04-16T19:52:00.000","Title":"mouse rollover event in Python (VPython)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:-\n\nIronPython + .NET Framework\nPython + PyQt\n\nMay I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)?\nOther than the .NET support, is there any big difference between IronPython and Python? Which one is a better choice for me?\nThank you.\nPatrick.L","AnswerCount":5,"Available Count":5,"Score":0.1586485043,"is_accepted":false,"ViewCount":5960,"Q_Id":2657036,"Users Score":4,"Answer":"Per my play with both PyQt (as interface to Qt) and IronPython (as an interface to WinForms) the bag is mixed.\nBoth are basically \"bindings\" for underlying platforms. PyQt is practically \"autogenerated\" from Qt's API and slightly more \"mature\" as a wrapper because of significant use on Linux. \nIronPython goes a little deeper and seems to \"rebox\" system objects with small unfilled gaps between cPython and .Net libs (gzip, zip, subprocess etc).\nIn both cases, you need to look through Python into the toolkit and say to yourself if you like the toolkit. All python is doing is repackaging the toolkit's API to the objects. Again, forget about Python aspect. Look at the underlying toolkit API and think to yourself if you can live with that.\nI personally find the C++ nature of Qt's API too un-pythonic to be happy with it. C# and Python are so alike that if you remove curlies and type declaration from C# you would not know if it's C# or Python. As a result, for a Python programmer, C#-based .Net API, code and examples as provided in MSDN and elsewhere are instantly applicable with very minor tweaks.\nIn the end, a more correct comparison would be between PyQt (Qt bindings for cPython) and Win32py (Windows ABI bindings for cPython). IronPython is almost a reinvention of same language on a different platform, with all the problems (lacking functionality) that comes with that.","Q_Score":8,"Tags":".net,python,user-interface,ironpython,pyqt","A_Id":3042547,"CreationDate":"2010-04-17T02:52:00.000","Title":"\"IronPython + .NET\" vs \"Python + PyQt\". Which one is better for Windows App development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:-\n\nIronPython + .NET Framework\nPython + PyQt\n\nMay I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)?\nOther than the .NET support, is there any big difference between IronPython and Python? Which one is a better choice for me?\nThank you.\nPatrick.L","AnswerCount":5,"Available Count":5,"Score":0.1973753202,"is_accepted":false,"ViewCount":5960,"Q_Id":2657036,"Users Score":5,"Answer":"I faced the same issue and have, with misgivings, decided to go with IronPython\/C#\/.Net. I liked Qt but got cold feet when it was sold to Nokia because I just wasn't sure Nokia's goals in owning Qt were consistent with my needs for a windows UI. That said, Nokia has made some positive moves by combining separate platform licenses into a single license and dropping GPL licensing in favor or LGPL. \nTechnically, Qt is well designed but relies heavily on hard to debug C# macros. I'm not sure why. The best thing about Qt is that it is open source. If you need to, you can fix it. I don't have direct experience with PyQt but it has been around for quite a while. \n.Net is .Net and as usual with Microsoft, a moving target. You will sacrifice speed for ease of coding. The IronPython group seems good but I'm not sure if Microsoft's commitment is there. Visual Studio support isn't there yet although the plans sound good. After all, MS only really cares if they own everything, which is not the case for Python. What I really expect is MS will create a dynamic version of C#, interpreter and all, and tell all the Python programmers that it is better and supported and well integrated with .Net. They will then through their considerable weight behind crushing Python like they've done to Java. \nGood luck. It's a big decision.","Q_Score":8,"Tags":".net,python,user-interface,ironpython,pyqt","A_Id":2668271,"CreationDate":"2010-04-17T02:52:00.000","Title":"\"IronPython + .NET\" vs \"Python + PyQt\". Which one is better for Windows App development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:-\n\nIronPython + .NET Framework\nPython + PyQt\n\nMay I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)?\nOther than the .NET support, is there any big difference between IronPython and Python? Which one is a better choice for me?\nThank you.\nPatrick.L","AnswerCount":5,"Available Count":5,"Score":0.1194272985,"is_accepted":false,"ViewCount":5960,"Q_Id":2657036,"Users Score":3,"Answer":"PyQt is a great library, but .NET is the best way to go for Windows. That is because you can use any GUI controls that C# would be able to use in Python. Furthermore, in addition to WinForms, IronPython can be used to create WPF applications, which look good.\nThe main difference is the features, and PyQt has more cross-platform features, and .NET definitely has the edge in Windows.","Q_Score":8,"Tags":".net,python,user-interface,ironpython,pyqt","A_Id":2658657,"CreationDate":"2010-04-17T02:52:00.000","Title":"\"IronPython + .NET\" vs \"Python + PyQt\". Which one is better for Windows App development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:-\n\nIronPython + .NET Framework\nPython + PyQt\n\nMay I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)?\nOther than the .NET support, is there any big difference between IronPython and Python? Which one is a better choice for me?\nThank you.\nPatrick.L","AnswerCount":5,"Available Count":5,"Score":0.0399786803,"is_accepted":false,"ViewCount":5960,"Q_Id":2657036,"Users Score":1,"Answer":"I haven't used IronPython with .NET, but I have written a lot of PyQt code. From my experience, PyQt is a great library. It is a very well executed bindings to Qt, which is a very well known and widely used library.\nSince it's standard Python you're writing, you can enjoy all the Python standard library which gives you a ton of capabilities, in addition to several useful Qt modules imported with PyQt. Writing PyQt code is productive, and the GUIs come out pretty and responsive. And you can't ignore the portability benefit: with just the tiniest modifications, if any, you can just run these programs on Linux and they will just work.","Q_Score":8,"Tags":".net,python,user-interface,ironpython,pyqt","A_Id":2657263,"CreationDate":"2010-04-17T02:52:00.000","Title":"\"IronPython + .NET\" vs \"Python + PyQt\". Which one is better for Windows App development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:-\n\nIronPython + .NET Framework\nPython + PyQt\n\nMay I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)?\nOther than the .NET support, is there any big difference between IronPython and Python? Which one is a better choice for me?\nThank you.\nPatrick.L","AnswerCount":5,"Available Count":5,"Score":0.1194272985,"is_accepted":false,"ViewCount":5960,"Q_Id":2657036,"Users Score":3,"Answer":"First, there are lots more than 2 options (python has more GUI libraries than you can shake a stick at), but let's go on your premise for a minute. \"Better\" being subjective begs the question: \"what do you want to learn?\"\nIf the goal is Windows GUI Applications development, than I'd go with .Net. .Net is well respected, there is lots of work for .Net programmers, and it's windows centric nature (yeah I know there's Mono but still) means you aren't trying to think about details of three+ sets of user expectations.\nIf the goal is to learn widely used Python libraries and techniques, I'd go with PyQt (and recently did). It's cross-platform, well respected, and has a large community. But you lose the chance to learn the .Net platform as part of this project.\nI don't think you can loose either way if your goal is to learn. If your goal is to get something done, think about the long-term plans for the project and where its going over the long run. Do you want something that's well integrated into the Windows user-interface, and uses standard widgets? Do you want something that can easily be adapted to other platforms in the future?","Q_Score":8,"Tags":".net,python,user-interface,ironpython,pyqt","A_Id":2657059,"CreationDate":"2010-04-17T02:52:00.000","Title":"\"IronPython + .NET\" vs \"Python + PyQt\". Which one is better for Windows App development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed PyScript to try it out but it just wont start. It only gives me the error:\n\"Error126: Could not open Dll \"python26.dll\" followed by:\n\"Python could not be properly initialized. We must quit.\"\nI think this may have something to do with the PYTHONPATH but since I'm a newbie and dont know what it is or exactly what to put in the PYTHONPATH, after some googling, I ask here.\nAlso, when I tried to install wxPython it was impossible becouse the PYTHONPATH could not be found.(Just a side note)","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":22256,"Q_Id":2658779,"Users Score":0,"Answer":"I just copied python26.dll from my python folder to pyscripter folder and it worked well... dont know it that is a good way to do it...","Q_Score":5,"Tags":"python,pythonpath,pyscripter","A_Id":13216653,"CreationDate":"2010-04-17T14:58:00.000","Title":"How do I make PyScripter work? Says it cant find python26.dll","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed PyScript to try it out but it just wont start. It only gives me the error:\n\"Error126: Could not open Dll \"python26.dll\" followed by:\n\"Python could not be properly initialized. We must quit.\"\nI think this may have something to do with the PYTHONPATH but since I'm a newbie and dont know what it is or exactly what to put in the PYTHONPATH, after some googling, I ask here.\nAlso, when I tried to install wxPython it was impossible becouse the PYTHONPATH could not be found.(Just a side note)","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":22256,"Q_Id":2658779,"Users Score":0,"Answer":"I finally got it working by (a) not changing the directory it gets installed in to something else...just left it in c:\/programfiles\/pyscripter ...and (B) going into the pyscripter folder and in the lib folder extracting the rpyc folder so that there is another rpyc folder inside the lib folder that isnt compressed! hope that helps","Q_Score":5,"Tags":"python,pythonpath,pyscripter","A_Id":23843782,"CreationDate":"2010-04-17T14:58:00.000","Title":"How do I make PyScripter work? Says it cant find python26.dll","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed PyScript to try it out but it just wont start. It only gives me the error:\n\"Error126: Could not open Dll \"python26.dll\" followed by:\n\"Python could not be properly initialized. We must quit.\"\nI think this may have something to do with the PYTHONPATH but since I'm a newbie and dont know what it is or exactly what to put in the PYTHONPATH, after some googling, I ask here.\nAlso, when I tried to install wxPython it was impossible becouse the PYTHONPATH could not be found.(Just a side note)","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":22256,"Q_Id":2658779,"Users Score":0,"Answer":"Install python. should solve all your problems..","Q_Score":5,"Tags":"python,pythonpath,pyscripter","A_Id":2658872,"CreationDate":"2010-04-17T14:58:00.000","Title":"How do I make PyScripter work? Says it cant find python26.dll","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Pygame program that needs text input. The way it does this is to get keyboard input and when a key is pressed it renders that key so it is added to the screen. Essentially it acts like a text field. The problem is, when you hold shift it doesn't do anything. I realize this is because the program ignores shift input and instead writes the text if it's number is under 128. I have thought of setting a variable when shift is pressed then capitalizing if it was true, but string capitalization only woks on letters, not things like numbers or semicolons. Is there maybe a number I can add to the ASCII number typed to modify it if shift is pressed, or something else?\nEdit:\nEssentially, I just want to know if there is a number to add to ascii characters to make it seem like they were typed with shift held down. After reading over my original question it seemed slightly obscure.","AnswerCount":5,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":5694,"Q_Id":2671589,"Users Score":3,"Answer":"I can use the 'event.unicode' attribute to get the value of the key typed.","Q_Score":3,"Tags":"python,ascii,character,pygame,shift","A_Id":2785753,"CreationDate":"2010-04-19T23:27:00.000","Title":"Pygame program that can get keyboard input with caps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Pygame program that needs text input. The way it does this is to get keyboard input and when a key is pressed it renders that key so it is added to the screen. Essentially it acts like a text field. The problem is, when you hold shift it doesn't do anything. I realize this is because the program ignores shift input and instead writes the text if it's number is under 128. I have thought of setting a variable when shift is pressed then capitalizing if it was true, but string capitalization only woks on letters, not things like numbers or semicolons. Is there maybe a number I can add to the ASCII number typed to modify it if shift is pressed, or something else?\nEdit:\nEssentially, I just want to know if there is a number to add to ascii characters to make it seem like they were typed with shift held down. After reading over my original question it seemed slightly obscure.","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":5694,"Q_Id":2671589,"Users Score":0,"Answer":"I wrote a function that converts the strings after getting not enough help. It converts everything manually.","Q_Score":3,"Tags":"python,ascii,character,pygame,shift","A_Id":2683802,"CreationDate":"2010-04-19T23:27:00.000","Title":"Pygame program that can get keyboard input with caps","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to develop a multiplatform software that takes screenshots from opengl games without affecting the game in performance, it will run in the background and will add a watermark to my screenshots.\nWhat language should i use? I thought of Perl \/ Python.\nAnyone can point me out something to start?\nThanks!","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":502,"Q_Id":2691289,"Users Score":0,"Answer":"Do you need to add a watermark right when you take the screenshot? It would be a lot easier to simply add the watermark later to the static image, as many applications can do this (e.g. Photoshop).","Q_Score":1,"Tags":"python,perl,opengl","A_Id":2691789,"CreationDate":"2010-04-22T13:40:00.000","Title":"Programming language for opengl screenshot software","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to develop a multiplatform software that takes screenshots from opengl games without affecting the game in performance, it will run in the background and will add a watermark to my screenshots.\nWhat language should i use? I thought of Perl \/ Python.\nAnyone can point me out something to start?\nThanks!","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":502,"Q_Id":2691289,"Users Score":1,"Answer":"I would suggest C++. That way you can use OpenGL and DirectX libraries and API calls natively. Libraries that provide such functionality to other languages typically abstract the good stuff away from reach.","Q_Score":1,"Tags":"python,perl,opengl","A_Id":2691336,"CreationDate":"2010-04-22T13:40:00.000","Title":"Programming language for opengl screenshot software","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to develop a multiplatform software that takes screenshots from opengl games without affecting the game in performance, it will run in the background and will add a watermark to my screenshots.\nWhat language should i use? I thought of Perl \/ Python.\nAnyone can point me out something to start?\nThanks!","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":502,"Q_Id":2691289,"Users Score":0,"Answer":"The language you know best that has some sort of OpenGL Bindings.\nMy personal preference for such kind of applications is C, C++ or (if available) C# but it's a simple matter of preference.","Q_Score":1,"Tags":"python,perl,opengl","A_Id":2691318,"CreationDate":"2010-04-22T13:40:00.000","Title":"Programming language for opengl screenshot software","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to write a C++ application with Qt, but build a prototype first using Python and then gradually replace the Python code with C++.\nIs this the right approach, and what tools (bindings, binding generators, IDE) should I use?\nIdeally, everything should be available in the Ubuntu repositories so I wouldn't have to worry about incompatible or old versions and have everything set up with a simple aptitude install.\nIs there any comprehensive documentation about this process or do I have to learn every single component, and if yes, which ones?\nRight now I have multiple choices to make:\nQt Creator, because of the nice auto completion and Qt integration.\nEclipse, as it offers support for both C++ and Python.\nEric (haven't used it yet)\nVim\nPySide as it's working with CMake and Boost.Python, so theoretically it will make replacing python code easier.\nPyQt as it's more widely used (more support) and is available as a Debian package.\nEdit: As I will have to deploy the program to various computers, the C++-solution would require 1-5 files (the program and some library files if I'm linking it statically), using Python I'd have to build PyQt\/PySide\/SIP\/whatever on every platform and explain how to install Python and everything else.","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":5460,"Q_Id":2693558,"Users Score":3,"Answer":"If you are just learning Qt and want to leverage the speed of prototyping that Python gives you, then I would recommend you make a sample project using PyQt. As you said, there is a debian package, so you are just a simple apt-get away from making your first application.\nI personally use gVim as my Python\/Qt editor, but you can really use any Python-friendly editor without much trouble. I liked WingIDE and they have auto-complete for Qt but once you sip from the vim kool-aid it's hard to switch.\nI would say that PySide is 95%+ compatible with PyQt and the LPGL license is nice, but if you are just trying to prototype your first Qt app, then I don't think there is a real reason to use PySide. Although, I do like the PySide docs better, you can also just use them and replace all the library references with PyQt.\nDepending on the complexity of the application you are building, it might be better off to just start from scratch with a C++ version than to try to do a bunch SIP refactoring black magic. Once you have a solid grasp of the Qt framework, you should be able to switch between the C++ and Python bindings pretty effortlessly.","Q_Score":25,"Tags":"c++,python,qt,pyqt,pyside","A_Id":2694114,"CreationDate":"2010-04-22T18:49:00.000","Title":"Prototyping Qt\/C++ in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a very large file editor (where the editor only stores a part of the buffer in memory at a time), but I'm stuck while building my textview object. Basically- I know that I have to be able to update the text view buffer dynamically, and I don't know hot to get the scrollbars to relate to the full file while the textview contains only a small buffer of the file.\nI've played with Gtk.Adjustment on a Gtk.ScrolledWindow and ScrollBars, but though I can extend the range of the scrollbars, they still apply to the range of the buffer and not the filesize (which I try to set via Gtk.Adjustment parameters) when I load into textview. I need to have a widget that \"knows\" that it is looking at a part of a file, and can load\/unload buffers as necessary to view different parts of the file. So far, I believe I'll respond to the \"change_view\" to calculate when I'm off, or about to be off the current buffer and need to load the next, but I don't know how to get the scrollbars to have the top relate to the beginning of the file, and the bottom relate to the end of the file, rather than to the loaded buffer in textview.\nAny help would be greatly appreciated, thanks!","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":494,"Q_Id":2698533,"Users Score":1,"Answer":"You probably should create your own Gtk.TextBuffer implementation, as the default one relies on storing whole buffer in memory.","Q_Score":4,"Tags":"python,gtk,pygtk","A_Id":2698565,"CreationDate":"2010-04-23T12:43:00.000","Title":"Gtk: How can I get a part of a file in a textview with scrollbars relating to the full file","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im trying to do simple audio player, but I want use a image(icon) as a pushbutton.","AnswerCount":5,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":30515,"Q_Id":2711033,"Users Score":5,"Answer":"You can use QToolButton with set autoraise property true and there you can set your image also.","Q_Score":13,"Tags":"python,qt,pyqt,pyqt4","A_Id":6515261,"CreationDate":"2010-04-26T03:42:00.000","Title":"how code a Image button in PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a (single line) TextCtrl. The user types data into this. When they press enter, the contents of the box need to be extracted so they can be processed. I can't figure out how to catch enter being pressed.\nAccording to the docs, with the style wx.TE_PROCESS_ENTER set on my TextCtrl, it should generate a wx.EVT_COMMAND_TEXT_ENTER event when enter is pressed in the box, which I could then catch. However, wx.EVT_COMMAND_TEXT_ENTER seems not to exist (I get \"module has no attribute EVT_COMMAND_TEXT_ENTER), so I'm a bit stuck. Googling just gets a couple of hits of people complaining wx.EVT_COMMAND_TEXT_ENTER doesn't work, so I guess I need another way of doing it.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":7028,"Q_Id":2725362,"Users Score":6,"Answer":"I've never seen wx.EVT_COMMAND_TEXT_ENTER. I have used wx.EVT_TEXT_ENTER though...","Q_Score":8,"Tags":"python,wxpython,wxwidgets","A_Id":2725392,"CreationDate":"2010-04-27T21:44:00.000","Title":"Get text when enter is pressed in a text box in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for an easy-to-use graphics lib for python that can output to screen as well as pdf. So, I would use code to draw some stuff (simple prims like ovals, rectangles, lines and points) to screen and then when things look good, have it output to pdf.","AnswerCount":6,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":9999,"Q_Id":2725735,"Users Score":0,"Answer":"Creating PDFs is always a pain, it doesn't make sense if you do not aim to lose sanity.\nWith that said, you are aiming to do two completely different things: when you draw to screen you draw into a raster bitmap, while PDFs are mostly dynamic, like HTML. (unlike HTML they are more prone to be the same over different platforms, but that's beside the point)\nIf you really want to do that, the solution might be finding something that outputs PDFs, and then showing the generated PDF on screen at every step.\nI guess that's the only way to have WYSIWYG results.","Q_Score":3,"Tags":"python,pdf,graphics","A_Id":2725787,"CreationDate":"2010-04-27T22:56:00.000","Title":"Recommendations for a simple 2D graphics python library that can output to screen and pdf?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for an easy-to-use graphics lib for python that can output to screen as well as pdf. So, I would use code to draw some stuff (simple prims like ovals, rectangles, lines and points) to screen and then when things look good, have it output to pdf.","AnswerCount":6,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":9999,"Q_Id":2725735,"Users Score":3,"Answer":"If you use Tkinter, you can draw on a Canvas widget, then use its .postscript method to save the contents as a PostScript file, which you can convert to PDF using ps2pdf.\n\npostscript(self, cnf={}, **kw)\n Print the contents of the canvas to a postscript\n file. Valid options: colormap, colormode, file, fontmap,\n height, pageanchor, pageheight, pagewidth, pagex, pagey,\n rotate, witdh, x, y.","Q_Score":3,"Tags":"python,pdf,graphics","A_Id":2725883,"CreationDate":"2010-04-27T22:56:00.000","Title":"Recommendations for a simple 2D graphics python library that can output to screen and pdf?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Imagine I have a video playing.. Can I have some sort of motion graphics being played 'over' that video.. Like say the moving graphics is on an upper layer than the video, which would be the lower layer..\nI am comfortable in a C++ and Python, so a solution that uses these two will be highly appreciated.. \nThank you in advance,\nRishi..","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":169,"Q_Id":2759738,"Users Score":0,"Answer":"I'm not sure I understand the question correctly but a video file is a sequence of pictures that you can extract (for instance with the opencv library C++ interface) and then you can use it wherever you want. You can play the video on the sides of an opengl 3D cube (available in all opengl tutorials) and other 3D elements around it.\nOf course you can also displays it in a conventional 2D interface and draw stuff on top of it, but for this you need a graphical ui.\nIs it what you thought or am I completely lost?","Q_Score":0,"Tags":"c++,python,graphics,video,video-processing","A_Id":2760860,"CreationDate":"2010-05-03T17:00:00.000","Title":"Navigation graphics overlayed over video","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i converted recently from wxpython to pyqt and im still facing alot of problems since im still noob in pyqt\nso is it possible to detected if user pressed (CTRL+key ) in pyqt ? and how ?\n\n\ni've been trying to find an answer for this for 3 days . if you know website or a good place to learn pyqt, it will be highly appreciated \n\n\nthanx in advance","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":5552,"Q_Id":2761512,"Users Score":8,"Answer":"Add a QShortcut and listen to its activated() signal, then perform the action in the slot.\nOr you could reimplement QWidget and define keyPressEvent to what you like. Check for the event parameter's modifiers() and key() to see if they match with what you want. This listens for shortcut keys when the QWidget has focus.","Q_Score":3,"Tags":"python,qt,qt4,pyqt,pyqt4","A_Id":2761528,"CreationDate":"2010-05-03T22:01:00.000","Title":"getting keyboard events with pyqt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python application which need a gui HTML editor, I know FCKeditor is nice, so how to embed the FCKeditor in a python desktop app?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":340,"Q_Id":2777919,"Users Score":1,"Answer":"To embed FCKeditor (or maybe better the current CKeditor?), you basically need to embed a full-fledged browser (with Javascript) -- I believe wxPython may currently be the best bet for that, as I hear it has wxIE for Windows and wxWebKitCtrl for the Mac (I don't know if old summer-of-code ideas about making something suitable for Linux ever panned out, though). Most \"HTML viewer\" widgets, in most GUIs, don't support Javascript, and that's a must for (F?)CKeditor.","Q_Score":0,"Tags":"python,html,editor","A_Id":2778024,"CreationDate":"2010-05-06T01:41:00.000","Title":"Embed FCKeditor in python app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python application which need a gui HTML editor, I know FCKeditor is nice, so how to embed the FCKeditor in a python desktop app?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":340,"Q_Id":2777919,"Users Score":0,"Answer":"In order of difficulty:\nIf you just need to support Windows, you can embed IE in wx - see the docs and demos.\nwxWebKit is looking a bit more mature, but it's still in development.\nYou could just use the web-browser using webbrowser.open(url). Things will be very crude, and interaction will be a pain.\nA fourth option - you could try out pyjamas for your whole GUI, then run it all in a web-browser.","Q_Score":0,"Tags":"python,html,editor","A_Id":2778087,"CreationDate":"2010-05-06T01:41:00.000","Title":"Embed FCKeditor in python app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working with geodjango and I want to breakup a 2D Rectangular Polygon into smaller ones.\nMy input is a big rectangle and I want to subdivide it in smaller rectangles. The sum of the smaller rectangles must be the original rectangle.\nAll subrectangles should be equal size.\nHow can I do that?\nThank you.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":1964,"Q_Id":2783075,"Users Score":2,"Answer":"Pick any point inside the rectangle\nDraw two lines through it parallel to the edges of the rectangle. Now you've divided your rectangle into four smaller ones.","Q_Score":2,"Tags":"python,geometry,gis,geodjango","A_Id":2783174,"CreationDate":"2010-05-06T17:22:00.000","Title":"Break up a polygon into smaller ones","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I find if a GTKBuilder Checkbutton is checked?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":703,"Q_Id":2788927,"Users Score":1,"Answer":"Use checkbutton.get_active(). What's this got to do with GtkBuilder?","Q_Score":0,"Tags":"python,gtk,pygtk,glade,gtkbuilder","A_Id":2789043,"CreationDate":"2010-05-07T13:35:00.000","Title":"Python Glade GTKBuilder Checkbutton","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a fairly simple PyQt application in which I'm placing instances of a QGraphicsWidget in a QGraphicsGridLayout and want to connect the widgets with lines drawn with a QGraphicsPath. Unfortunately, no matter what I try, I always get (0, 0) back as the position for both the start and end widgets.\nI'm constructing the graph with a recursive function that adds widgets to the scene and layout. Once the recursive function is complete, the layout is added to a new widget, which is added to the scene to show everything. The edges are added to the scene as widgets are created.\nHow do I get a non-zero position of any of the widgets in the grid layout?\nUpdate: I forgot to mention that I've tried both pos() and scenePos() on the widgets in the grid layout. Both always return (0, 0) as the position for every widget in the grid.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2688,"Q_Id":2799776,"Users Score":1,"Answer":"If you use the QGraphicsItem::pos(), it gives you the position of the item in the parent coordinates. When using QGraphicsLayout, the parent is probably the cell containing the object thus the coordinate is equal to zero.\nSince you want to connect widgets with path, you will need scene coordinate to define the control points: use QGraphicsItem::scenePos() to obtain the position of your QGraphicsWidget in the scene.","Q_Score":3,"Tags":"python,qt,pyqt","A_Id":2801458,"CreationDate":"2010-05-10T00:45:00.000","Title":"PyQt: Get the position of QGraphicsWidgets in a QGraphicsGridLayout","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for a graphics library for 3D reconstruction research to develop my specific viewer based on some library. OpenGL seems in a low level and I have to remake the wheel everywhere. And I also tried VTK(visualization toolkit). However, it seems too abstract that I need to master many conceptions before I start. Is there any other graphics library? I prefer to program in python. So I would like the library has a python wrapper. I think something like O3D would be better. But O3D is for javascript and it seems that Google already stops the development.","AnswerCount":5,"Available Count":1,"Score":-0.0399786803,"is_accepted":false,"ViewCount":2730,"Q_Id":2823907,"Users Score":-1,"Answer":"I used openGL with C++ a few years back - found it quite low level. I also have used Java3D which seemed to be a bit higher level. If you are not stuck on using python - try Java3D - very simple to get up and running.","Q_Score":3,"Tags":"python,opengl,graphics","A_Id":2826036,"CreationDate":"2010-05-13T01:22:00.000","Title":"Is there any graphics library in a higher level than OpenGL","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a project idea, but unsure if using Python would be a good idea.\nFirstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I definitely use OOP in programming and I understand Python would work fine with that style. I could be way off on this, I've only read small bits and pieces about the language.\nThe project won't be public or anything, just purely something of my own creation do dabble in at home.\nSo the project would essentially represent a simple game idea I have. The game would consist roughly these things:\n\nData structures to hold specific information (would be strongly typed).\nA way to output the gamestate for the players. This is completely up in the air, it can be graphical or text based, I don't really care at this point.\nA way to save off game data for the players in something like a database or file system.\nA relatively easy way for me to input information and a 'GO' button which processes the changes and obviously creates a new gamestate.\nThe game would function similar to a board game.\n\nReally nothing out of the ordinary when I look back at that list. Would this be a fun way to learn Python or should I select another language?","AnswerCount":4,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":823,"Q_Id":2823983,"Users Score":6,"Answer":"I find that the best way to learn a new language is by doing something like this (small project of your own). Python is no different. \nEverything you wrote can be done in Python, so I can't find any reason not to use it, if you want to learn.","Q_Score":2,"Tags":"python,oop","A_Id":2824002,"CreationDate":"2010-05-13T01:45:00.000","Title":"Idea for a small project, should I use Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a project idea, but unsure if using Python would be a good idea.\nFirstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I definitely use OOP in programming and I understand Python would work fine with that style. I could be way off on this, I've only read small bits and pieces about the language.\nThe project won't be public or anything, just purely something of my own creation do dabble in at home.\nSo the project would essentially represent a simple game idea I have. The game would consist roughly these things:\n\nData structures to hold specific information (would be strongly typed).\nA way to output the gamestate for the players. This is completely up in the air, it can be graphical or text based, I don't really care at this point.\nA way to save off game data for the players in something like a database or file system.\nA relatively easy way for me to input information and a 'GO' button which processes the changes and obviously creates a new gamestate.\nThe game would function similar to a board game.\n\nReally nothing out of the ordinary when I look back at that list. Would this be a fun way to learn Python or should I select another language?","AnswerCount":4,"Available Count":4,"Score":0.1488850336,"is_accepted":false,"ViewCount":823,"Q_Id":2823983,"Users Score":3,"Answer":"I've already voted for del-boy's answer, but I would like to go further and say that if your goals are to (1) have fun, (2) learn a new language, and (3) write your own game, then Python is a slam-dunk, no-brainer, awesome choice to achieve all three.\nThe language excels at all the things you seem to be looking for (see Alex Martelli's answer for the caveat on strong typing), and in my opinion is not much of a \"stretch\" from the C family of languages (I think you will find most things simply easier, rather than strange), compared to other good languages such as Ruby or Lua.","Q_Score":2,"Tags":"python,oop","A_Id":2824090,"CreationDate":"2010-05-13T01:45:00.000","Title":"Idea for a small project, should I use Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a project idea, but unsure if using Python would be a good idea.\nFirstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I definitely use OOP in programming and I understand Python would work fine with that style. I could be way off on this, I've only read small bits and pieces about the language.\nThe project won't be public or anything, just purely something of my own creation do dabble in at home.\nSo the project would essentially represent a simple game idea I have. The game would consist roughly these things:\n\nData structures to hold specific information (would be strongly typed).\nA way to output the gamestate for the players. This is completely up in the air, it can be graphical or text based, I don't really care at this point.\nA way to save off game data for the players in something like a database or file system.\nA relatively easy way for me to input information and a 'GO' button which processes the changes and obviously creates a new gamestate.\nThe game would function similar to a board game.\n\nReally nothing out of the ordinary when I look back at that list. Would this be a fun way to learn Python or should I select another language?","AnswerCount":4,"Available Count":4,"Score":0.049958375,"is_accepted":false,"ViewCount":823,"Q_Id":2823983,"Users Score":1,"Answer":"Well, if you do C++\/C#, I'd say go for it - I personally love C++ because it is (in my opinion) self-intuitive and easy. The 'grammar' of Python doesn't make much sense. Plus, if you already know another language, why learn Python for fun? I mean, if you want to create a simple project for fun, it's really not worth it, and you'll end up working for several weeks at least, before you can begin your game. So yeah, you should definitely use C++. \n\nHowever, if you're just trying to learn a new language, there's nothing wrong with that; Python certainly is pretty popular. Javascript is pretty easy as well, as it uses automatic inference and all that jazz.","Q_Score":2,"Tags":"python,oop","A_Id":2824020,"CreationDate":"2010-05-13T01:45:00.000","Title":"Idea for a small project, should I use Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a project idea, but unsure if using Python would be a good idea.\nFirstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I definitely use OOP in programming and I understand Python would work fine with that style. I could be way off on this, I've only read small bits and pieces about the language.\nThe project won't be public or anything, just purely something of my own creation do dabble in at home.\nSo the project would essentially represent a simple game idea I have. The game would consist roughly these things:\n\nData structures to hold specific information (would be strongly typed).\nA way to output the gamestate for the players. This is completely up in the air, it can be graphical or text based, I don't really care at this point.\nA way to save off game data for the players in something like a database or file system.\nA relatively easy way for me to input information and a 'GO' button which processes the changes and obviously creates a new gamestate.\nThe game would function similar to a board game.\n\nReally nothing out of the ordinary when I look back at that list. Would this be a fun way to learn Python or should I select another language?","AnswerCount":4,"Available Count":4,"Score":0.2449186624,"is_accepted":false,"ViewCount":823,"Q_Id":2823983,"Users Score":5,"Answer":"Python seems very suitable to your purposes (e.g., pygame and other popular third party extensions make it easy to achieve nice graphics, and you can also choose curses for structured textual I\/O, etc) with the single exception of what you probably mean by \"strongly typed\".\nPython is strongly typed (there is no way you can erroneously use a string for an operation for which an integer is required, and vice versa, for example), but it's dynamic strong typing: each object has a strong type, but names (in the wide sense, including barenames, compound names, items in containers, ...) do not have types -- each name refers to an object, the object has the type, not the name. You can rebind the name to a different object, and that object may have a different (strong;-) type than whatever object was previously bound to that same name.\nDynamic languages all have this character, even though many go further than Python in \"type laxity\" (\"confusing\" strings and numbers, and different kinds of numbers, while Python distinguishes strings from integers from floating-point numbers, for example) -- Python is quite \"type-picky\"... in the dynamic sense where names, per se, have no types, though;-).","Q_Score":2,"Tags":"python,oop","A_Id":2824031,"CreationDate":"2010-05-13T01:45:00.000","Title":"Idea for a small project, should I use Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do i add SOCKS support to my application? and where can i get the libs?\nany help appreciated thanks","AnswerCount":2,"Available Count":1,"Score":-0.2913126125,"is_accepted":false,"ViewCount":867,"Q_Id":2829637,"Users Score":-3,"Answer":"VC++ has extensive support if you want to try on Windows. \nGoogle \"Windows sockets for beginners msdn\", great info for windows sockets...\nIf linux, try C sockets by beej... Just google beej's guide for sockets...","Q_Score":2,"Tags":"c++,python,c,perl,socks","A_Id":2829664,"CreationDate":"2010-05-13T19:21:00.000","Title":"SOCKS in C\/C++ or another language?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using the wxWizard widget in wxPython. Is there any way I could change the text of the next button on a page? Can i change the visibility of the navigation buttons on any page? Can I enable\/disable the navigation buttons?\nI tried looking for answers to these questions on the wxPython site but it doesn't seem to be documented.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":211,"Q_Id":2829993,"Users Score":0,"Answer":"Use wx.FindWindowById(wx.ID_FORWARD) this will return a wxWindow object representing the Next button. Call methods on it. e.g. \nwx.FindWindowById(wx.ID_FORWARD).disable() would disable the Next Button.","Q_Score":0,"Tags":"python,wxpython","A_Id":5441284,"CreationDate":"2010-05-13T20:17:00.000","Title":"Access properties of navigation buttons in wxPython's wxWizard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a simple gtk.TreeView with a gtk.ListStore model and set_reorderable(True), I want to catch the signal\/event emited when the user reorder through drag&drop the list, but the documentation does not help much: \n\"The application can listen to these changes by connecting to the model's signals\"\nSo I tried to connect the model (ListStore) signals... but surprise! ListStore has no signals, so you are dispatched to TreeModel signals, then I tried to connect with the TreeModel \"rows-reordered\" signal with no lucky.\nHow should I catch the list reorder performed by the user?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1654,"Q_Id":2831779,"Users Score":3,"Answer":"There is no way to do that in PyGTK currently. \"rows-reordered\" is the correct signal, but it is impossible to derive any information from it in PyGTK other than \"somehow reordered\". In C GTK+ you could use the same signal and get the required information in callback, but not in Python.","Q_Score":1,"Tags":"python,gtk,pygtk,gtktreeview","A_Id":2835863,"CreationDate":"2010-05-14T04:10:00.000","Title":"Catch PyGTK TreeView reorder","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was working on a program,that I need to support new additions. Hmmm. Let me give you some background on the program.\nIt is an educational software program that has quizzes for the user to take, just to gain odd knowledge. Now, It currently supports 6 subjects, all organized with directores on the HDD ( i.e. the Science directory is called science. ) and the way you launch the subject to see what quizzes you have to take is by pushing a button on the home screen. \nThis sort of thing prevents easy subject additions. I want to be able to add a subject later on without having to recode the home screen and re organize all the buttons. I would use a Listbox and os.listdir(...), but I was kind of wanting something prettier than a Listbox. I am using Tkinter on Windows. The Python version I am using is 2.6\nIs there a \"fancy\" listbox sort of thing that can be styled to work with the background?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":72,"Q_Id":2853708,"Users Score":0,"Answer":"You can add buttons dynamically just fine, nothing is forcing you into the listbox. That said, I don't know why you care so much about \"prettiness\" since you're using Tkinter, which is very ugly by default.","Q_Score":1,"Tags":"python,tkinter","A_Id":2853858,"CreationDate":"2010-05-17T23:42:00.000","Title":"Automatically support new changes with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I randomly add buttons to a Tkinter GUI? I need it to be able to create a button, then put it anywhere on the window, is this possible? I am using Python 2.6 on Windows.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1244,"Q_Id":2853933,"Users Score":0,"Answer":"There are several options to choose from. For example, you could design on a grid where you have six buttons per row. Then it's just a matter of starting at row 0, incrementing the column for each button. When you get to the last column, reset the column to 0 and increment the row by one.\nAnother option is to use a text widget as the container, and embed your buttons in the text widget with wrapping enabled. With this trick the buttons will fill a row automatically and wrap if the user grows or shrinks the main windows. It's a tiny bit more work, but it works well if that's the behavior you want.","Q_Score":0,"Tags":"python,windows,random,tkinter,button","A_Id":2864899,"CreationDate":"2010-05-18T00:40:00.000","Title":"Randomly add buttons to Tkinter GUI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to write an app in python to control a motor using serial. This all works in a CLI situation fine and is generally stable. but I was wondering how simple it was to add a GUI on top of this code base?\nI assume there will be more code, but is there a simple way of detecting something like GTK, so it only applied the code when GTK was present?\nAlso, GUI creation in Python in general: is it best to keep as little GUI specifics out of the code and use something like GTK's XML based approach (using gtk.glade.XML() function)? Are there other GUI toolkits that have a similar approach to the Glade \/ XML \/ \"Explode in Code\" approach?\nThanks for any advice.\nAndy","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1570,"Q_Id":2857634,"Users Score":0,"Answer":"I don't recommend doing a GUI in XML. All the XML does is give you a mini language for describing a layout. Why use a mini language when you can have the full power of python?\nAs for detecting GTK, I wouldn't suggest that. Instead, add a command line argument to determine whether to create a GUI or not (eg: myprogram -g). It then becomes easy to create a desktop shortcut or command line alias to start in GUI mode, while still being able to use the command line tool from any terminal.\nYou do, however, want to keep the GUI code separate from the bits that do the real work. Give youself a class that contains all the business logic, then have the GUI and CLI both access this object to do work.","Q_Score":2,"Tags":"python,xml,user-interface,gtk,glade","A_Id":2857711,"CreationDate":"2010-05-18T13:24:00.000","Title":"How can I create a GUI on top of a Python APP so it can do either GUI or CLI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm doing a little program and I want to distribute it using this recipe:\n\nsingle directory with __main__.py in it\nzip this directory and adding a shebang on it #!\/usr\/bin\/env python\nmaking it executable\n\nThe problem is that in this package I have also extra files (I'm using pygtk toolkit and I need images and ui xml files). When I try to access these files I have the error that the resource is unavailable (the path that I'm trying to open is something like file.zip\/gui\/gui.ui ).\nHow can I handle this situation?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2816,"Q_Id":2859413,"Users Score":8,"Answer":"I figured out by myself, It's sufficient to use pkgutil.get_data to access the data inside a package.","Q_Score":4,"Tags":"python,packaging,zipapp","A_Id":2861524,"CreationDate":"2010-05-18T17:06:00.000","Title":"Distributing an executable zip file with __main__.py, how to access extra data?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am about to begin a project where I will likely use PyQt or Pyside.\nI will need to interface with a buggy 3rd party piece of server software that provides C++ and Java APIs. The Java APIs are a lot easier to use because you get Exceptions where with the C++ libraries you get segfaults. Also, the Python bindings to the Java APIs are automatic with Jython whereas the Python bindings for the C++ APIs don't exist.\nSo, how would a CPython PyQt client application be able to communicate with these Java APIs? How would you go about it?\nWould you have another separate Java process on the client that serializes \/ pickles objects and communicates with the PyQt process over a socket?\nI don't want to re-invent the wheel... is there some sort of standard interface for these types of things? Some technology I should look into? RPC, Corba, etc?\nThanks,\n~Eric","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1047,"Q_Id":2860650,"Users Score":0,"Answer":"If the criteria is not reinventing the wheel, there is the SimpleXMLRPCServer and xmlrpclib modules available in the standard library. They should work in Jython too.","Q_Score":3,"Tags":"python,qt,pyqt,process,jython","A_Id":2861467,"CreationDate":"2010-05-18T19:58:00.000","Title":"Integrating Jython Cpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Just curious if anyone knows of good sites for learning and understanding PyGame.\nI've programmed a bunch in Python, so I'm well-equipped with that. Just curious if anyone knows a good site or more for learning PyGame.\nThanks for any help!","AnswerCount":7,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":7938,"Q_Id":2865003,"Users Score":0,"Answer":"No one has mentioned this yet as a source of games written in pygame, but check out www.pyweek.org - it's a week-long programming competition featuring games built in python. In many cases they use pygame, though there are other libs such as pyglet and opengl that are used.","Q_Score":13,"Tags":"python,pygame","A_Id":2897004,"CreationDate":"2010-05-19T11:25:00.000","Title":"Best resources for learning PyGame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using cx_Freeze to freeze my python program. On running cx_Freeze, a bunch of PYD files are created, a whole bunch of PYC files are put into a archive named library.zip and a few DLL files are there too.\nCould someone tell me the difference between the PYC and the PYD files?\nWhat's the reason for the PYD files not in the library.zip? \nIs it possible to put the PYD files into the archive as well?\nThanks.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3772,"Q_Id":2875530,"Users Score":6,"Answer":"Disclaimer: I haven't used cx_Freeze in awhile......\n.PYD files are DLL machine-code files that contain specific python-required functions. \n.PYC files are .py files that have been compiled into bytecode.\nso PYDs are machine code and PYCs are bytecode\nNow as for why the PYDs aren't in the .zip....I'd imagine it's because those .PYDs are needed by the python interpreter to run the program. What cx_Freeze does is basically this:\n\ncompile all .py files and throw the .pyc files in a zip\nput all needed .pyd files in the zip\ncreate a stub .py file and put it in the output directory\ncopy the python.exe and rename to myprogram.exe\ncopy all .pyd files needed to open the .zip and run the contents\n\nSo you're not actually compiling your python file, you're instead renaming the interpeter and freezing all the source files. \nI hope this helps.","Q_Score":3,"Tags":"python,cx-freeze","A_Id":2875948,"CreationDate":"2010-05-20T15:55:00.000","Title":"cx_Freeze and PYC\/PYD files","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a Python application using wxPython and freezing it using cxFreeze. All seems to be going fine apart from this following bit:\nWhen I run the executable created by cxFreeze, a blank console window pops up. I don't want to show it. Is there any way I could hide it? \nIt doesn't seem to be documented on the cxFreeze site and Googling didn't turn up much apart from some similar sorta problems with Py2Exe.\nThanks.","AnswerCount":4,"Available Count":1,"Score":0.1488850336,"is_accepted":false,"ViewCount":18074,"Q_Id":2880316,"Users Score":3,"Answer":"If you're using Windows, you could rename your \"main\" script's extension (that launches the app) to .pyw","Q_Score":31,"Tags":"python,wxpython,cx-freeze","A_Id":2881979,"CreationDate":"2010-05-21T07:37:00.000","Title":"How can I hide the console window when freezing wxPython applications with cxFreeze?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am trying really hard to make a sliding frame containing widgets in tkinter in python. There is this frame inside a big window with different widgets. And as soon as i click on the next button on that frame the frame should slowly slide towards the left and vanish ultimately. As soon as it vanishes, i want new frame with widgets to come sliding towards right. \nWhat should i do? \nAnticipating your suggestions and ideas.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1113,"Q_Id":2882060,"Users Score":0,"Answer":"How you do it depends on the geometry manager, but the basic idea is simply to set the width of the frame to smaller and smaller values until it has a width of zero. You don't need a loop though -- the code is already running in the event loop, so take advantage of that. Use 'after' to schedule a job that changes the width a tiny bit, then reschedules itself for a few milliseconds later.","Q_Score":0,"Tags":"python,user-interface,tkinter,frame,sliding","A_Id":2896537,"CreationDate":"2010-05-21T12:38:00.000","Title":"Creating a sliding frame containing widgets in tkinter in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Could someone show me how I could return a value from a wxPython Frame? When the use clicks close, I popup a message dialog asking him a question. I would like to return the return code of this message dialog to my calling function.\nThanks","AnswerCount":8,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":7486,"Q_Id":2889255,"Users Score":0,"Answer":"I don't think a wxFrame can return a value since it is not modal. If you don't need to use a wxFrame, then a modal dialog could work for you. If you really need a frame, I'd consider using a custom event. \nIt would go something like this:\n(1) User clicks to close the wxFrame\n(2) You override OnClose (or something like that) to pop up a dialog to ask the user a question\n(3) Create and post the custom event\n(4) Close the wxFrame\n(5) Some other code processes your custom event","Q_Score":7,"Tags":"python,wxpython","A_Id":2893253,"CreationDate":"2010-05-22T18:27:00.000","Title":"Return value from wxPython Frame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a working QListView, but from the documentation, I can't figure out how to get a signal to fire with the index of the newly selected item. Any ideas?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":3622,"Q_Id":2911991,"Users Score":1,"Answer":"Imho, an easier way to achieve this would be to use a QListWidget instead of a QListView, this way you could use the itemClicked signal, which sends the selected item to the callback function.","Q_Score":1,"Tags":"python,pyqt4,qlistview","A_Id":2912399,"CreationDate":"2010-05-26T10:16:00.000","Title":"clicked() signal for QListView in PyQt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm rewriting this post to clarify some things and provide a full class definition for the Virtual List I'm having trouble with. The class is defined like so:\n\nfrom wx import ListCtrl, LC_REPORT, LC_VIRTUAL, LC_HRULES, LC_VRULES, \\\n EVT_LIST_COL_CLICK, EVT_LIST_CACHE_HINT, EVT_LIST_COL_RIGHT_CLICK, \\\n ImageList, IMAGE_LIST_SMALL, Menu, MenuItem, NewId, ITEM_CHECK, Frame, \\\n EVT_MENU\n\nclass VirtualList(ListCtrl):\n def __init__(self, parent, datasource = None,\n style = LC_REPORT | LC_VIRTUAL | LC_HRULES | LC_VRULES):\n ListCtrl.__init__(self, parent, style = style)\n\n self.columns = []\n self.il = ImageList(16, 16)\n\n self.Bind(EVT_LIST_CACHE_HINT, self.CheckCache)\n self.Bind(EVT_LIST_COL_CLICK, self.OnSort)\n\n if datasource is not None:\n self.datasource = datasource\n self.Bind(EVT_LIST_COL_RIGHT_CLICK, self.ShowAvailableColumns)\n\n self.datasource.list = self\n\n self.Populate()\n\n def SetDatasource(self, datasource):\n self.datasource = datasource\n\n def CheckCache(self, event):\n self.datasource.UpdateCache(event.GetCacheFrom(), event.GetCacheTo())\n\n def OnGetItemText(self, item, col):\n return self.datasource.GetItem(item, self.columns[col])\n\n def OnGetItemImage(self, item):\n return self.datasource.GetImg(item)\n\n def OnSort(self, event):\n self.datasource.SortByColumn(self.columns[event.Column])\n self.Refresh()\n\n def UpdateCount(self):\n self.SetItemCount(self.datasource.GetCount())\n\n def Populate(self):\n self.UpdateCount()\n\n self.datasource.MakeImgList(self.il)\n\n self.SetImageList(self.il, IMAGE_LIST_SMALL)\n\n self.ShowColumns()\n\n def ShowColumns(self):\n for col, (text, visible) in enumerate(self.datasource.GetColumnHeaders()):\n if visible:\n self.columns.append(text)\n self.InsertColumn(col, text, width = -2)\n\n def Filter(self, filter):\n self.datasource.Filter(filter)\n\n self.UpdateCount()\n\n self.Refresh()\n\n def ShowAvailableColumns(self, evt):\n colMenu = Menu()\n\n self.id2item = {}\n\n for idx, (text, visible) in enumerate(self.datasource.columns):\n id = NewId()\n\n self.id2item[id] = (idx, visible, text)\n\n item = MenuItem(colMenu, id, text, kind = ITEM_CHECK)\n colMenu.AppendItem(item)\n\n EVT_MENU(colMenu, id, self.ColumnToggle)\n\n item.Check(visible)\n\n Frame(self, -1).PopupMenu(colMenu)\n\n colMenu.Destroy()\n\n def ColumnToggle(self, evt):\n toggled = self.id2item[evt.GetId()]\n\n if toggled[1]:\n idx = self.columns.index(toggled[2])\n\n self.datasource.columns[toggled[0]] = (self.datasource.columns[toggled[0]][0], False)\n\n self.DeleteColumn(idx)\n\n self.columns.pop(idx)\n\n else:\n self.datasource.columns[toggled[0]] = (self.datasource.columns[toggled[0]][0], True)\n\n idx = self.datasource.GetColumnHeaders().index((toggled[2], True))\n\n self.columns.insert(idx, toggled[2])\n\n self.InsertColumn(idx, toggled[2], width = -2)\n\n self.datasource.SaveColumns()\n\nI've added functions that allow for Column Toggling which facilitate my description of the issue I'm encountering. On the 3rd instance of this class in my application the Column at Index 1 will not display String values. Integer values are displayed properly. If I add print statements to my OnGetItemText method the values show up in my console properly. This behavior is not present in the first two instances of this class, and my class does not contain any type checking code with respect to value display.\nIt was suggested by someone on the wxPython users' group that I create a standalone sample that demonstrates this issue if I can. I'm working on that, but have not yet had time to create a sample that does not rely on database access. Any suggestions or advice would be most appreciated. I'm tearing my hair out on this one.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1183,"Q_Id":2914816,"Users Score":0,"Answer":"Are you building on the wxPython demo code for virtual list controls? There are a couple of bookkeeping things you need to do, like set the ItemCount property.\nOne comment about your OnGetItemText method: Since there's no other return statement, it will return None if data is None, so your test has no effect.\nHow about return data or \"\" instead?","Q_Score":2,"Tags":"python,wxpython,listctrl","A_Id":2915460,"CreationDate":"2010-05-26T16:17:00.000","Title":"wxPython ListCtrl Column Ignores Specific Fields","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm rewriting this post to clarify some things and provide a full class definition for the Virtual List I'm having trouble with. The class is defined like so:\n\nfrom wx import ListCtrl, LC_REPORT, LC_VIRTUAL, LC_HRULES, LC_VRULES, \\\n EVT_LIST_COL_CLICK, EVT_LIST_CACHE_HINT, EVT_LIST_COL_RIGHT_CLICK, \\\n ImageList, IMAGE_LIST_SMALL, Menu, MenuItem, NewId, ITEM_CHECK, Frame, \\\n EVT_MENU\n\nclass VirtualList(ListCtrl):\n def __init__(self, parent, datasource = None,\n style = LC_REPORT | LC_VIRTUAL | LC_HRULES | LC_VRULES):\n ListCtrl.__init__(self, parent, style = style)\n\n self.columns = []\n self.il = ImageList(16, 16)\n\n self.Bind(EVT_LIST_CACHE_HINT, self.CheckCache)\n self.Bind(EVT_LIST_COL_CLICK, self.OnSort)\n\n if datasource is not None:\n self.datasource = datasource\n self.Bind(EVT_LIST_COL_RIGHT_CLICK, self.ShowAvailableColumns)\n\n self.datasource.list = self\n\n self.Populate()\n\n def SetDatasource(self, datasource):\n self.datasource = datasource\n\n def CheckCache(self, event):\n self.datasource.UpdateCache(event.GetCacheFrom(), event.GetCacheTo())\n\n def OnGetItemText(self, item, col):\n return self.datasource.GetItem(item, self.columns[col])\n\n def OnGetItemImage(self, item):\n return self.datasource.GetImg(item)\n\n def OnSort(self, event):\n self.datasource.SortByColumn(self.columns[event.Column])\n self.Refresh()\n\n def UpdateCount(self):\n self.SetItemCount(self.datasource.GetCount())\n\n def Populate(self):\n self.UpdateCount()\n\n self.datasource.MakeImgList(self.il)\n\n self.SetImageList(self.il, IMAGE_LIST_SMALL)\n\n self.ShowColumns()\n\n def ShowColumns(self):\n for col, (text, visible) in enumerate(self.datasource.GetColumnHeaders()):\n if visible:\n self.columns.append(text)\n self.InsertColumn(col, text, width = -2)\n\n def Filter(self, filter):\n self.datasource.Filter(filter)\n\n self.UpdateCount()\n\n self.Refresh()\n\n def ShowAvailableColumns(self, evt):\n colMenu = Menu()\n\n self.id2item = {}\n\n for idx, (text, visible) in enumerate(self.datasource.columns):\n id = NewId()\n\n self.id2item[id] = (idx, visible, text)\n\n item = MenuItem(colMenu, id, text, kind = ITEM_CHECK)\n colMenu.AppendItem(item)\n\n EVT_MENU(colMenu, id, self.ColumnToggle)\n\n item.Check(visible)\n\n Frame(self, -1).PopupMenu(colMenu)\n\n colMenu.Destroy()\n\n def ColumnToggle(self, evt):\n toggled = self.id2item[evt.GetId()]\n\n if toggled[1]:\n idx = self.columns.index(toggled[2])\n\n self.datasource.columns[toggled[0]] = (self.datasource.columns[toggled[0]][0], False)\n\n self.DeleteColumn(idx)\n\n self.columns.pop(idx)\n\n else:\n self.datasource.columns[toggled[0]] = (self.datasource.columns[toggled[0]][0], True)\n\n idx = self.datasource.GetColumnHeaders().index((toggled[2], True))\n\n self.columns.insert(idx, toggled[2])\n\n self.InsertColumn(idx, toggled[2], width = -2)\n\n self.datasource.SaveColumns()\n\nI've added functions that allow for Column Toggling which facilitate my description of the issue I'm encountering. On the 3rd instance of this class in my application the Column at Index 1 will not display String values. Integer values are displayed properly. If I add print statements to my OnGetItemText method the values show up in my console properly. This behavior is not present in the first two instances of this class, and my class does not contain any type checking code with respect to value display.\nIt was suggested by someone on the wxPython users' group that I create a standalone sample that demonstrates this issue if I can. I'm working on that, but have not yet had time to create a sample that does not rely on database access. Any suggestions or advice would be most appreciated. I'm tearing my hair out on this one.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1183,"Q_Id":2914816,"Users Score":0,"Answer":"There's a problem with the native object in Windows. If GetImg returns None instead of -1 the list has a problem with column 1 for some reason. That from Robin over on the Google Group post for this issue.","Q_Score":2,"Tags":"python,wxpython,listctrl","A_Id":2954639,"CreationDate":"2010-05-26T16:17:00.000","Title":"wxPython ListCtrl Column Ignores Specific Fields","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a window with 2 QTableWidgets, having their scrolling synchronized.\nThe 1st one usually has horizontal scroll, while the 2nd usually (automatically) not.\nIn order for them to show consistent data (row against row) I make the 2nd have the scroll (through property HorizontalScrollBar -> AlwaysOn).\nBut sometimes the 1st table doesn't have the scroll. What's event worse, it may have it or not depending on the window size (when making window wider the scroll disappears). As far as I see there's no signal for resize of window or control (widget).\nI can, of course, use some constantly running timer to check if 1st table has scroll, but I wounder if there's more pure solution.\nThanks!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":695,"Q_Id":2916052,"Users Score":0,"Answer":"The answer was to reimplement the resizeEvent and check table.horizontalScrollBar().isVisible()","Q_Score":0,"Tags":"python,pyqt4","A_Id":3012347,"CreationDate":"2010-05-26T19:20:00.000","Title":"Track window\/control resize in PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an application that displays some HTML in a QWebview, which references images on the local file system. This works fine directly running the python. When compiling via py2exe, the images no longer load. Google doesn't seem to know the answer, any ideas?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":1402,"Q_Id":2924781,"Users Score":2,"Answer":"Only png support is native, jpg (and others) is supplied via plugins.\nDon't recall the exact paths (and I don't know your platform) but search for the PyQt plugins folder and:\n\nCopy the plugins folder to: $yourprogram\/PyQt4\/plugins (along with qt.conf)\nEdit qt.conf, and change prefix to $yourprogram\/PyQt4\n\nYou might also need to convince py2exe to also include this folder (verbatim).","Q_Score":1,"Tags":"python,pyqt4,py2exe,qwebview","A_Id":2925711,"CreationDate":"2010-05-27T20:46:00.000","Title":"Images not loading in QWebview in PyQt4 in py2exe","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am writing a wxPython application that remains open after closing all of its windows - so you can still drag & drop new files onto the OSX dock icon (I do this with myApp.SetExitOnFrameDelete(False)).\nUnfortunately if I close all the windows, the OSX menubar will only contain a \"Help\" menu. I would like to add at least a File\/Open menu item, or just keep the menubar of the main window. Is this somehow possible in wxPython?\nIn fact, I would be happy with a non-wxPython hack as well (for example, setting the menu in pyobjc, but running the rest of the GUI in wxPython). wxPython development in OSX is such a hack anyway ;)\nUPDATE: I managed to solve this problem using the tip from Lyndsey Ferguson. Here's what I have done:\n\nOn startup I create a window which I show and hide immediately. I set its position to (-10000,-10000) so that it does not flicker on the screen (aargh, what a dirty hack!)\nI create an empty EVT_CLOSE event handler in that window so that it cannot be closed.\nIt seems that destroying a window resets the OSX menu, but hiding does not... So when the last window is closed, I need to show and hide this window again (hiding is necessary so that the user cannot switch to this window using the Window menu or Cmd-`)\n\nYeah, this is really ugly... I will be very grateful if someone comes up with a prettier solution.\nUPDATE 2: Actually it can be solved in a much easier way: if we do not close the last window, only hide it. And ensure that it does not respond to menu events anymore.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1471,"Q_Id":2934435,"Users Score":1,"Answer":"Can you create a hidden window that is offscreen somewhere? It is a hack, but I remember having to do a lot of hacks to make my wxPython-based application work correctly on Mac OS X.\nNote:You'll have to disable the close button and set up that hidden window so that it doesn't show up in the Window menu.\nAside:Have you considered factoring out your GUI portion of your Python application and using PyObjC on Mac OS X? You'll get more native behaviours...","Q_Score":5,"Tags":"python,macos,wxpython,pyobjc","A_Id":2958571,"CreationDate":"2010-05-29T09:02:00.000","Title":"How to change the OSX menubar in wxPython without any opened window?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have a QWebview in a grid layout, along with other widgets. When the user resizes the window, the QWebview doesn't resize, but the other widgets do. How can I make the QWebview resize correctly?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1113,"Q_Id":2938874,"Users Score":0,"Answer":"in the dialog class's resizeEvent, one that extends QDialog, call webView->setGeometry, and this->resize, this->update.\nhint: check if size changed via the QResizeEvent *ptr","Q_Score":0,"Tags":"python,grid,resize,pyqt4,qwebview","A_Id":6977293,"CreationDate":"2010-05-30T13:51:00.000","Title":"PyQT4 QWebView not resizing correctly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a media player. Right now it's a simple window with a button to load .wav files. The problem is I would like to implement a pause button now. But, when playing a audio file the GUI isn't accessible again (no buttons can be pushed) till the file is done playing. How can I make the GUI dynamic while an audio file is playing? \nI'm using PyAudio, and their implementation doesn't allow this.","AnswerCount":3,"Available Count":1,"Score":0.2605204458,"is_accepted":false,"ViewCount":3328,"Q_Id":2939224,"Users Score":4,"Answer":"Probably you have to use threads for that. You have to play your audio file in a different thread than the gui mainloop so that the GUI keeps responding user input.\nIMHO, wxpython is not so complicated and has some utility functions that would help to do what you want. Check the wxpython demo, you have several examples there.","Q_Score":0,"Tags":"python,tkinter,media,pyaudio,audio-player","A_Id":2939414,"CreationDate":"2010-05-30T15:30:00.000","Title":"Python\/Tkinter Audio Player","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a small script in python with ttk and I have a problem where a function runs where it shouldn't. The button code looks as follows:\n\nbtReload = ttk.Button(treeBottomUI, text=\"Reload\", width=17, command=loadModelTree(treeModel))\nbtReload.pack(side=\"left\")\n\nand the function is as this:\n\ndef loadModelTree(tree):\n print (\"Loading models...\")\n allModels = os.listdir(confModPath)\n for chunk in allModels:\n ...\n\nFor some reason, the function runs without the button being pressed. Why?","AnswerCount":2,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":3407,"Q_Id":2947817,"Users Score":2,"Answer":"Markus, yes, that's the right solution, but it is not because you can't use multi-argument commands in widget callouts. Consider, in your original code, ...command=loadModelTree(treeModel)... is an invocation of the method. Lambda allows you to abstract the command so you can have an arbitrary number of arguments without confusing the interpreter by invoking it, e.g., ...command=lambda arg1=myarg1, arg2=myarg2, arg3=myarg3: myCallout(arg1, arg2, arg3)....\nI hope that makes what is going on a bit clearer.","Q_Score":1,"Tags":"python,function,button,ttk","A_Id":11642028,"CreationDate":"2010-06-01T06:58:00.000","Title":"Python ttk.Button -command, runs without button being pressed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a small script in python with ttk and I have a problem where a function runs where it shouldn't. The button code looks as follows:\n\nbtReload = ttk.Button(treeBottomUI, text=\"Reload\", width=17, command=loadModelTree(treeModel))\nbtReload.pack(side=\"left\")\n\nand the function is as this:\n\ndef loadModelTree(tree):\n print (\"Loading models...\")\n allModels = os.listdir(confModPath)\n for chunk in allModels:\n ...\n\nFor some reason, the function runs without the button being pressed. Why?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":3407,"Q_Id":2947817,"Users Score":1,"Answer":"Well, as I found the answer, I'll answer my own question.\nIt appers that ttk.button commands does not support sending arguments to functions so the work around is to do as follows:\n\nbtReload = ttk.Button(treeBottomUI, text=\"Reload\", width=17, command=lambda i=treeModel: loadModelTree(i))\nbtReload.pack(side=\"left\")\n\nSimple as pie!","Q_Score":1,"Tags":"python,function,button,ttk","A_Id":2947926,"CreationDate":"2010-06-01T06:58:00.000","Title":"Python ttk.Button -command, runs without button being pressed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to print the contents of a python tkinter canvas. I have tried using the postscript method of canvas to create a postscript file, but I get a blank page. I know this is because I have embedded widgets, and these do not get rendered by the postscript method.\nBefore I rewrite my program to create a more printer-friendly layout, can someone suggest a way to approach this problem? All of the programming books I have ever read approach the problem of sending output to a printer with a bit of hand-waving, something along the lines of: \"It's a difficult problem that depends on interacting with the operating system.\" I also have a hard time finding resources about this because of all the pages related to printing to the screen.\nI am using Python 2.6, on Ubuntu 9.04.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5306,"Q_Id":2951530,"Users Score":0,"Answer":"I think your butting up to the limits of Tkinter. If not for the widgets, another method is to draw the same image on a PIL image-draw object as the two have similar APIs.\nA hacky workaround would be to programatically take a screen grab of the window area you want using ImageGrab in PIL.\nwxPython is a decent alternative. Personally I prefer Qt, it certainly has excellent printer support. Also the Graphics View framework is outstanding.","Q_Score":5,"Tags":"python,printing,tkinter","A_Id":3214960,"CreationDate":"2010-06-01T16:29:00.000","Title":"Printing python tkinter output","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm going to start on a long (~1-year) programming project in Python. I want to use wxPython for my GUI (supports 2.6), but I also want to use 3.1 for the rest of the project (to start using the 3.x syntax).\nIs there any way for me to design a project that mixes 2.x and 3.x modules? Or should I just bite the bullet and use either 2.x (preferred, since I really want to learn wxPython) or 3.x throughout?\nThanks,\nMike","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":4940,"Q_Id":2951982,"Users Score":3,"Answer":"Python 2 and 3 are not that different. If you have learned Python 2 well, it will be a matter of minutes to get acquainted with Python 3. The official recommendation says that you should use Python 2.6 (the current version) and try to be forward-compatible. Python 3 is currently not an option for large projects as virtually none of the popular packages have been translated yet. But development of Python 2 and 3 will continue in parallel for a long time, so you won't lose much by not using Python 3. You can import many syntactical features of 3 (Unicode string literals, division, print function, absolute imports) using the __future__ module, and the standard library remains mostly the same. So I'd recommend using Python 2.","Q_Score":5,"Tags":"python,python-3.x,python-2.x","A_Id":2952037,"CreationDate":"2010-06-01T17:43:00.000","Title":"Can one Python project use both 2.x and 3.x code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm going to start on a long (~1-year) programming project in Python. I want to use wxPython for my GUI (supports 2.6), but I also want to use 3.1 for the rest of the project (to start using the 3.x syntax).\nIs there any way for me to design a project that mixes 2.x and 3.x modules? Or should I just bite the bullet and use either 2.x (preferred, since I really want to learn wxPython) or 3.x throughout?\nThanks,\nMike","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":4940,"Q_Id":2951982,"Users Score":2,"Answer":"mixing the ability to use wxPython (2.x) + with learning new syntax (3.x) \n\nDon't \"mix\".\nWrite Python 2. Get it to work.\nPlay with Python 3 separately. Don't \"mix\".\nWhen the various packages and modules are available in Python 3, use the 2to3 conversion to create Python 3. You'll find some small problems. Fix your Python 2 so that your package works in Python 2 and also works after the conversion.\nThen, you can drop support for Python 2 and focus on Python 3. \nDon't \"mix\".","Q_Score":5,"Tags":"python,python-3.x,python-2.x","A_Id":3026057,"CreationDate":"2010-06-01T17:43:00.000","Title":"Can one Python project use both 2.x and 3.x code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a signal that is emitted when a window\/dialog is presented in GTK+?\nExample: when issuing this command to the GTK widget dialog:\ndialog.present()\nis there a resulting signal? Or is there any signal that denotes the \"showing\" of a window\/dialog?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":317,"Q_Id":2954412,"Users Score":1,"Answer":"I believe the \"show\" signal (inherited from Widget) will do this.","Q_Score":0,"Tags":"python,c,gtk","A_Id":2954934,"CreationDate":"2010-06-02T01:16:00.000","Title":"gtk+ signal emitted when window\/dialog is \"presented\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. \nThe functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or other taxing\/exotic things.\nSeems there are quite a few options for Python GUI libraries (Tk, QT, wxPython, Gtk, etc). What do you recommend that:\n\nIs easy to learn and maintain\nCan be cleanly packaged using py2exe or something similar\nLooks nice\n\n[Update] For what it's worth I ended up going with tkinter. It's fairly well documented, can be made to look nice (mainly, use native fonts), and most importantly ships with Python so there's nothing extra to worry about. wxpython also looked good, but the download was 10M or so, and I didn't want to add that extra weight to the packages I distribute.","AnswerCount":5,"Available Count":4,"Score":0.1194272985,"is_accepted":false,"ViewCount":4853,"Q_Id":2962194,"Users Score":3,"Answer":"The most beautiful one that I can suggest is PyQt (almost native), otherwise a good idea would be using directly IronPython that is native .net code.\nAnyway nothing beats tkinter for multi-platformness and packaging-friendliness.","Q_Score":3,"Tags":"python,user-interface,wxpython,tkinter","A_Id":2962443,"CreationDate":"2010-06-02T22:54:00.000","Title":"Python: Attractive, clean, packagable windows GUI library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. \nThe functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or other taxing\/exotic things.\nSeems there are quite a few options for Python GUI libraries (Tk, QT, wxPython, Gtk, etc). What do you recommend that:\n\nIs easy to learn and maintain\nCan be cleanly packaged using py2exe or something similar\nLooks nice\n\n[Update] For what it's worth I ended up going with tkinter. It's fairly well documented, can be made to look nice (mainly, use native fonts), and most importantly ships with Python so there's nothing extra to worry about. wxpython also looked good, but the download was 10M or so, and I didn't want to add that extra weight to the packages I distribute.","AnswerCount":5,"Available Count":4,"Score":0.0399786803,"is_accepted":false,"ViewCount":4853,"Q_Id":2962194,"Users Score":1,"Answer":"From using both wxPython and TKinter, I'd say wxPython looks nicer and is easy to learn.\nAlthough you said you are planning on using the program for Windows, it's worth mentioning that I've had problems with TKinter on Mac not working correctly.","Q_Score":3,"Tags":"python,user-interface,wxpython,tkinter","A_Id":2962216,"CreationDate":"2010-06-02T22:54:00.000","Title":"Python: Attractive, clean, packagable windows GUI library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. \nThe functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or other taxing\/exotic things.\nSeems there are quite a few options for Python GUI libraries (Tk, QT, wxPython, Gtk, etc). What do you recommend that:\n\nIs easy to learn and maintain\nCan be cleanly packaged using py2exe or something similar\nLooks nice\n\n[Update] For what it's worth I ended up going with tkinter. It's fairly well documented, can be made to look nice (mainly, use native fonts), and most importantly ships with Python so there's nothing extra to worry about. wxpython also looked good, but the download was 10M or so, and I didn't want to add that extra weight to the packages I distribute.","AnswerCount":5,"Available Count":4,"Score":0.0399786803,"is_accepted":false,"ViewCount":4853,"Q_Id":2962194,"Users Score":1,"Answer":"I've used wxPython in the past (For Mac\/Windows deployments). It has worked good. And it looks nicer than Tk :)","Q_Score":3,"Tags":"python,user-interface,wxpython,tkinter","A_Id":2962200,"CreationDate":"2010-06-02T22:54:00.000","Title":"Python: Attractive, clean, packagable windows GUI library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. \nThe functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or other taxing\/exotic things.\nSeems there are quite a few options for Python GUI libraries (Tk, QT, wxPython, Gtk, etc). What do you recommend that:\n\nIs easy to learn and maintain\nCan be cleanly packaged using py2exe or something similar\nLooks nice\n\n[Update] For what it's worth I ended up going with tkinter. It's fairly well documented, can be made to look nice (mainly, use native fonts), and most importantly ships with Python so there's nothing extra to worry about. wxpython also looked good, but the download was 10M or so, and I didn't want to add that extra weight to the packages I distribute.","AnswerCount":5,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":4853,"Q_Id":2962194,"Users Score":3,"Answer":"tkinter's major advantage (IMHO!) is that it comes with Python (at least on Windows). It looks ugly, and there's no progress bar or something like that (at least not builtin). Being a thin wrapper around Tk, its API doesn't feel very elegant or intuitive. However, there are quite a few good Tkinter resources on the web so learning it is not necessarily a pain.\nFor any serious GUI attempts, I'd go for wxPython as well. I don't know about packaging, though. But I wouldn't expect any problems.","Q_Score":3,"Tags":"python,user-interface,wxpython,tkinter","A_Id":2962228,"CreationDate":"2010-06-02T22:54:00.000","Title":"Python: Attractive, clean, packagable windows GUI library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to start learning OpenGL but I don't really want to have to learn another language to do it. I already am pretty proficient in python and enjoy the language. I just want to know how close it is to the regular api? Will I be able to pretty easily follow tutorials and books without too much trouble?\nI know C++ gives better performance, but for just learning can I go wrong with PyOpenGL?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":3573,"Q_Id":2962571,"Users Score":13,"Answer":"With the caveat that I have done very little OpenGL programming myself, I believe that for the purposes of learning, PyOpenGL is a good choice. The main reason is that PyOpenGL, like most other OpenGL wrappers, is just that: a thin wrapper around the OpenGL API. \nOne large benefit of PyOpenGL is that while in C you have to worry about calling the proper glVertex3{dfiX} command, Python allows you to just write glVertex3(x,y,z) without worrying about telling Python what type of argument you passed in. That might not sound like a big deal, but it's often much simpler to use Python's duck-typing instead of being overly concerned with static typing.\nThe OpenGL methods are almost completely all wrapped into Python methods, so while you'll be writing in Python, the algorithms and method calls you'll use are identical to writing OpenGL in any other language. But since you're writing in Python, you'll have many fewer opportunities to make \"silly\" mistakes with proper pointer usage, memory management, etc. that would just eat up your time if you were to study the API in C or C++, for instance.","Q_Score":9,"Tags":"python,graphics,pyopengl","A_Id":2962599,"CreationDate":"2010-06-03T00:28:00.000","Title":"Is PyOpenGL a good place to start learning opengl programming?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to start learning OpenGL but I don't really want to have to learn another language to do it. I already am pretty proficient in python and enjoy the language. I just want to know how close it is to the regular api? Will I be able to pretty easily follow tutorials and books without too much trouble?\nI know C++ gives better performance, but for just learning can I go wrong with PyOpenGL?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3573,"Q_Id":2962571,"Users Score":0,"Answer":"PyOpenGL\n\nI don't think it is a good choice. In my opinon in C\/C++ it is easier to play around around with your OpenGL code - start with simple app, then add shader, then add some geometry functions, make a texture\/geometry generator, build scene via CSG, etc. You know - to have fun, play around with code, experiment and learn something in process. I honestly just don't see myself doing this in python. Surely it is possible to do OpenGL programming in Python, but I see no reason to actually do it. Plus several OpenGL functions take memory pointers as arguments, and although there probably a class (or dozen of alternatives) for that case, I don't see a reason to use them when a traditional way of doing things is available in C\/C++, especially when I think about amount of wrappers python code uses to pass vector or array of those into OpenGL function. It just looks like making things more complicated without a real reason to do that. Plus there is a noticeable performance drop, especially when you use \"RAW\" OpenGL.\nBesides, if you're going to make games, it is very likely that you'll have to use C++ or some other \"non-python\" language.\nP.S. I've done enough OpenGL programming, a lot of DirectX programming, but I specialize on C++, and use python only for certain algorithmic tests, tools and scripts.","Q_Score":9,"Tags":"python,graphics,pyopengl","A_Id":2963034,"CreationDate":"2010-06-03T00:28:00.000","Title":"Is PyOpenGL a good place to start learning opengl programming?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a toolbar using wxpython and I want to put the Quit button on the right side of it, I don't want to put them sequencially.\nIs it possible to define this position?\nThanks in advance!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":292,"Q_Id":2964108,"Users Score":0,"Answer":"If you add the quit button last, it will be on the right side.","Q_Score":0,"Tags":"python,button,wxpython,toolbar,position","A_Id":3172009,"CreationDate":"2010-06-03T07:47:00.000","Title":"Is it possible to put a toolbar button on the right side of it using wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am streaming some data down from a webcam. When I get all of the bytes for a full image (in a string called byteString) I want to display the image using OpenCV. Done fast enough, this will \"stream\" video from the webcam to an OpenCV window.\nHere's what I've done to set up the window:\ncvNamedWindow('name of window', CV_WINDOW_AUTOSIZE)\nAnd here's what I do when the byte string is complete:\nimg = cvCreateImage(IMG_SIZE,PIXEL_DEPTH,CHANNELS)\nbuf = ctypes.create_string_buffer(byteString)\nimg.imageData = ctypes.cast(buf, ctypes.POINTER(ctypes.c_byte))\ncvShowImage('name of window', img)\ncvWaitKey(0)\nFor some reason this is producing an error:\nFile \"C:\\Python26\\lib\\site-packages\\ctypes_opencv\\highgui_win32.py\", line 226, in execute\n return func(*args, **kwargs)\nWindowsError: exception: access violation reading 0x015399E8\nDoes anybody know how to do what I'm trying to do \/ how to fix this crazy violation error?","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1712,"Q_Id":2970207,"Users Score":2,"Answer":"I actually solved this problem and forgot to post the solution. Here's how I did it, though it may not be entirely robust:\nI analyzed the headers coming from the MJPEG of the network camera I was doing this to, then I just read from the stream 1 byte at a time, and, when I detected that the header of the next image was also in the bytestring, I cut the last 42 bytes off (since that's the length of the header).\nThen I had the bytes of the JPEG, so I simply created a new Cv Image by using the open(...) method and passing it the byte string wrapped in a StringIO class.","Q_Score":3,"Tags":"python,string,image,opencv,byte","A_Id":2980849,"CreationDate":"2010-06-03T22:20:00.000","Title":"from string of bytes to OpenCV's IplImage in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is NetBeans recommended for developing a GUI for a Python app? \nDoes it have a form\/screen builder for Python apps, like Dabo?","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":11421,"Q_Id":2971094,"Users Score":2,"Answer":"I haven't seen a built-in GUI builder for CPython. You could use Jython + Matisse (the built-in Netbeans Java-based GUI builder).","Q_Score":5,"Tags":"python,netbeans","A_Id":2971227,"CreationDate":"2010-06-04T02:15:00.000","Title":"Using NetBeans for Python GUI development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have downloaded the zip archive (my only option) and installed it as suggested by unzipping into the dropin folder. When I try to start a project the problem occurs:\n\"Plug-in org.python.pydev was unable to load class org.python.pydev.ui.wizard.project.PythonProjectWizard\"\nI've googled and the only suggestion is to re-download and re-install as it might be a corrupted install. Done that, no good. Any more suggestions? Seems PyDev have a lot of troubles getting the zip alternative to work... (judging by other similar posts)\nThis is regardless of Eclipse version.\nI run under WinXP.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3435,"Q_Id":2972696,"Users Score":0,"Answer":"I had no luck with this. Eventually I had to download it through Eclipse download manager and it worked. I guess they have some issues with the automatic plugin functionality.","Q_Score":2,"Tags":"python,eclipse,eclipse-plugin,pydev","A_Id":3211758,"CreationDate":"2010-06-04T08:58:00.000","Title":"PyDev problem staring project","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Logitech G15 keyboard. It has a screen. Can i program this? I googled it but the one site i found didn't work.. It seems like it is possible, but i cannot grasp how.\nThanks!\nThis site is truly great.","AnswerCount":2,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":977,"Q_Id":2976446,"Users Score":6,"Answer":"I believe the G15 comes with an SDK. You could use that along with the ctypes module to call into the supplied DLLs. Otherwise, I imagine you'd have to use something like Swig or Boost.Python to make a Python module for the G15 from the SDK.","Q_Score":3,"Tags":"python,logitech,g15","A_Id":2976466,"CreationDate":"2010-06-04T17:36:00.000","Title":"Is Python programming for Logitech G15 possible?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"By just adding a datagridview in IronPython Studio it triggers a\n\"DataGridView' object has no attribute 'BeginInit'\". Is there a fix for this? \nThe errors are gone if the lines self._DataGridView1.BeginInit() and self._DataGridView1.EndInit() are deleted, but that's not what it should be done to fix that","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":773,"Q_Id":2976803,"Users Score":2,"Answer":"There's no fix for this and there's likely not to be one because IronPython Studio isn't supported anymore. DataGridView.BeginInit is implemented explicitly and IronPython Studio is based upon IronPython 1.1. You might be able to work around with it by changing that to \"ISupportInitialize.BeginInit(self._DataGridView1)\" after importing ISupportInitialize but I doubt it'll survive round tripping through the designer.\nIf you wanted to fix this yourself the source for IronPython Studio is available and you could try modifying the winforms designer code to notice the explicit interface implementation call and emit this code instead. That's likely just fixing IronPython's CodeDom generator.\nBut really I'd advise you to move to IronPython Tools and WPF. Generating code for the WinForms designer doesn't really work that well with IronPython and WPF is much more suitable. An alternate plan would be to generate the WinForm w\/ the designer in C# and subclass it from Python.","Q_Score":1,"Tags":".net,winforms,ironpython,ironpython-studio","A_Id":2978656,"CreationDate":"2010-06-04T18:37:00.000","Title":"Adding a DataGridView in IronPython Studio Winforms gets a \"'DataGridView' object has no attribute 'BeginInit'\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a dense set of points in the plane. I want them colored so that points that are close to each other have the same color, and a different color if they're far away. For simplicity assume that there are, say, 5 different colors to choose from. Turns out I've not the slightest idea how to do that ..\nI'm using Tkinter with Python, by the way","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":270,"Q_Id":2979697,"Users Score":0,"Answer":"I'd start with identifying the concentrations of the spots in the plane. Find the centers of those agglomerations and assign them each unique color. Then for other spots you could simply calculate the color using the linear principle. For example, if one center is red and the other is yellow, a point somewhere in the middle would become orange.\nI'd probably use some exponential function instead of a linear principle. This will keep the point groups more or less of the same color only giving a noticeable color change to far away points, or, to be more exact, to far away and somewhere in between points.","Q_Score":4,"Tags":"python,geometry,tkinter","A_Id":2979705,"CreationDate":"2010-06-05T08:31:00.000","Title":"Coloring close points","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a dense set of points in the plane. I want them colored so that points that are close to each other have the same color, and a different color if they're far away. For simplicity assume that there are, say, 5 different colors to choose from. Turns out I've not the slightest idea how to do that ..\nI'm using Tkinter with Python, by the way","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":270,"Q_Id":2979697,"Users Score":0,"Answer":"One approach is to go through your points and partition them into sets with a \"center\". Since you have 5 colours, you'll have 5 sets. You compare the distance of the new point from each of the centers and then put it in the same group as the closest one.\nEach set corresponds to a different colour so you can just plot it after this partitioning is done.","Q_Score":4,"Tags":"python,geometry,tkinter","A_Id":2979707,"CreationDate":"2010-06-05T08:31:00.000","Title":"Coloring close points","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm attempting to write a Python wrapper for poker-eval, a c static library. All the documentation I can find on ctypes indicates that it works on shared\/dynamic libraries. Is there a ctypes for static libraries?\nI know about cython, but should I use that or recompile the poker-eval into a dynamic library so that I can use ctypes?\nThanks,\nMike","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":12127,"Q_Id":2983649,"Users Score":1,"Answer":"I can't say for sure there are no modules out there, but the advantages of dynamic libraries (uses less space, can update without recompiling dependent programs) are such that you're probably better off doing just that.","Q_Score":16,"Tags":"python,static-libraries,ctypes","A_Id":2983728,"CreationDate":"2010-06-06T09:03:00.000","Title":"ctypes for static libraries?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The substance of an app is more important to me than its apperance, yet GUI always seems to dominate a disproportionate percentage of programmer time, development and target resource requirements\/constraints.\nIdeally I'd like an application architecture that will permit me to develop an app\nusing a lightweight reference GUI\/kit and focus on non gui aspects to produce \na quality app which is GUI enabled\/friendly.\nI would want APP and the GUI to be sufficiently decoupled to maximize the ease \nfor you GUI experts to plug the app into to some target GUI design\/framework\/context.\ne.g. targets such as: termcap GUI, web app GUI framework, desktop GUI, thin client GUI. \nIn short: How do I mostly ignore the GUI, but avoid painting you into a corner when I don't even know who you are yet?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":141,"Q_Id":2991910,"Users Score":3,"Answer":"Write a core library that handles the functionality and provides hooks for progress notification. Then write the interfaces as separate applications or libraries that use the core library.","Q_Score":2,"Tags":"python,user-interface,portability","A_Id":2991933,"CreationDate":"2010-06-07T17:58:00.000","Title":"How to ignore GUI as much as possible without rendering APP less GUI developer friendly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed VS2010 and IronPython tools. When I start a VB.NET WPFProject everything works fine. But when I start a WPF IronPython project, it creates a button by default which fills all the window, and when you try to add an event to that control or another control dragged from the toolbox, you just cant do it. You double click on them, but the event is never added to the sourcecode. Anyone had this problem?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":355,"Q_Id":2996854,"Users Score":3,"Answer":"Currently we don't have support for double clicking and adding an event handler. For the time being you'll need to wire it up by hand. We are going to spend some time on improving the designer experience so that this should eventually work.","Q_Score":1,"Tags":".net,wpf,visual-studio-2010,ironpython","A_Id":3000618,"CreationDate":"2010-06-08T11:29:00.000","Title":"Cant add events for controls in WPF IronPython VS2010","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I make a simple clipboard monitor in Python using the PyGTK GUI?\nI found gtk.clipboard class and but I couldn't find any solution to get the \"signals\" to trigger the event when the clipboard content has changed.\nAny ideas?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1505,"Q_Id":3005522,"Users Score":4,"Answer":"Without a proper notification API, such as WM_DrawClipboard messages, you would probably have to resort to a polling loop. And then you will cause major conflicts with other apps that are trying to use this shared resource.\nDo not resort to a polling loop.","Q_Score":6,"Tags":"python,clipboard,pygtk,monitor","A_Id":3010018,"CreationDate":"2010-06-09T11:54:00.000","Title":"PyGTK: how to make a clipboard monitor?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want get the details of the wave such as its frames into a array of integers.\nUsing fname.getframes we can ge the properties of the frame and save in list or anything for writing into another wav or anything,but fname.getframes gives information not in integers some thing like a \"\/xt\/x4\/0w' etc..\nBut i want them in integer so that would be helpful for manupation and smoothening join of 2 wav files","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":660,"Q_Id":3021046,"Users Score":0,"Answer":"NumPy can load the data into arrays for easy manipulation. Or SciPy. I forget which.","Q_Score":1,"Tags":"python,wav","A_Id":3021073,"CreationDate":"2010-06-11T07:45:00.000","Title":"wav file manupalation","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have a list of Project objects, that I display in a GtkTreeView. I am trying to open a dialog with a Project's details when the user double-clicks on the item's row in the TreeView. \nRight now I get the selected value from the TreeView (which is the name of the Project) via get_selection(), and search for that Project by name in my own list to corelate the selection with my own model.\nHowever, this doesn't feel quite right (plus, it assumes that a Project's name is unique), and I was wondering if there is a more elegant way of doing it.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":296,"Q_Id":3032905,"Users Score":1,"Answer":"What I ended up doing was extending gtk.ListStore and use my custom list. I also hijacked the append() method so that not only it will append a [str, str, etc] into the ListStore, but also the actual model inside a custom list property of the class that extends ListStore.\nThen, when the user double clicks the row, I fetch the requested model by the row's index in the ListStore, which corresponds to the model's index in the custom list.","Q_Score":1,"Tags":"python,pygtk,gtktreeview","A_Id":3056761,"CreationDate":"2010-06-13T16:09:00.000","Title":"How to correlate gtk.ListStore items with my own models","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When you write an application using Qt, can it just be run right away in different operating systems? And (correct me if I'm wrong) you don't need to have Qt already installed in all of the different platforms where you want to execute your application?\nHow exactly does this work? Does Qt compile to the desired platform, or does it bundle some \"dlls\" (libs), or how does it do it? Is it different from programming a Java application, that runs cross-platform.\nIf you use Python to write a Qt application with Python bindings, does your end user need to have Python installed?","AnswerCount":3,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":3747,"Q_Id":3045745,"Users Score":15,"Answer":"Qt (ideally) provides source compatibility, not binary compatibility. You still have to compile the application separately for each platform, and use the appropriate dynamic Qt libraries (which also need to be compiled separately, and have some platform-specific code). \nFor your final question, the user would need Python, the Qt libraries, and the binding library (e.g. pyqt), but there are various ways to bundle these.","Q_Score":13,"Tags":"python,qt","A_Id":3045754,"CreationDate":"2010-06-15T13:49:00.000","Title":"How does Qt work (exactly)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I force a GTK window object to stay the same size, even when a table inside of it tries to expand? \nI've tried using gtk.SHRINK when attaching children to the table, but the TextViews within the table still keep expanding to way beyond an acceptable width and expanding the window along with it.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":6353,"Q_Id":3047582,"Users Score":0,"Answer":"Text views won't expand if you pack them into a gtk.ScrolledWindow. This is not what you directly asked, but I believe should solve your problem in a better way.","Q_Score":1,"Tags":"python,pygtk","A_Id":3048270,"CreationDate":"2010-06-15T17:41:00.000","Title":"How to force GTK window to stay at a certain width, even when widgets try to expand?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to add 1,000,000+ entries to the root node of a TreeListCtrl. Therefore I would like to make it \"virtual\", i.e. work just like a virtual ListCtrl so that it's still fast and I can easily scroll around due to the currently-displayed items being loaded on-demand. But I can't use a virtual ListCtrl because I also want to be able to expand any of the 1,000,000 items to display its children (the items will always have less than 50 children). Can this be done efficiently with a TreeListCtrl? Or with a different class? From my own experiments with treemixin.VirtualTree and wx.gizmos.TreeListCtrl, overloading the OnGetItemText method does not work the same way as it does with a plain virtual ListCtrl. It doesn't get called on-demand as the user is scrolling around, meaning all 1,000,000 items have to be added to the TreeListCtrl in advance.","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":762,"Q_Id":3074175,"Users Score":0,"Answer":"One thing you might do is leave the sub-nodes empty, and catch the expand-node event. Then you check to see if the node's sub-nodes are populated. If they aren't, you add them before expanding the node. If they are populated, you simply ignore the event.","Q_Score":0,"Tags":"python,wxpython,virtual,listctrl,treecontrol","A_Id":3074866,"CreationDate":"2010-06-19T03:15:00.000","Title":"wxPython: VirtualTreeListCtrl with millions of items","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to add 1,000,000+ entries to the root node of a TreeListCtrl. Therefore I would like to make it \"virtual\", i.e. work just like a virtual ListCtrl so that it's still fast and I can easily scroll around due to the currently-displayed items being loaded on-demand. But I can't use a virtual ListCtrl because I also want to be able to expand any of the 1,000,000 items to display its children (the items will always have less than 50 children). Can this be done efficiently with a TreeListCtrl? Or with a different class? From my own experiments with treemixin.VirtualTree and wx.gizmos.TreeListCtrl, overloading the OnGetItemText method does not work the same way as it does with a plain virtual ListCtrl. It doesn't get called on-demand as the user is scrolling around, meaning all 1,000,000 items have to be added to the TreeListCtrl in advance.","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":762,"Q_Id":3074175,"Users Score":0,"Answer":"You're right that the treemixin doesn't make the TreeListCtrl really virtual. I thought about that when I was developing treemixin, but the one thing I didn't know how to solve was how to know which lines to draw to the left of items when the user is looking at items deep down the tree, e.g. 10000 to 10030. If you know of a solution for that I'll gladly adapt treemixin.\nFrank\nAuthor treemixin","Q_Score":0,"Tags":"python,wxpython,virtual,listctrl,treecontrol","A_Id":3074875,"CreationDate":"2010-06-19T03:15:00.000","Title":"wxPython: VirtualTreeListCtrl with millions of items","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to add 1,000,000+ entries to the root node of a TreeListCtrl. Therefore I would like to make it \"virtual\", i.e. work just like a virtual ListCtrl so that it's still fast and I can easily scroll around due to the currently-displayed items being loaded on-demand. But I can't use a virtual ListCtrl because I also want to be able to expand any of the 1,000,000 items to display its children (the items will always have less than 50 children). Can this be done efficiently with a TreeListCtrl? Or with a different class? From my own experiments with treemixin.VirtualTree and wx.gizmos.TreeListCtrl, overloading the OnGetItemText method does not work the same way as it does with a plain virtual ListCtrl. It doesn't get called on-demand as the user is scrolling around, meaning all 1,000,000 items have to be added to the TreeListCtrl in advance.","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":762,"Q_Id":3074175,"Users Score":0,"Answer":"I think what I'll do is use a virtual ListCtrl along with a skip-list for the data model. Initially, the data model will contain the 1 million top-layer nodes. When a node is expanded, I can insert its children into the skip-list in log time (much better than the linear time for an array). I will indent the names of the children in the ListCtrl so that you can visually tell who their parent is. I think the log search time for the skip-list (as opposed to instant random-access time for an array) will be fast enough to handle the user's scrolling. If someone has a better suggestion, please let me know. I will provide an update in the future as to whether my idea worked or not.","Q_Score":0,"Tags":"python,wxpython,virtual,listctrl,treecontrol","A_Id":3087197,"CreationDate":"2010-06-19T03:15:00.000","Title":"wxPython: VirtualTreeListCtrl with millions of items","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have one wx.emptybitmap (1) and one wx.bitmap (2). I want to merge(join) them..\nI want to create a single wx.bitmap that consists on the wx.emptybitmap (1) on the top and wx.bitmap (2) on the bottom.\nHow can I do that?\nThanks in advance! :D","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1043,"Q_Id":3079409,"Users Score":0,"Answer":"You could always use PIL, it has a function to do this. Save the image in memory and convert it into an wx.Bitmap.","Q_Score":1,"Tags":"python,image,wxpython,image-manipulation","A_Id":11616749,"CreationDate":"2010-06-20T13:36:00.000","Title":"How to merge (join) two wx.bitmap using wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When I type from Tkinter import ttk it says that there is no module named ttk, and also on many websites online the t in tkinter is always lowercase, but when I type tkinter in Python it throws an error. Why is that?","AnswerCount":4,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":54493,"Q_Id":3080918,"Users Score":12,"Answer":"Tkinter in python 2.6 is capitalized, in python 3 it is lowercase, tkinter","Q_Score":18,"Tags":"python,python-3.x,tkinter","A_Id":3081089,"CreationDate":"2010-06-20T20:58:00.000","Title":"Why can't I use ttk in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Am trying to provide a response from a Managers perspective to the question: What overall performance penalty will we incur if we write the application in IronPython instead of C#?\nThis question is directed at those who might have already undertaken some testing, benchmarking or have completed a migration from C# to IronPython, in order to quantify the penalty.","AnswerCount":4,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":8794,"Q_Id":3081661,"Users Score":-2,"Answer":"Based on my understanding both languages will be compiled into MSIL so theoretically the performance of the application should be identical or very close, but there is a lot more to it, the human factor.\nI can assure you that a program I write in C# could be a lot faster that the same program in iron-python not because C# is faster but because I'm more familiar with C# and I know what choices to make, so if your team is more familiar with C# your application has a better chance at performance if it is written in C# or the other way around.\nThis is just a personal theory so take it with a grain of salt.","Q_Score":7,"Tags":"ironpython","A_Id":3082237,"CreationDate":"2010-06-21T01:27:00.000","Title":"Speed of code execution: IronPython vs C#?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If it doesn't use ironpython, how C# use cpython program(py file)?\nBecause there are some bugs that ironpython load cpython code.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":189,"Q_Id":3083167,"Users Score":0,"Answer":"If you need strict CPython behavior and do not want to change Python program I am afraid that in this case you should spawn separate CPython process and interact with it via some RPC protocol (there are plenty to choose from) via pipe or network connection to localhost.\nAs alternative to \"serialized\" RPC you might use system's facilities e.g. COM if you're on Windows or D-Bus on Linux - but this would make code platform dependent and not necessarily simpler.","Q_Score":0,"Tags":"c#,python,cpython","A_Id":3083261,"CreationDate":"2010-06-21T08:47:00.000","Title":"How C# use python program?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background.\nThe row selection color is not so easy to change. I can set it using treeview.modify_base(gtk.STATE_SELECTED, \"#C4C4C4\"), but no colours work well with the colours used to enhance the concept of priority.\nI had the idea to change the selection colour to be a slightly darker version of the colour used as the normal row background, so in the example above, that would be a darker red. I tried calling the function above in response to the treeselection's changed signal, and it works, but with heavy flickering.\nAnother idea was to change the selection to transparent and put a border around it instead, but as far as I can tell, this isn't possible.\n\nHow can I change the selection colour in the way described above without the flickering?\nCan I change show the selection by having only a border around the row?\n\nNote: I'm aware that this violates the theme selected by the user. I feel I have a good reason for it. Having the priority indicated by colour makes it instantly recognisable. The selection colour hides this. If you have alternative suggestions, I am open to them, but it needs to retain the ease at which a user can identify the priority.","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3920,"Q_Id":3099244,"Users Score":0,"Answer":"Calling both ModifyBase and ModifyText worked for me. Calling just ModifyBase changes the text color to White\nExample in GTK C#:\ntreeViewList.ModifyBase(StateType.Selected, treeViewList.Style.Base(StateType.Normal));\ntreeViewList.ModifyText(StateType.Selected, treeViewList.Style.Text(StateType.Normal));","Q_Score":9,"Tags":"python,user-interface,gtk,pygtk,gtktreeview","A_Id":60073336,"CreationDate":"2010-06-23T05:58:00.000","Title":"Changing the selected item colour in a GtkTreeview using python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background.\nThe row selection color is not so easy to change. I can set it using treeview.modify_base(gtk.STATE_SELECTED, \"#C4C4C4\"), but no colours work well with the colours used to enhance the concept of priority.\nI had the idea to change the selection colour to be a slightly darker version of the colour used as the normal row background, so in the example above, that would be a darker red. I tried calling the function above in response to the treeselection's changed signal, and it works, but with heavy flickering.\nAnother idea was to change the selection to transparent and put a border around it instead, but as far as I can tell, this isn't possible.\n\nHow can I change the selection colour in the way described above without the flickering?\nCan I change show the selection by having only a border around the row?\n\nNote: I'm aware that this violates the theme selected by the user. I feel I have a good reason for it. Having the priority indicated by colour makes it instantly recognisable. The selection colour hides this. If you have alternative suggestions, I am open to them, but it needs to retain the ease at which a user can identify the priority.","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":3920,"Q_Id":3099244,"Users Score":0,"Answer":"Not sure what you mean by flickering. A border would require subclassing TreeView.\nI'd make the STATE_SELECTED color identical to STATE_NORMAL to disable the built-in highlighting. Then set a data_func on each column and change some color on the cell renderer depending on whether it's in the selection or not.\nYou're probably already doing this for your priority, so just multiply the color with something to highlight a row.","Q_Score":9,"Tags":"python,user-interface,gtk,pygtk,gtktreeview","A_Id":3099780,"CreationDate":"2010-06-23T05:58:00.000","Title":"Changing the selected item colour in a GtkTreeview using python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been annoyed lately by the fact that PyDev doesn't information about classes and function when it code completes wxPython code.\nCan anybody tell me FOSS IDE's or extensions that offer code information (function params, returns etc.) when it code completes for C\/C++ and Python.\nI am a fan of CodeLite, Eclipse CDT and CodeBlocks in that order for C\/C++ (excepting non-FOSS)\nand PyScripter, PyDev for Python in that order.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":144,"Q_Id":3101160,"Users Score":0,"Answer":"I use notepad++ and am vary happy with it.","Q_Score":5,"Tags":"c++,python,c,ide,code-completion","A_Id":3102007,"CreationDate":"2010-06-23T11:30:00.000","Title":"ide code information","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been working with a few RAD gui builders lately. I absolutely despise CSS ( camel is a horse designed by committee etc.) What algorithms are used by packing managers(java\/tk). Most GUI toolkits I've used have some alternative to absolute positioning, sorry for the ambiguity but how do you start thinking about implementing a packing manger in language X.\n\nThanks for the replies, to clarify - I want to create a generic text file that defines a 'form' this form file can then be used to generated a native(ish) GUI form (eg tk) and also an HTML form.\nWhat I'm looking for is some pointers on how a grid based packing manager is implemented so I can formulate my generic text file based on some form of established logic.\nIf this doesn't make sense to you then you understand me:). Some notes\n1. XML lives in the same stable as the zebra and the camel but not the horse.\n2. Think lightweight markup languages (Markdown\/ReStructuredText) but for simple forms.\n3. This has probably already been implemented, do you know where?\n4. Yes, I have Googled it (many,many times),answer was not between G1 and o2 \nThks","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":306,"Q_Id":3122291,"Users Score":3,"Answer":"Tk has three methods. One is absolute positioning, the other two are called \"grid\" and \"pack\". \ngrid is just what it sounds like: you lay out your widgets in a grid. There are options for spanning rows and columns, expanding (or not) to fill a cell, designating rows or columns which can grow, etc. You can accomplish probably 90% of all layout issues with the grid geometry manager.\nThe other manager is \"pack\" and it works by requesting that widgets be placed on one side or another (top, bottom, left, right). It is remarkably powerful, and with the use of nested containers (called frames in tk) you can accomplish pretty much any layout as well. Pack is particularly handy when you have things stacked in a single direction, such as horizontally for a toolbar, vertically for a main app (toolbar, main area, statusbar). \nBoth grid and pack are remarkably powerful and simple to use, and between them can solve any layout problem you have. It makes me wonder why Java and wxPython have so many and such complicated geometry managers when its possible to get by with no more than three.","Q_Score":0,"Tags":"python,grid,tcl,rad","A_Id":3122400,"CreationDate":"2010-06-26T00:55:00.000","Title":"GUI layout -how?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm planning some Symbian related development on S60 3.1 platform. It seems like generally available language options are Python and C++. However Nokia's official forum seems very much tilted towards C++.\nI want to know what are the advantages and disadvantages of using Python for S60 over Symbian C++? And is it even possible to do Python programming for S60 3.1 platform?","AnswerCount":6,"Available Count":3,"Score":0.0333209931,"is_accepted":false,"ViewCount":1021,"Q_Id":3123340,"Users Score":1,"Answer":"C++ is very, very fast, and the Qt library is for C++. If you're programming on a mobile phone, Python will be very slow and you'll have to spend ages writing bindings for it.","Q_Score":1,"Tags":"c++,python,symbian,pys60","A_Id":3123427,"CreationDate":"2010-06-26T09:15:00.000","Title":"PyS60 vs Symbian C++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm planning some Symbian related development on S60 3.1 platform. It seems like generally available language options are Python and C++. However Nokia's official forum seems very much tilted towards C++.\nI want to know what are the advantages and disadvantages of using Python for S60 over Symbian C++? And is it even possible to do Python programming for S60 3.1 platform?","AnswerCount":6,"Available Count":3,"Score":0.0333209931,"is_accepted":false,"ViewCount":1021,"Q_Id":3123340,"Users Score":1,"Answer":"I answer this as a user.\nPyS60 is slow and not so much app and sample to start with.\nC++ is good, native, fast, but if you mind deevelop app for most device (current N-series), you will not want to go with Qt, I have a N78 and tested Qt in N82 too, it's slow (more than Python, sadly but true)","Q_Score":1,"Tags":"c++,python,symbian,pys60","A_Id":3124371,"CreationDate":"2010-06-26T09:15:00.000","Title":"PyS60 vs Symbian C++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm planning some Symbian related development on S60 3.1 platform. It seems like generally available language options are Python and C++. However Nokia's official forum seems very much tilted towards C++.\nI want to know what are the advantages and disadvantages of using Python for S60 over Symbian C++? And is it even possible to do Python programming for S60 3.1 platform?","AnswerCount":6,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1021,"Q_Id":3123340,"Users Score":0,"Answer":"What is the purpose of your programming? Are you planning distribute your app through Ovi Store? If so, you should use a tool that could be tested and signed by Symbian Signed. \nWhat does it mean? As far as I know, they don't provide such functionality for Python. So you have to choose native Symbian C++ or Qt. \nBy the way, Qt signing procedure is not quite clear for now. It seems Ovi Store and Symbian Signed are only allow Qt apps for a certain devices (Nokia X6, Nokia N97 mini, maybe some other). I suppose it is a subject for a change, and quite fast change, but you should consider this too.","Q_Score":1,"Tags":"c++,python,symbian,pys60","A_Id":3131900,"CreationDate":"2010-06-26T09:15:00.000","Title":"PyS60 vs Symbian C++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In Tkinter I'm trying to make it so when a command is run a widget is automatically selected, so that a one may bind events to the newly selected widget. \nBasically I want it so when I press a button a text widget appears. When it appears normally one would have to click the text widget to facilitate the running of events bound to the text widget. I want that behavior to automatically happen when the user clicks the button. So that one does not have to click the button and then the text widget, but simply the button. \nI'd also like it so if one started typing after the button was pressed it would automatically start filling the text widget. Again to cut out having to click on the text widget. \nWhat bit of code does the above?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":45,"Q_Id":3125707,"Users Score":0,"Answer":"The terminology which describes what you want is \"focus\" -- you want to set the keyboard focus to your text widget. To do that you need to use the focus_set() and\/or focus_force() methods on the text widget.","Q_Score":0,"Tags":"python,binding,tkinter","A_Id":3126035,"CreationDate":"2010-06-26T22:25:00.000","Title":"Selecting Widgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having a problem with widget Gtk.Table - I would like to know, if there is a way how to get a current size of the table (number of rows and columns).\nThank you, very much for help, Tomas","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":881,"Q_Id":3126802,"Users Score":0,"Answer":"In most recent versions of PyGTK you can get\/set those values via table.props.n_columns and table.props.n_rows, which is synonymous with the get_property() (mentioned in the other answers) and set_property() methods.","Q_Score":0,"Tags":"python,gtk,pygtk","A_Id":3128879,"CreationDate":"2010-06-27T08:17:00.000","Title":"Getting size of Gtk.Table in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We all knows that C# is a static language while Python is a dynamic language. But I want to know what are the features that Python has and c# does not. Also, is it advisable\/beneficial to use IronPython with c# in the same application? \nAlso what points I should focus to learn before I try to convince my boss to use IronPython?","AnswerCount":2,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":995,"Q_Id":3131703,"Users Score":7,"Answer":"One of IronPython's key advantages is in its function as an extensibility layer to application frameworks written in a .NET language. It is relatively simple to integrate an IronPython interpreter into an existing .NET application framework. Once in place, downstream developers can use scripts written in IronPython that interact with .NET objects in the framework, thereby extending the functionality in the framework's interface, without having to change any of the framework's code base.\nIronPython makes extensive use of reflection. When passed in a reference to a .NET object, it will automatically import the types and methods available to that object. This results in a highly intuitive experience when working with .NET objects from within an IronPython script.\nSource - Wikipedia","Q_Score":2,"Tags":"c#,architecture,ironpython","A_Id":3131716,"CreationDate":"2010-06-28T10:46:00.000","Title":"Why should C# developer learn IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"We all knows that C# is a static language while Python is a dynamic language. But I want to know what are the features that Python has and c# does not. Also, is it advisable\/beneficial to use IronPython with c# in the same application? \nAlso what points I should focus to learn before I try to convince my boss to use IronPython?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":995,"Q_Id":3131703,"Users Score":7,"Answer":"In other words, what points I can give to my boss to convince him to use IronPython?\n\nDon't. If you don't know why you should use a new tool and for what, don't try to convice anybody to use it. At work, you should try to solve problems with the best tools for the task, not throw the fanciest tools avaiable at your problems just because they're fancy.\nLearn IronPython, maybe make a small side project in it, find out what the strenghts are. Then if you think these strengths are useful for the project you're working on (e.g. for \"glue code\", plugins, macros etc.), convice your boss to use them.","Q_Score":2,"Tags":"c#,architecture,ironpython","A_Id":3131741,"CreationDate":"2010-06-28T10:46:00.000","Title":"Why should C# developer learn IronPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython application which allows the users to select items from menus that then change what is visible on the screen. This often requires a recalculation of the layout of panels. I'd like to be able to call the layout of all the children of a panel (and the children of those children) in reverse order. That is, the items with no children have their Layout() function called first, then their parents, and so on.\nOtherwise I have to keep all kinds of knowledge about the parents of panels in the codes. (i.e. how many parents will be affected by a change in this-or-that panel).","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":248,"Q_Id":3136997,"Users Score":0,"Answer":"More in response to your comment to Jon Cage's answer, than to your\noriginal question (which was perfectly answered by Jon):\nThe user might find it irritating, if the position of every element in\nyour dialog changes, when he makes a choice. Maybe it'll look better,\nif only the \"variable part\" is updated. To achieve this, you could\nmake a panel for each set of additional controls. The minimum size of\neach panel should be the minimum size of the largest of these\npanels. Depending on the user's choice you can hide or show the\ndesired panel.\nAlternatively, wxChoicebook might be what you need?","Q_Score":1,"Tags":"python,model-view-controller,wxpython,dry,wxwidgets","A_Id":3137378,"CreationDate":"2010-06-28T23:58:00.000","Title":"How to layout all children of a wxPanel?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to dive into Qt big time but haven't done a large project with it yet. Currently using Python, but I've been thinking -- which is really the better language to use in terms of programmer productivity?\nIn most comparisons between the languages, Python is the obvious answer, because you don't have to mess with memory management and all that.\nHowever, with Qt I'm not so sure. It provides enough added features to C++ that (from what I can tell) a line of Python code is roughly equal to a line of C++ code most of the time (excluding some additional things like class definitions and structure components). Qt does nearly all the memory management for you as long as you stick with its classes, and provides equivalents to the nice containers you would find in Python.\nI've always preferred statically typed languages, but have gotten on the Python bandwagon for various reasons. If programmer productivity is similar with C++, however, I may jump back that way for its other benefits -- more efficient code and fewer dependencies for users to install.\nThoughts?","AnswerCount":5,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":16818,"Q_Id":3139414,"Users Score":7,"Answer":"With Python you don't have to build your project. That's enough of a time saver I guess. And Pyqt bindings are awesome. I'm definitely more efficient with pyqt than with qt\/C++.","Q_Score":47,"Tags":"c++,python,qt,pyqt","A_Id":3139453,"CreationDate":"2010-06-29T09:32:00.000","Title":"Qt programming: More productive in Python or C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to dive into Qt big time but haven't done a large project with it yet. Currently using Python, but I've been thinking -- which is really the better language to use in terms of programmer productivity?\nIn most comparisons between the languages, Python is the obvious answer, because you don't have to mess with memory management and all that.\nHowever, with Qt I'm not so sure. It provides enough added features to C++ that (from what I can tell) a line of Python code is roughly equal to a line of C++ code most of the time (excluding some additional things like class definitions and structure components). Qt does nearly all the memory management for you as long as you stick with its classes, and provides equivalents to the nice containers you would find in Python.\nI've always preferred statically typed languages, but have gotten on the Python bandwagon for various reasons. If programmer productivity is similar with C++, however, I may jump back that way for its other benefits -- more efficient code and fewer dependencies for users to install.\nThoughts?","AnswerCount":5,"Available Count":5,"Score":0.1194272985,"is_accepted":false,"ViewCount":16818,"Q_Id":3139414,"Users Score":3,"Answer":"Whether you use python or C++ depends more on the application you are building and not so much on Qt. If you are building an application which is resource heavy and needs lots of resources like CPU and memory, C++ would be a better bet. On the other hand, if you application is more UI driven, python provides lot of other benefits in terms of rapid development and rich libraries.","Q_Score":47,"Tags":"c++,python,qt,pyqt","A_Id":3139458,"CreationDate":"2010-06-29T09:32:00.000","Title":"Qt programming: More productive in Python or C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to dive into Qt big time but haven't done a large project with it yet. Currently using Python, but I've been thinking -- which is really the better language to use in terms of programmer productivity?\nIn most comparisons between the languages, Python is the obvious answer, because you don't have to mess with memory management and all that.\nHowever, with Qt I'm not so sure. It provides enough added features to C++ that (from what I can tell) a line of Python code is roughly equal to a line of C++ code most of the time (excluding some additional things like class definitions and structure components). Qt does nearly all the memory management for you as long as you stick with its classes, and provides equivalents to the nice containers you would find in Python.\nI've always preferred statically typed languages, but have gotten on the Python bandwagon for various reasons. If programmer productivity is similar with C++, however, I may jump back that way for its other benefits -- more efficient code and fewer dependencies for users to install.\nThoughts?","AnswerCount":5,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":16818,"Q_Id":3139414,"Users Score":33,"Answer":"If one or the other, I'd actually suggest Python in spite of being a C++ enthusiast. With Python code you don't have to bother with the MOC, portability, build times, etc. Just compare the work involved in implementing a QT slot in C++ vs. PyQT or PySide, e.g. I find it to be much less of a pain to deal with widgets this way (much greater productivity). You can still invoke C++ code from Python in cases where you need the added performance.\nIf you do use a combination, consider extending Python rather than embedding it. Python is generally better suited to embed C\/C++ code than to be embedded into a C\/C++ system. It also tends to make more sense that way as applications are generally composed of far more mundane, non-performance critical code than performance-critical code, so writing your application primarily as a python application with C\/C++ functions attached to it fits that kind of system design better.","Q_Score":47,"Tags":"c++,python,qt,pyqt","A_Id":3139451,"CreationDate":"2010-06-29T09:32:00.000","Title":"Qt programming: More productive in Python or C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to dive into Qt big time but haven't done a large project with it yet. Currently using Python, but I've been thinking -- which is really the better language to use in terms of programmer productivity?\nIn most comparisons between the languages, Python is the obvious answer, because you don't have to mess with memory management and all that.\nHowever, with Qt I'm not so sure. It provides enough added features to C++ that (from what I can tell) a line of Python code is roughly equal to a line of C++ code most of the time (excluding some additional things like class definitions and structure components). Qt does nearly all the memory management for you as long as you stick with its classes, and provides equivalents to the nice containers you would find in Python.\nI've always preferred statically typed languages, but have gotten on the Python bandwagon for various reasons. If programmer productivity is similar with C++, however, I may jump back that way for its other benefits -- more efficient code and fewer dependencies for users to install.\nThoughts?","AnswerCount":5,"Available Count":5,"Score":1.2,"is_accepted":true,"ViewCount":16818,"Q_Id":3139414,"Users Score":31,"Answer":"My Opinion (having tried out C++ and Python in general and specifically in Qt case): Python always wins in terms of 'programmer productivity' and 'peace of mind'. PyQt represent Qt very well and hence question doesn't remain of \"Qt with Python\" or \"Qt with C++\", in general python is more productive unless off-course you need speed or something which isn't available in python.\nBest way for you to arrive at the answer would be to write a simple project first in C++ and then same project in python and compare, but that could be biased towards python as after coding the project once you may find it easy in Python, so try another project too and first do it in Python and then in C++.","Q_Score":47,"Tags":"c++,python,qt,pyqt","A_Id":3139545,"CreationDate":"2010-06-29T09:32:00.000","Title":"Qt programming: More productive in Python or C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to dive into Qt big time but haven't done a large project with it yet. Currently using Python, but I've been thinking -- which is really the better language to use in terms of programmer productivity?\nIn most comparisons between the languages, Python is the obvious answer, because you don't have to mess with memory management and all that.\nHowever, with Qt I'm not so sure. It provides enough added features to C++ that (from what I can tell) a line of Python code is roughly equal to a line of C++ code most of the time (excluding some additional things like class definitions and structure components). Qt does nearly all the memory management for you as long as you stick with its classes, and provides equivalents to the nice containers you would find in Python.\nI've always preferred statically typed languages, but have gotten on the Python bandwagon for various reasons. If programmer productivity is similar with C++, however, I may jump back that way for its other benefits -- more efficient code and fewer dependencies for users to install.\nThoughts?","AnswerCount":5,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":16818,"Q_Id":3139414,"Users Score":11,"Answer":"definitely Python. \nYes, people will say that Python is more productive without a reason. Some of the answers mention that you do not have to recompile. I will give you some more details\n\nPython is one layer of abstraction over C++, so you can think and express your designs with less code. Your program might not run as fast, but sure you express faster in code what you want.\nThe most common case is when you launch your application, load some files, setup the environment and open a dialog. There you notice that a button is not working or where it should be. Now that is the point where most people close the application, bind one slot here, one signal there... and start the application, load the files, setup... with python you just write the code and fire up the dialog again, not the whole application. I do not know about you, but that type of task is what I do most of the time with Qt\nPython gives you something that C++ does not have: introspection. You can explore a running program and pull out information about its components on runtime. Qt gives you partially this. You have that MOC layer where meta properties and meta information can be attached to Qt objects. All parts of a Python program can be introspected. Many people debugging Python code, or trying to understand how it works, are addicted to this for a good reason","Q_Score":47,"Tags":"c++,python,qt,pyqt","A_Id":7457626,"CreationDate":"2010-06-29T09:32:00.000","Title":"Qt programming: More productive in Python or C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've just started to learn pygame, and it pretty much needs some coordinates and points in the code in order to position the object. Do you know of any tool or application that I could use as a reference so that I could see a visual representation of the points. \nMaybe a grid with numbers. \nAnd pygame also includes declaring the color by using numbers. \nDo you know of any site or application that I can use as reference to those numbers and corresponding color. Like this one: 230, 170, 0 And what do these numbers mean.\nI'm using windows operating system.","AnswerCount":8,"Available Count":1,"Score":0.024994793,"is_accepted":false,"ViewCount":1295,"Q_Id":3154830,"Users Score":1,"Answer":"You don't need a grid to help you, you just need to know the origin point (easy - it is one of the corners). Since it is all interpreted, I say you just hack around displaying stuff on the screen till it clicks in your head.\nThe other part is easy. It is Red, Blue, Green (each one goes from 0-255, 0 is no-color, 255 is full-color).","Q_Score":1,"Tags":"python,pygame","A_Id":3154895,"CreationDate":"2010-07-01T03:03:00.000","Title":"tools for pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm building a form class in python for producing and validating HTML forms. Each field has an associated widget which defines how the field is rendered.\nWhen the widget is created, it is passed in a (default) value so that it knows what to display the first time it is rendered. After the form is submitted, the widget is asked for a value. I delegate this to the widget rather than just nabbing it from the POST data because a widget may consist of several HTML inputs (think of a month\/day\/year selector). Only the widget knows how to mash these together into one value.\nProblem is, I don't know if I should have the widget always accept a string, and always return a string for consistency, or accept and return a data type consistent with its purpose (i.e., a date selector should probably return a DateTime object).\nThe philosophy behind my form class is \"mix and match\". You choose what widget you want, and what validators\/formatters\/converters you want to run on it. Which I guess lends itself towards \"use strings\" and let the developer decide on the data type afterwords, but... I can't think of a good but. Do you anticipate any problems with this approach?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":80,"Q_Id":3169096,"Users Score":2,"Answer":"While simply passing strings around seems like a useful idea, I think you're going to discover it doesn't work as well as you might hope.\nThink about the date example\u2014instead of passing around a date object, instead you pass around a str of the format \"2010-01-01\". In order to work with that data, every user of the class needs to know not only that it's a str which represents a date, but what the format of that string is. In other words, you haven't gained anything. Worse, you lose the ability to pass a datetime object into the widget (unless you take extra steps to deal with that case).\nThe validator or formatter issue isn't as big a deal as you might think; how often are you going to want to validate a string which doesn't represent a date as if it were a date?","Q_Score":2,"Tags":"python,design-patterns","A_Id":3169254,"CreationDate":"2010-07-02T21:04:00.000","Title":"What data type should my widgets accept\/return?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm building a form class in python for producing and validating HTML forms. Each field has an associated widget which defines how the field is rendered.\nWhen the widget is created, it is passed in a (default) value so that it knows what to display the first time it is rendered. After the form is submitted, the widget is asked for a value. I delegate this to the widget rather than just nabbing it from the POST data because a widget may consist of several HTML inputs (think of a month\/day\/year selector). Only the widget knows how to mash these together into one value.\nProblem is, I don't know if I should have the widget always accept a string, and always return a string for consistency, or accept and return a data type consistent with its purpose (i.e., a date selector should probably return a DateTime object).\nThe philosophy behind my form class is \"mix and match\". You choose what widget you want, and what validators\/formatters\/converters you want to run on it. Which I guess lends itself towards \"use strings\" and let the developer decide on the data type afterwords, but... I can't think of a good but. Do you anticipate any problems with this approach?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":80,"Q_Id":3169096,"Users Score":1,"Answer":"This approach is quite generic and serializing to and from strings should always work fine. You could also save the state of a widget to a file or send it over a network for recreating another widget from it.\nSome potential issues or aspects to consider:\n\nLocalization: how to interpret the string regarding the culture, which format is the canonical format for comparisons.\nPerformance: some transformations might be time consuming, but I assume for human interaction that will be far fast enough.","Q_Score":2,"Tags":"python,design-patterns","A_Id":3169184,"CreationDate":"2010-07-02T21:04:00.000","Title":"What data type should my widgets accept\/return?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have a function that calculates the number of images that can be displayed on the screen, if there are more images than the ones that can be put on screen, I resize the images till they all can appear.\nThen, I want to display them with one vertical box sizer and several horizontal box sizers!\nThe horizontal number of box sizers are dynamic, it can be only one or more depending on the number of images.\nHow can I define several box sizers and add them to the vertical box sizer?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":153,"Q_Id":3171256,"Users Score":0,"Answer":"wx.GridSizer is the answer!","Q_Score":1,"Tags":"python,wxpython,sizer","A_Id":3174624,"CreationDate":"2010-07-03T10:55:00.000","Title":"How to make a dynamic number of horizontal BoxSizers?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Suppose you know the three vertices for a spherical triangle. \nThen how do you draw the sides on a sphere in 3D?\nI need some python code to use in Blender 3d modelisation software.\nI already have the sphere done in 3D in Blender.\nThanks & happy blendering.\nnote 1:\ni have the 3 points \/ vertices (p1,p2,p3 ) on the sphere for a spherical triangle\nbut i need to trace the edges on the sphere in 3D\nso what would be the equations needed to determine all vertices between each points pair of the triangle on the sphere\n3 edges from p1 to p2 - p2 to p3 and o3 to p1\ni know it has something to do with the Great circle for Geodesic on a sphere\nbut cannot find the proper equations to do the calculations in spherical coordinates!\nThanks\n\nGreat circles\nit would have been interesting to see a solution with great circle and see tehsolution in spherical coordinates directly !\nbut still interesting to do it in the euclidiens space \nThanks \n\nok i used this idea of line segment between 2 points \nbut did not do it as indicated before\ni used an alternative method - Bezier line interpolation**\ni parametrize the line with a bezier line\nthen subdivided and calculated as shonw ealier the ratio and angle for each of the subdivided bezier point on the chord\nand it works very well and very precise \nbut it would be interesting to see how it is done whit the earlier method\nbut not certain how to do the iteration loop?\nhow do you load up the python code here\njust past it with Ctrl-V?\nThanks and happy 2.5\n\ni do use the blenders' forum\nbut no guaranti to get a clear answer all the time!\nthat's why i tried here - took a chance\ni did the first edge seems to work \nnow got to make a loop to get multi segment for first edge and then do the other edges also\n2- other subject\n i open here a post on bezier triangle patch\n i know it's not a usfull tool\nbut just to show how it is done\nhave youeseen a python sript to do theses triangel patch\nand i did ask this questin on blender's foum and no answer\nalso on IRC python and sems to be dead right now \nprobably guys are too busy finishing the 2.5 Beta vesion which should come out in a week or 2\nHey Thanks a lot for this math discussion \nif i have problem be back tomorrow\nhappy math and 2.5","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3171,"Q_Id":3172535,"Users Score":0,"Answer":"One cheap and easy method for doing this would be to create the triangle and subdivide the faces down to the level of detail you want, then normalize all the vertices to the radius you want.","Q_Score":3,"Tags":"python,blender","A_Id":3172669,"CreationDate":"2010-07-03T19:03:00.000","Title":"How to draw a spherical triangle on a sphere in 3D?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've recently started using a mac, and I'm curious about how to make a mac app that uses PyQt and is self-contained.\nCan anyone give me any pointers on where to start and what I'll need?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":1222,"Q_Id":3173047,"Users Score":1,"Answer":"I've tried the same for some weeks now. Finally i have to say py2app just wont do. I was lucky with pyinstaller1.4. Although you need to add some minor modifications to run flawlessly on OS X. Furthermore the apps it creates are only 1\/4 of the size compared to py2app. And most important it works :) And yet another goodie ... it works with the python framework which ships with OS X so there is no need to install python via MacPorts etc.","Q_Score":2,"Tags":"python,macos,qt","A_Id":4022382,"CreationDate":"2010-07-03T22:26:00.000","Title":"How to create a self contained Python Qt app on mac","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Installed the IronPython tools for VS 2010 but it didn't associate the *.py files to VS, neither did it (obviously) change the *.py files' icon.\nHow do I do that in Windows 7?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":4332,"Q_Id":3177918,"Users Score":3,"Answer":"I also had this issue. Here is what I did.\n\nRight click on a python program.\nSelect properties.\nYou will find \"opens with\" option in the general tab.\nClick change and select \"python.exe\".\n\nNow, you will have your python icons back for all .py type of files.","Q_Score":1,"Tags":"visual-studio-2010,windows-7,ironpython,file-type,root","A_Id":32558068,"CreationDate":"2010-07-05T08:03:00.000","Title":"How to make *.py files have the python icon in Win7?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i have just received a task to implement a software that paints over pictures (pretty much like microsoft paint )\ni have no idea where to start or how to do that. do anyone have a good reference or idea for painting in qt or pyqt ?\n\nthis will be highly appreciated \nthanks in advance","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1562,"Q_Id":3179469,"Users Score":0,"Answer":"Have you looked at the scribble example included in PyQt? It does basic drawing, saving, loading, etc.","Q_Score":0,"Tags":"python,qt,pyqt,paint","A_Id":3497327,"CreationDate":"2010-07-05T12:34:00.000","Title":"making paint in pyqt or qt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"is it possible to connect a href link in QTextBrowser to a slot?\nI want to make something that looks like a link in a QTextBrowser, but when user clicked on it, it will call one of the methods.\nIs that possible?\nif that is not, what is a good alternative?\nThanks in advance.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":198,"Q_Id":3186576,"Users Score":1,"Answer":"i finally found out how.\nthere's a signal call anchorClicked(QUrl)\nthat should do the trick :)","Q_Score":0,"Tags":"python,pyqt4","A_Id":3187108,"CreationDate":"2010-07-06T13:28:00.000","Title":"is it possible to connect a href link in QTextBrowser to a slot?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":146,"Q_Id":3190013,"Users Score":0,"Answer":"Portability is one thing. There are even differences between python 2.x and 3.x that can make things difficult with C extensions, if the writer didn't update them.\nAnother thing is that pure python code gives you a bit more possibilities to read, understand and even modify (although it is usually a bad sign if you need to do that for other peoples modules)","Q_Score":1,"Tags":"python","A_Id":3190568,"CreationDate":"2010-07-06T20:35:00.000","Title":"What are the pros and cons in Python of using a c library vs a native python one","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?","AnswerCount":3,"Available Count":3,"Score":0.2605204458,"is_accepted":false,"ViewCount":146,"Q_Id":3190013,"Users Score":4,"Answer":"C library is likely to have better performance, but needs to be recompiled for each platform.\nYou can't use C libraries on Google App Engine","Q_Score":1,"Tags":"python","A_Id":3190053,"CreationDate":"2010-07-06T20:35:00.000","Title":"What are the pros and cons in Python of using a c library vs a native python one","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":146,"Q_Id":3190013,"Users Score":4,"Answer":"Of course using a C library hurts portability. It also prohibites you (in general) to use Jython or IronPython. I would only use a C library if I had no other option. This could happen if direct access to hardware is necessary or if special efficiency requirements apply.","Q_Score":1,"Tags":"python","A_Id":3190035,"CreationDate":"2010-07-06T20:35:00.000","Title":"What are the pros and cons in Python of using a c library vs a native python one","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Me and a friend are developing an application which uses Boost::Python. I have defined an interface in C++ (well a pure virtual class), exposed through Boost::Python to the users, who have to inherit from it and create a class, which the application takes and uses for some callback mechanism.\nEverything that far goes pretty well. Now, the function callback may take some time (the user may have programmed some heavy stuff)... but we need to repaint the window, so it doesn't look \"stuck\".We wanted to use Boost::Thread for this. Only one callback will be running at a time (no other threads will call python at the same time), so we thought it wouldn't be such a great deal... since we don't use threads inside python, nor in the C++ code wrapped for python.\nWhat we do is calling PyEval_InitThreads() just after Py_Initialize(), then, before calling the function callback inside it's own boost thread, we use the macro PY_BEGIN_ALLOW_THREADS and, and the macro PY_END_ALLOW_THREADS when the thread has ended.\nI think I don't need to say the execution never reaches the second macro. It shows several errors everytime it runs... but t's always while calling the actual callback. I have googled a lot, even read some of the PEP docs regarding threads, but they all talk about threading inside the python module (which I don't sice it's just a pure virtual class exposed) or threading inside python, not about the main application calling Python from several threads.\nPlease help, this has been frustrating me for several hours.\nPs. help!","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":511,"Q_Id":3197236,"Users Score":1,"Answer":"Python can be called from multiple threads serially, I don't think that's a problem. It sounds to me like your errors are just coming from bad C++ code, as you said the errors happened after PY_BEGIN_ALLOW_THREADS and before PY_END_ALLOW_THREADS.\nIf you know that's not true, can you post a little more of your actual code and show exactly where its erroring and exactly what errors its giving?","Q_Score":7,"Tags":"c++,python,boost-thread,boost-python","A_Id":3223165,"CreationDate":"2010-07-07T17:19:00.000","Title":"Problems regarding Boost::Python and Boost::Threads","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using Pygame to pageflip different stimuli on the screen. The problem is that pygame's flip function, although syncing the flip to the vertical retrace, does not tell me when the retrace was.\nDoes anyone know of a way to get this information (preferably platform independent) in Python?\nRegards,\nfladd","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":153,"Q_Id":3201685,"Users Score":0,"Answer":"Just poll for the time immediately after the flip call, if that one syncs to the vertical retrace.","Q_Score":0,"Tags":"python,pygame,flip","A_Id":3201723,"CreationDate":"2010-07-08T08:07:00.000","Title":"How to get the point in time of (last) vertical retrace under Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having a bit of trouble with the Tkinter grid() manager. It is spacing the rows too far apart. I have two entry widgets to place, and I need one almost directly under the other. When I place them both on the same row and column, but change the pady option, it places them directly on top of each other. I know there has to be a way to fix this, never had this problem before.\nI am using Python 2.6 on Windows XP.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1716,"Q_Id":3219765,"Users Score":2,"Answer":"Don't place them in the same row and column; place the upper in a row, and the lower in row+1, both in the same column. That does the trick.\nNote that the grid manager does not need to have all rows and columns filled with widgets; it ignores empty rows and columns.","Q_Score":1,"Tags":"python,tkinter,grid,tkinter-entry","A_Id":3222439,"CreationDate":"2010-07-10T15:23:00.000","Title":"Tkinter grid() Manager","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"A primary reason to use wx.SpinCtrl is to restrict the user to input integers, therefore I think that the text inside it would look better if right-aligned.\nIs there a way to do this in wxPython?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":435,"Q_Id":3252671,"Users Score":1,"Answer":"Actually, there is a control you can use. It's called FloatSpin, which is in the agw sub-library. If you don't already have it, download the wxPython demo and check it out!\n\nMike","Q_Score":0,"Tags":"python,wxpython,alignment,spinner","A_Id":3261410,"CreationDate":"2010-07-15T05:20:00.000","Title":"wxPython: Right-align the numbers in a wx.SpinCtrl","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:\n\nsudo apt-get instal python-pygame\n\nWhen I go into the python IDLE and write:\n\nimport pygame\n\nI get:\n\nTraceback (most recent call last):\nFile \"\", line 1, in \nImportError: No module named pygame\n\nWhat can I do to solve this problem? I am forgetting something, or doing something wrong?","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":9872,"Q_Id":3264024,"Users Score":1,"Answer":"If you don't like to download an unpack then install manually, you can use apt to install setuptools . After that you can use easy_install(or easy_install-2.7?) to install many python packages, including pygame, of course.","Q_Score":3,"Tags":"python,ubuntu,pygame,python-idle","A_Id":9820042,"CreationDate":"2010-07-16T10:44:00.000","Title":"pygame not found","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:\n\nsudo apt-get instal python-pygame\n\nWhen I go into the python IDLE and write:\n\nimport pygame\n\nI get:\n\nTraceback (most recent call last):\nFile \"\", line 1, in \nImportError: No module named pygame\n\nWhat can I do to solve this problem? I am forgetting something, or doing something wrong?","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":9872,"Q_Id":3264024,"Users Score":1,"Answer":"I just had this same problem!\nI read this and while it works to do the sys.path.append thing, I decided to try and get it to work with out.\nWhat I did was went to the Ubuntu Software center uninstalled the python IDLE i had installed and then installed the IDLE.\nThis seems confusing the way I said it so to clarify you want to download the IDLE that doesn't come with its own version of python, it'll then use the python that already comes with Ubuntu!\nIf this doesn't make since or doesn't help fix your problem let me know!","Q_Score":3,"Tags":"python,ubuntu,pygame,python-idle","A_Id":14076665,"CreationDate":"2010-07-16T10:44:00.000","Title":"pygame not found","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:\n\nsudo apt-get instal python-pygame\n\nWhen I go into the python IDLE and write:\n\nimport pygame\n\nI get:\n\nTraceback (most recent call last):\nFile \"\", line 1, in \nImportError: No module named pygame\n\nWhat can I do to solve this problem? I am forgetting something, or doing something wrong?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":9872,"Q_Id":3264024,"Users Score":0,"Answer":"check that you are installing pygame for the right version of python. I think the pygame for python 2.7 won't work on python 3.3. I had the same problem but even after installing the right version it didn't work. So after a little googling I found that I was installing pygame meant for 32-bit but my os is 64-bit. so try to google \"pygame for window 64-bit\" or something like that. I hope it helps.","Q_Score":3,"Tags":"python,ubuntu,pygame,python-idle","A_Id":17222436,"CreationDate":"2010-07-16T10:44:00.000","Title":"pygame not found","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When I update my objectListView list it flickers\/flashes white, is this normal behaviour or can it be prevented. The list gets updated around every 1-5 seconds using the AddObject method if that makes any difference.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":463,"Q_Id":3268106,"Users Score":0,"Answer":"I seem to have fixed it by using the FastObjectListView class instead...","Q_Score":0,"Tags":"python,user-interface,wxpython,objectlistview","A_Id":3268404,"CreationDate":"2010-07-16T19:14:00.000","Title":"ObjectListView Flickers\/Flashes when adding a new list object","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a wxpython list widget that displays alternating row colours even when empty the list is empty? or Is there even one that will display a background colour(other than white) when it is empty?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":843,"Q_Id":3269019,"Users Score":1,"Answer":"You could do it with a wx.Grid or you might look at the new UltimateListCtrl, which is a pure python widget. You can hack it if it doesn't do what you want it to!","Q_Score":0,"Tags":"python,user-interface,listview,wxpython,background-color","A_Id":3269998,"CreationDate":"2010-07-16T21:35:00.000","Title":"Is there a wxpython list widget that displays alternating row colours even when the list is empty?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I am trying to write a rich text editor in PyGTK, and originally used the older, third party script InteractivePangoBuffer from Gourmet to do this. While it worked alright, there were still plenty of bugs with it which made it frustrating to use at times, so I decided to write my own utilizing text tags. I have got them displaying and generally working alright, but now I am stuck at trying to figure out how to export them to a file when saving. I've seen that others have had the same problem I've had, though I haven't seen any solutions. I haven't come across any function (built in or otherwise) which comes close to actually getting the starting and ending position of each piece of text with a texttag applied to it so I can use it.\nI have come up with one idea which should theoretically work, by walking the text by utilizing gtk.TextBuffer.get_iter_at_offset(), gtk.TextIter.get_offset(), gtk.TextIter.begins_tag(), and gtk.TextIter.ends_tag() in order to check each and every character to see if it begins or ends a tag and, if so, put the appropriate code. This would be horribly inefficient and slow, especially on larger documents, however, so I am wondering if anyone has any better solutions?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":276,"Q_Id":3269942,"Users Score":0,"Answer":"You can probably use gtk.TextIter.forward_to_tag_toggle(). I.e. loop over all tags you have and for each tags scan the buffer for the position where it is toggled.","Q_Score":1,"Tags":"python,pygtk","A_Id":3271663,"CreationDate":"2010-07-17T02:05:00.000","Title":"Saving gtk.TextTags to file?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python program uses Qt (PyQt4 in fact) and when I launch it from its main.py, I get a console window and the GUI window (on Windows, of course).\nThen I compile my program with py2exe and main.exe is successfully created. However, if I run main.exe (this is what users of program will do) console window of Python still appears and all my debug text is stdout-ed to that window.\nI want to hide cmd line window when my application is running and I want just my GUI to be visible to the user when executed from .exe file.\nIs that possible?","AnswerCount":4,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":19469,"Q_Id":3275293,"Users Score":6,"Answer":"I doubt this has an effect on py2exe, but it's related to the question. To run a python GUI on windows without the terminal, use pythonw.exe instead of python.exe. This should happen automatically if you end the filename with \".pyw\".","Q_Score":20,"Tags":"python,pyqt,pyqt4,py2exe","A_Id":3275651,"CreationDate":"2010-07-18T11:17:00.000","Title":"Hiding console window of Python GUI app with py2exe","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK.\nThe C++ SDK documentation appears incomplete in certain areas and isn't documented that well.\nThe Python SDK docs appear more complete and in general are much easier to work with.\nSo I'm trying to decide if I want to go through the potential trouble of building a C++ plugin instead of a Python plugin to sell. About the only thing that makes me want to do a C++ plugin is that in my mind, a \"C++ plugin\" might be an easier sell than a \"Python plugin\". A lot of programmers out there don't even considered writing Python to be real \"programming\".\nDo you think that potential customers might say \"Why would I pay money for a measly little Python script?\"? As opposed to \"Oh it was written in C++ so the guy must be a decent programmer\"?\nWriting the Python plugin would be faster. Both plugins would look and behave exactly the same. The C++ plugin might be faster in certain spots, but for the type of plugin this is, that's not a huge deal.\nSo my question is, would a Python plugin be considered not as professional\/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":815,"Q_Id":3277376,"Users Score":0,"Answer":"Python will also have the advantage\/disadvantage (depending on what you want) that the source code must be open. (I think delivering only the .pyc file is not really an option as the Python bytecode format is changing in every release.)\nOtherwise, let's say you are selling to people who don't really know what the difference is between Python\/C++: The outcome is the important thing. If your Python plugin runs and feels stable and fast, it is fine.\nIf they have heard about both languages, there really may be a difference. I must admit, if I had a choice between two plugins which do exactly the same and which are perfectly stable from all user reports, I probably would prefer the C++ plugin. It would be my intuition which would tell me that the C++ code is probably slightly more stable and faster. This is also for Unix tools and other stuff.","Q_Score":3,"Tags":"c++,python","A_Id":3277408,"CreationDate":"2010-07-18T21:42:00.000","Title":"Is Python-based software considered less-professional than C++\/compiled software?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK.\nThe C++ SDK documentation appears incomplete in certain areas and isn't documented that well.\nThe Python SDK docs appear more complete and in general are much easier to work with.\nSo I'm trying to decide if I want to go through the potential trouble of building a C++ plugin instead of a Python plugin to sell. About the only thing that makes me want to do a C++ plugin is that in my mind, a \"C++ plugin\" might be an easier sell than a \"Python plugin\". A lot of programmers out there don't even considered writing Python to be real \"programming\".\nDo you think that potential customers might say \"Why would I pay money for a measly little Python script?\"? As opposed to \"Oh it was written in C++ so the guy must be a decent programmer\"?\nWriting the Python plugin would be faster. Both plugins would look and behave exactly the same. The C++ plugin might be faster in certain spots, but for the type of plugin this is, that's not a huge deal.\nSo my question is, would a Python plugin be considered not as professional\/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":815,"Q_Id":3277376,"Users Score":6,"Answer":"A lot of programmers out there don't even considered writing Python to be real \"programming\".\n\nA lot of \"programmers\" out there are incompetent, too.\n\nDo you think that potential customers might say \"Why would I pay money for a measly little Python script?\"?\n\nI'm sure it depends on the type of software, but I can tell you that my program's customers have little interest in what we use to develop our product, and I doubt most of them know that the software is written in C++. They just care that it works.\n\nSo my question is, would a Python plugin be considered not as professional\/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?\n\nNo.","Q_Score":3,"Tags":"c++,python","A_Id":3277400,"CreationDate":"2010-07-18T21:42:00.000","Title":"Is Python-based software considered less-professional than C++\/compiled software?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK.\nThe C++ SDK documentation appears incomplete in certain areas and isn't documented that well.\nThe Python SDK docs appear more complete and in general are much easier to work with.\nSo I'm trying to decide if I want to go through the potential trouble of building a C++ plugin instead of a Python plugin to sell. About the only thing that makes me want to do a C++ plugin is that in my mind, a \"C++ plugin\" might be an easier sell than a \"Python plugin\". A lot of programmers out there don't even considered writing Python to be real \"programming\".\nDo you think that potential customers might say \"Why would I pay money for a measly little Python script?\"? As opposed to \"Oh it was written in C++ so the guy must be a decent programmer\"?\nWriting the Python plugin would be faster. Both plugins would look and behave exactly the same. The C++ plugin might be faster in certain spots, but for the type of plugin this is, that's not a huge deal.\nSo my question is, would a Python plugin be considered not as professional\/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":815,"Q_Id":3277376,"Users Score":0,"Answer":"I think it doesn't matter. It all come down to 'use the right tool for the right job'. Your primary goal should be to make the best plugin you can. So if you feel more at ease with Python use that. It will probably take you less time to write. The client probably doesn't mind it and just want the most stable, reliable, cheapest, easiest to use plugin. So concentrate on that not on the tool.","Q_Score":3,"Tags":"c++,python","A_Id":3277403,"CreationDate":"2010-07-18T21:42:00.000","Title":"Is Python-based software considered less-professional than C++\/compiled software?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What would be the best way to use negative coordinates in pygame?\nAt the moment I have a surface that is 1.5 times the original surface then everything that needs to be drawn is shifted up by a certain amount (to ensure the negative coordinates become positive) and drawn.\nIs there an easier\/alternate way of doing this?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2454,"Q_Id":3279436,"Users Score":0,"Answer":"There is no way to move the origin of a surface from 0,0.\nImplement your own drawing class which transforms all the coordinates passed in into the space of the surface.","Q_Score":2,"Tags":"python,pygame,coordinates,geometry-surface","A_Id":3279476,"CreationDate":"2010-07-19T08:22:00.000","Title":"Negative coordinates in pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any way to run a python script that utilizes TKinter on a web page such that a user could run the script and interact with the TK windows without having to download the script or have the appropriate python interpreter?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":944,"Q_Id":3284779,"Users Score":1,"Answer":"No. There is no way to do this.","Q_Score":0,"Tags":"python,tkinter","A_Id":3284846,"CreationDate":"2010-07-19T20:27:00.000","Title":"Any way to run python TK scripts on web page?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from. \nMy intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and for it to be processed by another component. \nComparing with another toolkits, for example, in wxWidgets I would use events. These automatically propogate up from child windows\/objects to parents. At each level they can be handled. This means if I have a lot of children which may emit the same event, I don't have to explicitly connect all of them to the handler. I can just put the handler in the parent, or some higher level in the window hierarchy. This means that only the event generator and consumer need to know about the event at all. The consumer doesn't need to know where the source of the event is, how many such sources there are, or anything else about it.\nIs this possible in Qt - is there another approach? Maybe there is an alternative event mechanism to signals and slots?","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1116,"Q_Id":3286826,"Users Score":0,"Answer":"Signal handlers do NOT know the emitter (only the signal type) and emitters do NOT know what handlers are connected. Many handlers can connect to the same signal and they are executed in the order of connection. A signal can be emitted from many places.","Q_Score":3,"Tags":"python,qt4,pyqt,signals","A_Id":8453598,"CreationDate":"2010-07-20T03:36:00.000","Title":"How to broadcast a signal in Qt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from. \nMy intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and for it to be processed by another component. \nComparing with another toolkits, for example, in wxWidgets I would use events. These automatically propogate up from child windows\/objects to parents. At each level they can be handled. This means if I have a lot of children which may emit the same event, I don't have to explicitly connect all of them to the handler. I can just put the handler in the parent, or some higher level in the window hierarchy. This means that only the event generator and consumer need to know about the event at all. The consumer doesn't need to know where the source of the event is, how many such sources there are, or anything else about it.\nIs this possible in Qt - is there another approach? Maybe there is an alternative event mechanism to signals and slots?","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":1116,"Q_Id":3286826,"Users Score":1,"Answer":"This isn't easily possible - you have to have something that knows about the signaling object and the receiving object to connect the two. Depending on what you need, however, you might be able to set up a class that mediates between the two (so objects with signals tell the class they exist, and have such-and-such a signal, while objects with slots tell the class they exist and have such-and-such a slot to connect to a given signal, and the mediator class tracks both of those, making connections when necessary).","Q_Score":3,"Tags":"python,qt4,pyqt,signals","A_Id":3292687,"CreationDate":"2010-07-20T03:36:00.000","Title":"How to broadcast a signal in Qt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from. \nMy intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and for it to be processed by another component. \nComparing with another toolkits, for example, in wxWidgets I would use events. These automatically propogate up from child windows\/objects to parents. At each level they can be handled. This means if I have a lot of children which may emit the same event, I don't have to explicitly connect all of them to the handler. I can just put the handler in the parent, or some higher level in the window hierarchy. This means that only the event generator and consumer need to know about the event at all. The consumer doesn't need to know where the source of the event is, how many such sources there are, or anything else about it.\nIs this possible in Qt - is there another approach? Maybe there is an alternative event mechanism to signals and slots?","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1116,"Q_Id":3286826,"Users Score":0,"Answer":"Don't you just want a good old fashioned method invocation? The response is just the return value of the method.","Q_Score":3,"Tags":"python,qt4,pyqt,signals","A_Id":3300104,"CreationDate":"2010-07-20T03:36:00.000","Title":"How to broadcast a signal in Qt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am making a html window in wxpython and want to print it. Before that I need to enter user input (such as his name or such things ) in the html page. How to do that nicely? \nThanks in advance,","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":614,"Q_Id":3287455,"Users Score":0,"Answer":"There are a couple of approaches that come to my mind. If it's like a form letter where only specific parts will be replaced, then you can just should that to the user and have some text controls for them to fill in. Something like this:\nDear #NAME,\nThank you for contacting #COMPANY, blah blah blah\nAnd then have a text control for each of the replaceable parts. The other method would be to use the RichTextCtrl's Save As HTML functionality. See the wxPython Demo application for an example.","Q_Score":2,"Tags":"python,wxpython,tags","A_Id":3294064,"CreationDate":"2010-07-20T06:13:00.000","Title":"How to insert dynamic string in wxpython html window? (wx.html.htmlwindow)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I need to get the mouse position relative to the tkinter window.","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":9025,"Q_Id":3288047,"Users Score":3,"Answer":"Get the screen coordinates of the mouse move event (x\/y_root) and subtract the screen coordinates of the window (window.winfo_rootx()\/y()).","Q_Score":5,"Tags":"python,tkinter,mouse-position","A_Id":3288196,"CreationDate":"2010-07-20T08:05:00.000","Title":"How do I get mouse position relative to the parent widget in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When the user presses a close Button that I created, some tasks are performed before exiting. However, if the user clicks on the [X] button in the top-right of the window to close the window, I cannot perform these tasks. \nHow can I override what happens when the user clicks [X] button?","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":56249,"Q_Id":3295270,"Users Score":2,"Answer":"The command you are looking for is wm_protocol, giving it \"WM_DELETE_WINDOW\" as the protocol to bind to. It lets you define a procedure to call when the window manager closes the window (which is what happens when you click the [x]).","Q_Score":29,"Tags":"python,button,tkinter","A_Id":3295508,"CreationDate":"2010-07-20T23:46:00.000","Title":"Overriding Tkinter \"X\" button control (the button that close the window)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted if it is significantly easier to implement.\nQuestion 1\nFrom what I have learned so far, there are broadly speaking two ways to integrate Python\/Lua with C++ : \"extending\" and \"embedding\".\nIn this case, it looks like I need both. The scripting language need access to objects, methods and data from the app but needs to be called by the app once the user has written the script - without restarting anything.\nHow is this usually done in the real world?\nQuestion 2\nThere seems to be a bewildering array of of manual solutions and binding generators out there, all of them less than perfect. \n\nswig, pyste, Py++, ctypes, Boost.Python sip, PyCXX, pybindgen, robin, (Cython\/Pyrex, Weave)\nCppLua, Diluculum, Luabind, Luabridge, LuaCpp, Luna\/LunaWrapper, MLuaBind, MultiScript, OOLua, SLB, Sweet Lua, lux\n(this list from the lua wiki)\nCPB, tolua, tolua++, toLuaxx, luna and again swig\n\nMost commments on these found on the web are a little out of date. For example, swig is said to be difficult in non-trivial cases and to generate incomprehensible code. OTOH, it has recently gone to v2.0.\nSome of the above use pygccxml to let gcc analyze the C++ code and then genarate the binding. I find this idea appealing, as gcc probably understands the code better than i do :-). Does this work well?\nTesting them all might easily cost me half of the time allocated for the whole project.\nSo, which ones do you recommend?","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1926,"Q_Id":3299067,"Users Score":0,"Answer":"My experience may not be much, but I figure it's at least worth what you paid for it ;)\nI've done some basic \"hello world\" python modules, and I couldn't really get into swig - it seemed like a lot of overhead for what I was doing. Of course it's also possible that it's just the right amount for your needs.","Q_Score":12,"Tags":"c++,python,binding,lua,scriptable","A_Id":3299189,"CreationDate":"2010-07-21T12:18:00.000","Title":"How do I make a nasty C++ program scriptable with Python and\/or Lua?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted if it is significantly easier to implement.\nQuestion 1\nFrom what I have learned so far, there are broadly speaking two ways to integrate Python\/Lua with C++ : \"extending\" and \"embedding\".\nIn this case, it looks like I need both. The scripting language need access to objects, methods and data from the app but needs to be called by the app once the user has written the script - without restarting anything.\nHow is this usually done in the real world?\nQuestion 2\nThere seems to be a bewildering array of of manual solutions and binding generators out there, all of them less than perfect. \n\nswig, pyste, Py++, ctypes, Boost.Python sip, PyCXX, pybindgen, robin, (Cython\/Pyrex, Weave)\nCppLua, Diluculum, Luabind, Luabridge, LuaCpp, Luna\/LunaWrapper, MLuaBind, MultiScript, OOLua, SLB, Sweet Lua, lux\n(this list from the lua wiki)\nCPB, tolua, tolua++, toLuaxx, luna and again swig\n\nMost commments on these found on the web are a little out of date. For example, swig is said to be difficult in non-trivial cases and to generate incomprehensible code. OTOH, it has recently gone to v2.0.\nSome of the above use pygccxml to let gcc analyze the C++ code and then genarate the binding. I find this idea appealing, as gcc probably understands the code better than i do :-). Does this work well?\nTesting them all might easily cost me half of the time allocated for the whole project.\nSo, which ones do you recommend?","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1926,"Q_Id":3299067,"Users Score":0,"Answer":"Try Boost::Python, it has somewhat of a learning curve associated with it but it is the best tool for the job in my view, we have a huge real time system and developed the scripting library for the QA in Boost::Python.","Q_Score":12,"Tags":"c++,python,binding,lua,scriptable","A_Id":3299415,"CreationDate":"2010-07-21T12:18:00.000","Title":"How do I make a nasty C++ program scriptable with Python and\/or Lua?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted if it is significantly easier to implement.\nQuestion 1\nFrom what I have learned so far, there are broadly speaking two ways to integrate Python\/Lua with C++ : \"extending\" and \"embedding\".\nIn this case, it looks like I need both. The scripting language need access to objects, methods and data from the app but needs to be called by the app once the user has written the script - without restarting anything.\nHow is this usually done in the real world?\nQuestion 2\nThere seems to be a bewildering array of of manual solutions and binding generators out there, all of them less than perfect. \n\nswig, pyste, Py++, ctypes, Boost.Python sip, PyCXX, pybindgen, robin, (Cython\/Pyrex, Weave)\nCppLua, Diluculum, Luabind, Luabridge, LuaCpp, Luna\/LunaWrapper, MLuaBind, MultiScript, OOLua, SLB, Sweet Lua, lux\n(this list from the lua wiki)\nCPB, tolua, tolua++, toLuaxx, luna and again swig\n\nMost commments on these found on the web are a little out of date. For example, swig is said to be difficult in non-trivial cases and to generate incomprehensible code. OTOH, it has recently gone to v2.0.\nSome of the above use pygccxml to let gcc analyze the C++ code and then genarate the binding. I find this idea appealing, as gcc probably understands the code better than i do :-). Does this work well?\nTesting them all might easily cost me half of the time allocated for the whole project.\nSo, which ones do you recommend?","AnswerCount":5,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":1926,"Q_Id":3299067,"Users Score":12,"Answer":"I wouldn't recommend swig as it's hard to get it to generate satisfactory binding in complex situations: been there, done that. I had to write a horrible script that \"parsed\" the original C++ code to generate some acceptable C++ code that swig could chew and generate acceptable bindings. So, in general: avoid ANY solution that relies on parsing the original C++ program.\nBetween Lua and Python: I have found Lua MUCH, MUCH better documented and more cleanly implemented. Python has a GIL (global lock), whereas with Lua, you can have an interpreter instance in each thread, for example.\nSo, if you can choose, I'd recommend Lua. It is smaller language, easier to comprehend, easier to embed (much cleaner and smaller API, with excellent documentation). I have used luabind for a small project of mine and found it easy to use.","Q_Score":12,"Tags":"c++,python,binding,lua,scriptable","A_Id":3299174,"CreationDate":"2010-07-21T12:18:00.000","Title":"How do I make a nasty C++ program scriptable with Python and\/or Lua?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For a college project, I need to implement a GUI for a console app I wrote. For this I decided to use PyQt. I need only basic functionalities, such as designing a simple form with basic elements and displaying some texts on it.\nCan anyone point me to a nice tutorial for learning PyQt? I really don't want to get into the details of Qt at this stage.","AnswerCount":5,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":9748,"Q_Id":3300182,"Users Score":0,"Answer":"you need to see the orginal pyqt Examples\nyou need time for practice\nyou get Experience \nyou must specify a goal and start Researching about it.","Q_Score":12,"Tags":"python,pyqt","A_Id":10767981,"CreationDate":"2010-07-21T14:15:00.000","Title":"Learning PyQt Quickly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"for python2.x py2app will do the work. But for python3 code which one is alternate to go ahead?\nOr is there any other way to get single .app file?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":231,"Q_Id":3307083,"Users Score":0,"Answer":"py2app claims to support Python 3, so you should be able to use it.","Q_Score":1,"Tags":"python,macos,python-3.x","A_Id":5049583,"CreationDate":"2010-07-22T08:38:00.000","Title":"How to convert python3-pyqt code into .app file for mac os x?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When I compiled Python using PCBuild\\build.bat I discovered that several Python external projects like ssl, bz2, ... were not compiled because the compiler did not find them. \nI did run the Tools\\Buildbot\\external.bat and it did download them inside \\Tools\\ but it looks that the build is not looking for them in this location and the PCBuild\\readme.txt does not provide the proper info regarding this.\nIn case it does matter, I do use VS2008 and VS2010 on this system.\nExample:\n\nBuild log was saved at \"file:\/\/C:\\dev\\os\\py3k\\PCbuild\\Win32-temp-Release\\_tkinter\\BuildLog.htm\" \n_tkinter - 2 error(s), 0 warning(s) \nBuild started: Project: bz2, Configuration: Release|Win32 \nCompiling... \nbz2module.c \n..\\Modules\\bz2module.c(12) : fatal error C1083: Cannot open include file: 'bzlib.h': No such file or\n directory","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":872,"Q_Id":3307813,"Users Score":2,"Answer":"Tools\\buildbot\\external.bat must be run from py3k root, not from Tools\\buildbot\\ subdir as you did. Also to build release version of python with Tkinter support you have to edit or copy Tools\\buildbot\\external.bat to remove DEBUG=1 so it can build tclXY.dll\/tkXY.dll (without -g suffix).","Q_Score":1,"Tags":"python","A_Id":3683128,"CreationDate":"2010-07-22T10:20:00.000","Title":"How to compile Python with all externals under Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Could someone tell me which is better of the two for bundling Python applications \u2014 cx_Freeze or PyInstaller? I'm looking for a comparison based on factors such as:\n\nPopularity (i.e. larger user base)\nFootprint of the built binary\nCross platform compatibility\nEase of use","AnswerCount":2,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":20447,"Q_Id":3307966,"Users Score":26,"Answer":"I tried both for a current project and decided to use cx_freeze. I found it easier to get started. It has an option to bundle dependencies in a zip archive, which makes it easy to check that everything was properly included.\nI had trouble getting PyInstaller to include certain egg dependencies. It couldn't handle conditional imports as well as I needed and looking through the bundled archive was difficult. On Windows, it requires pywin32 (so it can't be used with virtualenv) and version 1.4 doesn't work with Python 2.6. There's no information on whether Python 2.7 is supported.","Q_Score":37,"Tags":"python,pyinstaller,cx-freeze","A_Id":3368456,"CreationDate":"2010-07-22T10:45:00.000","Title":"Which is better - PyInstaller or cx_Freeze?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am compiling on Ubuntu 10.04 LTS. The Perforce Python API uses their C++ API for some of it. So, I point the setup.py at the C++'s API directory using the --apidir= they say to use. When it starts to compile the C++, I get a whole load of errors (temporary error list link is now gone). No one else has had these errors as far as I can tell. So, my question is, is it my idiocy, or Perforce's?\nP.S. The reason I don't have the flag in the command is because I setup the setup.cfg file to point at the API.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":290,"Q_Id":3324490,"Users Score":0,"Answer":"Woops! Forgot I still needed to install python-dev...","Q_Score":0,"Tags":"c++,python,perforce","A_Id":3324560,"CreationDate":"2010-07-24T09:08:00.000","Title":"Perforce P4Python API Bug","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any difference in speed of copying files from one location to another betwen python or delphi or c++ ? \nI guess that all 3 laguages uses same or similar win api calls and that there is not much performance difference.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":78,"Q_Id":3324870,"Users Score":1,"Answer":"Pythons shutil module does not use the Windows API, but instead uses an open\/read\/write loop. This may or may not be slower than using CopyFile(Ex). Please measure it, everything else is just guessing.","Q_Score":0,"Tags":"python,windows,performance,comparison","A_Id":3324905,"CreationDate":"2010-07-24T11:17:00.000","Title":"python file copying","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a developer on a software project for Linux that uses Python and PyGTK. The program we are writing depends on a number of third-party packages that are available through all mayor distro repositories. One of these is a python binding (written in C) that allows our program to chat with a common C library. Unfortunately, there's a bug in the bindings that affects our program a great deal. A fix\/patch was recently presented, but hasn't been committed yet. We want to include this fix as soon as possible, but are unsure that the best course of action would be. \nBased on the scenario I described, we figured we have the following options. Hopefully someone can give more insight or maybe point us to a solution we haven't considered yet\n\nWait for the python bindings to be updated. The problem with this is that we have no way of knowing when the update would be accepted into distribution repositories, or even if it will be backported to earlier releases. \nInclude a modified version of the python bindings including the fix with our program and have users compile it on installation. This would provide a burden for packagers as every version of every distribution would link against another version of the C library. \nRewrite our program in C++ and avoid dealing with python bindings all together. Yep, actually considering this hehe. \nKeep the ugly hack we have in place intact. Not preferable obviously as it is, well, an ugly hack\n\nThanks in advance!","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":115,"Q_Id":3325161,"Users Score":3,"Answer":"As long as the ugly hack works, use it. It will have drawbacks local to your package. Additionally, you can phase it out (significantly) later by requiring a bug-free version of your dependency, when it is released and is available for some time so that distros have a chance to start shipping it.","Q_Score":2,"Tags":"python,linux,repository,packaging","A_Id":3325182,"CreationDate":"2010-07-24T12:54:00.000","Title":"Bug in third-party dependency creates python packaging dilemma","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know how to make an image a button in Tkinter, now how do I make th image a toggle button similar to a radio button?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1795,"Q_Id":3327799,"Users Score":2,"Answer":"Use a checkbutton with \"indicatoron\" set to False. This will turn off the little checkbox so you only see the image (or text), and the relief will toggle between raised and sunken each time it is clicked. \nAnother way is to use a label widget and manage the button clicks yourself. Add a binding for <1> and change the relief to sunken if raised, and raised if sunken. It's easier to use the built-in features of the checkbutton, since it also handles keyboard traversal, activation, etc.","Q_Score":0,"Tags":"python,radio-button,toggle,tkinter","A_Id":3327963,"CreationDate":"2010-07-25T02:49:00.000","Title":"Making a Toggle Button with an image in Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a gtk TextView in a maximized window and I want to know how many characters a line can fit before you have to scroll.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":214,"Q_Id":3328241,"Users Score":0,"Answer":"(Friendly reminder, please stop putting answers in the comments, people.)\nTo summarize:\nIt depends on the size of the TextView, size of the window, size of the font, and as Alex Martelli said, the particular font and the usage of letters...\"i\" is a narrow letter, \"m\" is a wide letter, thus you can fit more \"i\"s than you can \"m\"s in a given space.\nSo, in short, there is no way to know for sure.","Q_Score":0,"Tags":"python,gtk,pygtk","A_Id":8647405,"CreationDate":"2010-07-25T06:03:00.000","Title":"Get the length in characters of a PyGTK TextView","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What are the usable tools?\nI am aware of wxformbuilder and wxGlade, but none of them seems to be complete yet.","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":831,"Q_Id":3329762,"Users Score":2,"Answer":"Here are a few of the most popular wxPython related GUI builders:\n\nBoa Constructor (mostly dead) \nwxGlade\nwxFormBuilder \nXRCed \nwxDesigner (not FOSS)\nDabo - one of their videos shows a way to interactively design an app...\n\nI personally just use a Python IDE to hand code my applications. My current favorite IDE is Wing.","Q_Score":2,"Tags":"python,wxpython,wxwidgets","A_Id":3345554,"CreationDate":"2010-07-25T15:30:00.000","Title":"What are the existing open-source Python WxWidgets designers?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What are the usable tools?\nI am aware of wxformbuilder and wxGlade, but none of them seems to be complete yet.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":831,"Q_Id":3329762,"Users Score":1,"Answer":"afaik... none. I'll follow the answers to see if someone has one and try it of course but I'm not convinced this will be THAT useful. When using wxPython, you usually work with sizers (at least I think the results are better) so you don't really need to \"place\" the controls on the frame and I think a GUI \"design\" would be longer to do. The only part where I think it could have some interest is to fill atributes for the controls but a good auto-complete with wx (or a good cheat sheet or a \"template class\" with all the options you use) solves the problem in my opinion. I stopped seeking for a GUI designer for wx after trying Pydev that auto-completes wx very nicely (a lot better than everything I tried before... and that's a lot!).","Q_Score":2,"Tags":"python,wxpython,wxwidgets","A_Id":3330832,"CreationDate":"2010-07-25T15:30:00.000","Title":"What are the existing open-source Python WxWidgets designers?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am new to this post as well as to python GUI programming.I want to make a realtime graphical GUI in wxpython.My requirement is that i have to catch signals from a device and i have to display the data in graphical as well as in textual form.The system should be accurate and be specific with the time constraints.Please can any one guide me in this,and if this be possible in wxpython and if yes how can i and if no what i can use for this is python.\nHoping someone will help me out soon.Thanks in advance and for your concern.\nregards,\nAnil ph","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":179,"Q_Id":3332263,"Users Score":0,"Answer":"If you can connect to this mysterious device and receive data from it from Python, then you can display said data with wxPython or any other GUI toolkit. You don't really say what kind of data it is or what you want to display? Lines? Graphs? Or what? If it's just tabular data, use the wx.ListCtrl (or ObjectListView) widget. If you need graphs, see the Plot widget or Matplotlib.","Q_Score":0,"Tags":"user-interface,wxpython,real-time","A_Id":5598605,"CreationDate":"2010-07-26T04:48:00.000","Title":"Help : Realtime graphical interface in wxpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an application where my DataFetch() class \"Wraps\" around my HBHTray() class for the purpose of interacting with the functions\/variables of that class. Unfortunately, I can't seem to be able to get the code to continue execution after my DataFetch() class makes a instance of HBHTray and calls it, and on the Start() method of HBHTray it hangs.\nThis is the relevant code:\n\nclass DataFetch(): # I need the DataFetch class to be wrapping around HBHTray so I can call\/edit certain variables from within functions in DataFetch\n def init(self):\n self.Interval, self.Username, self.Password, self.CheckShoutBox = GetOptions('.tray')\n self.Gui = HBHTray()\n print '1'\n self.Gui.Start()\n print '2'\n def Login(self):\n pass # Do stuff (Eg: Edit self.Gui.StatusIcon state or call self.Gui.Notify()\n def Start(self):\n print 'hi!'\n sleep(self.Interval)\n print 'Hi!'\nclass HBHTray():\n def init(self):\n self.StatusIcon = gtk.StatusIcon()\n self.StatusIcon.set_from_file('img')\n self.StatusIcon.set_tooltip('No new messages')\n self.Menu = gtk.Menu()\n self.CheckBox = gtk.CheckMenuItem('Notify')\n self.CheckBox.connect('activate', self.ChangeCheckBox)\n self.CheckBox.set_active(True)\n self.Menu.append(self.CheckBox)\n self.MenuItem = gtk.ImageMenuItem('Options')\n self.MenuItem.connect('activate', self.Options, self.StatusIcon)\n self.Menu.append(self.MenuItem)\n self.MenuItem = gtk.ImageMenuItem('About')\n self.MenuItem.connect('activate', self.About, self.StatusIcon)\n self.Menu.append(self.MenuItem)\n self.MenuItem = gtk.ImageMenuItem('Quit')\n self.MenuItem.connect('activate', self.Quit, self.StatusIcon)\n self.Menu.append(self.MenuItem)\n self.StatusIcon.connect('popup-menu', self.PopMenu, self.Menu)\n self.StatusIcon.set_visible(1)\n def PopMenu(self, widget, button, time, data = None):\n if data:\n data.show_all()\n data.popup(None, None, gtk.status_icon_position_menu, 3, time, self.StatusIcon)\n def Notify(self, message):\n pynotify.init('null')\n notification = pynotify.Notification('Something', message, 'dialogue')\n notification.attach_to_status_icon(self.StatusIcon)\n notification.show()\n def Start(self):\n gtk.main()\n def About(self, a, b):\n self.Notify('test')\n def Options(self, a, b):\n print a, b\n def ChangeCheckBox(self, null):\n pass\n def Quit(self, a, b):\n raise SystemExit\nif name == 'main':\n try:\n gobject.threads_init() # Doesn't work?\n Monitor = DataFetch()\n Monitor.Start()\n\nSorry for the terrible formatting, Stack Overflow doesn't seem to like blank lines....\nAnyways, though, \"1\" is printed, but \"2\" is not. So, gtk.main() is obviously where it's hanging. Is there any way to allow me to continue execution and have gtk go do it's own thing?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":356,"Q_Id":3336457,"Users Score":0,"Answer":"Turns out the problem was that I couldn't find a working solution because I was utilizing the Thread module the wrong way and calling run() directly when I should have been calling start(). Because of that, I was thinking that nothing I did worked (especially with no error or complaint from anything) and figured it was a problem relating to how I was wrapping gtk.main()","Q_Score":0,"Tags":"python,multithreading,pygtk,wrapper","A_Id":3337085,"CreationDate":"2010-07-26T15:42:00.000","Title":"Continuing code execution after a pygtk.main() in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an application where my DataFetch() class \"Wraps\" around my HBHTray() class for the purpose of interacting with the functions\/variables of that class. Unfortunately, I can't seem to be able to get the code to continue execution after my DataFetch() class makes a instance of HBHTray and calls it, and on the Start() method of HBHTray it hangs.\nThis is the relevant code:\n\nclass DataFetch(): # I need the DataFetch class to be wrapping around HBHTray so I can call\/edit certain variables from within functions in DataFetch\n def init(self):\n self.Interval, self.Username, self.Password, self.CheckShoutBox = GetOptions('.tray')\n self.Gui = HBHTray()\n print '1'\n self.Gui.Start()\n print '2'\n def Login(self):\n pass # Do stuff (Eg: Edit self.Gui.StatusIcon state or call self.Gui.Notify()\n def Start(self):\n print 'hi!'\n sleep(self.Interval)\n print 'Hi!'\nclass HBHTray():\n def init(self):\n self.StatusIcon = gtk.StatusIcon()\n self.StatusIcon.set_from_file('img')\n self.StatusIcon.set_tooltip('No new messages')\n self.Menu = gtk.Menu()\n self.CheckBox = gtk.CheckMenuItem('Notify')\n self.CheckBox.connect('activate', self.ChangeCheckBox)\n self.CheckBox.set_active(True)\n self.Menu.append(self.CheckBox)\n self.MenuItem = gtk.ImageMenuItem('Options')\n self.MenuItem.connect('activate', self.Options, self.StatusIcon)\n self.Menu.append(self.MenuItem)\n self.MenuItem = gtk.ImageMenuItem('About')\n self.MenuItem.connect('activate', self.About, self.StatusIcon)\n self.Menu.append(self.MenuItem)\n self.MenuItem = gtk.ImageMenuItem('Quit')\n self.MenuItem.connect('activate', self.Quit, self.StatusIcon)\n self.Menu.append(self.MenuItem)\n self.StatusIcon.connect('popup-menu', self.PopMenu, self.Menu)\n self.StatusIcon.set_visible(1)\n def PopMenu(self, widget, button, time, data = None):\n if data:\n data.show_all()\n data.popup(None, None, gtk.status_icon_position_menu, 3, time, self.StatusIcon)\n def Notify(self, message):\n pynotify.init('null')\n notification = pynotify.Notification('Something', message, 'dialogue')\n notification.attach_to_status_icon(self.StatusIcon)\n notification.show()\n def Start(self):\n gtk.main()\n def About(self, a, b):\n self.Notify('test')\n def Options(self, a, b):\n print a, b\n def ChangeCheckBox(self, null):\n pass\n def Quit(self, a, b):\n raise SystemExit\nif name == 'main':\n try:\n gobject.threads_init() # Doesn't work?\n Monitor = DataFetch()\n Monitor.Start()\n\nSorry for the terrible formatting, Stack Overflow doesn't seem to like blank lines....\nAnyways, though, \"1\" is printed, but \"2\" is not. So, gtk.main() is obviously where it's hanging. Is there any way to allow me to continue execution and have gtk go do it's own thing?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":356,"Q_Id":3336457,"Users Score":0,"Answer":"gobject.threads_init() does not magically put your things into separate threads. It only tells the library that you're going to use threads, and sets up some locking. You'll still have to create the threads yourself.","Q_Score":0,"Tags":"python,multithreading,pygtk,wrapper","A_Id":3336490,"CreationDate":"2010-07-26T15:42:00.000","Title":"Continuing code execution after a pygtk.main() in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.\nI'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.\nMy goals:\n1. to make GUI using as less custom components as possible.\n2. to make it as cross-platform as possible\n(I know already that CPython and Jython are cross-platform-friendly, but what about IronPython+Mono?)\nSo - the question is about GUI - what should I choose?","AnswerCount":8,"Available Count":5,"Score":0.1243530018,"is_accepted":false,"ViewCount":6247,"Q_Id":3337725,"Users Score":5,"Answer":"Well, Mono does not come with the base of most Linux distributions. It's not a terribly lightweight dependency either, and I think Java is considerably more likely for people to already have. Would you plan on using \"Winforms\" with Mono? If so, and you don't have experience with Winforms, read about what others have to say :-) The other .NET GUI toolkit is WPF, which unfortunately Mono has no plans to implement.\nJython would be better too, because you can use SWT, which renders native widgets and provides lots of layout possibilities easily. Or you can use Jython with Swing, or whatever else -- even AWT if you love ugliness.\nI really like wxPython (which you can use with CPython, which is on most distros by default), because it renders good-looking native widgets in OSX, Windows and Linux (I've only seen the Gnome widgets in person). wxPython is by far the easiest to use GUI toolkit I've used -- even programatically (i.e. layout without Glade or similar). I've also used SWT, which I found quite nice, and Swing, which I personally don't really like the looks of, and Winforms, which was a nightmare to try to do even simple layouts with.\nHere's a quick comparison of the existence of the interpreter\/language runtime by OS\n\nCPython\n\nWindows - Probably not installed, and you'd have to make a non-python installer install it with your software :-P\nLinux - Probably installed (Ubuntu, Gentoo and RedHat all have system tools that are written in Python and run on CPython)\nMac - Preinstalled on OSX\n\nJython\n\nWindows - Probably installed at some point in my experience, though it doesn't come with\nLinux - Probably installed, but more importantly nobody would hate you for depending on it like Mono\nMac - Preinstalled on OSX (\"Mac OS X Leopard comes with J2SE 5.0 preinstalled, based on JDK 1.5.0_13_b05\" -- Apple's site)\n\nIronPython\n\nWindows - Will probably run fine because I bet most people have at the very least .NET 2.0 if they have a recent version of Windows\nLinux - Probably not installed -- the only application with which I've used Mono on Linux was Rasterbator, which worked well but I felt weird putting .NET on Linux\nMac - See above\n\n\nI would choose a GUI toolkit first, since that will very much impact the user experience and overall difficulty (I would choose wxPython but SWT would be a close second) then consider the above as well maybe as a tiebreaker.","Q_Score":9,"Tags":"python,user-interface,ironpython,jython,cpython","A_Id":3337830,"CreationDate":"2010-07-26T18:19:00.000","Title":"CPython vs. Jython vs. IronPython for cross-platform GUI development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.\nI'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.\nMy goals:\n1. to make GUI using as less custom components as possible.\n2. to make it as cross-platform as possible\n(I know already that CPython and Jython are cross-platform-friendly, but what about IronPython+Mono?)\nSo - the question is about GUI - what should I choose?","AnswerCount":8,"Available Count":5,"Score":0.049958375,"is_accepted":false,"ViewCount":6247,"Q_Id":3337725,"Users Score":2,"Answer":"Take a look at comparable GUI's written in python\/jython\/ironpython. Look for programs that you like and find out what they use. I guess most if not all will be written in cpython + gtk or cpython + qt. I think all gui toolkits in python are cross platform.","Q_Score":9,"Tags":"python,user-interface,ironpython,jython,cpython","A_Id":3337760,"CreationDate":"2010-07-26T18:19:00.000","Title":"CPython vs. Jython vs. IronPython for cross-platform GUI development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.\nI'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.\nMy goals:\n1. to make GUI using as less custom components as possible.\n2. to make it as cross-platform as possible\n(I know already that CPython and Jython are cross-platform-friendly, but what about IronPython+Mono?)\nSo - the question is about GUI - what should I choose?","AnswerCount":8,"Available Count":5,"Score":0.1243530018,"is_accepted":false,"ViewCount":6247,"Q_Id":3337725,"Users Score":5,"Answer":"I'd say that if cross-platform is a goal, forget IronPython. A lot of people hate the dependency hell it causes so it'll be too much work to get it up in running in some OSes\/distributions. Jython will suffer this also, albeit to a lesser degree.","Q_Score":9,"Tags":"python,user-interface,ironpython,jython,cpython","A_Id":3337744,"CreationDate":"2010-07-26T18:19:00.000","Title":"CPython vs. Jython vs. IronPython for cross-platform GUI development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.\nI'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.\nMy goals:\n1. to make GUI using as less custom components as possible.\n2. to make it as cross-platform as possible\n(I know already that CPython and Jython are cross-platform-friendly, but what about IronPython+Mono?)\nSo - the question is about GUI - what should I choose?","AnswerCount":8,"Available Count":5,"Score":0.049958375,"is_accepted":false,"ViewCount":6247,"Q_Id":3337725,"Users Score":2,"Answer":"Java is the most portable platform. Jython is written in 100% pure Java. 'Nuff said.\nBTW I just switched a CPython\/GTK project to Jython (trying to remove as much unmanaged code as possible), the only problem is that Jython is at 2.5 still, which kind of sucks when you're used to 2.6\/2.7\/3 :)","Q_Score":9,"Tags":"python,user-interface,ironpython,jython,cpython","A_Id":3341283,"CreationDate":"2010-07-26T18:19:00.000","Title":"CPython vs. Jython vs. IronPython for cross-platform GUI development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.\nI'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.\nMy goals:\n1. to make GUI using as less custom components as possible.\n2. to make it as cross-platform as possible\n(I know already that CPython and Jython are cross-platform-friendly, but what about IronPython+Mono?)\nSo - the question is about GUI - what should I choose?","AnswerCount":8,"Available Count":5,"Score":0.024994793,"is_accepted":false,"ViewCount":6247,"Q_Id":3337725,"Users Score":1,"Answer":"There are plenty of answers already, but I'd like to add one important thing - regardless of which library you learn, most of the principles will be the same when you move to another library.\nI don't know about Qt, but for most graphics programs (in PyGTK or Tkinter) the best thing to do, as far as editing goes, is to use a PIL image (or something similar) to draw on and then draw that image on your canvas widget, otherwise you can lose pixel data if your window gets covered.","Q_Score":9,"Tags":"python,user-interface,ironpython,jython,cpython","A_Id":3337836,"CreationDate":"2010-07-26T18:19:00.000","Title":"CPython vs. Jython vs. IronPython for cross-platform GUI development","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i was wondering how to update a StaticText dynamically in wxpython?\nI have a script that goes every five minutes and reads a status from a webpage, then prints using wxpython the status in a static input.\nHow would i dynamically, every 5 minutes update the statictext to reflect the status?\nthanks alot\n-soule","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":12769,"Q_Id":3339263,"Users Score":1,"Answer":"Call the SetLabel method in your static text instance. So you don't run into conflict with the size, make sure your StaticText instance is created with enough space to write the future labels you'll want to write to it.","Q_Score":5,"Tags":"python,wxpython,refresh","A_Id":3339765,"CreationDate":"2010-07-26T21:50:00.000","Title":"Dynamically update wxPython staticText","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Just wondering if there is any kind of framework or method of making a Gui that will override (Stay on top of) all other windows in python. Including Games or other programs that seem to \"Take over\" the computers Graphical processes. Any point in the right direction would be much appreciated...\nPS. The OS in question is Windows 7, but a cross platform solution would be appreciated.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":99,"Q_Id":3340639,"Users Score":0,"Answer":"For a cross-platform solution, you could use wxPython with a wxSTAY_ON_TOP style bit in a main window. I believe that this will give you the behavior you desire on Mac and Unix GUIs as well as Microsoft Windows ones.","Q_Score":0,"Tags":"python,user-interface","A_Id":3340779,"CreationDate":"2010-07-27T03:55:00.000","Title":"GUI's Over Running Programs in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"What's a good way to handle fatal errors - missing packages, .ui files not compiled, Qt DLLs or shared objects not found, etc. - in a PyQt app (or other Python app)?\nDisplaying a cross-platform message box without Qt DLLs or shared objects seems like a lot of work. Dumping a message to the console seems not very helpful, since the end user will likely not see the console. How do other Python apps handle this? Or do they simply assume that a properly installed app won't run into these problems?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":67,"Q_Id":3358759,"Users Score":1,"Answer":"The distutils model handles installing a python app correctly, or there is a third party setuptools package that is even easier for end users.","Q_Score":0,"Tags":"python,installation,error-handling,pyqt,packages","A_Id":3358864,"CreationDate":"2010-07-29T01:04:00.000","Title":"Handling missing packages or DLLs in a PyQt app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering how to hide\/delete a StaticText in wxPython?","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":3670,"Q_Id":3367986,"Users Score":0,"Answer":"statictext.Show to show\nand \nstatictext.Hide to hide","Q_Score":4,"Tags":"python,wxpython,hide","A_Id":22358518,"CreationDate":"2010-07-30T00:37:00.000","Title":"Hide\/Delete a StaticText in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering how to hide\/delete a StaticText in wxPython?","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":3670,"Q_Id":3367986,"Users Score":5,"Answer":"Have you tried control.Hide() or control.Show(False)?","Q_Score":4,"Tags":"python,wxpython,hide","A_Id":3368074,"CreationDate":"2010-07-30T00:37:00.000","Title":"Hide\/Delete a StaticText in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering how to hide\/delete a StaticText in wxPython?","AnswerCount":3,"Available Count":3,"Score":0.3215127375,"is_accepted":false,"ViewCount":3670,"Q_Id":3367986,"Users Score":5,"Answer":"The widget's Hide\/Show methods should work. If the widget is in a sizer, then you can use the sizer's Detach method to \"hide\" it but not destroy it. Otherwise, the sizer has a Remove method that will remove the widget and destroy it. And there's the widget's own Destroy method.","Q_Score":4,"Tags":"python,wxpython,hide","A_Id":3371640,"CreationDate":"2010-07-30T00:37:00.000","Title":"Hide\/Delete a StaticText in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any examples how to authenticate your desktop Facebook application using PyQT and embedded webkit? \nThis is to provide better user experience than opening Facebook authentication page in a separate browser window.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":640,"Q_Id":3371549,"Users Score":0,"Answer":"I don't believe you can open an \"authentication page\" in a separate window under Facebook's terms (I used to work for Zynga, and we couldn't then, so I don't know how you'd achieve this now legally). \nSecond, you're looking into the QWebkit backwards I believe. From a UI perspective this is supposed to provide access to websites, and interact with them. If you want a good looking page, with all the bells and whistle, it pains me to say it ~ but use Actionscript 3, or Ajax and it's bundle.\nThis post would probably be answered better if tagged in the javascript, php, and as3 sections. As the php guys will know the correct hacks to get your intended result, if possible","Q_Score":4,"Tags":"python,facebook,webkit,pyqt","A_Id":5099848,"CreationDate":"2010-07-30T12:51:00.000","Title":"pyqt, webkit and facebook authentication?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"i have a scene with a multiple (QGraphicsTextItem)s, and i need to have control over their colors , so how to change a color of a QGraphicsTextItem ? is it possible anyway? i've been trying for 3 days until now . please help\n\nthanks in advance","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":8684,"Q_Id":3377439,"Users Score":2,"Answer":"setDefaultTextColor(col) \"Sets the color for unformatted text to col.\" The documentation is not clear about what \"unformatted text\" means. I think it means: \"all portions of the contents of the item that have not been styled.\"\nThe contents is a QTextDocument.\nYou style a part of a document using a QTextCursor. You can't style the QTextDocument per se, only a part that is selected by a QTextCursor (but you can select the whole document.)\nYou can style a QTextCursor using method mergeCharFormat(QTextCharFormat)\nThe QTextCharFormat has methods:\n\nforeground().setColor(QColor) \nsetForeground(QBrush)\nsetTextOutline(QPen)\n\nForeground is a QBrush that paints several things including \"text\" (but better said: the fill of characters?)\nOne nuance is that certain newly constructed QBrush have (default to) QBrushStyle.NoBrush, which is transparent, even if you setColor().","Q_Score":10,"Tags":"python,qt,qt4,pyqt","A_Id":12565371,"CreationDate":"2010-07-31T08:52:00.000","Title":"how to change the color of a QGraphicsTextItem","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a WxPython app that, among other things, has a integrated file-browser.\nI want to be able to create a system-default file context menu (e.g. what you get if you right-click on a file in windows explorer) when a user right clicks on one of the items within my application.\nNote: I already know how to create my own context menu (e.g. wx.EVT_LIST_ITEM_RIGHT_CLICK), I want the Windows context menu.\nTo clarify, I do not want, or need to modify the existing system context menu, I want to be able to display it for a specific file within my application. \nBasically, I know what was right clicked on, and where the mouse pointer is (if it's needed). I want to create the system context menu there, just like it works in windows explorer.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":741,"Q_Id":3380986,"Users Score":0,"Answer":"If you have python win32 installed, then look under the directory \/lib\/site-packages\/win32comext\/shell\/demos\/servers. This contains a file context_menu.py which has sample code for creating a shell extension.\nUpdate: I think you want the folder_view.py sample.","Q_Score":0,"Tags":"python,user-interface,windows-xp,wxpython","A_Id":3380995,"CreationDate":"2010-08-01T06:20:00.000","Title":"Create Explorer.exe's File - Context Menu in WxPython application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I hope to load .net dll in ironpython.\nBut one of static functions in .net dll, has some Named and Optional Arguments.\nlike, Draw(weight:w,height:h, Area=1)\nOnly can I use full arguments?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1159,"Q_Id":3384989,"Users Score":6,"Answer":"Named and optional parameters are fully supported. .NET has had these for a long time for VB.NET support and so IronPython has supported that same way to do them since the beginning. The new C# syntax maps to the same underlying metadata as the old VB support.\nFor calling you use f(x = 42) which is Python's named parameter syntax. For optional parameters you can just leave them out. In your example case you can probably do Draw(weight, height) and leave Area out. Or you can call w\/ weight and height as named parameters and leave Area out.\nThe underlying .NET meta data that IronPython looks for is either the OptionalAttribute or DefaultParameterValueAttribute. For optional we pass in default(T) unless the type is object in which case we pass in Missing.Value. This generally matches how reflection calls these APIs as well.","Q_Score":3,"Tags":".net,ironpython,optional-parameters,named-parameters","A_Id":3401635,"CreationDate":"2010-08-02T04:28:00.000","Title":"Can I use Named and Optional Arguments in ironpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im planing to do some GUI development using pyqt4 pykde and python3.1 on Kubuntu 10.4. In the research I did I found out that most of the things are available as packages in repositories and some of the packages are preinstalled. Only thing is I'm not able to figure out what to install and what not to. Can someone please give me a list of packages that I need to install to do GUI development using python3.1 pyQt4 and pyKDE.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":333,"Q_Id":3385013,"Users Score":0,"Answer":"I guess you need python-qt4 qt4-designer qt4-dev-tools.","Q_Score":2,"Tags":"python,linux,pyqt4,kubuntu","A_Id":3460599,"CreationDate":"2010-08-02T04:35:00.000","Title":"pyqt installation question","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a project using Tkinter and Python. In order to have native theming and to take advantage of the new widgets I'm using ttk in Python 2.6. My problem is how to allow the user to scroll through the tabs in the notebook widget (a la firefox). Plus, I need a part in the right edge of the tabs for a close button. The frame for the active tab would need to fill the available horizontal space (including under the scroll arrows).\nI thought I could do this using the Place geometry manager, but I was wondering if there was a better way? The ttk python docs don't have any methods to deal with this that I could see. \nEdit: looks like there are difficulties for even trying to implement this using place. For one, I'd still need the tabs to scroll and the active panel to stay in the one place.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1350,"Q_Id":3386098,"Users Score":0,"Answer":"I've never used these widgets so I have no idea how possible this is, but what I would try is something akin to the grid_remove() method. If you can move the tabs to an invisible widget, or just make them invisible without losing content, that's what I'd look for\/try.","Q_Score":1,"Tags":"python,user-interface,tkinter,ttk","A_Id":3389225,"CreationDate":"2010-08-02T08:20:00.000","Title":"Using the ttk (tk 8.5) Notebook widget effectively (scrolling of tabs)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a project using Tkinter and Python. In order to have native theming and to take advantage of the new widgets I'm using ttk in Python 2.6. My problem is how to allow the user to scroll through the tabs in the notebook widget (a la firefox). Plus, I need a part in the right edge of the tabs for a close button. The frame for the active tab would need to fill the available horizontal space (including under the scroll arrows).\nI thought I could do this using the Place geometry manager, but I was wondering if there was a better way? The ttk python docs don't have any methods to deal with this that I could see. \nEdit: looks like there are difficulties for even trying to implement this using place. For one, I'd still need the tabs to scroll and the active panel to stay in the one place.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1350,"Q_Id":3386098,"Users Score":2,"Answer":"The notebook widget doesn't do scrolling of tabs (or multiple layers of them either) because the developer doesn't believe that they make for a good GUI. I can see his point; such GUIs tend to suck. The best workaround I've seen is to have a panel on the side that allows the selection of which pane to display. You can then apply tricks to that panel to manage the amount of information there (e.g., by making it a treeview widget and holding the info hierarchically, much like most email clients handle mail folders; treeview widgets are scrollable).","Q_Score":1,"Tags":"python,user-interface,tkinter,ttk","A_Id":3650157,"CreationDate":"2010-08-02T08:20:00.000","Title":"Using the ttk (tk 8.5) Notebook widget effectively (scrolling of tabs)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.0665680765,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":3,"Answer":"First, results speak for themselves: if you can piece together another version of one of your applications in pyqt, and tell him how long it took, it might be motivation enough.\nOr, next time you're starting a project, you could prototype four or five different versions of the interface in pyqt in the morning, ask his feedback after lunch, and then say, \"if I keep going on these, it'll be done in two days; if I redo this in netbeans, it'll be done in four.\"\nAnd as for the \"never heard of it\", feel free to point out that Google uses python extensively, and even hired many of the python developers.","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386409,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.0,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":0,"Answer":"Just use Netbeans as an IDE and he'll never notice :P\nSpeaking more seriously: a side by side comparison of strong and weak points behind each of technologies will certianly be more convincing. Just don't cheat too much in favor of Python ;)","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386403,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":1.2,"is_accepted":true,"ViewCount":874,"Q_Id":3386377,"Users Score":12,"Answer":"If your selling skills are not working in discussion format I highly suggest that you document it. Some managers\/bosses really respond well to this.\nMake a matrix of all the metrics that you yourself use to grade the two frameworks (I leave the level of objectivity to you there: for example if objective it should analyze the cost of transition and the loss of institutional experience; but it might not be high).\nFinally, send it by e-mail and viola you have:\n\nmade a report\/analysis of the situation providing options for improvement\nthis shows that you are thinking towards future and that you show initiative\n\nEDIT:\nYou can also ask your boss to show your analysis to his friend if he trust his friend that much, but ask for a written counter-analysis so that you can address the critique.\nIt is a good thing to do it openly and document the decision process well, since ultimately, if your suggestion is accepted, you will share responsibility for the decision.","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386436,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.022218565,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":1,"Answer":"Perhaphs showing him\na)Time spent in developing in Python and Java\nb)lines of code in Python and Java\nwith these two metrics maybe you can make your case stronger","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386699,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.1106561105,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":5,"Answer":"The basic problem here is that your non-technical boss is getting conflicting advice from you and from the friend who advised him in the first place. If you want him to take your advice seriously you need to prove that your advice is likely to be trustworthy. And that will only come with taking the lead and being successful with significant projects in the company. Right now, you haven't earned his confidence.\nThe other thing to consider is how your preferences mesh with the company's objectives. For instance, you want to be able to write code fast. But the boss \/ the company needs code that is going to be reliable and maintainable ... if you decide to take another position. He doesn't want to be left in the awkward situation where the company is contractually committed to deliver code that doesn't really work properly, and the only person who understands it has left.","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386477,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.022218565,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":1,"Answer":"I would guess a lot, in terms of risk management, would depend on the separation\/isolation of the various softwares you develop, and their life cycle.\nIf you don't need to further a central set of libraries, or have (or can develop) Python bindings for those, and the projects are relatively self contained, say a turn around of two to six months, you could give him a quote for a project in Java that is reasonable and he's familiar with (to make sure it doesn't appear artificially inflated). Then give a much reduced quote for the same in py+pyQt, and see if you can get him to invest on your advice.\nWithout tangible evidence coming from inside that a change in route will bring benefit the more management and economics savvy people who are technically ignorant will not buy into a new platform when the old one never prevented from realizing and selling.\nWithout a decent assessment of why he doesn't want to switch platform and what he considers risks it's kinda hard to give more pertinent advice.","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3387150,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.022218565,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":1,"Answer":"Have you emphasised the point of the lower development time. Any person that doesn't want a shorter turn around time is an idiot. This is the only main issue i can think for the change. Or what you could do is develop it on the side and when you have errors say this is what i have been doing in my spare time(have a working copy written in python).","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386396,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":1.0,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":8,"Answer":"The problem is that development time is usually nothing compared to maintenance. Who cares if it takes two days instead of four if the app has a 1-5 year lifetime?\nYou'll have to convince him that if you get hit by a truck or leave the company (perhaps to work for somebody who uses Python exclusively) that he won't be left in the lurch with a bunch of applications that nobody else knows and can't maintain or upgrade.","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3386487,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working for small company, which operates in the automation industry.\nThe boss hired me because he wants to sell\/give some desktop applications to his\ncurrent costumers.\nHe imposes me to use the Netbeans Platform (a generic desktop application framework).\nA software engineer friend of his advised him to choose this framework. \nAt the moment I created 3 desktop applications with Netbeans Platform.\nI like Netbeans Platfom. I really take advantage of modularity, Window System and Lookup.\nUnfortunately I'm frustrated to known that I can do the same works with Python and PyQt in a fraction of time.\nI've already illustrated to my boss the main advantages of Python, but he doesn't like the\nidea to use a language that he never heared of it.\nI'm the only programmer who codes desktop applications. And except the framework imposition, I'm free to use whatever I want.\nI'm looking for good motivations to convince him to leave Netbeans Platform for Python\/PyQt.\nP.S: My english is bad, sorry.","AnswerCount":9,"Available Count":9,"Score":0.0444152037,"is_accepted":false,"ViewCount":874,"Q_Id":3386377,"Users Score":2,"Answer":"Some people will tell you to try to convince your boss verbally. Others will tell you to document the time savings you think you can make. My opinion is that you just go ahead and do it. Do it in your own time if you strongly believe its in your best interests.\nI'm yet to meet a software manager who turned down a working piece of software when it comes in on time and under budget. This is by far the best method of persuasion I've used in my career. Its also a great way to show you have initiative. Just be prepared to work for free if it doesnt work out.","Q_Score":5,"Tags":"java,python,netbeans,pyqt","A_Id":3387872,"CreationDate":"2010-08-02T09:07:00.000","Title":"How to convince boss to substitute Java\/Netbeans Platform for Python\/PyQt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"HI all\nI am trying to use SWIG to export C++ code to Python.\nThe C sample I read on the web site does work but I have problem with C++ code.\nHere are the lines I call\n\nswig -c++ -python SWIG_TEST.i\ng++ -c -fPIC SWIG_TEST.cpp SWIG_TEST_wrap.cxx -I\/usr\/include\/python2.4\/\ngcc --shared SWIG_TEST.o SWIG_TEST_wrap.o -o _SWIG_TEST.so -lstdc++\n\nWhen I am finished I receive the following error message\n\nImportError: .\/_SWIG_TEST.so: undefined symbol: Py_InitModule4\n\nDo you know what it is?","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":886,"Q_Id":3387663,"Users Score":4,"Answer":"It looks like you aren't linking to the Python runtime library. Something like adding -lpython24 to your gcc line. (I don't have a Linux system handy at the moment).","Q_Score":2,"Tags":"c++,python,swig","A_Id":3393617,"CreationDate":"2010-08-02T12:20:00.000","Title":"using SWIG with C++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to implement my own key command. However when I do, it does both what I tell it and the default command. How do I disable the default command, so that my command is the only one that runs?\nThis is on Windows 7, BTW.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":226,"Q_Id":3400622,"Users Score":2,"Answer":"Put return 'break' at the end of your event handling function. This tells Tkinter not to propagate the event to default handlers.","Q_Score":0,"Tags":"python,windows,keyboard-shortcuts,tkinter","A_Id":3401235,"CreationDate":"2010-08-03T20:44:00.000","Title":"How do I disable default Tkinter key commands?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I call QApplication's init without arguments i get\n\nTypeError: arguments did not match any overloaded call:\n QApplication(list-of-str): not enough arguments\n QApplication(list-of-str, bool): not enough arguments\n QApplication(list-of-str, QApplication.Type): not enough arguments\n QApplication(Display, int visual=0, int colormap=0): not enough arguments\n QApplication(Display, list-of-str, int visual=0, int cmap=0): not enough arguments\n\nvery interesting! How can I write a class like that?? I mean, every trick for this kind of function overloading I saw did not involve explicit signatures.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1044,"Q_Id":3419282,"Users Score":3,"Answer":"TypeError is just another Exception. You can take *args **kwargs, check those, and raise a TypeError yourself, specify the text displayed - e.g. listing the expected call.\nThat being said, PyQt is a bunch of .pyd == native python extension, written in C or C++ (using Boost::Python). At least the latter supports \"real\" overloads afaik.\nEither way, you shouldn't do this unless you have a really good reason. Python is duck-typed, embrace it.","Q_Score":1,"Tags":"python,overloading","A_Id":3419420,"CreationDate":"2010-08-05T21:24:00.000","Title":"Python method overload based on argument count?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I call QApplication's init without arguments i get\n\nTypeError: arguments did not match any overloaded call:\n QApplication(list-of-str): not enough arguments\n QApplication(list-of-str, bool): not enough arguments\n QApplication(list-of-str, QApplication.Type): not enough arguments\n QApplication(Display, int visual=0, int colormap=0): not enough arguments\n QApplication(Display, list-of-str, int visual=0, int cmap=0): not enough arguments\n\nvery interesting! How can I write a class like that?? I mean, every trick for this kind of function overloading I saw did not involve explicit signatures.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1044,"Q_Id":3419282,"Users Score":0,"Answer":"It's quite possible that its init is simply using __init__(self, *args, **kwargs) and then doing its own signature testing against the args list and kwargs dict.","Q_Score":1,"Tags":"python,overloading","A_Id":3419307,"CreationDate":"2010-08-05T21:24:00.000","Title":"Python method overload based on argument count?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Panel with a bunch of pictures placed on it in a GridSizer layout. How can I draw a highlighted color around the edge of an image or its border to show that it has been selected upon a mouse click event?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":233,"Q_Id":3431154,"Users Score":0,"Answer":"You could put each picture in a panel, and use SetBackgroundColour()to set the background color of the panel.","Q_Score":1,"Tags":"python,wxpython","A_Id":3431426,"CreationDate":"2010-08-07T16:25:00.000","Title":"wxPython: Highlight item in GidSizer upon mouse click","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a form using wxPython where I want want listctrl's list of values to change based on the selection of another listctrl. To do this, I'm using methods linked to the controlling object's EVT_LIST_ITEM_SELECTED and EVT_LIST_ITEM_DESELECTED events to call Publisher.sendMessage. The control to be changed has a method that is a subscriber to that publisher. This works: when the first listctrl is clicked, the second is refreshed.\nThe problem is that the data must be refreshed from the database and a message is sent for every selection and deselection. This means that even if I simply click on one item, the database gets queried twice (once for the deselection, then again for the selection). If I shift-click to multi-select 5 items, then 5 calls get made. Is there any way to have the listctrl respond to the set, rather than the individual selections?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":940,"Q_Id":3441991,"Users Score":0,"Answer":"You can try EVT_LIST_ITEM_RIGHT_CLICK. That should work. Otherwise you'd want to use a flag and check said flag every time the selection event fires to see if it needs to query the database or not. There's also the UltimateListCtrl, a pure python widget, that you can probably hack to do this too.","Q_Score":3,"Tags":"python,wxpython,listctrl","A_Id":3442559,"CreationDate":"2010-08-09T16:12:00.000","Title":"Respond to Listctrl change exactly once","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a GUI with Tkinter, now how do I make it so when a key command will execute a command even if the Tkinter window is not in focus? Basically I want it so everything is bound to that key command. \nExample: \nSay I was browsing the internet and the focus was on my browser, I then type Ctrl + U. An event would then run on my program.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":515,"Q_Id":3445867,"Users Score":2,"Answer":"Tkinter, on its own, cannot grab keystrokes that (from the OS's\/WM's viewpoint) were directed to other, unrelated windows -- you'll need to instruct your window manager, desktop manager, or \"operating system\", to direct certain keystrokes differently than it usually does. So, what platform do you need to support for this functionality? Each platform has different ways to perform this kind of functionality, of course.","Q_Score":1,"Tags":"python,binding,tkinter","A_Id":3445919,"CreationDate":"2010-08-10T03:43:00.000","Title":"Key commands in Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"OK, I'm trying to explain what I want to achieve in another way. Here's an example:\nSay if it's an anti virus program, and user can choose between two ways to run the program, choice one, automatically start to scan disks for virus when the program starts up, choice two, hit the start button to make the program scan disks for virus after the program starts up any time the user wants. So, as a wxpython beginner, I know how to bind wx.EVT_BUTTON to let scanning start after the user hit the start button, but I don't know how to make the scanning start once the program starts up. I wonder if there's a program_start event I can bind? Hope you guys can help me out. Thanks!","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":372,"Q_Id":3450525,"Users Score":0,"Answer":"In your init or OnInit method, do some kind of check to see if the program should run the startup process on startup (i.e. check a config file or some such). If yes, call the \"scan\" method using wx.CallAfter or wx.CallLater or call it after you Show() the frame.","Q_Score":0,"Tags":"python,event-handling,wxpython","A_Id":3451727,"CreationDate":"2010-08-10T15:19:00.000","Title":"Is there a wxpython event like program_start?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"OK, I'm trying to explain what I want to achieve in another way. Here's an example:\nSay if it's an anti virus program, and user can choose between two ways to run the program, choice one, automatically start to scan disks for virus when the program starts up, choice two, hit the start button to make the program scan disks for virus after the program starts up any time the user wants. So, as a wxpython beginner, I know how to bind wx.EVT_BUTTON to let scanning start after the user hit the start button, but I don't know how to make the scanning start once the program starts up. I wonder if there's a program_start event I can bind? Hope you guys can help me out. Thanks!","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":372,"Q_Id":3450525,"Users Score":1,"Answer":"Why don't you run it just in module code? This way it will be run only once, because code in module is run only once per program instance.","Q_Score":0,"Tags":"python,event-handling,wxpython","A_Id":3450557,"CreationDate":"2010-08-10T15:19:00.000","Title":"Is there a wxpython event like program_start?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to customize ProgressDialog in wxPython?\nFor instance, I would like to make the progressbar slimmer, and the window size wider.\nSetSize() method doesn't appear to have any effect.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":352,"Q_Id":3452986,"Users Score":1,"Answer":"The wx.ProgressDialog isn't customizable its just a wrapper around the native ProgressDialog, the the easiest solution would be to roll your own by extending the wx.Dialog class and using a wx.Gauge","Q_Score":0,"Tags":"python,wxpython,progress-bar","A_Id":3453038,"CreationDate":"2010-08-10T20:09:00.000","Title":"How to customize wx.ProgressDialog?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"suppose a C++ class has several constructors which are overloaded according the number and type and sequences of their respective parameters, for example, constructor(int x, int y) and constructor(float x, float y, float z), I think these two are overloaded methods, which one to use depends on the parameters, right? So then in python, how could I create a constructor that can work like this? I notice that python has the def method(self, *args, **kwargs):, so can I use it like: def __init__(self, *args), then I check the length of *args, like if len(args) == 2:, then construct according to the 2-parameters constructor, if len(args) == 3, then use the 3-parameters constructor, etc. So, does that work? Or is there any better way to do it with python? Or should I think in other ways that could take the advantage of python feature itself? thanks~","AnswerCount":4,"Available Count":1,"Score":0.1488850336,"is_accepted":false,"ViewCount":251,"Q_Id":3476387,"Users Score":3,"Answer":"Usually, you're fine with any combination of\n\nslightly altered design\ndefault arguments (def __init__(self, x = 0.0, y = 0.0, z = 0.0))\nuse of polymorphism (in a duck-typed language, you don't need an overload for SomeThing vs SomeSlightlyDifferentThing if neither inherits from the other one, as long as their interfaces are similar enough).\n\nIf that doesn't seem feasible, try harder ;) If it still doesn't seem feasible, look at David's link.","Q_Score":1,"Tags":"c++,python,constructor,overloading","A_Id":3476486,"CreationDate":"2010-08-13T11:35:00.000","Title":"C++ methods overload in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want the text of the ListBox to be centered, is that possible?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":434,"Q_Id":3483179,"Users Score":1,"Answer":"No, the default ListBox won't work for that. Try the VListBox instead.","Q_Score":0,"Tags":"python,listbox,wxpython,center,alignment","A_Id":3506756,"CreationDate":"2010-08-14T12:03:00.000","Title":"How to align the text in a wx.ListBox using wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to use PyQt from IronPython? \nFrom what I've read IronPython should work with CPython compatible libraries but out of the box it doesn't seem to work.\nIf it is possible, will code completion work?","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":2411,"Q_Id":3483492,"Users Score":2,"Answer":"Hope someone else who spent more time messing around with this comes by and gives you qualified, ambiguous answer, but here is some questionable insight from my personal experience:\nPyQt relates to cPython in a way that is very different than .Net relates to IronPython.\nWhile IronPython is built on TOP of .Net, PyQt is a BINARY, semi-automatically generated set of bindings specific to a version of cPython against which it was compiled.\nFor a variety of reasons, i have problems running \"standard\" BINARY python modules against IronPython. Only the pure-Python modules that can be interpreted by IronPython as \"Python\" would ever work for me.\nI am not saying \"it can't be done,\" but I do expect you to have very bad experience with the set up if you manage to compile and install PyQt into IronPython.","Q_Score":2,"Tags":"ironpython,pyqt","A_Id":3490601,"CreationDate":"2010-08-14T13:25:00.000","Title":"Using PyQt from IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a GUI program in which I already bind a start button with one event, and when I click the start button, the event runs as I like. My question is, if I want my program to start the event immediately after the GUI program starts, which means the start button is immediately being \"clicked\" once the program starts, how do I do it?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":205,"Q_Id":3483675,"Users Score":0,"Answer":"In the __init__( )\u00a0for your main frame put this:\n\nwx.CallAfter( func_name )","Q_Score":0,"Tags":"python,event-handling,wxpython","A_Id":41389878,"CreationDate":"2010-08-14T14:11:00.000","Title":"How to make a event run immediately after a GUI program starts in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a GUI program in which I already bind a start button with one event, and when I click the start button, the event runs as I like. My question is, if I want my program to start the event immediately after the GUI program starts, which means the start button is immediately being \"clicked\" once the program starts, how do I do it?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":205,"Q_Id":3483675,"Users Score":1,"Answer":"In the main frame constructor set a one-shot timer with interval 0 that fires the event.","Q_Score":0,"Tags":"python,event-handling,wxpython","A_Id":3483688,"CreationDate":"2010-08-14T14:11:00.000","Title":"How to make a event run immediately after a GUI program starts in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I get a widget's \"name\"?\nWhen I define a GUI using Glade, I can \"name\" the widgets of the window but how do I recover that property when I have a widget object instance?\nI've tried get_property(), get_name() and $widget.name to no avail.\nUpdate: I am using GtkBuilder file format (i.e. XML format).\nResolution: a fix I have used: use the set_property(\"name\", name) method on the widget just after getting it from GtkBuilder.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":4906,"Q_Id":3489520,"Users Score":0,"Answer":"Given the widget w, what does w.get_name() return? If None, that means the widget has no name property. Maybe you want gtk.glade.get_widget_name(w) instead? (I'm not sure if the name property of the widget and the name for it in the Glade XML from which it was created are the same thing...).","Q_Score":10,"Tags":"python,gtk","A_Id":3489566,"CreationDate":"2010-08-15T22:25:00.000","Title":"Python GTK+ widget name","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What is the format of the parameter activate_time in Python GTK+ when using Gtk.Menu.popup() method?\nI have tried using int(time.time()) but I get a traceback saying an integer is required...","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":132,"Q_Id":3494587,"Users Score":1,"Answer":"I found out I can use gtk.get_current_event_time() to get a reasonable timestamp matching what Gtk looks like it expects.","Q_Score":0,"Tags":"python,gtk","A_Id":3495112,"CreationDate":"2010-08-16T15:22:00.000","Title":"Format of activate_time in Gtk.Menu","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I render a huge SVG file with a lot of elements with Cairo, OpenGL and rsvg. I draw svg on cairo surface via rsvg and create an OpenGL texture to draw it. Everything is fine. And now I have to interact with elements from SVG. For example, I want to guess an element by coordinates. And I want to change the background of some path in SVG. In the case of changing background I think, I can change SVG DOM and somehow re-render a part of SVG. But in the case of hit testing elements I'm totally embarrassed.\nSo, is there some python library to interact with SVG? Is it possible to stay with cairo and rsvg and how can I implement it myself? Or is there a better way to render SVG in OpenGL and interact with it in python? All I want is load SVG, manipulate its DOM and render it","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3978,"Q_Id":3501215,"Users Score":0,"Answer":"I had to do the same (changing element color for instance), and had to modify rsvg library because all those nice features exist but they are hidden. You have to make a new interface to link to the nice features.","Q_Score":3,"Tags":"python,opengl,svg,cairo,rsvg","A_Id":37703846,"CreationDate":"2010-08-17T09:51:00.000","Title":"SVG interaction in python with cairo, opengl and rsvg","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing an e-book reader in Python + wxPython, and I'd like to find out how many lines of text can be displayed in a given RichTextCtrl with the current formatting without scrolling. \nI thought of using and dividing the control's height by RichTextCtrl.GetFont().GetPixelSize(), but it appears that the pixel size parameter of wx.Font is only specified on Windows and GTK. In addition, this won't cover any additional vertical spacing between lines\/paragraphs. \nI could of course get the font size in points, attempt to get the display's resolution in ppi, and do it that way, but 1) the line spacing problem still remains and 2) this is far too low a level of abstraction for something like this. \nIs there a sane way of doing this?\nEDIT: The objective is, to divide the ebook up into pages, so the scrolling unit is a whole page, as opposed to a line.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":445,"Q_Id":3504383,"Users Score":0,"Answer":"Did you try calling the GetNumberOfLines() method? According to Robin Dunn, that should work, although it doesn't take wrapped lines into account.","Q_Score":2,"Tags":"python,wxpython,resolution-independence","A_Id":3526358,"CreationDate":"2010-08-17T15:52:00.000","Title":"Finding out how many lines can be displayed in wx.richtext.RichTextCtrl without scrolling","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to know how i can select a pixel with a mouse click in an image (QImge) and get pixel position and value.\nThanks","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":19296,"Q_Id":3504522,"Users Score":2,"Answer":"First you have to draw the image. You can do this my making a QLabel widget and call setPixmap. You need to convert your QImage to QPixmap before doing this (you can use QPixmap.fromImage(img)).\nYou can get mouse clicks by subclassing the QImage and intercepting mousePressEvent. Look up the pixel value with QImage.pixel().","Q_Score":9,"Tags":"python,image,pyqt,selection,pixel","A_Id":3543483,"CreationDate":"2010-08-17T16:05:00.000","Title":"Pyqt get pixel position and value when mouse click on the image","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Here is what I would like to do, and I want to know how some people with experience in this field do this:\nWith three POST requests I get from the http server:\n\nwidgets and layout\nand then app logic (minimal)\ndata\n\nOr maybe it's better to combine the first two or all three. I'm thinking of using pyqt. I think I can load .ui files. I can parse json data. I just think it would be rather dangerous to pass code over a network to be executed on the client. If someone can hijack the connection, or can change the apps setting to access a bogus server, that is nasty.\nI want to do it this way because it keeps all the clients up-to-date. It's sort of like a webapp but simpler because of Qt. Essentially the \"thin\" app is just a minimal compiled python file that loads data from a server.\nHow can I do this without introducing security issues on the client? Is https good enough? Is there a way to get pyqt to run in a sandbox of sorts?\nPS. I'm not stuck on Qt or python. I do like the concept though. I don't really want to use Java - server or client side.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1647,"Q_Id":3517841,"Users Score":1,"Answer":"Your desire to send \"app logic\" from the server to the client without sending \"code\" is inherently self-contradictory, though you may not realize that yet -- even if the \"logic\" you're sending is in some simplified ad-hoc \"language\" (which you don't even think of as a language;-), to all intents and purposes your Python code will be interpreting that language and thereby execute that code. You may \"sandbox\" things to some extent, but in the end, that's what you're doing.\nTo avoid hijackings and other tricks, instead, use HTTPS and validate the server's cert in your client: that will protect you from all the problems you're worrying about (if somebody can edit the app enough to defeat the HTTPS cert validation, they can edit it enough to make it run whatever code they want, without any need to send that code from a server;-).\nOnce you're using https, having the server send Python modules (in source form if you need to support multiple Python versions on the clients, else bytecode is fine) and the client thereby save them to disk and import \/ reload them, will be just fine. You'll basically be doing a variant of the classic \"plugins architecture\" where the \"plugins\" are in fact being sent from the server (instead of being found on disk in a given location).","Q_Score":0,"Tags":"python,qt,networking,pyqt,thin","A_Id":3517886,"CreationDate":"2010-08-19T00:33:00.000","Title":"how to implement thin client app with pyqt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a frame that asks the user to put in a bunch of information in several text control fields. How can I make it so that when you hit the 'tab' key your cursor moves to the next text control?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":595,"Q_Id":3525005,"Users Score":2,"Answer":"If you put a wx.Panel as the only child of the ScrolledWindow and put the other widgets on the panel, then it should work automatically. You could also use ScrolledPanel instead.","Q_Score":3,"Tags":"python,wxpython","A_Id":3525652,"CreationDate":"2010-08-19T18:29:00.000","Title":"wxPython: switching text control focus on tab press","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm displaying some data as a TreeView. How can I detect a click on a particular tree-view cell, so that I know which column of which row was clicked on?\nThis is what I want to do, so maybe there's a better way: Part of the data is a series of True\/False values indicating a particular set of options. For example, the options might be picking any of the options \"Small, Medium, Large, X-Large\" to be display. If the user selects \"Small\" and \"Large\", then the cell should display \"Small, Large\". I don't want to give each a separate column since there are actually like 20 options, and only 2 or 3 will be selected at any point.\nWhen the user clicks on the cell, I want to display a pop-up with a bunch of checkboxes. The user can then select what s\/he wants and submit the changes, at which point the cell's value should be updated.\nThe easiest way I thought of doing this would be to just detect a click (or a double-click) on the cell. Then I could pop up the window, and have the submit button of the window do what I want.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4742,"Q_Id":3534127,"Users Score":6,"Answer":"The row-activated signal is sent when a GTK TreeView row is double-clicked.","Q_Score":5,"Tags":"python,user-interface,gtk,pygtk","A_Id":3534190,"CreationDate":"2010-08-20T19:17:00.000","Title":"gtk: detect click on a cell in a TreeView","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What Python-related code (PyGTK, Glade, Tkinter, PyQT, wxPython, Cairo, ...) could you easily use to create a GUI to do some or all of the following?\n\nPart of the GUI has an immovable square grid.\nThe user can press a button to create a resizable rectangle.\nThe user can drag the rectangle anywhere on the grid, and it will snap to the grid.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5729,"Q_Id":3538769,"Users Score":0,"Answer":"Those actions are not that difficult. All you really need for that is hit detection, which is not hard (is the cursor over the correct area? Okay, perform the operation then). The harder part is finding an appropriate canvas widget for the toolkit in use.","Q_Score":7,"Tags":"python,user-interface,pygtk,tkinter,glade","A_Id":3538804,"CreationDate":"2010-08-21T20:09:00.000","Title":"How do you draw a grid and rectangles in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently in the process of making my Nintendo Wiimote (Kinda sad actually) to work with my computer as a mouse. I've managed to make the nunchuk's stick control actually move the mouse up and down, left and right on the screen! This was so exciting. Now I'm stuck.\nI want to left\/right click on things via python when I press A, When I went to do a search, All it came up with was tkinter?\nSo my question is, What do I call to make python left\/right click on the desktop, and if it's possible, maybe provide a snippet?\nThank you for your help!\nNOTE: I guess I forgot to mention that this is for Linux.","AnswerCount":8,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":65052,"Q_Id":3545230,"Users Score":2,"Answer":"Open your terminal and goto cd \/usr\/share\/pyshared\/twisted\/protocols\/mice\nmay this __init__.py mouseman.py python script will work for you,check them out.","Q_Score":40,"Tags":"python,linux,mouse,mouse-cursor,wiimote","A_Id":9583583,"CreationDate":"2010-08-23T06:42:00.000","Title":"Simulate Mouse Clicks on Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to add images to wx.Dialog (and then sizer) some like wx.ImageList and display it dynamically. \nBut I don't want to change already displayed image, I want to add next.\nHow can I resolve this problem?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":883,"Q_Id":3555065,"Users Score":2,"Answer":"I don't think a dialog is a good choice for a growing list of images, but if you have a good argument for that...\nAnyway, you should be able to display your images using the wx.StaticBitmap widget. To add another one, use your sizer's Add method, then call the dialog's Layout() method and maybe its Refresh() method. If you plan on displaying many images, then you'll probably want to look at the ScrolledPanel or the ScrolledWindow widgets.","Q_Score":1,"Tags":"python,image,wxpython","A_Id":3557437,"CreationDate":"2010-08-24T09:21:00.000","Title":"How to add images\/bitmaps to wx.Dialog","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Assume i want to create 500 wxWidget like (some panels , color buttons and text ctrl etc), I have to create all this at single time but this will freeze my main thread, so i put this creation part in child thread and show some gif anim in main thread. But i was not able to get all these wxWidget object those created on my frame in child thread.\nCan i get that wxWidgets (created in child thread) back in main thread.\n simply just consider a case where i have to create children of a frame in child thread and main thread show animation. once child thread finish the all child created in child thread should available in main thread.\nAny help is really appreciable.\nI am using python 2.5, wxpython 2.8 on windowsxp.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":649,"Q_Id":3574714,"Users Score":0,"Answer":"You can send them back over a queue, or this all takes place in one instance of a class, assign the widgets to some known place in the instance for the main thread to pick them up. Signal via semaphore.","Q_Score":1,"Tags":"python,wxpython","A_Id":3574976,"CreationDate":"2010-08-26T11:42:00.000","Title":"Get object created in child thread back in main thread","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So, for example I draw some objects on wx.PaintDC, such as lines and rectangles.\nNow I want next: on mouse click I wont know which object was clicked.\nOf course, I can see what object is the closest, but what about more exact answer?\nMaybe even not standart wx.DC, but such things as FloatCanvas or something like this.\nSo, what's the best solution?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":100,"Q_Id":3576071,"Users Score":0,"Answer":"Does calling event.GetEventObject() in your event handler give you the object you need?","Q_Score":0,"Tags":"python,user-interface,wxpython","A_Id":3579195,"CreationDate":"2010-08-26T14:24:00.000","Title":"What is the best solution to bind objects in wx.DC?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to implement a button \"New\" that would work the same as File>New in most applications - that is: resets all the labels, treeviews, etc. to the original state.\nThank you, Tomas","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":263,"Q_Id":3577335,"Users Score":1,"Answer":"The widgets don't remember their original state; you have to set them all back one by one. Give labels their original text, clear the tree views by setting their model to None.\nPerhaps it is better to destroy your window and rebuild it from your Glade file if you have one?","Q_Score":0,"Tags":"python,gtk,pygtk","A_Id":3580114,"CreationDate":"2010-08-26T16:39:00.000","Title":"How do I restore default settings of an application in Gtk (set all the widgets to the state as if the application was restarted)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have made an application using Glade and Python and I would like to make several localizations.\nI know how to localize strings that are in the Python code, I just encapsule all the strings that are supposed to be localized with _() and than specify the translation of the string in a .po file.\nBut how do I tell a string that is built with Glade that it should be localizable (for example labels, menu items, button labels, ...)?\nI am using gettext for the localization.\nThank you, Tomas","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1203,"Q_Id":3586071,"Users Score":4,"Answer":"You should be able to create a *.pot file from a *.glade file using intltool-extract --type=gettext\/glade foo.glade, and intltool supposedly knows what is translatable.\nAlso, I suggest you look into GtkBuilder if you didn't do that already (you can save GtkBuilder interface files from recent Glade 3 versions, and you won't need the extra libglade anymore).","Q_Score":7,"Tags":"python,user-interface,pygtk,gettext,glade","A_Id":3588790,"CreationDate":"2010-08-27T16:05:00.000","Title":"Localization of GUI built with Glade and Python (Gtk)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to make a PyQt4 program that supports plugins. Basically I want the user to be able to write QWidget subclasses in PyQt4 and add\/remove them from the main application window via a GUI. How would I do that, especially the plugin mechanism?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":834,"Q_Id":3588915,"Users Score":0,"Answer":"Have a directory for the plugins, define an interface for those plugins, and walk the directory importing them.\nI've never done this in Python, but in C the way I did it was to define a number of functions that the plugin needed to implement. The basic key elements that are necessary is the name of the things in the plugin (so that you can display them in your UI so that the user can instantiate them) and a factory to actually create the things. I suppose in Python it'd be pretty trivial to just do those as one dict that you can return from the module.\nE.g. declare that all plugins must author a function called GetPluginInfo() which returns a dictionary of name:class mappings.\nActually now that I think about it you could probably just import the file and look for classes that are subclasses of whatever you care about and not require any explicit API be implemented. I haven't done a lot of that but basically you'd walk the module's dir() and test to see if each thing is a subclass of QWidget (for example).","Q_Score":2,"Tags":"python,qt,plugins,pyqt4,pluggable","A_Id":3588947,"CreationDate":"2010-08-28T00:28:00.000","Title":"Pluggable Python program","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a command similar to \"wm_overrideredirect\" for Ubuntu? I want My program to be displayed without the standard window.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":182,"Q_Id":3589185,"Users Score":3,"Answer":"Ubuntu's desktop manager is Gnome, which should support wm_overrideredirect as well as any other. What's going wrong for you when you try that? Can you show (by editing your Q) some as-tiny-as-possible Python\/Tkinter script that does not behave the way you want, and tell us how it does behave and how you'd like to behave?","Q_Score":0,"Tags":"python,ubuntu,window,tkinter","A_Id":3589200,"CreationDate":"2010-08-28T02:26:00.000","Title":"Tkinter removing standard window in Ubuntu","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an existing python script and I want to wrap it in a GUI. Since I already have tkinter installed I would like to use it if possible. At the moment my script has many places where it asks for user input using raw_input(). I would like to replace these with either a modal pop-up asking for user input or (preferably) an Entry object which responds to the enter key.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1228,"Q_Id":3589817,"Users Score":2,"Answer":"UI toolkits usually have an event-driven model where the main loop is in the toolkit itself. This is probably different from your current synchronous, interactive model (where the program just pauses while waiting for input)\nThe best would be to try to refactor your program and factor-out the view part (look up the model-view-control design pattern). After that, it should be easy to replace your console oriented view with an tkInter based one.\n(that's as specific as I can get without a concrete question)","Q_Score":0,"Tags":"python,user-input,tkinter","A_Id":3589984,"CreationDate":"2010-08-28T07:08:00.000","Title":"Creating a gui around a python script using Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am new to the world of GUI programming and I am writing a little GUI app using IronPython and WinForms. It reads values from an external device and displays them in a ListView component (name, value). I want to periodically perform the reading and updating of the ListView component at a certain fixed rate.\nI had the following ideas to accomplish this:\n\nA timer, which periodically triggers the read\/screen update directly in the OnTick handler\nA timer, whose OnTick handler triggers a BackgroundWorker to perform the read\/update\n\nSince the first solution will block the GUI until the read\/update loop is done, which, depending on the number of values being read from the device, could take some time, I think the BackgroundWorker might be a better solution. I might want to add some functionality to manipulate the ListView items later (add, remove values etc.) and a blocked GUI does not seem like a good idea.\nIs there a certain design pattern or a better way to accomplish reading\/updating screen data?\nNOTE: Any code examples can be IronPython or C#. The conversion from C# to IronPython is pretty straight forward. Thanks!","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1455,"Q_Id":3595236,"Users Score":3,"Answer":"Personally, I'd have one thread that's responsible for reading values out of the device and storing the data in a data structure, and then a System.Windows.Forms.Timer (there's 3 Timers in .NET, this is the only one that ticks in the thread that's safe to update your controls) to read values out of that data structure and update the UI. You may need to synchronise that data structure, you may not.\nThat way the device can take as long as it likes to return data, or it can push as many millions of rows per second at you, and the UI thread will still poll at your predetermined tick rate (probably every 100 msec?). Since your timer ticks are just reading data out of memory, the UI won't block for IO.","Q_Score":2,"Tags":"c#,winforms,ironpython","A_Id":3595266,"CreationDate":"2010-08-29T15:03:00.000","Title":"Pattern for periodically updating screen data","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering if there is a good library for python for decoding QR code. Basically what I would like is to give library image with QR code on it and the library would output contents saved in image.","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3926,"Q_Id":3602645,"Users Score":2,"Answer":"I've looked before with no success. Two problems are that native c code can't be compiled and you can't get access to the file system.\npyqrcode didn't work out and neither did zxing.","Q_Score":4,"Tags":"python,google-app-engine,qr-code","A_Id":3602758,"CreationDate":"2010-08-30T17:15:00.000","Title":"Google app engine QR code decoder","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to write a simple GTD-style todo list app with python and gtk to learn python. I want a container that can select an individual list from a lot of choices. It would be something like the list of notebooks area in tomboy. Not a combobox.\nAs you can probably tell I'm a beginner and the terminology is probably off.\nCan you please tell me what it is I'm looking for and an overview of how to implement it?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":256,"Q_Id":3604357,"Users Score":0,"Answer":"You mean a widget to filter a large collection into multiple subsets \/ views? \nI would guess you have to implement this yourself - a list of options on the left and filtered results on the right, I don't know of any existing (gtk) widgets.","Q_Score":1,"Tags":"python,user-interface,gtk","A_Id":3604511,"CreationDate":"2010-08-30T21:28:00.000","Title":"Python PyGTK. What's this component?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I don't get what Clyther is or how to use it. \nMy stuff:\n ATI OpenCl SDK (just dl'd)\n clyther beta (just dl'd)\n windows 7 pro 64 bit\n active python 3.1.2\n Xfxs Ati radeon 5850 video card\nI downloaded the ATI OpenCl SDK and the clyther beta from sourceforge. Then I tooke the sample 'reduce' function from the sourceforge documents and pasted the code into notepad and named it clythersample.py. When I double-click the file or open it in the interactiveshell, it gives an error message on the first line.\nIs naming the file .py wrong? I guess clyther is its own lqnguage and not really python? Can I write python code and in the middle of the program, write a chunk of clyther code? Will python IDEs (esp. Wing understand and debug it?) Will it work with python 3 or do I need 2.6? Is 64 bit os ok? \n(I'm not a programme or technically competent, so things like its a python API for OpenCl or it had C bindings for python don't mean a whole lot).","AnswerCount":2,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":507,"Q_Id":3612410,"Users Score":2,"Answer":"Clyther is a Python package for High-Performance Computing (HPC) using, for example, video cards with multiple Graphics Packaging Units (GPUs) or (less frequently) multi-core processors. Clyther is for parallel processing of algorithms or data sets that would normally take a lot of time to process serially. Meaning, if you have a problem that can be split into many smaller problems, then Clyther is a useful package to use. Additionally, your problem must be something that can use numpy arrays.\nClyther is a nice package to use if you have the problem it is intended to solve. It makes it fairly easy to write Python code to run on multiple processes.\nIf that's not the problem you need to solve, then Clyther probably won't help you.","Q_Score":2,"Tags":"python,python-3.x,gpu","A_Id":10986086,"CreationDate":"2010-08-31T19:18:00.000","Title":"Clyther-how to get started?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I don't get what Clyther is or how to use it. \nMy stuff:\n ATI OpenCl SDK (just dl'd)\n clyther beta (just dl'd)\n windows 7 pro 64 bit\n active python 3.1.2\n Xfxs Ati radeon 5850 video card\nI downloaded the ATI OpenCl SDK and the clyther beta from sourceforge. Then I tooke the sample 'reduce' function from the sourceforge documents and pasted the code into notepad and named it clythersample.py. When I double-click the file or open it in the interactiveshell, it gives an error message on the first line.\nIs naming the file .py wrong? I guess clyther is its own lqnguage and not really python? Can I write python code and in the middle of the program, write a chunk of clyther code? Will python IDEs (esp. Wing understand and debug it?) Will it work with python 3 or do I need 2.6? Is 64 bit os ok? \n(I'm not a programme or technically competent, so things like its a python API for OpenCl or it had C bindings for python don't mean a whole lot).","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":507,"Q_Id":3612410,"Users Score":1,"Answer":"When you name the file .py (the file extension associated with python.exe) and double-click it, how is windows supposed to know it's supposed to run the file with CLyther?\n\nIs naming the file .py wrong? I guess clyther is its own lqnguage and not really python?\n\nDocumentation compares it with Cython - so I suppose it's an extension to the language, i.e. they take Python and bolt more features on it.\n\nCan I write python code and in the middle of the program, write a chunk of clyther code?\n\nFrom the goals of the project, it should (like Cython) ultimately be able to accept all or most Python code. So, yes - but of course you'd have to run the whole program with CLyther.\n\nWill python IDEs (esp. Wing understand and debug it?)\n\nNot natively, I suppose.\nSide note: The project is in a very early stage of developement (very first beta-release), so don't expect things to run smoothly right now.","Q_Score":2,"Tags":"python,python-3.x,gpu","A_Id":3612526,"CreationDate":"2010-08-31T19:18:00.000","Title":"Clyther-how to get started?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python script bundled into a application (I'm on a mac) and have the application set to be able to open .zip files. But when I say \"open foo.zip with bar.py\" how do I access the file that I have passed to it? \nAdditional info:\nUsing tkinter.\nWhat's a good way to debug this, as there is no terminal to pass info to?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":310,"Q_Id":3614609,"Users Score":0,"Answer":"If I'm not greatly mistaken, it should pass the name of the file as the first argument to the script - sys.argv[1].","Q_Score":0,"Tags":"python,macos,tkinter","A_Id":3614650,"CreationDate":"2010-09-01T02:17:00.000","Title":"Python: open a file *with* script?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a widget that measures elapsed time, then after a certain duration it does a command. However, if the widget is left I want I want it to abort this function call and not do the command. \nHow do I go about this?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":88,"Q_Id":3621111,"Users Score":0,"Answer":"Why not use threads and stop that? I don't think it's possible to intercept a function call in a single threaded program (if not with some kind of signal or interrupt).\nAlso, with your specific issue, you might want to introduce a flag and check that in the command.","Q_Score":1,"Tags":"python,tkinter,abort","A_Id":3621138,"CreationDate":"2010-09-01T18:38:00.000","Title":"Is there a way to write a command so that it aborts a running function call?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a widget that measures elapsed time, then after a certain duration it does a command. However, if the widget is left I want I want it to abort this function call and not do the command. \nHow do I go about this?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":88,"Q_Id":3621111,"Users Score":0,"Answer":"No idea about python threads, but in general the way you interrupt a thread is by having some sort of a threadsafe state object that you can set from the widget, and the logic in thread code to check for the change in state object value and break out of the thread loop.","Q_Score":1,"Tags":"python,tkinter,abort","A_Id":3621195,"CreationDate":"2010-09-01T18:38:00.000","Title":"Is there a way to write a command so that it aborts a running function call?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to bind all widgets to one command, with a single line? It would be nice if I could type in one line as opposed to doing each widget individually.","AnswerCount":4,"Available Count":2,"Score":-0.0996679946,"is_accepted":false,"ViewCount":9705,"Q_Id":3630664,"Users Score":-2,"Answer":"If you have a list that contains all your widgets, you could iterate over them and assign the events.","Q_Score":7,"Tags":"python,binding,widget,tkinter,global","A_Id":3630691,"CreationDate":"2010-09-02T19:49:00.000","Title":"Tkinter Global Binding","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to bind all widgets to one command, with a single line? It would be nice if I could type in one line as opposed to doing each widget individually.","AnswerCount":4,"Available Count":2,"Score":-0.1488850336,"is_accepted":false,"ViewCount":9705,"Q_Id":3630664,"Users Score":-3,"Answer":"You could also just define a function that calls on all your widgets, and call that function. Or better yet create a class that call on your widgets in init and import the class...","Q_Score":7,"Tags":"python,binding,widget,tkinter,global","A_Id":3630962,"CreationDate":"2010-09-02T19:49:00.000","Title":"Tkinter Global Binding","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python program that has no windows frame and doesn't show up in the taskbar because of self.overrideredirect(1). This program has an options menu (a top level widget) that allows for the alpha to be adjusted with self.attributes(\"-alpha\", 0.85). However when I close out of the options menu my program shows up in the task bar. Obviously I don't want it to do this. I tried invoking the self.overrideredirect(1) command after the options menu was closed, but to no avail. Does anyone have a solution\/ know of a line that will remove my program from the task bar?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2723,"Q_Id":3644113,"Users Score":0,"Answer":"If you change the override redirect flag you need to withdraw and then deiconify the window to give the window manager a chance to make the change. You might try that.\nAlso, when you say \"close out\" the option menu top-level, what exactly do you mean? Are you sure destroying this second top-level window?","Q_Score":0,"Tags":"python,windows,transparency,tkinter,alpha","A_Id":3644372,"CreationDate":"2010-09-04T21:43:00.000","Title":"Help with Tkinter Alpha","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to retrieve the row data from a treemodel when the row_activated callback is fired.\nWhen row_activated is called, the 'path' variable it passes is a tuple. How do I easily use this tuple to retrieve an iter and ultimately the data itself? The treemodel class has a function to convert a string into an iter, but it seems like there should be an easier way than converting the tuple to a string, then the string to an iter.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":262,"Q_Id":3644777,"Users Score":2,"Answer":"Answering my own question, it makes sense after 45 minutes of googling I solve my own problem 30 seconds after posting on StackOverflow.\nI needed to use the get_iter function, not the get_iter_from_string function.","Q_Score":1,"Tags":"python,pygtk","A_Id":3644788,"CreationDate":"2010-09-05T02:32:00.000","Title":"PyGTK treeview and row_activated callback","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am starting to use python,more. Is there a good way to keep python disk access to a minimum. \nSeems to me that everytime a *.py file runs, it hits a hard disk. Is there way to avoid hitting the harddisk, and keep *.py file in memory and access it there. \nWould creating a small gui using Wxframe, keep code in memory, and reuse work or is it more pain vs benefit.","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":181,"Q_Id":3647368,"Users Score":2,"Answer":"If you run a .py file from the harddisk, the harddisk will be accessed.\nIn your GUI, just import your code and it will be loaded once and you can access it later.","Q_Score":0,"Tags":"python,wxpython","A_Id":3647374,"CreationDate":"2010-09-05T19:08:00.000","Title":"Python Software design","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am starting to use python,more. Is there a good way to keep python disk access to a minimum. \nSeems to me that everytime a *.py file runs, it hits a hard disk. Is there way to avoid hitting the harddisk, and keep *.py file in memory and access it there. \nWould creating a small gui using Wxframe, keep code in memory, and reuse work or is it more pain vs benefit.","AnswerCount":3,"Available Count":3,"Score":0.1325487884,"is_accepted":false,"ViewCount":181,"Q_Id":3647368,"Users Score":2,"Answer":"Modern operating systems cache file access pretty efficiently, as long as there is enough spare RAM available. You most likely won't notice any difference, fi you're not loading thousand of python files at once.\nAnd as always, before trying to optimize one aspect, make sure that this is really the bottleneck. Chances are, your percieved slowness is not due to loading of the .py files.","Q_Score":0,"Tags":"python,wxpython","A_Id":3647570,"CreationDate":"2010-09-05T19:08:00.000","Title":"Python Software design","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am starting to use python,more. Is there a good way to keep python disk access to a minimum. \nSeems to me that everytime a *.py file runs, it hits a hard disk. Is there way to avoid hitting the harddisk, and keep *.py file in memory and access it there. \nWould creating a small gui using Wxframe, keep code in memory, and reuse work or is it more pain vs benefit.","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":181,"Q_Id":3647368,"Users Score":0,"Answer":"I think if you took the time to measure how much time it takes to load your python code from disk you would end up with a very, very tiny number unless you are doing something very wrong. And if you are doing something really wrong, solving that problem will be a better use of your time.\nUsing wxpython to create a guy to work around what you perceive to be a problem wouldn't likely make any difference.","Q_Score":0,"Tags":"python,wxpython","A_Id":3647549,"CreationDate":"2010-09-05T19:08:00.000","Title":"Python Software design","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm having a right old nightmare with JPype. I have got my dev env on Windows and so tried installing it there with no luck. I then tried on Ubunto also with no luck. I'm getting a bit desperate now. I am using Mingw32 since I tried installing VS2008 but it told me I had to install XP SP2 but I am on Vista. I tried VS2010 but no luck, I got the 'error: Unable to find vcvarsall.bat' error. Anyway, I am now on Mingw32\nUltimately I am trying to use Neo4j and Python hence my need to use JPype. I have found so many references to the problem on the net for MySQL etc but they don't help me with JPype. \nIf I could fix unix or windows I could get going so help on either will be really appreciated. \nHere's the versions..\nWindows: Vista 64\nPython: 2.6\nCompiler Mingw32: latest version\nJpype: 0.5.4.1\nJava info: \njava version \"1.6.0_13\"\nJava(TM) SE Runtime Environment (build 1.6.0_13-b03)\nJava HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)\nI run:\npython setup.py install --compiler=wingw32 \nand get the following output.\nChoosing the Windows profile\nrunning install\nrunning build\nrunning build_py\nrunning build_ext\nbuilding '_jpype' extension\nC:\\MinGW\\bin\\gcc.exe -mno-cygwin -mdll -O -Wall -DWIN32=1 \"-IC:\\Program Files (x86)\\Java\\jdk1.6.0_21\/include\" \"-IC:\\Program Files (x86)\\Java\\jdk1.6.0_21\/include\/win32\" -Isrc\/native\/common\/include -Isrc\/native\/python\/include -Ic:\\Python26\\include -Ic:\\Python26\\PC -c src\/native\/common\/jp_array.cpp -o build\\temp.win32-2.6\\Release\\src\\native\\common\\jp_array.o \/EHsc\nsrc\/native\/common\/jp_array.cpp: In member function 'void JPArray::setRange(int, int, std::vector&)':\nsrc\/native\/common\/jp_array.cpp:56:13: warning: comparison between signed and unsigned integer expressions\nsrc\/native\/common\/jp_array.cpp:68:4: warning: deprecated conversion from string constant to 'char*'\nsrc\/native\/common\/jp_array.cpp: In member function 'void JPArray::setItem(int, HostRef*)':\nsrc\/native\/common\/jp_array.cpp:80:3: warning: deprecated conversion from string constant to 'char*'\ngcc: \/EHsc: No such file or directory\nerror: command 'gcc' failed with exit status 1\nSo on unix Ubunto the problem is as follows:\nJava version: 1.6.0_18\nJPype: 0.5.4.1\nPython: 2.6\nJava is in the path and I did apt-get install build-essentials just now so have latest GCC etc. \nI won't paste all the output as it's massive. So many errors it's like I have missed the install of Java or similar but I haven't. typing java takes me into version above. This is the beginning:\nrunning install\nrunning build\nrunning build_py\nrunning build_ext\nbuilding '_jpype' extension\ngcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I\/usr\/lib\/jvm\/java-1.5.0-sun-1.5.0.08\/include -I\/usr\/lib\/jvm\/java-1.5.0-sun-1.5.0.08\/include\/linux -Isrc\/native\/common\/include -Isrc\/native\/python\/include -I\/usr\/include\/python2.6 -c src\/native\/common\/jp_javaenv_autogen.cpp -o build\/temp.linux-i686-2.6\/src\/native\/common\/jp_javaenv_autogen.o\ncc1plus: warning: command line option \"-Wstrict-prototypes\" is valid for Ada\/C\/ObjC but not for C++\nIn file included from src\/native\/common\/jp_javaenv_autogen.cpp:21:\nsrc\/native\/common\/include\/jpype.h:45:17: error: jni.h: No such file or directory\nIn file included from src\/native\/common\/jp_javaenv_autogen.cpp:21:\nsrc\/native\/common\/include\/jpype.h:77: error: ISO C++ forbids declaration of \u2018jchar\u2019 with no type\nsrc\/native\/common\/include\/jpype.h:77: error: expected \u2018,\u2019 or \u2018...\u2019 before \u2018\u2019 token\nsrc\/native\/common\/include\/jpype.h:82: error: ISO C++ forbids declaration of \u2018jchar\u2019 with no type\nsrc\/native\/common\/include\/jpype.h:82: error: expected \u2018;\u2019 before \u2018\u2019 token\nsrc\/native\/common\/include\/jpype.h:86: error: ISO C++ forbids declaration of \u2018jchar\u2019 with no type\nsrc\/native\/common\/include\/jpype.h:86: error: expected \u2018;\u2019 before \u2018&\u2019 token\nsrc\/native\/common\/include\/jpype.h:88: error: expected \u2018;\u2019 before \u2018private\u2019\nsrc\/native\/common\/include\/jpype.h:89: error: ISO C++ forbids declaration of \u2018jchar\u2019 with no type\nsrc\/native\/common\/include\/jpype.h:89: error: expected \u2018;\u2019 before \u2018*\u2019 token\nIn file included from src\/native\/common\/include\/jpype.h:96,\n from src\/native\/common\/jp_javaenv_autogen.cpp:21:\nAnd this is the end:\nsrc\/native\/common\/include\/jp_monitor.h:27: error: \u2018jobject\u2019 does not name a type\nsrc\/native\/common\/jp_javaenv_autogen.cpp:30: error: \u2018jbyte\u2019 does not name a type\nsrc\/native\/common\/jp_javaenv_autogen.cpp:38: error: \u2018jbyte\u2019 does not name a type\nsrc\/native\/common\/jp_javaenv_autogen.cpp:45: error: variable or field \u2018SetStaticByteField\u2019 declared void\nsrc\/native\/common\/jp_javaenv_autogen.cpp:45: error: \u2018jclass\u2019 was not declared in this scope\nsrc\/native\/common\/jp_javaenv_autogen.cpp:45: error: \u2018jfieldID\u2019 was not declared in this scope\nsrc\/native\/common\/jp_javaenv_autogen.cpp:45: error: \u2018jbyte\u2019 was not declared in this scope\nerror: command 'gcc' failed with exit status 1","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":3736,"Q_Id":3649577,"Users Score":1,"Answer":"Edit the Setup.py and remove the \/EHsc option.","Q_Score":3,"Tags":"java,python","A_Id":6258169,"CreationDate":"2010-09-06T06:54:00.000","Title":"JPype compile problems","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm working on a wxPython app which has multiple frames and a serial connection. I need to be able to exit the app cleanly, closing the serial connection as the app terminates.\nWhat is the best way to do this? Should this be handled by a subclass of wxApp?\nThanks,\nJosh","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1263,"Q_Id":3673418,"Users Score":0,"Answer":"I usually use my close button's event handler to close connections and what-not before closing the frame. If you want to catch the upper right \"x\" button, then you'll need to bind to EVT_CLOSE. Unfortunately, when you do that, you need to call your frame's Destroy() method rather than its Close() method or you'll end up in an infinite loop.","Q_Score":2,"Tags":"python,wxpython","A_Id":3677070,"CreationDate":"2010-09-09T02:43:00.000","Title":"Terminating a wxPython app cleanly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"There are a lot of games that can generally be viewed as a bunch of objects spread out through space, and a very common operation is to pick all objects in a sub-area. The typical example would be a game with tons of units across a large map, and an explosion that affects units in a certain radius. This requires picking every unit in the radius in order to apply the effects of the explosion.\nNow, there are several ways to store objects that allows efficiently picking a sub-area. The easiest method is probably to divide the map into a grid; picking units in an area would involve selecting only the parts of the grid that is affected, and do a fine-grained coordinate check grid tiles that aren't 100% inside the area.\nWhat I don't like about this approach is answering \"How large should the grid tiles be?\" Too large, and efficiency may become a real problem. Too small, and the grid takes up tons of memory if the game world is large enough (and can become ridiculous if the game is 3d). There may not even be a suitable golden mean.\nThe obvious solution to the above is to make a large grid with some kind of intelligent subdivision, like a pseudo tree-structure. And it is at this point I know for sure I am far into premature optimization. (Then there are proper dynamic quad\/octrees, but that's even more complex to code and I'm not even confident it will perform any better.)\nSo my question is: Is there a standard solution to the above problem? Something, in the lines of an STL container, that can just store any object with a coordinate, and retreive a list of objects within a certain area? It doesn't have to be different than what I described above, as long as it's something that has been thought out and deemed \"good enough\" for a start.\nBonus points if there is an implementation of the algorithm in Python, but C would also do.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":293,"Q_Id":3691278,"Users Score":1,"Answer":"The first step to writing a practical program is accepting that choices for some constants come from real-world considerations and not transcendent mathematical truths. This especially applies to game design\/world simulation type coding, where you'd never get anywhere if you persisted in trying to optimally model the real world. :-)\nIf your objects will all be of fairly uniform size, I would just choose a grid size proportional to the average object size, and go with that. It's the simplest - and keep in mind simplicity will buy you some speed even if you end up searching over a few more objects than absolutely necessary!\nThings get a big harder if your objects vary greatly in size - for example if you're trying to use the same engine to deal with bullets, mice, humans, giant monsters, vehicles, asteroids, planets, etc. If that's the case, a common accepted (but ugly) approach is to have different 'modes' of play depending on the type of situation you're in. Short of that, one idea might be to use a large grid with a binary-tree subdivision of grid cells after they accumulate too many small objects.\nOne aside: if you're using floating point coordinates, you need to be careful with precision and rounding issues for your grid size, since points close to the origin have a lot more precision than those far away, which could lead to errors where grid cells miss some objects.","Q_Score":2,"Tags":"python,c,containers","A_Id":3691446,"CreationDate":"2010-09-11T14:08:00.000","Title":"A container for accessing contents by 2d\/3d coordinates","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"There are a lot of games that can generally be viewed as a bunch of objects spread out through space, and a very common operation is to pick all objects in a sub-area. The typical example would be a game with tons of units across a large map, and an explosion that affects units in a certain radius. This requires picking every unit in the radius in order to apply the effects of the explosion.\nNow, there are several ways to store objects that allows efficiently picking a sub-area. The easiest method is probably to divide the map into a grid; picking units in an area would involve selecting only the parts of the grid that is affected, and do a fine-grained coordinate check grid tiles that aren't 100% inside the area.\nWhat I don't like about this approach is answering \"How large should the grid tiles be?\" Too large, and efficiency may become a real problem. Too small, and the grid takes up tons of memory if the game world is large enough (and can become ridiculous if the game is 3d). There may not even be a suitable golden mean.\nThe obvious solution to the above is to make a large grid with some kind of intelligent subdivision, like a pseudo tree-structure. And it is at this point I know for sure I am far into premature optimization. (Then there are proper dynamic quad\/octrees, but that's even more complex to code and I'm not even confident it will perform any better.)\nSo my question is: Is there a standard solution to the above problem? Something, in the lines of an STL container, that can just store any object with a coordinate, and retreive a list of objects within a certain area? It doesn't have to be different than what I described above, as long as it's something that has been thought out and deemed \"good enough\" for a start.\nBonus points if there is an implementation of the algorithm in Python, but C would also do.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":293,"Q_Id":3691278,"Users Score":0,"Answer":"I don't know anything about games programming, but I would imagine (based on intuition and what I've read in the past) that a complete grid will get very inefficient for large spaces; you'll lose out in both storage, and also in time, because you'll melt the cache.\nSTL containers are fundamentally one-dimensional. Yes, things like set and map allow you to define arbitrary sort relationships, but it's still ordered in only one dimension. If you want to do better, you'll probably need to use a quad-tree, a kd-tree, or something like that.","Q_Score":2,"Tags":"python,c,containers","A_Id":3691977,"CreationDate":"2010-09-11T14:08:00.000","Title":"A container for accessing contents by 2d\/3d coordinates","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I place an image in a Tkinter GUI using the python standard library?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":543,"Q_Id":3698900,"Users Score":0,"Answer":"You can Built-In the images on the code encoding it on Base64","Q_Score":0,"Tags":"python,tkinter","A_Id":3713622,"CreationDate":"2010-09-13T08:45:00.000","Title":"Putting images in a Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In my application i have text control.\nI want my text ctrl should be read only but when some one right click on this he is able to copy the value from that ctrl and he can paste that value in other text control.\nIf i made my text control read only with wx.TE_READONLY then copy\/paste is not working.\nIs there any requirement to handle other type of wx event or i have to set more type of wx style flags while creating the text control object.\nThanks in advance.","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":8427,"Q_Id":3710751,"Users Score":1,"Answer":"We should bind wx.EVT_TEXT_COPY and wx.EVT_TEXT_PASTE with text control.\none can copy and paste data from text ctrl although text ctrl is read only mode.","Q_Score":1,"Tags":"python,wxpython","A_Id":3716517,"CreationDate":"2010-09-14T16:13:00.000","Title":"how to create read only text ctrl but support copy paste event","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How is Python able to call C++ objects when the interpreter is C and has been built w\/ a C compiler?","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":1508,"Q_Id":3712125,"Users Score":2,"Answer":"C++ can interoperate with C by extern \"C\" declarations.","Q_Score":8,"Tags":"c++,python,boost-python","A_Id":3712249,"CreationDate":"2010-09-14T19:16:00.000","Title":"How does Boost.Python work?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python\/wxPython program where the GUI is the main thread and I use another thread to load data from a file. Sometimes the files are big and slow to load so I use a wxPulse dialog to indicate progress.\nAs I load the file, I count the number of lines that have been read in the counting thread, and I display this count in the wxPulse dialog in the main thread. I get the count in the main thread by reading the same variable that is being written to by the loading thread. \nIs this \"thread safe\"? Could this somehow cause problems? I've been doing it for awhile and it has been fine so far.\nPS. I know I could use a queue to transfer the count, but I'm lazy and don't want to if I don't have to.","AnswerCount":5,"Available Count":5,"Score":0.1194272985,"is_accepted":false,"ViewCount":2094,"Q_Id":3714613,"Users Score":3,"Answer":"In normal python this will be safe as all access to variables are protected by the GIL(Global Interpreter Lock) this means that all access to a variable are syncronised so only one thread can do this at a time. The only issue is as @Eloff noted if you need to read more than one value and need them to be consistent - you will need to design in some control of access in this case.","Q_Score":6,"Tags":"python,thread-safety","A_Id":3716794,"CreationDate":"2010-09-15T04:12:00.000","Title":"Python: safe to read values from an object in a thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python\/wxPython program where the GUI is the main thread and I use another thread to load data from a file. Sometimes the files are big and slow to load so I use a wxPulse dialog to indicate progress.\nAs I load the file, I count the number of lines that have been read in the counting thread, and I display this count in the wxPulse dialog in the main thread. I get the count in the main thread by reading the same variable that is being written to by the loading thread. \nIs this \"thread safe\"? Could this somehow cause problems? I've been doing it for awhile and it has been fine so far.\nPS. I know I could use a queue to transfer the count, but I'm lazy and don't want to if I don't have to.","AnswerCount":5,"Available Count":5,"Score":0.0399786803,"is_accepted":false,"ViewCount":2094,"Q_Id":3714613,"Users Score":1,"Answer":"It's quite safe.\nWhen the count increases from n to n+1 the \"n+1 object\" is created and then count is switched from referring to the \"n object\" to the new \"n+1 object\".\nThere is no stage that count is referring to something other than the \"n object\" or the \"n+1 object\"","Q_Score":6,"Tags":"python,thread-safety","A_Id":3714773,"CreationDate":"2010-09-15T04:12:00.000","Title":"Python: safe to read values from an object in a thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python\/wxPython program where the GUI is the main thread and I use another thread to load data from a file. Sometimes the files are big and slow to load so I use a wxPulse dialog to indicate progress.\nAs I load the file, I count the number of lines that have been read in the counting thread, and I display this count in the wxPulse dialog in the main thread. I get the count in the main thread by reading the same variable that is being written to by the loading thread. \nIs this \"thread safe\"? Could this somehow cause problems? I've been doing it for awhile and it has been fine so far.\nPS. I know I could use a queue to transfer the count, but I'm lazy and don't want to if I don't have to.","AnswerCount":5,"Available Count":5,"Score":1.2,"is_accepted":true,"ViewCount":2094,"Q_Id":3714613,"Users Score":8,"Answer":"Generally as long as...\n\nYou only have one thread writing to it, and...\nIt's not important that the count be kept precisely in sync with the displayed value...\n\nit's fine.","Q_Score":6,"Tags":"python,thread-safety","A_Id":3714627,"CreationDate":"2010-09-15T04:12:00.000","Title":"Python: safe to read values from an object in a thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python\/wxPython program where the GUI is the main thread and I use another thread to load data from a file. Sometimes the files are big and slow to load so I use a wxPulse dialog to indicate progress.\nAs I load the file, I count the number of lines that have been read in the counting thread, and I display this count in the wxPulse dialog in the main thread. I get the count in the main thread by reading the same variable that is being written to by the loading thread. \nIs this \"thread safe\"? Could this somehow cause problems? I've been doing it for awhile and it has been fine so far.\nPS. I know I could use a queue to transfer the count, but I'm lazy and don't want to if I don't have to.","AnswerCount":5,"Available Count":5,"Score":0.0798297691,"is_accepted":false,"ViewCount":2094,"Q_Id":3714613,"Users Score":2,"Answer":"This is fine because you have only one writer thread. Read only operations are always thread-safe. The exception to this arises when you are reading more than one related value and expecting some form of consistency between them. Since writes can happen at any time, reads of multiple values may not be consistent and indeed may not even have any sensible program state at all. In this case, locks are used to make the multiple reads appear to happen as a single atomic operation exclusive to any writes.","Q_Score":6,"Tags":"python,thread-safety","A_Id":3714663,"CreationDate":"2010-09-15T04:12:00.000","Title":"Python: safe to read values from an object in a thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python\/wxPython program where the GUI is the main thread and I use another thread to load data from a file. Sometimes the files are big and slow to load so I use a wxPulse dialog to indicate progress.\nAs I load the file, I count the number of lines that have been read in the counting thread, and I display this count in the wxPulse dialog in the main thread. I get the count in the main thread by reading the same variable that is being written to by the loading thread. \nIs this \"thread safe\"? Could this somehow cause problems? I've been doing it for awhile and it has been fine so far.\nPS. I know I could use a queue to transfer the count, but I'm lazy and don't want to if I don't have to.","AnswerCount":5,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":2094,"Q_Id":3714613,"Users Score":0,"Answer":"It's safe only because it's not especially critical. Weird things like the value not updating when it should won't matter. It is very hard to get a definitive answer on what happens when you pretend a single int that's being read and written to is \"atomic\", as it depends on the exact architecture and a bunch of other things. But it won't do anything worse than give the wrong number sometimes, so go ahead... or use a queue. :)","Q_Score":6,"Tags":"python,thread-safety","A_Id":3714667,"CreationDate":"2010-09-15T04:12:00.000","Title":"Python: safe to read values from an object in a thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"A wxPython program that I'm writing uses two sliders as part of the GUI. These sliders represent a three state switch with the states \"On Full\", \"On Medium\" and \"Off\". I'd like to be able to assign these labels to the ticks on the slider. Is there a way of doing this without having to subclass or position separate static text controls?\nThanks,\nSpry","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":326,"Q_Id":3715317,"Users Score":1,"Answer":"Not built in. You'd have to create your own.","Q_Score":0,"Tags":"python,user-interface,wxpython","A_Id":3716150,"CreationDate":"2010-09-15T06:53:00.000","Title":"wxPython: Assigning text labels to ticks on a slider","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wrote a implementation of conway's game of life. I set up two modes, one is auto and the other is manual, which I mean the way to ouput the result of the game. For the auto mode, I cannot stop the running progran without ctrl + q or ctrl + c (which prints out the error message). So is there any way which can allow me to stop the running program and return to the python >>> prompt by pressing some key defined by myself, say, ctrl + k. Thank you.","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":3663,"Q_Id":3737922,"Users Score":1,"Answer":"Are you running it from an iteractive prompt and want to just get back to the prompt. Or, are you running it from a shell and want to get to a python prompt in but with the current state of the programs execution? \nFor the later it you could the keyboard interupt exception in your code and break out to the python debugger (pdb).\n\nimport pdb\ntry:\n mainProgramLoop()\nexcept (KeyboardInterrupt, SystemExit):\n pdb.set_trace()","Q_Score":4,"Tags":"python","A_Id":3737996,"CreationDate":"2010-09-17T18:23:00.000","Title":"How to quit the running python program to python prompt?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to detect when a window that doesn't belong to my application is being dragged in windows using python\/pywin32? I want to set it up so that when I drag a window whose title matches a pattern near the desktop edge, it snaps to the edge when the mouse is let go. I could write code to snap all windows with that title to the desktop whenever the mouse is released, but I want to only move the particular window that was being dragged.","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1517,"Q_Id":3753612,"Users Score":2,"Answer":"So far the only possible solution I see is to use SetWindowsHookEx. Pywin32 doesn't interface this, so I think I'll have to do something like this:\n\nWrite a C extension module. It has a function like setCallback which takes a python function to be called when the drag event happens. \nWrite a C DLL that contains the actual hook into windows. This DLL will somehow have to call the python function that is currently set.\n\nI'm not sure how to do these, or if it's correct, though..","Q_Score":2,"Tags":"python,winapi,pywin32,windows","A_Id":3762323,"CreationDate":"2010-09-20T16:50:00.000","Title":"python+win32: detect window drag","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have wxpython application that run over a list of files on some directory and proccess the files line by line\nI need to build a progress bar that show the status how records already done with wx.gauge control\nI need to count the number of the records before i use the wx.guage in order to build the progress bar ,\nis this the way to do this and if yes what is the best method to count the number of lines of all the files on some directory with pyhon ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":222,"Q_Id":3758468,"Users Score":1,"Answer":"I think you could do 2 progress bars, one for files, and second for line in just read file. This will be similar to copy progress in TotalCommander.\nIf you want one progress bar you could just count file sizes using os.path.getsize(path) and then show how many bytes have you processed\/bytes total.","Q_Score":0,"Tags":"python,wxpython","A_Id":3758497,"CreationDate":"2010-09-21T08:20:00.000","Title":"counting records of files on directory with python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been looking for how to do this and I've found places where the subject comes up, but none of the suggestions actually work for me, even though they seem to work out okay for the questioner (they don't even list what to import). I ran across self.setWindowFlags(Qt.FramelessWindowHint) but it doesn't seem to work regardless of the import I try (QtGui.FramelessWindowHint, QtCore.FramelessWindowHint, etc.).\nAny ideas?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":6028,"Q_Id":3758648,"Users Score":13,"Answer":"u need to import QtCore\n\n\nso the code will look like this : \n self.setWindowFlags(QtCore.Qt.FramelessWindowHint) \nwhenever you see Qt.something put in mind that they are talking about the Qt class inside QtCore module .\nhope this helps","Q_Score":7,"Tags":"python,pyqt,pyside","A_Id":3761216,"CreationDate":"2010-09-21T08:48:00.000","Title":"Setting window style in PyQT\/PySide?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am interested in programming for Mobile Devices.\nNow I have a phone which runs Symbian S60 3rd, which is one of my motivations for programming for mobile devices.\nNow, my question is, which one is better to go for?\nPython or C++?\nI have a good background in C++ (ANSI), Java and C#.\nThanks.","AnswerCount":5,"Available Count":2,"Score":0.0399786803,"is_accepted":false,"ViewCount":1838,"Q_Id":3763766,"Users Score":1,"Answer":"Python is more easy to use, but you have to know that a mobile is normally a very strict environment, so is possible that C++ be a better alternative.","Q_Score":0,"Tags":"c++,python,symbian","A_Id":3763786,"CreationDate":"2010-09-21T19:31:00.000","Title":"Python or C++? Programming for mobile devices","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am interested in programming for Mobile Devices.\nNow I have a phone which runs Symbian S60 3rd, which is one of my motivations for programming for mobile devices.\nNow, my question is, which one is better to go for?\nPython or C++?\nI have a good background in C++ (ANSI), Java and C#.\nThanks.","AnswerCount":5,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1838,"Q_Id":3763766,"Users Score":2,"Answer":"There's a large learning curve associated with Symbian C++, if you want to do a quick prototype probably do it in Python.\nIt depends on what you want your application to do. I believe the Symbian Python implementation was done in some Symbian developers spare time so it may not give you access to everything on the phone. Symbian C++ will give you access to almost everything.\nAlso, Java and MIDP may be useful to you too.","Q_Score":0,"Tags":"c++,python,symbian","A_Id":3763991,"CreationDate":"2010-09-21T19:31:00.000","Title":"Python or C++? Programming for mobile devices","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"It's my understanding that in wxPython in OSX, \u2318+w support for closing wx.Window objects. In order to add it, I've had to bind to wx.EVT_KEY_DOWN, checking for event.MetaDown() and event.KeyCode == 'W' explicitly.\nIn my app, I need to have all windows and dialogs support this. I'm still in the process of layout out my GUI, but I got to thinking, and I'm wondering what the best way to add this support to an existing class easily is. I tried out Multiple Inheritance, but it didn't seem to be working (my event handler never got called).\nI was thinking maybe a class decorator, but this is functionality that will be added at runtime, due to the dynamic nature of python. So I'm a little stumped.\nPS: I know 'best' is subjective, but I'm honestly looking for anything here that might work that's not an exorbitant amount of code.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":93,"Q_Id":3765496,"Users Score":0,"Answer":"I was thinking maybe a class\n decorator, but this is functionality\n that will be added at runtime, due to\n the dynamic nature of python.\n\nI don't understand why this makes you \"a little stumped\". The class decorator executes just after the end of the class statement -- yes, that's \"at runtime\", but, so is the clqss statement itself, all the def statement in it for its methods, and so forth. By the time you instantiate any of the classes thus decorated, the decorator will have run and so the class you're instantiating will have been modified accordingly by the decorator's code. Can you please give a small example of why this isn't working for you?","Q_Score":0,"Tags":"python,macos,user-interface,wxpython","A_Id":3765854,"CreationDate":"2010-09-22T00:37:00.000","Title":"Command+W Support in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an image having dimension 1000*500\nI want to make it of 400*300\nBut My image should not looked distorted.\nhttp:\/\/www.daniweb.com\/forums\/thread295652.html - i used this as a reference. But My image get distorted.","AnswerCount":1,"Available Count":1,"Score":0.761594156,"is_accepted":false,"ViewCount":1120,"Q_Id":3778043,"Users Score":5,"Answer":"Your target image size has a different aspect ratio to that of the original. The original is 2:1 but the target is 4:3.\nYou can resize preserving the aspect ratio, but depending on which dimension you choose you'll either get an image that's 400 x 200 or 600 x 300.\nIf you need the image to be 400 x 300 then you'll need to resize to 400 x 200 and then add border to each side or 600 x 300 and add the border to the top and bottom.","Q_Score":0,"Tags":"python,image-processing","A_Id":3778086,"CreationDate":"2010-09-23T11:52:00.000","Title":"i want a to resize an image but without distortion","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wx.toolbar with some buttons. One of the buttons makes pan left!\nI want to click on the button and while I keep it pressed, the pan left is made.\nFor now I only saw that the wx.EVT_TOOL only works when mouse left is up.\nIs there a way to do what I intend ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":318,"Q_Id":3793526,"Users Score":1,"Answer":"In the toolbar button's event, you should be able to get the state of the mouse via wx.GetMouseState.\nAlternatively, you can make your own toolbar with a panel and some wx.Buttons (or other button widgets).","Q_Score":0,"Tags":"python,events,wxpython,mouseevent","A_Id":3806500,"CreationDate":"2010-09-25T11:01:00.000","Title":"How to change my wx.toolbar event?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"IronPython.net documentation says the MSIL in the assembly isn't CLS-compliant, but is there a workaround?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":305,"Q_Id":3795914,"Users Score":0,"Answer":"I'm typing this on my phone so please forgive any silly mistakes. To use the compiled assembly, make sure you compile with clr.CompileModules, NOT pyc.py. Then in your C# call the LoadAssembly method on your Python ScriptEngine object. The module can then be imported by calling the ImportModule method on your ScriptEngine. From there if you can take advantage of the dynamic keyword, do so. Otherwise you'll be stuck with some magic string heavy calls to GetVariable. Also note that you'll have to provide the standard library to your compiled Python Assembly in one form or another.","Q_Score":1,"Tags":"c#,ironpython,.net-assembly,cil,cls-compliant","A_Id":3835553,"CreationDate":"2010-09-25T23:07:00.000","Title":"Is there a way to use IronPython objects and functions (compiled into an assembly) from C# code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have used Lua.NET on .NET platform and I could call the .NET class\/object from Lua and I could call the Lua from .NET Lua API interface. I did the same with the IronPython. I knew the how the .NET binding works.\nNow I have a C++ project and I want to use the dynamic capabilities. I want to call C++ object which may not be possible from Lua so I may need to call some C API which makes call to C++. Meantime I want to call the Lua from C++.\nWe have configuration data which is best described in table like format in Lua or List & Dict like in Python. We need to enumerate these data structures defined in Lua\/Python in C++. \nWhen considering Lua to Python in C++ for two way calling, is Python have upper hand with Boost Python library? I don't have experience in Python\/C++ binding. I don't have equal experience of using Python in C++ and calling Python from C++.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3491,"Q_Id":3818703,"Users Score":0,"Answer":"If you are planning to just use windows you could use C++\/CLI a managed variant of C++. With C++\/CLI you can easily mix managed and unmanaged code. You could call the managed classes from any .net language and the unmanaged (exported) functions from C.","Q_Score":2,"Tags":"c++,python,boost,lua,embedding","A_Id":3819333,"CreationDate":"2010-09-29T04:22:00.000","Title":"Lua or Python binding with C++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"all, I want to draw a rectangular or a container with 20 slots inside. it is like a cd container or archive, with empty slot to insert the cd or book. I choose wxPython. \nfor this 20 horizontal empty slots, i see there is wx.BoxSizer(wx.Horizonal) or other sizers to make the layout.\nmy question is, Is it possible to have \"visible border and grey background\" (to represent the empty slots) for the spaces generated by the wx.BoxSizer? It seems to me that, it is not possible. The sizer seems only to do layout, instead of generating visible subwindow.\nIf it is not possible, I think I need to create a slot window class for this \"border and colorful background\" feature, and create 20 slot window objects and add into the sizer. Then, I have to use create another window class to represent the book or CD, and insert this CD window to the slot window. \nThis sounds a bit awkard. I do not know if slot window is necessary or maybe wx.sizer (or other sizer) could achieve the same effect as the slot window.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":355,"Q_Id":3823429,"Users Score":1,"Answer":"I would create a subclass of wx.Panel for each \"slot\", then manage them with a grid or box sizer.","Q_Score":0,"Tags":"wxpython,window,sizer","A_Id":3823479,"CreationDate":"2010-09-29T15:58:00.000","Title":"use wxPython to draw a grided rectangular container or box","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Toplevel widget I'd like it so that it would never appear within the confines of the main Tk window. Basically so that when the Toplevel appears it doesn't cover up any of the main Tk window.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":348,"Q_Id":3836086,"Users Score":1,"Answer":"You want to use wm_geometry and a tiny bit of math to calculate and set a suitable starting position for the second toplevel.","Q_Score":1,"Tags":"python,tkinter","A_Id":3836182,"CreationDate":"2010-10-01T02:10:00.000","Title":"Toplevel widgets in Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a plugin UI for an existing application using PyQt4. The window is created using uic.loadUi() on the press of a button in the main window. The problem is that if I press the button again (while the window is showing) the window is re-created and unsaved changes are lost. I don't want to make the window modal. Which options do I have to cope with this problem? I guess it would be related to checking whether the QWidget is already showing.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1072,"Q_Id":3839426,"Users Score":2,"Answer":"You should initializer a pointer to the QWidget (member variable) to 0.\nWhen the button is pressed, check if the pointer is 0 - if it is, load and show the widget, and assign the pointer variable to point to the new widget. If the pointer is not null when the button is pressed, call widget->raise() and widget->activateWindow().\nDisabled buttons can be frustrating to users, as can buttons which appear to do nothing because e.g. their effect is hidden.","Q_Score":2,"Tags":"python,user-interface,qt4,pyqt4","A_Id":3839514,"CreationDate":"2010-10-01T13:07:00.000","Title":"How to check if a QWidget is already showing?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a plugin UI for an existing application using PyQt4. The window is created using uic.loadUi() on the press of a button in the main window. The problem is that if I press the button again (while the window is showing) the window is re-created and unsaved changes are lost. I don't want to make the window modal. Which options do I have to cope with this problem? I guess it would be related to checking whether the QWidget is already showing.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1072,"Q_Id":3839426,"Users Score":0,"Answer":"I would have thought that this would be handled more by your application logic than anything else. The main window should disable the button after it has been clicked and then re-enable it again when the window is closed. Connect up a closing signal on the secondary window to a slot on the main window to notify the main window when the secondary window is being closed.","Q_Score":2,"Tags":"python,user-interface,qt4,pyqt4","A_Id":3839466,"CreationDate":"2010-10-01T13:07:00.000","Title":"How to check if a QWidget is already showing?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"It doesn't look like it has that attribute, but it'd be really useful to me.","AnswerCount":13,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":131968,"Q_Id":3842155,"Users Score":0,"Answer":"You could use a Label instead. A Label can be edited programmatically and cannot be edited by the user.","Q_Score":83,"Tags":"python,text,tkinter","A_Id":58942250,"CreationDate":"2010-10-01T18:47:00.000","Title":"Is there a way to make the Tkinter text widget read only?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing an application that uses multiple threads to gather data from a variety of network devices. I'm using PyQT to display the collected data on a GUI. I am using regular python threads (from thread, threading) in my app (instead of QThread). In order to update the GUI on the different threads, I use a lock (thread.allocate_lock()). So, anytime a GUI update will happen, I call with lock, update GUI. Any concerns about this?","AnswerCount":3,"Available Count":1,"Score":-0.0665680765,"is_accepted":false,"ViewCount":7384,"Q_Id":3842558,"Users Score":-1,"Answer":"I use pyqtSignal and Python's threading. You can create threads and when the thread is completed have it send a signal to update your GUI.","Q_Score":1,"Tags":"python,multithreading,pyqt","A_Id":3886587,"CreationDate":"2010-10-01T19:50:00.000","Title":"PyQT and threads","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have input values of x, y, z coordinates in the following format:\n[-11.235865 5.866001 -4.604924]\n[-11.262565 5.414276 -4.842384]\n[-11.291885 5.418229 -4.849229]\n[-11.235865 5.866001 -4.604924]\nI want to draw polygons and succeeded with making a list of wx.point objects. But I need to plot floating point coordinates so I had to change it to point2D objects but DrawPolygon doesn't seem to understand floating points, which returns error message: TypeError: Expected a sequence of length-2 sequences or wxPoints.\nI can't find anywhere in the API that can draw shapes based on point2D coordinates, could anyone tell me a function name will do the job? \nThanks","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1320,"Q_Id":3852146,"Users Score":0,"Answer":"DC's only use integers. Try using Cairo or wx.GraphicsContext.","Q_Score":1,"Tags":"python,wxpython","A_Id":3855400,"CreationDate":"2010-10-04T00:29:00.000","Title":"How to draw polygons with Point2D in wxPython?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":0.0,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":0,"Answer":"Python scripts are analogous to a man looking at a to-do list written in English (or language he understands). The man has to do all the work, every time that list of things has to be done.\nIf the man, instead of doing the steps on his own each time, creates and programs a robot which can carry out those steps again and again (and probably faster than him), that robot is analogous to the C program.\nThe man in the python case is called the \"interpreter\" and in the C case is called the \"compiler\", and the C robot is called the compiled program\/executable.\nWhen you look at the python program source, you see the to-do list. In case of the robot, you see the gears, motors and batteries, etc, which look very different from the to-do list. If you could get hold of the C \"to-do\" list, it looks somewhat like the python code, just in a different language.","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3869481,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":0.0906594778,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":5,"Answer":"This is sorta a big topic. You should look into your local friendly Computer Science curriculum, you'll find a lot of great stuff on this subject there.\nThe short answer is the Python is an \"interpreted\" language, which means that it requires a machine language program (the python interpreter) to run the python program, adding a layer of indirection. C or C++ are different. They are compiled directly to machine code, which runs directly on your processor.\nThere is a lot of additional voodoo to be learned here, however. Technically Python is compiled to a bytecode, and modern interpreters do more and more \"Just in Time\" compilation, so the boundaries between compiled and interpreted code are getting fuzzier all the time.","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3869458,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":0.0181798149,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":1,"Answer":"because C code is complied to object (machine) code and python code is compiled into an intermediate byte code. I am not sure if you are even referring to the byte code of python - you must be referring to the source file itself which is directly executable (hiding the byte code from you!). C needs to be compiled and linked.","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3869445,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":0.0,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":0,"Answer":"Python scripts are parsed and converted to binary only when they're run - i.e., they're text files and you can read them with an editor.\nC code is compiled and linked to an executable binary file before they can be run. Normally, only this executable binary file is distributed - hence you need a decompiler. You can always view the source code, if you've access to it.","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3869451,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":0.0,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":0,"Answer":"G-WAN executes ANSI C scripts on the fly -making it just like Python scripts.\nThis can be server-side scripts (using G-WAN as a Web server) or any general-purpose C program and you can link any existing library.\nOh, and G-WAN C scripts are much faster than Python, PHP or Java...","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3874099,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":1.0,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":10,"Answer":"Python is a script language, runs in a virtual machine through an interpeter.\nC is a compiled language, the code compiled to binary code which the computer can run without all that extra stuff Python needs.","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3869443,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code.","AnswerCount":11,"Available Count":7,"Score":0.0363476168,"is_accepted":false,"ViewCount":801,"Q_Id":3869435,"Users Score":2,"Answer":"Yes, you can - it's called disassembling, and allows you to look at the code of Safari perfectly well. The thing is, C, among other languages, compiles to native code, i.e. code that your CPU can \"understand\" and execute. \nMore or less obviously, the level of abstraction present in the instruction set of your CPU is much smaller than that of a high level language like Python. The CPU instructions are not concerned with \"downloading that URI\", but more \"check if that bit is set in a hardware register\".\nSo, in conclusion, the level of complexity present in a native application is much higher when looking at the machine code, so many people simply can't make any sense of what is going on there, it's hard to get the big picture. With experience and time at your hands, it is possible though - people do it all the time, reversing applications and all.","Q_Score":3,"Tags":"python,c,decompiling","A_Id":3869460,"CreationDate":"2010-10-06T04:07:00.000","Title":"Why do C programs require decompilers but python programs dont?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a QWebView in my app which renders a html page stored in the app as a Qresource. This page, however requires meaty external Javascript libraries such as MathJax, which I would want to include as a resource due to its size. \nMy problem is that it seems that QtWebkit does not cache these files as a regular browser would do, and every time I refresh the widget it downloads MathJax afresh.\nSo my question is: is there any way to cache these libraries after first time they are downloaded, without having resorting to shipping it with the app as resource?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1071,"Q_Id":3872033,"Users Score":0,"Answer":"Could you post some source code? Once downloaded that data will stay in the \/tmp\/ folder for some time. You could likely use the data in the temp folder, my guess is you are not enforcing that policy.","Q_Score":1,"Tags":"javascript,python,pyqt,qtwebkit","A_Id":3886529,"CreationDate":"2010-10-06T11:41:00.000","Title":"Caching external javascript for a QtWebkit widget in a PyQt app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Is anybody familiar with Worldviz-Vizard's 3D engine for python? How does it compare to Panda3D? I have a feeling that it might be easier to learn but far more limited. They only support python 2.4 which also makes me not want to try it.","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":1459,"Q_Id":3877971,"Users Score":2,"Answer":"Been using Vizard for various VR and AR development for about 3 yrs now - it's NOT unity - i.e. a web enabled game engine (excellent though it is) - what Vizard provides is a highly optimized OpenGL engine, wrapped in user friendly python scripting environment BUT on top of this you get the ability to seamlessly distribute your simulations over a cluster or a network. Vizard keeps all things completely synched - invisible to the user. Connects to pretty much all known VR tracking equipment and display periphals and standard gaming equipment is also supported (Wiimote & Kinnect). Native support for frame sequential, side-by-side and anaglyph stereo, spatial sound engine and the ability to extend it with C and C++ plugins or GLSL shaders.\nDidn't actually mean to write that much and I don't want to come across as a Vizard evangelist, it is not perfect, BUT comparing it to Panda3D, Unity or other game engines I feel is an unfair comparison - not like-for-like :o)","Q_Score":1,"Tags":"python,pygame,3d-engine,panda3d","A_Id":6589557,"CreationDate":"2010-10-07T00:54:00.000","Title":"How does Worldviz Vizard compares to Panda3D and Pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is anybody familiar with Worldviz-Vizard's 3D engine for python? How does it compare to Panda3D? I have a feeling that it might be easier to learn but far more limited. They only support python 2.4 which also makes me not want to try it.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1459,"Q_Id":3877971,"Users Score":0,"Answer":"I only used Vizard, and that for one small project.\nIt was easy to use, well documented, and had a good set of examples.","Q_Score":1,"Tags":"python,pygame,3d-engine,panda3d","A_Id":4122231,"CreationDate":"2010-10-07T00:54:00.000","Title":"How does Worldviz Vizard compares to Panda3D and Pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm.","AnswerCount":5,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":515,"Q_Id":3878873,"Users Score":0,"Answer":"Opencv has functions named like \"cvHoughLines2\" to detect lines.","Q_Score":0,"Tags":"c#,c++,python,image,lua","A_Id":3895535,"CreationDate":"2010-10-07T05:13:00.000","Title":"transforming an image into an array of lines to draw","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm.","AnswerCount":5,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":515,"Q_Id":3878873,"Users Score":1,"Answer":"You are looking for a \"raster to vector\" algorithm. The term comes from early graphics display systems, that used a CRT (cathode ray tube) for the display itself. There were 2 approaches to displaying graphics: \"raster\" was the scan of a series of lines left to right, top to bottom, each line made up of on\/off pixels. The controller of the CRT's electron gun simply scanned the same pattern over and over, just varying the intensity of the electron beam. On a \"vector\" display, the electron gun could draw a straight line between any two points - no aliasing, no pixelation, just a pure straight line. Vector displays were capable of higher resolution, but were limited by the number of lines they could draw - if a drawing had too many lines, then the display would begin to flicker as the time it would take to redraw the picture (to refresh the phosphors of the CRT) would take longer than the persistence of the CRT's phosphor surface. Raster displays were simpler to control, had much less flicker, but lower resolution.","Q_Score":0,"Tags":"c#,c++,python,image,lua","A_Id":3880279,"CreationDate":"2010-10-07T05:13:00.000","Title":"transforming an image into an array of lines to draw","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm.","AnswerCount":5,"Available Count":4,"Score":0.0399786803,"is_accepted":false,"ViewCount":515,"Q_Id":3878873,"Users Score":1,"Answer":"In general, bitmaps are stored in sequential memory, ideal for 'blitting' to the display; your GUI framework of choice will have a function for drawing bitmaps, and this function will be very carefully optimised.\nOn the other hand, decomposing an image into lines - vectorizing the image - is the domain of specialist programs and ongoing research. In all cases, its going to be slower to computer and slower to draw than just blitting the bitmap.","Q_Score":0,"Tags":"c#,c++,python,image,lua","A_Id":3879121,"CreationDate":"2010-10-07T05:13:00.000","Title":"transforming an image into an array of lines to draw","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm.","AnswerCount":5,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":515,"Q_Id":3878873,"Users Score":0,"Answer":"How can you achieve with lines what you have to do with pixels? You need to draw each pixel individually I'd say.","Q_Score":0,"Tags":"c#,c++,python,image,lua","A_Id":3879102,"CreationDate":"2010-10-07T05:13:00.000","Title":"transforming an image into an array of lines to draw","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Due to refactoring\/reworking on a controller I've had to embed a Python Interpreter inside a C application. I can now call python functions and pass\/get Objects into Python fine.\nThe python code is a controller for a robot (currently simulated), this now needs make use of some C code for comparisons I'm making.\nPreviously the Python code created objects, read sensors, ran control code and wrote the outputs to motors. All of this except the control code now needs to be done in C. The problem I have is that Objects which are created in an init function (in python) which, when I come to run the control code no longer exist.\nWhat is the best way to solve this? My idea was to return the controllers from the init function and store references to them in the C, passing the reference to the controller each time it is called.\nThanks for any help.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":102,"Q_Id":3883724,"Users Score":1,"Answer":"This may not be the answer you want, but there are ways of working with C and Python other than embedding an interpreter inside a C application.\nNamely, why don't you do the opposite? Create C libraries for Python? You can control the general flow of your application in Python, which is much more comfortable, and call C code whenever you see fit.\nAgain, I'm not really addressing your actual question, so feel free to ignore me.","Q_Score":0,"Tags":"python,c,embedded-language","A_Id":3884055,"CreationDate":"2010-10-07T16:26:00.000","Title":"Maintaining a Python Object when embedding in C","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a programs that runs several threads (on a while loop until \nCtrl C is pressed). The app also has a GUI that I developed in PyQt. However, I am facing the following problem:\nIf I press Ctrl C on the console, and then close the GUI, the program exits fine. However, if I close the GUI first, the other threads won't stop and the program keeps running after Ctrl C. Anyone knows how I could address this problem?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":722,"Q_Id":3886500,"Users Score":0,"Answer":"In Qt you would overload the OnClose method for the widget\/frame or hook the lastwindowsdclosed signal to do whatever you need to shut down the app - don't know if it's diiferent from python","Q_Score":0,"Tags":"python,multithreading,pyqt,copy-paste","A_Id":3886510,"CreationDate":"2010-10-07T22:56:00.000","Title":"PyQT4 and Ctrl C","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for qrcode generator for python window version. Can anyone help me to find out. \nI didn't get anywhere. \nPlease help me.\nThanks,\nmanu","AnswerCount":5,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":8188,"Q_Id":3888125,"Users Score":0,"Answer":"pyqrnative is working pretty well for me. I wish I could find some documentation in English for it. Would like to know the relationship between data content size and the first \"typeNumber\" argument.","Q_Score":5,"Tags":"python,qr-code","A_Id":5047781,"CreationDate":"2010-10-08T06:17:00.000","Title":"qrcode generator using python for windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need a simple interpreter which will do execution (evaluation) of simple expressions\/statements and also call functions from main C++ applications. At the moment I do not need scripting of the application, but it may be useful later.\nIt should also be strait-forward for other team members to pull my application from Source Repository and to build it, without having to install additional application, libraries, etc.\nSearching reveled options like: Python (via Boost and \/ or Python API), Lua, Guile, TinyScheme.\nI am the closest to Python, but using Boost, building Python library, complicated task of interfacing main application with Python makes this choice an overkill, maybe I am wrong.\nThere should be a simple solution for this request, what are your experiences and suggestions?","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":739,"Q_Id":3896313,"Users Score":1,"Answer":"Guile is easy to embed and extend, and scheme if powerfull programming language.\nYou can compile libguile and add it to the repository in lib directory or add source for guile and compile it when user compile the project.\nBut I don't try to use guile on Windows.","Q_Score":3,"Tags":"c++,python,scripting,lua","A_Id":3897041,"CreationDate":"2010-10-09T16:04:00.000","Title":"Simple interpreter to embed and extend inside an C++ Windows application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I need a simple interpreter which will do execution (evaluation) of simple expressions\/statements and also call functions from main C++ applications. At the moment I do not need scripting of the application, but it may be useful later.\nIt should also be strait-forward for other team members to pull my application from Source Repository and to build it, without having to install additional application, libraries, etc.\nSearching reveled options like: Python (via Boost and \/ or Python API), Lua, Guile, TinyScheme.\nI am the closest to Python, but using Boost, building Python library, complicated task of interfacing main application with Python makes this choice an overkill, maybe I am wrong.\nThere should be a simple solution for this request, what are your experiences and suggestions?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":739,"Q_Id":3896313,"Users Score":4,"Answer":"Two great options you've already listed are Python and Lua. Here are some of the tradeoffs for your consideration:\nPython\n\nA much more complete and powerful language (IMHO!) with libraries for anything and tons of support and communities everywhere you look.\nSyntax is not entirely C-like\nAlthough Python wasn't designed specifically for embedding (it's much more often used as a standalone language extended by code in C\/C++), it's tot really hard to embed. The official docs contain some examples, and following Boost's examples shouldn't be much harder.\n\nLua\n\nDesigned from bottom up for embedding, so it should be the simplest one to embed. \nSyntax more C-like than Python's\n\nIf you foresee a definite future need for scripting, building in a scripting engine early is a good idea as it may open some interesting possibilities for you as you go on developing the program. Both options listed above are good ones, you should have no problems embedding any of them without much effort.","Q_Score":3,"Tags":"c++,python,scripting,lua","A_Id":3897270,"CreationDate":"2010-10-09T16:04:00.000","Title":"Simple interpreter to embed and extend inside an C++ Windows application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I need a simple interpreter which will do execution (evaluation) of simple expressions\/statements and also call functions from main C++ applications. At the moment I do not need scripting of the application, but it may be useful later.\nIt should also be strait-forward for other team members to pull my application from Source Repository and to build it, without having to install additional application, libraries, etc.\nSearching reveled options like: Python (via Boost and \/ or Python API), Lua, Guile, TinyScheme.\nI am the closest to Python, but using Boost, building Python library, complicated task of interfacing main application with Python makes this choice an overkill, maybe I am wrong.\nThere should be a simple solution for this request, what are your experiences and suggestions?","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":739,"Q_Id":3896313,"Users Score":2,"Answer":"No matter which scripting language you choose (and I would probably vote for Python), you might consider using SWIG (www.swig.org) to ease the burden of interfacing to C++. While normally used to build C++ extensions for python (or ruby, lua, guile, any many others), it can be used to aid in embedding too.\nYou had mentioned boost::python, which is certainly a full featured option, and allows for a somewhat closer Python\/C++ integration (especially where virtual functions are involved). However, in my experience, SWIG is a lot easier to integrate, works with scads of scripting languages, and for python, is natively supported by Python's distutils.","Q_Score":3,"Tags":"c++,python,scripting,lua","A_Id":3898118,"CreationDate":"2010-10-09T16:04:00.000","Title":"Simple interpreter to embed and extend inside an C++ Windows application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm writing a small app which has 2 separate frames.\nThe first frame is like a video player controller. It has Play\/Stop\/Pause buttons etc. It's named controller.py.\nThe second frame contains OpenGL rendering and many things inside it, but everything is wrapped inside a Frame() class as the above. It's named model.py.\nI'm up to the final part where I have to \"join\" these two together.\nDoes anyone know how to control a frame (model.py) from another frame (controller.py)?\nI would like to do something like a movie player when you clicks play it pops up a new window and play until the stop button is clicked. \nIf you know how, please let me know. (Just tell me in general no need to specific).","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":669,"Q_Id":3898988,"Users Score":1,"Answer":"I'd definitely use PubSub as it's probably the cleanest way I can think of to do it. You can also do it with wx.PostEvent or use a modal frame.","Q_Score":1,"Tags":"python,wxpython,frame,send","A_Id":3906746,"CreationDate":"2010-10-10T04:11:00.000","Title":"How to control a frame from another frame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am hoping to use PyQt to produce an application that will display an equation entered by the user. I had considered matplotlib, but this seems like overkill as I would only be using it to render the latex.\nI need to use SymPy anyway, so I was hoping there would be a way to use it to do the rendering also, preferably producing an SVG file for PyQt to use.\nI hope this makes sense - many thanks in advance for any help\/advice.\nBest wishes,\nGeddes","AnswerCount":2,"Available Count":1,"Score":0.4621171573,"is_accepted":false,"ViewCount":2067,"Q_Id":3902008,"Users Score":5,"Answer":"If you just need simple rendering using python, how about trying ipython 0.11 with qtconsole using sympy profile(ipython qtconsole --profile=sympy). It did implement matplotlib, but I consider it quite clean considering mathematical expressions can be rendered directly on the qtconsole. Need to install pyzmq module.","Q_Score":5,"Tags":"python,latex,pyqt,sympy","A_Id":6916267,"CreationDate":"2010-10-10T20:17:00.000","Title":"Is it possible for SymPy to render LaTeX for use in a GUI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a simple Python program with a (dynamic) form interface, but it needs to run on Google App Engine. I understand that IronPython lets one use Visual Studio's drag-and-drop interface builder and classes while programming with Python, but will this be compatible with Google App Engine?","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":651,"Q_Id":3908062,"Users Score":3,"Answer":"Google's Google App Engine can only run pure python code, and not even all Python is supported. No, you can't do things like IronPython.\nIf you want to use Python, I'd learn Django. If you want something closer to .NET, I'd go with Java.","Q_Score":3,"Tags":"python,user-interface,google-app-engine,ironpython","A_Id":3908074,"CreationDate":"2010-10-11T16:23:00.000","Title":"Can I use IronPython to develop GUIs for Google App Engine?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have a pygtk application and would like to provide a text-based fallback mode for it. When mporting gtk without a X display available I see only a GtkWarning on stderr but no exception I could take advantage of and checking for DISPLAY seems like an ugly hack. How can I implement this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":46,"Q_Id":3914370,"Users Score":0,"Answer":"Checking gtk.gdk.screen_get_default() does it, however there seems no way to suppress the GTK warnings.","Q_Score":1,"Tags":"python,pygtk","A_Id":3917071,"CreationDate":"2010-10-12T11:56:00.000","Title":"Implementing a text-based fallback for pygtk applications","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a problem with my python application, and I think it's related to the python garbage collection, even if I'm not sure...\nThe problem is that my application takes a lot of time to exit and to switch to one function to the next one.\nIn my application I handle very large dictionaries, containing thousands of large objects which are instantiated from wrapped C++ classes.\nI put some timestamp outputs in my program, and I saw that at the end of each function, when objects created inside the function should go out of scope, a lot of time is spent by the interpreter before calling the next function. And I observe the same problem at the end of the application, when the program should exit: a lot of time (~ hours!) is spent between the last timestamp on screen and the appearance of the fresh prompt.\nThe memory usage is stable, so I don't really have memory leaks.\nAny suggestions?\nCan be the garbage collection of thousands of large C++ objects that slow?\nIs there a method to speed up that?\nUPDATE:\nThanks a lot for all your answers, you gave me a lot of hints to debug my code :-)\nI use Python 2.6.5 on Scientific Linux 5, a customized distribution based on Red Hat Enterprise 5.\nAnd actually I'm not using SWIG to get Python bindings for our C++ code, but the Reflex\/PyROOT framework. I know, it's not very known outside particle physics (but still open source and freely available) and I have to use it because it's the default for our main framework.\nAnd in this context the DEL command from the Python side does not work, I had already tried it. DEL only deletes the python variable linked to the C++ object, not the object itself in memory, which is still owned by the C++ side...\n...I know, it's not-standard I guess, and a bit complicated, sorry :-P\nBut following your hints, I'll profile my code and I'll come back to you with more details, as you suggested.\nADDITIONAL UPDATE:\nOk, following your suggestions, I instrumented my code with cProfile, and I discovered that actually the gc.collect() function is the function taking the most of the running time!!\nHere the output from cProfile + pstats print_stats():\n\n\n >>> p.sort_stats(\"time\").print_stats(20)\nWed Oct 20 17:46:02 2010 mainProgram.profile\n\n 547303 function calls (542629 primitive calls) in 548.060 CPU seconds\n\n Ordered by: internal time\n List reduced from 727 to 20 due to restriction \n\n ncalls tottime percall cumtime percall filename:lineno(function)\n 4 345.701 86.425 345.704 86.426 {gc.collect}\n 1 167.115 167.115 200.946 200.946 PlotD3PD_v3.2.py:2041(PlotSamplesBranches)\n 28 12.817 0.458 13.345 0.477 PlotROOTUtils.py:205(SaveItems)\n 9900 10.425 0.001 10.426 0.001 PlotD3PD_v3.2.py:1973(HistoStyle)\n 6622 5.188 0.001 5.278 0.001 PlotROOTUtils.py:403(__init__)\n 57 0.625 0.011 0.625 0.011 {built-in method load}\n 103 0.625 0.006 0.792 0.008 dbutils.py:41(DeadlockWrap)\n 14 0.475 0.034 0.475 0.034 {method 'dump' of 'cPickle.Pickler' objects}\n 6622 0.453 0.000 5.908 0.001 PlotROOTUtils.py:421(CreateCanvas)\n 26455 0.434 0.000 0.508 0.000 \/opt\/root\/lib\/ROOT.py:215(__getattr__)\n[...]\n\n>>> p.sort_stats(\"cumulative\").print_stats(20)\nWed Oct 20 17:46:02 2010 mainProgram.profile\n\n 547303 function calls (542629 primitive calls) in 548.060 CPU seconds\n\n Ordered by: cumulative time\n List reduced from 727 to 20 due to restriction \n\n ncalls tottime percall cumtime percall filename:lineno(function)\n 1 0.001 0.001 548.068 548.068 PlotD3PD_v3.2.py:2492(main)\n 4 0.000 0.000 346.756 86.689 \/usr\/lib\/\/lib\/python2.5\/site-packages\/guppy\/heapy\/Use.py:171(heap)\n 4 0.005 0.001 346.752 86.688 \/usr\/lib\/\/lib\/python2.5\/site-packages\/guppy\/heapy\/View.py:344(heap)\n 1 0.002 0.002 346.147 346.147 PlotD3PD_v3.2.py:2537(LogAndFinalize)\n 4 345.701 86.425 345.704 86.426 {gc.collect}\n 1 167.115 167.115 200.946 200.946 PlotD3PD_v3.2.py:2041(PlotBranches)\n 28 12.817 0.458 13.345 0.477 PlotROOTUtils.py:205(SaveItems)\n 9900 10.425 0.001 10.426 0.001 PlotD3PD_v3.2.py:1973(HistoStyle)\n 13202 0.336 0.000 6.818 0.001 PlotROOTUtils.py:431(PlottingCanvases)\n 6622 0.453 0.000 5.908 0.001 \/root\/svn_co\/rbianchi\/SoftwareDevelopment\n\n[...]\n\n>>>\n\nSo, in both outputs, sorted by \"time\" and by \"cumulative\" time respectively, gc.collect() is the function consuming the most of the running time of my program! :-P\nAnd this is the output of the memory profiler Heapy, just before returning the main() program.\n\nmemory usage before return:\nPartition of a set of 65901 objects. Total size = 4765572 bytes.\n Index Count % Size % Cumulative % Kind (class \/ dict of class)\n 0 25437 39 1452444 30 1452444 30 str\n 1 6622 10 900592 19 2353036 49 dict of PlotROOTUtils.Canvas\n 2 109 0 567016 12 2920052 61 dict of module\n 3 7312 11 280644 6 3200696 67 tuple\n 4 6622 10 238392 5 3439088 72 0xa4ab74c\n 5 6622 10 185416 4 3624504 76 PlotROOTUtils.Canvas\n 6 2024 3 137632 3 3762136 79 types.CodeType\n 7 263 0 129080 3 3891216 82 dict (no owner)\n 8 254 0 119024 2 4010240 84 dict of type\n 9 254 0 109728 2 4119968 86 type\n Index Count % Size % Cumulative % Kind (class \/ dict of class)\n 10 1917 3 107352 2 4264012 88 function\n 11 3647 5 102116 2 4366128 90 ROOT.MethodProxy\n 12 148 0 80800 2 4446928 92 dict of class\n 13 1109 2 39924 1 4486852 93 __builtin__.wrapper_descriptor\n 14 239 0 23136 0 4509988 93 list\n 15 87 0 22968 0 4532956 94 dict of guppy.etc.Glue.Interface\n 16 644 1 20608 0 4553564 94 types.BuiltinFunctionType\n 17 495 1 19800 0 4573364 94 __builtin__.weakref\n 18 23 0 11960 0 4585324 95 dict of guppy.etc.Glue.Share\n 19 367 1 11744 0 4597068 95 __builtin__.method_descriptor\n\n\nAny idea why, or how to optimize the garbage collection?\nIs there any more detailed check I can do?","AnswerCount":3,"Available Count":1,"Score":-1.0,"is_accepted":false,"ViewCount":13216,"Q_Id":3916553,"Users Score":-5,"Answer":"If your problem really is the garbage collection, try explicitly freeing your objects when you're done with them using del().\nIn general, this doesn't sound like a garbage collection problem, unless we're talking about terabytes of memory.\nI agree with S.Lott... profile your app, then bring code snippets and the results of that back and we can be much more helpful.","Q_Score":18,"Tags":"python,garbage-collection,root,performance","A_Id":3919321,"CreationDate":"2010-10-12T15:50:00.000","Title":"Python garbage collection can be that slow?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am new to the world of PyQt.I am using PyQt designer for designing the UI and coding to provide functionality in it.But unfortunately I am getting confused to link with the UI.By importing the class we generally doing in examples.But when I try my own code its not happening.\nAny hints for how designer and other parts interacts will be super helpful.\nThanks in advance!","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":1463,"Q_Id":3949842,"Users Score":-1,"Answer":"winBase, winForm = uic.loadUiType(\"mainWindow.ui\") # this is the \n file created whith Qt Designer\nclass Window(winBase, winForm):\n def __init__(self, parent = None)\n super(winBase, self).__init__(parent)\n self.setupUi(self)","Q_Score":0,"Tags":"python,user-interface,pyqt4","A_Id":11305421,"CreationDate":"2010-10-16T17:01:00.000","Title":"PyQt GUI based CRUD application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget.\nI've tried somewidget[\"width\"], but it returns only a fixed value, and is not updated whenever the widget size changes (e.g. when the window is resized).","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":81835,"Q_Id":3950687,"Users Score":77,"Answer":"Use somewidget.winfo_width() and somewidget.winfo_height() to get the actual widget size, the somewidget['width'] property is only a hint given to the geometry manager.","Q_Score":62,"Tags":"python,tkinter","A_Id":3950766,"CreationDate":"2010-10-16T20:39:00.000","Title":"How to find out the current widget size in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget.\nI've tried somewidget[\"width\"], but it returns only a fixed value, and is not updated whenever the widget size changes (e.g. when the window is resized).","AnswerCount":3,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":81835,"Q_Id":3950687,"Users Score":82,"Answer":"somewidget.winfo_width() and somewidget.winfo_height() give 1. You need to update Tk (issue tk.update()) before getting these values.","Q_Score":62,"Tags":"python,tkinter","A_Id":49216638,"CreationDate":"2010-10-16T20:39:00.000","Title":"How to find out the current widget size in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget.\nI've tried somewidget[\"width\"], but it returns only a fixed value, and is not updated whenever the widget size changes (e.g. when the window is resized).","AnswerCount":3,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":81835,"Q_Id":3950687,"Users Score":13,"Answer":"You can use the function somewidget.winfo_reqheight() for height and somewidget.winfo_reqwidth() for width, but first don't forget to call the update function of the widget you want to know the dimension somewidget.update(). If you do not call the update function you will get the default value 1.","Q_Score":62,"Tags":"python,tkinter","A_Id":60086946,"CreationDate":"2010-10-16T20:39:00.000","Title":"How to find out the current widget size in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python dictionary stored in a file which I need to access from a c++ program. What is the best way of doing this?\nThanks","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":2650,"Q_Id":3966227,"Users Score":2,"Answer":"There are umpteen Python\/C++ bindings (including the one in Boost) but I suggest KISS: not a Python\/C++ binding but the principle \"Keep It Simple, Stupid\".\nUse a Python program to access the dictionary. :-)\nYou can access the Python program(s) from C++ by running them, or you can do more fancy things such as communicating between Python and C++ via sockets or e.g. Windows \"mailslots\" or even some more full-fledged interprocess communication scheme.\nCheers & hth.","Q_Score":0,"Tags":"c++,python,dictionary","A_Id":3966356,"CreationDate":"2010-10-19T07:47:00.000","Title":"Read python dictionary using c++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python dictionary stored in a file which I need to access from a c++ program. What is the best way of doing this?\nThanks","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2650,"Q_Id":3966227,"Users Score":0,"Answer":"I assume your Python dict is using simple data types and no objects (so strings\/numbers\/lists\/nested dicts), since you want to use it in C++.\nI would suggest using json library (http:\/\/docs.python.org\/library\/json.html) to deserialize it and then use a C++ equivalent to serialize it to a C++ object.","Q_Score":0,"Tags":"c++,python,dictionary","A_Id":3967560,"CreationDate":"2010-10-19T07:47:00.000","Title":"Read python dictionary using c++","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"how can I set width to a tk.Frame (post-initialization ?)\nIn other words, is there a member function to do it ? Sometheing like frame.setWidth()\nthanks","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4026,"Q_Id":3968275,"Users Score":3,"Answer":"frame.config(width=100)\nBe aware that if there are children in the frame that are managed by grid or pack, your changes may have no effect. There are solutions to this, but it is rarely needed. Generally speaking you should let widgets be their natural size. If you do need to resize a frame that is a container of other widgets you need to turn \"geometry propagation\" off.","Q_Score":3,"Tags":"python,tkinter","A_Id":3968351,"CreationDate":"2010-10-19T12:26:00.000","Title":"TKinter: how to change Frame width dynamically","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In which kind of application is Tkinter usually used?\nI'm doing a project in Python in which I'm using it for the first time to build a simple user interface.\nI was wondering if this is widely used for specific applications, or mobile applications.. etc","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":2320,"Q_Id":3970255,"Users Score":4,"Answer":"As far as I have seen, Tkinter is great for simple applications, teaching, or for when you don't need the features of a more comprehensive package like Qt or wxWidgets. These libraries can run several megabytes, and you may not need that. It's part of the standard library, so it's suited for this purpose. However, if you need more features, then Tkinter may not be the best choice.\nTkinter also used to look really ugly because it drew its own widgets on each platform; however, I think the version included with Python 2.7 uses native widgets now.\nI don't think there are any specific applications; it's a general purpose library.","Q_Score":6,"Tags":"python,tkinter","A_Id":3970297,"CreationDate":"2010-10-19T15:57:00.000","Title":"Is TkKinter widely used to build user interfaces?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In which kind of application is Tkinter usually used?\nI'm doing a project in Python in which I'm using it for the first time to build a simple user interface.\nI was wondering if this is widely used for specific applications, or mobile applications.. etc","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2320,"Q_Id":3970255,"Users Score":0,"Answer":"PyQt is a python binding of the popular Qt GUI toolkit. its very comprehensive.Anyway tkinter is good to start with and later you can move to PyQt or wxWidgets","Q_Score":6,"Tags":"python,tkinter","A_Id":3971297,"CreationDate":"2010-10-19T15:57:00.000","Title":"Is TkKinter widely used to build user interfaces?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using Qt 4.7 and PyQt 4.7 to build a multi-threaded GUI program. I've been carefully managing PyQt objects so that they stay in one UI thread to avoid synchronization issues and there is no problem in general.\nBut sometimes, at the moment the python garbage collector is activated from other thread, the destructor of Qt object is called right there and the following assertion fails from inside Qt.\nI can define QT_NO_DEBUG even for the debug version and it should be fine because objects being collected hardly cause a synchronization problem. But still, I don't think that's a good idea to turn off other debug messages. How do I prevent this from happening?\n\n#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD)\nvoid QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)\n{\n QThread *currentThread = QThread::currentThread();\n QThread *thr = receiver->thread();\n Q_ASSERT_X(currentThread == thr || !thr,\n \"QCoreApplication::sendEvent\",\n QString::fromLatin1(\"Cannot send events to objects owned by a different thread. \"\n \"Current thread %1. Receiver '%2' (of type '%3') was created in thread %4\")\n .arg(QString::number((quintptr) currentThread, 16))\n .arg(receiver->objectName())\n .arg(QLatin1String(receiver->metaObject()->className()))\n .arg(QString::number((quintptr) thr, 16))\n .toLocal8Bit().data());\n Q_UNUSED(currentThread);\n Q_UNUSED(thr);\n}\n#elif defined(Q_OS_SYMBIAN) && defined (QT_NO_DEBUG)","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1981,"Q_Id":3975343,"Users Score":1,"Answer":"I would recommend using pyqtSignal. You can create signals for your threads to send when their task is completed and the receiver becomes the signal's connected function.","Q_Score":5,"Tags":"python,multithreading,qt,garbage-collection,pyqt","A_Id":4130841,"CreationDate":"2010-10-20T06:44:00.000","Title":"How to prevent PyQt objects from garbage collecting from different thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have just made a small little app of a Python wxPython script with py2app. Everything worked as advertised, but the app is pretty big in size. Is there any way to optimize py2app to make the app smaller in size?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":2325,"Q_Id":3979658,"Users Score":1,"Answer":"py2app or any other such packager mostly bundles all dependencies and files together so that you could easily distribute them. The size is usually large as it bundles all dependencies , share libraries , packages along with your script file. In most cases, it will be difficult to reduce the size.\nHow ever, you can ensure the following so that there is lesser cruft in the bundled application.\n\nDo not use --no-strip option, this will ensure that debug symbols are stripped.\nUse \"--optimize 2 or -O2\" optimization option \nUse \"--strip (-S)\" option to strip debug and local symbols from output\nUse \"--debug-skip-macholib\", it will not make it truly stand alone but will reduce the size\nI am hoping that you have removed unnecessary files from wxPython like demo, doc etc.","Q_Score":1,"Tags":"python,optimization,wxpython,py2app","A_Id":3980702,"CreationDate":"2010-10-20T15:40:00.000","Title":"Slim down Python wxPython OS X app built with py2app?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Well i want to input a python function as an input in run time and execute that part of code 'n' no of times. For example using tkinter i create a textbox where the user writes the function and submits it , also mentioning how many times it wants to be executed. My program should be able to run that function as many times as mentioned by the user.\nPs: i did think of an alternative method where the user can write the program in a file and then i can simply execute it as python filename as a system cmd inside my python program , but i dont want it that way.","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":6779,"Q_Id":3981357,"Users Score":2,"Answer":"Python provides number of ways to do this using function calls:\n- eval()\n- exec()\nFor your needs you should read about exec.","Q_Score":1,"Tags":"python","A_Id":3981399,"CreationDate":"2010-10-20T19:02:00.000","Title":"how to input python code in run time and execute it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've got class A wrapped with method foo implemented using %extend:\nclass A {\n ...\n %extend {\n void foo()\n {\n self->foo_impl();\n }\n }\nNow I want to increase ref count to an A inside foo_impl, but I only got A* (as self). \nQuestion: how can I write\/wrap function foo, so that I have an access both to A* and underlying PyObject*?\nThank you","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":619,"Q_Id":4005355,"Users Score":1,"Answer":"I think it's not possible. If you need to increase the refcount, it's because you don't want the C++ object to be destroyed when it goes out of scope because there is a pointer to that object elsewhere. In that case, look at using the DISOWN typemap to ensure the target language doesn't think it \"owns\" the C++ object, so it won't get destroyed.","Q_Score":1,"Tags":"c++,python,swig","A_Id":4026127,"CreationDate":"2010-10-23T18:02:00.000","Title":"Python Swig wrapper: how access underlying PyObject","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Yes, that's what I need to achieve, don't ask why:)\nSo, since this is mainly OS dependent stuff I will be using Windows or Linux (whatever is simpler)\nEvery second my program will: \n1. do a screenshot, analyze the board and other stuff (this I can do)\n2. then move the mouse to some XY and do a left-click\nthat's all\nMy main concern is: is there any library for capturing screenshots and then left clicking somwhere on the screen?","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":784,"Q_Id":4007847,"Users Score":1,"Answer":"You can try to use Selenium RC + python driver for Selenium. There are means of making browser screenshot, and there is ClickAt method which takes coordinates.","Q_Score":2,"Tags":"python,click,screenshot","A_Id":4007877,"CreationDate":"2010-10-24T10:22:00.000","Title":"python program that plays flash games for me","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Yes, that's what I need to achieve, don't ask why:)\nSo, since this is mainly OS dependent stuff I will be using Windows or Linux (whatever is simpler)\nEvery second my program will: \n1. do a screenshot, analyze the board and other stuff (this I can do)\n2. then move the mouse to some XY and do a left-click\nthat's all\nMy main concern is: is there any library for capturing screenshots and then left clicking somwhere on the screen?","AnswerCount":3,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":784,"Q_Id":4007847,"Users Score":3,"Answer":"I've done this very thing before - use PIL to get the screenshots, and pywinauto to generate the mouse clicks.","Q_Score":2,"Tags":"python,click,screenshot","A_Id":4700444,"CreationDate":"2010-10-24T10:22:00.000","Title":"python program that plays flash games for me","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using \"tkFileDialog.askopenfilename\" to get a file name variable. I know that I can set the \"initialdir\" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dialog box they have open up. I'd like the user to be able to type something like \"\/h\/cowsandstuff\" and have it navigate to that directory instead of locking them in. I am programming in a Linux environment, BTW. The analogous function in Windows that I would like is the \"My Computer\" option in the drop down menu which would list all available drives...","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1219,"Q_Id":4017129,"Users Score":2,"Answer":"Linux doesn't have those drive letters C:, D:, etc. In linux all filesystems of different drives are mounted on separate folders in the same tree structure, so you only have a single tree.\nMost distros use \/media to mount pendrives etc, but hard drives can be configured to mount on any folder. So there's no such thing as \"drive letter\" in linux, your question doesn't apply.","Q_Score":0,"Tags":"python,linux,tkinter,option","A_Id":4018335,"CreationDate":"2010-10-25T17:19:00.000","Title":"tkFileDialog.askopenfilename How to specify a different drive?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using \"tkFileDialog.askopenfilename\" to get a file name variable. I know that I can set the \"initialdir\" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dialog box they have open up. I'd like the user to be able to type something like \"\/h\/cowsandstuff\" and have it navigate to that directory instead of locking them in. I am programming in a Linux environment, BTW. The analogous function in Windows that I would like is the \"My Computer\" option in the drop down menu which would list all available drives...","AnswerCount":3,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1219,"Q_Id":4017129,"Users Score":0,"Answer":"If you simply point to \"\/\" it contains all mounted devices...","Q_Score":0,"Tags":"python,linux,tkinter,option","A_Id":4028422,"CreationDate":"2010-10-25T17:19:00.000","Title":"tkFileDialog.askopenfilename How to specify a different drive?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using \"tkFileDialog.askopenfilename\" to get a file name variable. I know that I can set the \"initialdir\" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dialog box they have open up. I'd like the user to be able to type something like \"\/h\/cowsandstuff\" and have it navigate to that directory instead of locking them in. I am programming in a Linux environment, BTW. The analogous function in Windows that I would like is the \"My Computer\" option in the drop down menu which would list all available drives...","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":1219,"Q_Id":4017129,"Users Score":1,"Answer":"As nosklo sais, in Linux you don't have drive letters. Everything are paths.\nIf the file can be in any path, I would expect that the user will known the path, but I would consider the next options:\n\nDefault to the user's home path. You\ncan directly use the \u00b4~\u00b4and tk will\nconvert it to the Linux home folder\nor the Windows User\/My Documents path\nRemember the last path so you can use\nit in the future.","Q_Score":0,"Tags":"python,linux,tkinter,option","A_Id":4028563,"CreationDate":"2010-10-25T17:19:00.000","Title":"tkFileDialog.askopenfilename How to specify a different drive?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a camera that is taking pictures one by one (about 10 pictures per second) and sending them to PC. I need to show this incoming sequence of images as a live video in PC.\nIs it enough just to use some Python GUI framework, create a control that will hold a single image and just change the image in the control very fast?\nOr would that be just lame? Should I use some sort of video streaming library? If yes, what do you recommend?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":5351,"Q_Id":4019571,"Users Score":2,"Answer":"Or would that be just lame?\n\nNo. It wouldn't work at all.\nThere's a trick to getting video to work. Apple's QuickTime implements that trick. So does a bunch of Microsoft product. Plus some open source video playback tools.\nThere are several closely-related tricks, all of which are a huge pain in the neck.\n\nCompression. Full-sized video is Huge. Do the math 640x480x24-bit color at 30 frames per second. It adds up quickly. Without compression, you can't read it in fast enough.\nBuffering and Timing. Sometimes the data rates and frame rates don't align well. You need a buffer of ready-to-display frames and you need a deadly accurate clock to get them do display at exactly the right intervals.\n\nMaking a sequence of JPEG images into a movie is what iPhoto and iMovie are for.\nUsually, what we do is create the video file from the image and play the video file through a standard video player. Making a QuickTime movie or Flash movie from images isn't that hard. There are a lot of tools to help make movies from images. Almost any photo management solution can create a slide show and save it as a movie in some standard format.\nIndeed, I think that Graphic Converter can do this.","Q_Score":3,"Tags":"python,video,video-streaming","A_Id":4020278,"CreationDate":"2010-10-25T23:04:00.000","Title":"The simplest video streaming?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using .kml file which points to an overlay image (presumably in UTM projection?). \nThe KML file provides the latitudes and longitudes of the bounding box using the \"LatLonBox\" tag. \nI need to calculate the latitudes and longitudes of each pixel in this image. \nAre there any pre-existing libraries in Python that would do this for me?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":744,"Q_Id":4019611,"Users Score":0,"Answer":"The overlay image referenced by the kml file was in standard geographic projection.\nThis means that the latitudes and longitudes vary linearly within the image. \nCalculating the latitude and longitude of each pixel became a trivial case of interpolation given that we already known the lat\/lon bounds of the image provided by the LatLonBox tag attributes.","Q_Score":0,"Tags":"python,geospatial,kml,latitude-longitude","A_Id":4026507,"CreationDate":"2010-10-25T23:11:00.000","Title":"How can I calculate the latitude and longitude of each pixel of an image in a kml file using Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a QTableView which displays data from a QSqlTableModel. I want my model to check for changes when a user hits a \"refresh\" button but I can't find a way to update the data.\nI tried the reset() and update() methods on the model without any result.\nIs it possible to \"re-read\" from the database and update the model? How?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3260,"Q_Id":4022049,"Users Score":5,"Answer":"As you dont state what you canged in your model, ill assume the simplest form of change (changed data).\nFor me model.select() works to update the data in the model and force the View to update itself.","Q_Score":1,"Tags":"python,pyqt,qtableview","A_Id":4022111,"CreationDate":"2010-10-26T08:53:00.000","Title":"Force Update QTableView + QSqlTableModel in PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"My needs :\n\nI need to develop an GUI application that is cross platform\nthe chosen solution must be the fastest to implement\nit should be easy to extend\n\nThe application is just a database front-end, mainly for CRUD operations, listing, filtering, exporting, charts and graphs etc.\nAfter reading about some solutions (Python Card, PyGUI, DABO, pygtkhelpers, kiwi, pyjamas, pure-mvc, PyQt\/PySide, Wax, Tk-based frameworks, AVC, Fox etc.), I found myself interrested in two particular solutions, one of them is Camelot.\nBefore jumping into it, I would like to have some opinions about Camelot users vs skeptics. \nThanks for sharing :)","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":593,"Q_Id":4026026,"Users Score":0,"Answer":"In my opinion the best option for this would be to make a CGI program to run through a browser so that you do not have to worry about platform issues. Granted it might take a little bit more work, it may be better suited for cross platform deployment. :)","Q_Score":3,"Tags":"python,user-interface,sqlalchemy,cross-platform,python-elixir","A_Id":9863280,"CreationDate":"2010-10-26T17:02:00.000","Title":"Feedback for Camelot","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"My needs :\n\nI need to develop an GUI application that is cross platform\nthe chosen solution must be the fastest to implement\nit should be easy to extend\n\nThe application is just a database front-end, mainly for CRUD operations, listing, filtering, exporting, charts and graphs etc.\nAfter reading about some solutions (Python Card, PyGUI, DABO, pygtkhelpers, kiwi, pyjamas, pure-mvc, PyQt\/PySide, Wax, Tk-based frameworks, AVC, Fox etc.), I found myself interrested in two particular solutions, one of them is Camelot.\nBefore jumping into it, I would like to have some opinions about Camelot users vs skeptics. \nThanks for sharing :)","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":593,"Q_Id":4026026,"Users Score":1,"Answer":"Disclaimer: I am a Camelot committer.\nIf the question has been raised on the Programmers Stack Exchange, please link to it.\nThis question is kind of old, but for any reference, i'll chime in.\nCamelot was and is developed for exactly the reasons you stated. It has matured a lot since this questions was asked and is about feature complete. Latest efforts have been made to use Declarative instead of Elixir. Stability and speed are strongpoints as well.","Q_Score":3,"Tags":"python,user-interface,sqlalchemy,cross-platform,python-elixir","A_Id":14327581,"CreationDate":"2010-10-26T17:02:00.000","Title":"Feedback for Camelot","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Tkinter GUI where there is a Scale object. I have a callback assigned (by the command constructor parameter) to perform an action when the user changes the scale position. However, there is also a case where the value represented by the scale is modified externally, and so I set the scale position using Scale.set(). In this case, I want to set the scale, but not trigger the callback, since the rest of the program already knows about the change. However, I notice that the callback is indeed triggered by set().\nIs it possible to do one of:\n\nSet the scale value without triggering the callback.\nDifferentiate in the callback whether it was triggered by user interaction or by Scale.set() being called.\n\nThanks.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2247,"Q_Id":4038517,"Users Score":2,"Answer":"There is nothing specifically built-in to Tkinter to solve this. It's really a simple problem to solve though: remove the callback, set the value, add the callback. Or, set a global flag and check for that flag in the callback.\nThere are ways to solve the problem -- subclass the widget, for example -- but that doesn't really buy you anything. Just go with the simple solution and move on to more interesting problems.","Q_Score":4,"Tags":"python,tkinter","A_Id":4039444,"CreationDate":"2010-10-27T23:21:00.000","Title":"Tkinter: Set a 'scale' value without triggering callback?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a beginner in PyQt. I was trying to create a simple app to try some of the toolkit's many features. My question is, how can I hide the app icon from the taskbar? \nI don't want the user to be able to see the icon in taskbar and to minimize it using this icon. Is there any window flags that I can use to achieve this?","AnswerCount":6,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":7171,"Q_Id":4044994,"Users Score":0,"Answer":"Just initialise your main window like this self.setWindowFlags(Qt.ToolTip)","Q_Score":12,"Tags":"python,widget,pyqt4","A_Id":67350685,"CreationDate":"2010-10-28T16:24:00.000","Title":"Hide PyQt app from taskbar","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for a terminal UI library providing widgets like buttons, checkboxes and so on, that is compatible with python3.\nI've tried:\n\npycdk (pyrex does not work with python3, and porting it is a mess)\nurwid (does not work with python3, it has a port but not working well with new curses interface).\n\nDoes anyone know such a library?\nThanks!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":537,"Q_Id":4045189,"Users Score":2,"Answer":"Cython supports Python 3, and I was able to make Cython accept the pyx file by changing all __new__ to __cinit__. \nNote that the examples still needs some porting to Python 3 at that point. I get \"TypeError: expected bytes, str found\" when trying to run the examples. Switching all the strings to bytes worked.\nPossibly it would be better if the API accepted strings under Python 3 too, but that is definitely more work.","Q_Score":2,"Tags":"user-interface,python-3.x,widget,ncurses","A_Id":4993662,"CreationDate":"2010-10-28T16:48:00.000","Title":"Is there a terminal widget library compatible with Python 3?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running Python 3.1.2 with IDLE 3.1.2 on Windows 7. When I try to use the Stack Viewer, blue text and a new window briefly appear before all open IDLE windows exit (I don't have time to read the text or new window). This is the first time I have used Stack Viewer.\nIs this normal behavior? How can I get the Stack Viewer to stay open?\nThanks for your help,\nAlex","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":1247,"Q_Id":4046021,"Users Score":2,"Answer":"This IDLE bug (3 series only) was fixed 30Jan11. The fix is in 3.1.4 and 3.2.","Q_Score":0,"Tags":"python,windows,windows-7,python-3.x,python-idle","A_Id":8859539,"CreationDate":"2010-10-28T18:27:00.000","Title":"(Python, IDLE, Windows) Pressing Stack Viewer exits all IDLE windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running Python 3.1.2 with IDLE 3.1.2 on Windows 7. When I try to use the Stack Viewer, blue text and a new window briefly appear before all open IDLE windows exit (I don't have time to read the text or new window). This is the first time I have used Stack Viewer.\nIs this normal behavior? How can I get the Stack Viewer to stay open?\nThanks for your help,\nAlex","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1247,"Q_Id":4046021,"Users Score":0,"Answer":"I don't have Windows so I can't help you with hands-on experience, but I would do the following:\n\nsee what is the exact command that runs when you click on the menu item for Idle (I think you can right-click and see its properties, or at least you could on earlier versions of Windows)\nopen a command prompt, and run the command that opens Idle\nopen the stack viewer and then note the traceback that (should!) appear in the command prompt window\nreport said traceback here :)\n\nBTW, in my installation (neither Windows nor Python 3.x), an attempt to open the stack viewer without a traceback produces the following message box:\n\nTitle: No stack trace\nMessage: There is no stack trace yet.\n(sys.last_traceback is not defined)","Q_Score":0,"Tags":"python,windows,windows-7,python-3.x,python-idle","A_Id":4047313,"CreationDate":"2010-10-28T18:27:00.000","Title":"(Python, IDLE, Windows) Pressing Stack Viewer exits all IDLE windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"so I've got this little Text widget with a scroll bar and I've got a question. How do I make text in this Text widget a variable ? If I made this text a variable I would be able to open a text file and edit it's text or save the text I've written, etc or maybe it's a wrong way that I'm approaching this, is there a better way to do this ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1548,"Q_Id":4055017,"Users Score":5,"Answer":"There is no option to associate a variable with a text widget. You can achieve the same thing by using variable traces and widget bindings but it's rarely worth the effort.\nThe typical way to interact with the text widget is to read a file into a variable then use the insert method of the widget to put the text into the widget. Then, to save you just do the reverse -- get the text from the widget with the get method, and write the data to a file.\nOne tip: when you do a get, don't get the text from 1.0 to \"end\", use \"end-1c\" instead. If you specify \"end\" as the last character you'll get the implicit newline that tk always adds, meaning your text file will grow by one character each time you do a load\/save cycle.","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":4055447,"CreationDate":"2010-10-29T19:01:00.000","Title":"Text in Text Widget as a variable","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Any suggestions on how one might create event bindings that would allow a user to mouse drag a window without borders, eg. a window created with overridedirect(1)?\nUse case: We would like to create a floating toolbar\/palette window (without borders) that our users can drag around on their desktop.\nHere's where I'm at in my thinking (pseudo code):\n\nwindow.bind( '', onMouseDown ) to capture the initial position of the mouse.\nwindow.bind( '', onMouseMove ) to track position of mouse once it starts to move.\nCalculate how much mouse has moved and calculate newX, newY positions.\nUse window.geometry( '+%d+%d' % ( newX, newY ) ) to move window.\n\nDoes Tkinter expose enough functionality to allow me to implement the task at hand? Or are there easier\/higher-level ways to achieve what I want to do?","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":20122,"Q_Id":4055267,"Users Score":1,"Answer":"Try this, and it surely works;\n\nCreate an event function to move window:\ndef movewindow(event):\n root.geometry('+{0}+{1}'.format(event.x_root, event.y_root))\nBind window:\nroot.bind('', movewindow)\n\nNow you can touch the the window and drag","Q_Score":17,"Tags":"python,windows,user-interface,window,tkinter","A_Id":41426823,"CreationDate":"2010-10-29T19:35:00.000","Title":"Tkinter: Mouse drag a window without borders, eg. overridedirect(1)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are Tkinter StringVar (IntVar, FloatVar, etc) thread safe, eg. can a background thread read or write to these objects? Or must I use a Queue to pass information between my background thread and my main Tkinter GUI thread and have my main Tkinter thread pop the Queue and update the application's StringVar's accordingly?\nI know my application's background threads must not read or write a Tkinter widget directly but I'm unclear on whether StringVar's (or their ilk) are considered widgets or if they are objects far enough removed from widgets that they are thread safe for background threads to read and\/or write.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1582,"Q_Id":4058878,"Users Score":0,"Answer":"Definitely go the Queue route. Nothing in Tkinter is setup for being threadsafe :(","Q_Score":3,"Tags":"python,multithreading,user-interface,tkinter","A_Id":5036358,"CreationDate":"2010-10-30T13:26:00.000","Title":"Python\/Tkinter: Are Tkinter StringVar (IntVar, etc) thread safe?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup.\nI searched old posts on SO and found guys suggesting wxPython and py2exe. Apart from that few suggested IronPython since it is powered by .NET.\nI want to know whether IronPython is a pure variant of Python or a modified variant. Secondly, what is the actual use of Python? Is it for PHP like thing or like C# (you can either program Windows-based app. or Web.).","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1297,"Q_Id":4059201,"Users Score":6,"Answer":"IronPython isn't a variant of Python, it is Python. It's an implementation of the Python language based on the .NET framework. So, yes, it is pure Python.\nIronPython is caught up to CPython (the implementation you're probably used to) 2.6, so some of the features\/changes seen in Python 2.7 or 3.x will not be present in IronPython. Also, the standard library is a bit different (but what you lose is replaced by all that .NET has to offer).\nThe primary application of IronPython is to script .NET applications written in C# etc., but it can also be used as a standalone. IronPython can also be used to write web applications using the SilverLight framework.\nIf you need access to .NET features, use IronPython. If you're just trying to make a Windows executable, use py2exe.\nUpdate\nFor writing basic RDBMS apps, just use CPython (original Python), it's more extensible and faster. Then, you can use a number of tools to make it stand alone on a Windows PC. For now, though, just worry about learning Python (those skills will mostly carry over to IronPython if you choose to switch) and writing your application.","Q_Score":4,"Tags":"python,wxpython,ironpython","A_Id":4059227,"CreationDate":"2010-10-30T14:49:00.000","Title":"Is IronPython a 100% pure Python variant?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup.\nI searched old posts on SO and found guys suggesting wxPython and py2exe. Apart from that few suggested IronPython since it is powered by .NET.\nI want to know whether IronPython is a pure variant of Python or a modified variant. Secondly, what is the actual use of Python? Is it for PHP like thing or like C# (you can either program Windows-based app. or Web.).","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":1297,"Q_Id":4059201,"Users Score":1,"Answer":"IronPython is an implementation of Python using C#. It's just like the implementation of Python using Java by Jython. You might want to note that IronPython and Jython will always lag behind a little bit in development. However, you do get the benefit of having some libraries that's not available in the standard Python libraries. In IronPython, you will be able to get access to some of the .NET stuff, like System.Drawings and such, though by using these non-standard libraries, it will be harder to port your code to other platforms. For example, you will have to install mono to run apps written in IronPython on Linux (On windows you will need the .NET Framework)","Q_Score":4,"Tags":"python,wxpython,ironpython","A_Id":4059540,"CreationDate":"2010-10-30T14:49:00.000","Title":"Is IronPython a 100% pure Python variant?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup.\nI searched old posts on SO and found guys suggesting wxPython and py2exe. Apart from that few suggested IronPython since it is powered by .NET.\nI want to know whether IronPython is a pure variant of Python or a modified variant. Secondly, what is the actual use of Python? Is it for PHP like thing or like C# (you can either program Windows-based app. or Web.).","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":1297,"Q_Id":4059201,"Users Score":1,"Answer":"what does \"Pure Python\" mean? If you're talking about implemented in Python in the same sense that a module may be pure python, then no, and no Python implementation is. If you mean \"Compatible with cPython\" then yes, code written to cPython will work in IronPython, with a few caveats. The one that's likely to matter most is that the libraries are different, for instance code depending on ctypes or Tkinter won't work. Another difference is that IronPython lags behind cPython by a bit. the very latest version of this writing is 2.6.1, with an Alpha version supporting a few of the 2.7 language features available too.\nWhat do you really need? If you want to learn to program with python, and also want to produce code for windows, you can use IronPython for that, but you can also use cPython and py2exe; both will work equally well for this with only differences in the libraries.","Q_Score":4,"Tags":"python,wxpython,ironpython","A_Id":4059291,"CreationDate":"2010-10-30T14:49:00.000","Title":"Is IronPython a 100% pure Python variant?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm experimenting with PyQT, and I was trying to figure out how to get it to work with Firebird. I built the Firebird driver, but couldn't get it to work, so I was thinking maybe I wasn't putting it in the right place. So I tried experimenting with the SQLite driver, since PyQT came with it already installed, with working examples. I figured if I renamed all the qsqlite4.dll driver files I could find, eventually the example program would stop working when I renamed the one it was actually using. That didn't work. So I tried renaming the \"site-packages\\pyqt4\\plugins\\sqldrivers\" folder to \"site-packages\\pyqt4\\plugins\\sqldrivers-old\", and that did it. The example program stopped working. So I changed the folder name back, and tried renaming all the files in the folder. But the example program started working again. Then I moved the qsqlite4.dll file to a subdirectory, and it stopped working. So I moved it back, and renamed it to blah.blah.blah. And it worked again. Then I opened up blah.blah.blah with notepad++, and deleted some stuff at the top of the file, and that kept the example program from working. So I'm confused. As far as I can tell, either Python, PyQT, QT, or Windows Vista is finding the dll, no matter what I rename it to, as long as it's in the right folder. I even tried renaming it to the name of one of the other dll's, thinking maybe that would confuse it. But it only confused me. Is this normal?\nedit: I'm thinking this has something to do with plugins","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":284,"Q_Id":4068906,"Users Score":0,"Answer":"Yes, Qt plugin infrastructure is a fairly simple and robust one.\nIt attempts to load every file in sqldrivers directory. If it is successful, each dll then runs a function that registers all the features such a plugin supports.\nThen, you application initalizes. If all the features it needs are available, it works properly, otherwise, some form of error or exception handling occurs.","Q_Score":0,"Tags":"python,dll,windows-vista,qt4,pyqt4","A_Id":4453952,"CreationDate":"2010-11-01T12:37:00.000","Title":"Either Python, PyQT, QT, or Windows Vista is finding my dll, no matter what I rename it to. Is this normal?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently making a 2D side-scrolling run'n'jump platform game in PyGame. Most of the stuff is working OK and very well in fact - I am exploiting the fast pyGame Sprite objects & groups.\nWhat I'm interested to know is how people usually deal with Rects for scrolling games. I obviously have a level that is much bigger than visible area, and the player, enemies, bullets etc each have their own (x,y) coordinates which describe where they are in the level.\nBut now, since we use the \"spriteGroup.draw(surface)\" call, it will not display them in the right spot unless each objects Rects have been adjusted so that the right part displays on the screen. In other words, everytime a player\/enemy\/bullet\/whatever else is updated, the Camera information needs to be passed, so that their Rect can be updated.\nIs this the best method to use? It works but I don't really like passing the camera information to every single object at every update to offset the Rects.\nObviously the ideal method (I think) is to use Rects with \"real\" coordinates, blit everything to a buffer as big as the level, and then just blit the visible part to the screen, but in practice that slows the game down A LOT.\nAny comments\/insight would be appreciated.\nThanks","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1235,"Q_Id":4073928,"Users Score":0,"Answer":"You can have a 2 variables level_landlevel_d which see where you are in the level, Then check which sprites are in the visible area\nlevel_d+height and level_l+width,\n and draw them on the screen.","Q_Score":2,"Tags":"python,scroll,2d,pygame","A_Id":14293575,"CreationDate":"2010-11-01T23:21:00.000","Title":"Pygame: Updating Rects with scrolling levels","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently making a 2D side-scrolling run'n'jump platform game in PyGame. Most of the stuff is working OK and very well in fact - I am exploiting the fast pyGame Sprite objects & groups.\nWhat I'm interested to know is how people usually deal with Rects for scrolling games. I obviously have a level that is much bigger than visible area, and the player, enemies, bullets etc each have their own (x,y) coordinates which describe where they are in the level.\nBut now, since we use the \"spriteGroup.draw(surface)\" call, it will not display them in the right spot unless each objects Rects have been adjusted so that the right part displays on the screen. In other words, everytime a player\/enemy\/bullet\/whatever else is updated, the Camera information needs to be passed, so that their Rect can be updated.\nIs this the best method to use? It works but I don't really like passing the camera information to every single object at every update to offset the Rects.\nObviously the ideal method (I think) is to use Rects with \"real\" coordinates, blit everything to a buffer as big as the level, and then just blit the visible part to the screen, but in practice that slows the game down A LOT.\nAny comments\/insight would be appreciated.\nThanks","AnswerCount":5,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":1235,"Q_Id":4073928,"Users Score":0,"Answer":"One method I found is to keep track of a scrollx and a scrolly. Then, just add scrollx and scroll y to the coordinates when you move the rectangles.","Q_Score":2,"Tags":"python,scroll,2d,pygame","A_Id":14189213,"CreationDate":"2010-11-01T23:21:00.000","Title":"Pygame: Updating Rects with scrolling levels","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently making a 2D side-scrolling run'n'jump platform game in PyGame. Most of the stuff is working OK and very well in fact - I am exploiting the fast pyGame Sprite objects & groups.\nWhat I'm interested to know is how people usually deal with Rects for scrolling games. I obviously have a level that is much bigger than visible area, and the player, enemies, bullets etc each have their own (x,y) coordinates which describe where they are in the level.\nBut now, since we use the \"spriteGroup.draw(surface)\" call, it will not display them in the right spot unless each objects Rects have been adjusted so that the right part displays on the screen. In other words, everytime a player\/enemy\/bullet\/whatever else is updated, the Camera information needs to be passed, so that their Rect can be updated.\nIs this the best method to use? It works but I don't really like passing the camera information to every single object at every update to offset the Rects.\nObviously the ideal method (I think) is to use Rects with \"real\" coordinates, blit everything to a buffer as big as the level, and then just blit the visible part to the screen, but in practice that slows the game down A LOT.\nAny comments\/insight would be appreciated.\nThanks","AnswerCount":5,"Available Count":3,"Score":0.0399786803,"is_accepted":false,"ViewCount":1235,"Q_Id":4073928,"Users Score":1,"Answer":"You could extend de Sprite.Group so it recives the camera information.\nThen do one of these options:\nA. Override the update method so it updates the on-screen coordinates of every sprite.\nB. Override the draw method so it updates the on-screen coordinates of every sprite and then calls its parent draw method.\nI think A it's easier and cleaner.","Q_Score":2,"Tags":"python,scroll,2d,pygame","A_Id":4077600,"CreationDate":"2010-11-01T23:21:00.000","Title":"Pygame: Updating Rects with scrolling levels","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.)\nHow can I do this? I see that the winsound module is not available on Jython.\n(Note that I want to use the sound card, not the built-in beeper.)","AnswerCount":6,"Available Count":3,"Score":0.1325487884,"is_accepted":false,"ViewCount":2323,"Q_Id":4078734,"Users Score":4,"Answer":"If its Jython, then just use any of the Java classes that play sound. There are tons of them. \n\nfrom java import net\nfrom java.applet.Applet import newAudioClip\nfrom java import io\nurl = io.File(\"fileName\").toURL()\naudio = newAudioClip(url)\naudio.play()\n\n\nimport sun.audio\nimport java.io\ninputStream = java.io.FileInputStream(\"test.wav\")\naudioStream = sun.audio.AudioStream(inputStream)\nsun.audio.AudioPlayer.player.start(audioStream)","Q_Score":7,"Tags":"python,windows,audio,jython,sikuli","A_Id":4079110,"CreationDate":"2010-11-02T14:38:00.000","Title":"Jython: Making a simple beep on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.)\nHow can I do this? I see that the winsound module is not available on Jython.\n(Note that I want to use the sound card, not the built-in beeper.)","AnswerCount":6,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":2323,"Q_Id":4078734,"Users Score":0,"Answer":"Since you are using Sikuli you can to the following.\nAdd any mediafile such as any .mp3 on the desktop of a windows machine, asociate the file to a media player. Capture the image and include:\nclick(pattern(desktopnoiseicon.png)\nalternatley you could execute the same task with openApp(C:\\noise.mp3)\nSikuli gives the ability to find numerous workarounds\nin SikuluXrc2 you could even point to a URL from your code without the need of setting a bundle path","Q_Score":7,"Tags":"python,windows,audio,jython,sikuli","A_Id":4987576,"CreationDate":"2010-11-02T14:38:00.000","Title":"Jython: Making a simple beep on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.)\nHow can I do this? I see that the winsound module is not available on Jython.\n(Note that I want to use the sound card, not the built-in beeper.)","AnswerCount":6,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":2323,"Q_Id":4078734,"Users Score":2,"Answer":"You may do the fllowing using command line:\nExecute \"copy con beep.txt\"\ntype [ctrl+G] as input and then [ctrl+Z] followed by [Enter] to exit\nThen run\n\"type beep.txt\"\nand you will hear a beep.\nYou may place \"type beep.txt\" in a batch file or use Ctrl+G directly in batch (which would produce error in command line with sound)","Q_Score":7,"Tags":"python,windows,audio,jython,sikuli","A_Id":5165371,"CreationDate":"2010-11-02T14:38:00.000","Title":"Jython: Making a simple beep on Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a good wxpython GUI builder that does not require much coding, like in the case of the form builder in MS visual studio ?","AnswerCount":5,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":46286,"Q_Id":4079866,"Users Score":5,"Answer":"In addition to those, some people really like the XRCed application that's included with wxPython. Basically you create your GUI in XML. There's also the defunct Boa Constructor that I see people still using on the wxPython user's list.","Q_Score":29,"Tags":"python,wxpython,gui-builder","A_Id":4080817,"CreationDate":"2010-11-02T16:33:00.000","Title":"A good wxpython GUI builder?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a good wxpython GUI builder that does not require much coding, like in the case of the form builder in MS visual studio ?","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":46286,"Q_Id":4079866,"Users Score":0,"Answer":"You can use ezWxPython. it is not gui builder, but it helps you make layout easy same way as pySimpleGUI.","Q_Score":29,"Tags":"python,wxpython,gui-builder","A_Id":55686053,"CreationDate":"2010-11-02T16:33:00.000","Title":"A good wxpython GUI builder?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want basically to be able to use a Canvas as a meta container for other widgets. \nI want to divide my GUI into a left, center and middle section. Within each section I would like to be able to place widgets like: Checkbutton, Button, Label, etc. \nHow to place widgets in a Canvas widget?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4505,"Q_Id":4080413,"Users Score":6,"Answer":"Your choices depend on what you're really trying to accomplish. Why is using a canvas preferable to using a frame?\nYou can easily add widgets to a canvas just like you do any other container, using pack or grid or place. when you do this, the items will not scroll when you scroll the canvas because they aren't actually part of the canvas.\nThe other choice is to create window objects on the canvas. You do this with the create_window method of the canvas. The advantage is, this window becomes part of the canvas and will scroll along with any other objects on the canvas. The downside is, your only option is absolute placement and you have to explicitly control the size of the widgets.","Q_Score":4,"Tags":"python,python-3.x,widget,tkinter-canvas","A_Id":4080471,"CreationDate":"2010-11-02T17:30:00.000","Title":"How to place a widget in a Canvas widget in Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Problem: I have a gtk.Dialog. Whenever the 'minimize' button on the dialog is clicked, the window is destroyed.\nQuestion: How can I connect to the minimize button of a gtk.Dialog so that I can iconify the window?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":129,"Q_Id":4081020,"Users Score":0,"Answer":"Are you sure it's the minimize button? Because GTK doesn't deal with (or even know about the existence of) minimize buttons at all, they are part of the window manager.","Q_Score":0,"Tags":"python,user-interface,gtk,pygtk","A_Id":4085525,"CreationDate":"2010-11-02T18:40:00.000","Title":"Problems Connecting to Minimized Signal","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Does Tkinter provide a way to temporarily turn off screen updates (when performing a large amount of screen activity) and then turn on screen updates when the UI updates are complete? Many GUI frameworks have this feature. wxPython provides Freeze and Thaw methods for this functionality. The Windows Win32api supports this as well via LockWindowUpdate( hWnd | 0 ). Googling on \"tkinter freeze thaw\" and \"tkinter lockwindowupdate\" came up emtpy.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":968,"Q_Id":4088996,"Users Score":1,"Answer":"No, Tkinter has no such thing. However, the screen is only updated via the event loop, so if all of your \"large amount of screen activity\" is happening in a single method, none of the activity will show up until your method finishes and the event loop is re-entered (or you explicitly call .update_idletasks())","Q_Score":1,"Tags":"python,user-interface,tkinter,pywin32,win32ole","A_Id":4091168,"CreationDate":"2010-11-03T16:01:00.000","Title":"Python\/Tkinter: Turn on\/off screen updates like wxPython Freeze\/Thaw?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"im using wxpython 2.8 ansi with python 2.6 ,and richtext class seems to not exist as an error message prompts that wx module does not contain richtext attribute, i've searched the web but couldn't find a clear answer,therefore i come to you:)\nany thoughts?\nthanks in advance\nNataly","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":427,"Q_Id":4092333,"Users Score":1,"Answer":"You access the rich text control like this: import wx.richtext\nOr you pass the wx.TextCtrl the wx.TE_RICH or wx.TE_RICH2 flag. I've heard that the richtext widget isn't available on *nix though. Did you try the wxPython Demo? That's usually the best place to look to find out how to use a widget.","Q_Score":0,"Tags":"python,wxpython","A_Id":4101577,"CreationDate":"2010-11-03T22:46:00.000","Title":"Is wx.richtext supported in wxpython 2.8?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"im using wxpython 2.8 ansi with python 2.6 ,and richtext class seems to not exist as an error message prompts that wx module does not contain richtext attribute, i've searched the web but couldn't find a clear answer,therefore i come to you:)\nany thoughts?\nthanks in advance\nNataly","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":427,"Q_Id":4092333,"Users Score":1,"Answer":"I just downloaded and installed version 2.8.11-ansi. RichTextControl is the first demo listed, and works fine.\nIt sounds like there is something messed up with your installation.\nUnless you have to support windows 98\/ME, I don't know any good reason to prefer the ansi version over unicode.\nCan you provide the exact text of the error message, and a listing of your site-packages, and the contents of wx.pth","Q_Score":0,"Tags":"python,wxpython","A_Id":4093711,"CreationDate":"2010-11-03T22:46:00.000","Title":"Is wx.richtext supported in wxpython 2.8?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm creating a file dialog that allows the user to save a file after editing it in my app. I want to add a checkbox to the dialog so the user can make some choices about what format the file is saved in. I think I need to make some new class that inherits from FileDialog and inserts a checkbox into the frame created by the filedialog, but I don't really know how to do that. Can anyone help me out?\n(I also want to create an analogous file dialog for opening a file, but I assume that will just mean replacing the SAVE style with the OPEN style.)","AnswerCount":4,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":2300,"Q_Id":4093819,"Users Score":2,"Answer":"In wxWidgets 2.9 custom controls can be added to file dialogs using wxFileDialog::SetExtraControlCreator(). It's implemented for GTK, MSW and generic dialogs.\nAlternatively, you may use the wxFileCtrl class. It has native implementation only in wxGTK.\nI don't know if these features is available from Python wrappers, though.","Q_Score":2,"Tags":"wxpython,wxwidgets,openfiledialog,savefiledialog,filedialog","A_Id":5943314,"CreationDate":"2010-11-04T04:07:00.000","Title":"How do I add widgets to a file dialog in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm creating a file dialog that allows the user to save a file after editing it in my app. I want to add a checkbox to the dialog so the user can make some choices about what format the file is saved in. I think I need to make some new class that inherits from FileDialog and inserts a checkbox into the frame created by the filedialog, but I don't really know how to do that. Can anyone help me out?\n(I also want to create an analogous file dialog for opening a file, but I assume that will just mean replacing the SAVE style with the OPEN style.)","AnswerCount":4,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":2300,"Q_Id":4093819,"Users Score":2,"Answer":"I have to disagree with the sentiment that you should use standard dialogs only how they were designed.\nI take another view and would rather look at using subclassing the way that subclassing was intended. And to me, it is to add additional functionality\/specialization to a class.\nSo it is not changing the behavior of the standard dialog. It is creating a new dialog BASED ON the standard dialog with a little additional functionality.\nIn my case, I want to add two buttons to the wx.MultiChoiceDialog to provide a Select All and\/or Unselect All functions.","Q_Score":2,"Tags":"wxpython,wxwidgets,openfiledialog,savefiledialog,filedialog","A_Id":12428450,"CreationDate":"2010-11-04T04:07:00.000","Title":"How do I add widgets to a file dialog in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"there are some people? \ni have some question about wxpython ,\ncan i use panel without a frame?","AnswerCount":2,"Available Count":1,"Score":0.4621171573,"is_accepted":false,"ViewCount":588,"Q_Id":4096417,"Users Score":5,"Answer":"The simple answer is \"no\". The panel is not a TopLevelWindow. Top level windows are Frames and Windows. Panels typically go in Frames, although you can nest panels in panels or frames. Telling us what to do, as Ryan suggested, would be the best way to get a good answer though.","Q_Score":0,"Tags":"python,wxpython,wxwidgets","A_Id":4101554,"CreationDate":"2010-11-04T12:02:00.000","Title":"can i use panel without a frame in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am loading an IronPython script from a database and executing it. This works fine for simple scripts, but imports are a problem. How can I intercept these import calls and then load the appropriate scripts from the database?\nEDIT: My main application is written in C# and I'd like to intercept the calls on the C# side without editing the Python scripts.\nEDIT: From the research I've done, it looks like creating your own PlatformAdaptationLayer is the way you're supposed to to implement this, but it doesn't work in this case. I've created my own PAL and in my testing, my FileExsists method gets called for every import in the script. But for some reason it never calls any overload of the OpenInputFileStream method. Digging through the IronPython source, once FileExists returns true, it tries to locate the file itself on the path. So this looks like a dead end.","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":2738,"Q_Id":4105804,"Users Score":1,"Answer":"You can re-direct all I\/O to the database using the PlatformAdaptationLayer. To do this you'll need to implement a ScriptHost which provides the PAL. Then when you create the ScriptRuntime you set the HostType to your host type and it'll be used for the runtime. On the PAL you then override OpenInputFileStream and return a stream object which has the content from the database (you could just use a MemoryStream here after reading from the DB). \nIf you want to still provide access to file I\/O you can always fall back to FileStream's for \"files\" you can't find.","Q_Score":9,"Tags":"import,ironpython","A_Id":4111764,"CreationDate":"2010-11-05T12:25:00.000","Title":"Custom IronPython import resolution","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for suggestions on how one might implement a toolbar that provides edit cut, copy, paste commands using the Tkinter framework. I understand how to build a toolbar and bind the toolbar commands, but I'm confused over how the toolbar button bound commands will know which widget to apply the cut, copy, or paste action because the widget with edit activity will lose focus when the toolbar button is clicked. My first thought was to have each widget with potential edit activity set a global variable when the widget gains focus and have other widgets (without edit activity, eg. buttons, sliders, checkbox\/radiobox, etc) clear this global variable. But this sounds complicated to maintain unless I build a framework of widgets that inherit this behavior.\nIs there a simpler way to go about this or am I on the right track?","AnswerCount":2,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":1053,"Q_Id":4111049,"Users Score":2,"Answer":"You don't have to maintain a big framework, you can create a single binding on the root widget for and put all the logic in that binding. Or, use focus_class and bind to the class all. \nBinding on the root will only affect children of the root, binding to all will affect all widgets in the entire app. That only matters if you have more than one toplevel widget.","Q_Score":0,"Tags":"python,tkinter,clipboard,toolbar","A_Id":4111218,"CreationDate":"2010-11-05T23:48:00.000","Title":"Python\/Tkinter: Building a toolbar that provides edit cut, copy, paste commands","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for suggestions on how one might implement a toolbar that provides edit cut, copy, paste commands using the Tkinter framework. I understand how to build a toolbar and bind the toolbar commands, but I'm confused over how the toolbar button bound commands will know which widget to apply the cut, copy, or paste action because the widget with edit activity will lose focus when the toolbar button is clicked. My first thought was to have each widget with potential edit activity set a global variable when the widget gains focus and have other widgets (without edit activity, eg. buttons, sliders, checkbox\/radiobox, etc) clear this global variable. But this sounds complicated to maintain unless I build a framework of widgets that inherit this behavior.\nIs there a simpler way to go about this or am I on the right track?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1053,"Q_Id":4111049,"Users Score":1,"Answer":"You can tell the toolbar buttons to not take the focus; it's a configuration option and no UI guidelines I've ever seen have had toolbar buttons with focus. (Instead, the functionality is always available through some other keyboard-activatable mechanism, e.g., a hotkey combo.)","Q_Score":0,"Tags":"python,tkinter,clipboard,toolbar","A_Id":4111334,"CreationDate":"2010-11-05T23:48:00.000","Title":"Python\/Tkinter: Building a toolbar that provides edit cut, copy, paste commands","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a complicated algorithm that updates 3 histograms that are stored in arrays. I want to debug my algorithm, so I was thinking of showing the arrays as histograms in a user interface. What is the easiest way to do this. (Rapid application development is more important than optimized code.)\nI have some experience with Qt (in C++) and some experience with matplotlib.\n(I'm going to leave this question open for a day or two because it's hard for me to evaluate the solutions without a lot more experience that I don't have. Hopefully, the community's votes will help choose the best answer.)","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":37324,"Q_Id":4129697,"Users Score":1,"Answer":"I recommend using matplotlib in interactive mode, if you call .show once then it will pop up in its own window, if you don't then it exists only in memory and can be written to a file when you're done with it.","Q_Score":20,"Tags":"python,matplotlib,pyqt,vispy","A_Id":4129787,"CreationDate":"2010-11-09T01:28:00.000","Title":"How do I display real-time graphs in a simple UI for a python program?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm studying the Tkinter Listbox widget and have been unable to find solutions for the following functionality:\n\nHow can I create non-selectable horizontal separator items, eg. separators equivalent to the Tkinter Menu widget's .add_separator()? (Using chars like dashes and underscores looks awful).\n\nHow can I disable a specific item? I tried using .itemconfig( index, state='disabled' ) without success.\n\nHow can I enable keyboard navigation, eg. when a user's keyboard input automatically scrolls one forward to the closest item that begins with the text the user typed? Must I bind(, ...) and manage this behavior myself?\n\nWould some of the above functionality be easier to implement using a Text widget or the ttk.Treeview widget?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2343,"Q_Id":4140396,"Users Score":5,"Answer":"you cannot. The widget doesn't support that.\nyou can't disable certain items, the widget doesn't support a state attribute. That being said, you can monitor the selection and do the appropriate thing if the user selects something that is disabled, and use the item foreground to denote disabled-ness.\nYou will need to bind to keypress events and manage the behavior yourself. It's not particularly difficult, just a little tedious.\nthe text widget might be your best bet, though you'll have to add bindings to mimic the default bindings of the listbox. \n\nBottom line: Tkinter provides nothing that directly supports what you want to do, but the building blocks are all there. You'll just have to build it yourself.","Q_Score":4,"Tags":"python,user-interface,listbox,tkinter,ttk","A_Id":4141054,"CreationDate":"2010-11-10T01:15:00.000","Title":"Tkinter: Listbox separators, disabled items, keyboard navigation?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects.\nMy question is: what building mechanism can I use to manage dependencies and build these projects?\nI have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python.\nI develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.","AnswerCount":5,"Available Count":4,"Score":0.1586485043,"is_accepted":false,"ViewCount":2318,"Q_Id":4141511,"Users Score":4,"Answer":"I tried to do a Java \/ C++ \/ C++ To Java swig \/ (+ Protocol buffers) project in CMAKE and it was horrible! In such a case the problem with Cmake is, that the scripting language is extremely limited. I switched to Scons and everything got much easier.","Q_Score":6,"Tags":"java,c++,python,scons,gyp","A_Id":7201456,"CreationDate":"2010-11-10T05:32:00.000","Title":"What are the SCons alternatives?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects.\nMy question is: what building mechanism can I use to manage dependencies and build these projects?\nI have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python.\nI develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.","AnswerCount":5,"Available Count":4,"Score":0.0399786803,"is_accepted":false,"ViewCount":2318,"Q_Id":4141511,"Users Score":1,"Answer":"For Java and C++ projects you can take a look into Maven + Maven-nar-plugin but for Python i really don't know the best. May be other tools like CMake would fit better.","Q_Score":6,"Tags":"java,c++,python,scons,gyp","A_Id":4142509,"CreationDate":"2010-11-10T05:32:00.000","Title":"What are the SCons alternatives?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects.\nMy question is: what building mechanism can I use to manage dependencies and build these projects?\nI have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python.\nI develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.","AnswerCount":5,"Available Count":4,"Score":1.0,"is_accepted":false,"ViewCount":2318,"Q_Id":4141511,"Users Score":9,"Answer":"CMake\nI use and prefer it for my projects.\nThere's also Rake (comes with Ruby, but can be used for anything), which I regard rather highly.","Q_Score":6,"Tags":"java,c++,python,scons,gyp","A_Id":4141589,"CreationDate":"2010-11-10T05:32:00.000","Title":"What are the SCons alternatives?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects.\nMy question is: what building mechanism can I use to manage dependencies and build these projects?\nI have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python.\nI develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.","AnswerCount":5,"Available Count":4,"Score":0.0399786803,"is_accepted":false,"ViewCount":2318,"Q_Id":4141511,"Users Score":1,"Answer":"In Java world ant is \"lingua franca\" for build systems.\nAnt supports a C++ task via ant-contrib - so you can compile your C++ code.\nWith Ant's exec task you can still run swig on C++ code in order to get the wrappers.\nThen standard tasks as javac\/jar can be used for java application build.","Q_Score":6,"Tags":"java,c++,python,scons,gyp","A_Id":4143403,"CreationDate":"2010-11-10T05:32:00.000","Title":"What are the SCons alternatives?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'd like to develop a small\/medium-size cross-platform application (including GUI).\nMy background: mostly web applications with MVC architectures, both Python (Pylons + SqlAlchemy) and Java (know the language well, but don't like it that much). I also know some C#. So far, I have no GUI programming experience (neither Windows Forms, Swing nor QT).\nI plan to use SQLite for data storage: It seems to be a nice cross-platform solution and has some powerful features (e.g. full text search, which SQL Server Compact lacks).\nI have done some research and these are my favorite options:\n\n\n1) QT, Python (PyQT or PySide), and SQLAlchemy\npros:\n\nPython the language\nopen source is strong in the Python world (lots of libraries and users)\nSQLAlchemy: A fantastic way to interact with a DB and incredibly well documented!\n\ncons:\n\ncompilation, distribution and deployment more difficult?\nno QT experience\nQT Designer not as nice as the Visual Studio Winforms designer\n\n\n\n2) .NET\/Mono, Windows Forms, C#, (Fluent) NHibernate, System.Data.SQLite\npros:\n\nC# (I like it, especially compared to Java and would like to get more experience in it)\nThe Winforms GUI designer in Visual Studio seems really slick\nIntelliSense\nClickOnce Deployment(?)\nWindows Forms look and feel good on Windows\n\ncons:\n\n(Fluent) NHibernate far less documented than SQLAlchemy; also annoying: Fluent docs refer to NHibernate docs which refer to Hibernate (aargh!). But plain NHibernate + XML does not look very comfortable.\nWindows Forms will not look + behave native on Linux\/Mac OS (correct?)\nfewer open source libraries in the .NET world, fewer OSS users, less documentation in general\nno WinForms and NHibernate experience\n\n\n\n3) JVM, Java + Jython, Swing, SQLAlchemy\n(I'm emotionally biased against this one, but listed for completeness sake)\npros:\n\nJVM\/Swing work well as cross-platform basis\nJython\nSQLAlchemy\nlots of open source libraries\n\ncons:\n\nSwing seems ugly and difficult to layout\nlacks a good GUI designer\nGuessing that I won't be able to avoid Java for UI stuff\nNot sure how stable the Jython\/Java integration is\n\n(Options that I have ruled out... just to avoid discussion on these):\n- wxWidgets\/wxPython (now that QT is LGPLed)\n- GTK\/PyGTK\nThe look and feel of the final application is very important to me. The above technology stacks are very different (PyQT, .NET WinForms, JVM Swing) and require some time to get proficient, so:\nWhich alternative would you recommend and why?","AnswerCount":1,"Available Count":1,"Score":0.761594156,"is_accepted":false,"ViewCount":3111,"Q_Id":4145350,"Users Score":5,"Answer":"I'm a Python guy and use PyQt myself, and I can wholly recommend it. Concerning your cons:\n\ncompilation, distribution and deployment more difficult?\n\nNo, not really. For many projects, a full setup.py for e.g. cx_Freeze can be less than 30 lines that rarely need to change (most import dependencies are detected automatically, only need to specify the few modules that are not recognized), and then python setup.py will build a standalone executable. Then you can distribute it just like e.g. a C++ .exe.\n\nno QT experience\n\nI didn't have notable GUI experience either when I started out with Qt (only a bit of fiddling with Tkinter), but I grew to love Qt. Most of the time, all widgets work seamlessly and do what they're supposed to do - and there's a lot of them for many purposes. You name it, there's probably a widget that does it, and doesn't annoy the user by being half-assed. All the nice things we've been spoiled with are there.\nQt is huge, but the PyQt documentation answer most question with reasonable search effort. And if all else fails and you know a bit of C++, you can also look at Qt resources.\n\nQT Designer not as nice as the Visual Studio Winforms designer \n\nI don't know the VS Winforms designer, but I must admit that the Qt Designer is lacking. I ended up making a sketch of the UI in the designer, generating the code, cleaning that up and taking care all remaining details by hand. It works out okay so far, but my projects are rather small.\n\nPS:\n\n(now that QT is LGPLed)\n\nPyQt is still GPL only. PySide is LGPL, yes, but it's not that mature, if that's a concern. The project website states that \"starting development on PySide should be pretty safe now\" though.","Q_Score":11,"Tags":"c#,java,python,user-interface,cross-platform","A_Id":4145581,"CreationDate":"2010-11-10T14:11:00.000","Title":"Python + QT, Windows Forms or Swing for a cross-platform application?","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to add undo and redo capabilities in Tkinter Entry widgets or must I use single line Text widgets for this type of functionality? \nIf the latter, are there any tips I should follow when configuring a Text widget to act as an Entry widget? \nSome features that might need tweaking include trapping the Return KeyPress, converting tab keypresses into a request to change focus, and removing newlines from text being pasted from the clipboard.","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":4108,"Q_Id":4146971,"Users Score":1,"Answer":"Update on using this method for Undo\/Redo:\nI am creating a GUI with lot of frames and each contains at least ten or more 'entry' widgets. \nI used the History class and created one history object for each entry field that I had. I was able to store all entry widgets values in a list as done here. \nI am using 'trace' method attached to each entry widget which will call 'add' function of History class and store each changes. In this way, I was able to do it without running any thread separately. \nBut the biggest drawback of doing this is, we cannot do multiple undos\/redos with this method.\nIssue: \nWhen I trace each and every change of the entry widget and add that to the list, it also 'traces' the change that happens when we 'undo\/redo' which means we cannot go more one step back. once u do a undo, it is a change that will be traced and hence the 'undo' value will be added to the list at the end. Hence this is not the right method.\nSolution:\nPerfect way to do this is by creating two stacks for each entry widget. One for 'Undo' and one for 'redo'. When ever there is a change in entry, push that value into the undo stack. When user presses undo, pop the last stored value from the undo stack and importantly push this one to the 'redo stack'. hence, when the user presses redo, pop the last value from redo stack.","Q_Score":4,"Tags":"python,user-interface,text,tkinter,tkinter-entry","A_Id":32384249,"CreationDate":"2010-11-10T17:03:00.000","Title":"Undo and Redo in an Tkinter Entry widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a project involving puzzles made out of user-supplied images. I have been very hard-pressed to find a library that will serve my purposes. I would like to write the program in either Python or C++. I have been considering using Qt (or PyQt) to do it, so if you know of a library that will work with Qt it would be nice, though at this point anything would be nice.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":174,"Q_Id":4151746,"Users Score":2,"Answer":"You can't expect to find a library for any specific task. In this case, you need image-processing library, which is able to:\n\ndraw image region with transparent background. You have piece configuration, use it as a mask to cut out edges.\nsave drawn image to some format.\n\nQt graphics is totally able to do all that.","Q_Score":1,"Tags":"c++,python,qt,image-processing,pyqt","A_Id":4154281,"CreationDate":"2010-11-11T05:57:00.000","Title":"Anyone know of a C++ or Python library that will divide an image into pieces of arbitrary shape?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am wondering, is it possible to display images in python?","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":12412,"Q_Id":4160082,"Users Score":0,"Answer":"The easiest way is to use a web server I reckon. You can script a nice, simple server with bottle and turn out a UI with images.\nIt depends what you want to do. Python can do it all, but needs something to work with. There's pygame and stuff like that if you're just starting out.","Q_Score":3,"Tags":"python,image","A_Id":14884366,"CreationDate":"2010-11-11T22:54:00.000","Title":"How do you show a picture in python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am wondering, is it possible to display images in python?","AnswerCount":6,"Available Count":4,"Score":0.0333209931,"is_accepted":false,"ViewCount":12412,"Q_Id":4160082,"Users Score":1,"Answer":"The question needs more clearing up. \nDo you want to put the picture on a system display?\nOr on a window in a desktop app?\nOr render it to a http response?\nPython can do all these things in different manners, but for people to explain it - you need to specify your question a bit more.","Q_Score":3,"Tags":"python,image","A_Id":4160323,"CreationDate":"2010-11-11T22:54:00.000","Title":"How do you show a picture in python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am wondering, is it possible to display images in python?","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":12412,"Q_Id":4160082,"Users Score":0,"Answer":"The various OpenCV bindings for Python also provide ways to display images (and videos). Might be a bit heavy if you just want to display an image.","Q_Score":3,"Tags":"python,image","A_Id":4160130,"CreationDate":"2010-11-11T22:54:00.000","Title":"How do you show a picture in python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am wondering, is it possible to display images in python?","AnswerCount":6,"Available Count":4,"Score":0.1651404129,"is_accepted":false,"ViewCount":12412,"Q_Id":4160082,"Users Score":5,"Answer":"Almost all GUI toolkits (wxWindows, pyQt, pyGTK, Tkinter) have Canvas or other-type widgets that allow you to draw an image.\nThe standard library way to draw an image is to use Tkinter's Canvas widget.","Q_Score":3,"Tags":"python,image","A_Id":4160121,"CreationDate":"2010-11-11T22:54:00.000","Title":"How do you show a picture in python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Does Tkinter or underlying Tk framework support the ability to apply the equivalent of the attributes() method to Frames vs. Windows?\nSpecifically: I have forms with a message area that I would like to fade away in jquery-like manner, eg. display a non-modal status message that fades away. I know I can fade a Tkinter window via window.attributes(\"-alpha\", alpha), but I don't see an equivalent way to achieve this effect with a Frame. (I know I could place a top-level message window over my dialog, but coordinating the position and size of this window to match the layout of my dialog sounds complicated).","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":502,"Q_Id":4164962,"Users Score":0,"Answer":"No, there is no way to do what you want. Tkinter only supports transparency on top-level windows.","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":7360992,"CreationDate":"2010-11-12T13:13:00.000","Title":"Python\/Tkinter: Apply .attributes() method to Frame vs. Window?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How would I get a handle to the active gtk.Window in python? (not a window I created, but the currently focused window).","AnswerCount":2,"Available Count":1,"Score":0.4621171573,"is_accepted":false,"ViewCount":5129,"Q_Id":4166169,"Users Score":5,"Answer":"The answer is actually not OS-specific -- you can do it within GTK. You can get a list of all the toplevel windows from the application using gtk.window_list_toplevels(), then iterate through it until you find one where window.is_active() returns True.\nIf you want to consider other windows than the ones from your application, then you could try gtk.gdk.screen_get_default().get_toplevel_windows() but this will only get you GDK windows and not GTK windows, because you have no way of knowing whether those GDK windows are actually associated with GTK windows.","Q_Score":3,"Tags":"python,gtk","A_Id":4169956,"CreationDate":"2010-11-12T15:31:00.000","Title":"Get active gtk window in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to create application in windows. i need to use databases which would be preferable best for pyqt application\nlike\nsqlalchemy\nmysql\netc.","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":535,"Q_Id":4168020,"Users Score":0,"Answer":"i guess its totally upto you ..but as far as i am concerned i personlly use sqlite, becoz it is easy to use and amazingly simple syntax whereas for MYSQL u can use it for complex apps and has options for performance tuning. but in end its totally upto u and wt your app requires","Q_Score":0,"Tags":"python,database,pyqt","A_Id":4208750,"CreationDate":"2010-11-12T18:49:00.000","Title":"which databases can be used better for pyqt application","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to create application in windows. i need to use databases which would be preferable best for pyqt application\nlike\nsqlalchemy\nmysql\netc.","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":535,"Q_Id":4168020,"Users Score":1,"Answer":"SQlite is fine for a single user. \nIf you are going over a network to talk to a central database, then you need a database woith a decent Python lirary. \nTake a serious look at MySQL if you need\/want SQL. \nOtherwise, there is CouchDB in the Not SQL camp, which is great if you are storing documents, and can express searches as Map\/reduce functions. Poor for adhoc queries.","Q_Score":0,"Tags":"python,database,pyqt","A_Id":4294636,"CreationDate":"2010-11-12T18:49:00.000","Title":"which databases can be used better for pyqt application","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to create application in windows. i need to use databases which would be preferable best for pyqt application\nlike\nsqlalchemy\nmysql\netc.","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":535,"Q_Id":4168020,"Users Score":1,"Answer":"If you want a relational database I'd recommend you to use SQLAlchemy, as you then get a choice as well as an ORM. Bu default go with SQLite, as per other recommendations here.\nIf you don't need a relational database, take a look at ZODB. It's an awesome Python-only object-oriented database.","Q_Score":0,"Tags":"python,database,pyqt","A_Id":4512428,"CreationDate":"2010-11-12T18:49:00.000","Title":"which databases can be used better for pyqt application","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've done a few searches but I couldn't find anything about this topic. Perhaps because it is common programmer knowledge (I'm not a programmer, I've learned from necessity), or because I'm going about it the wrong way. \nI would like ideas\/suggestions on how to manage button states for a GUI. For example, if I have a program which allows the user to import and process data, then certain functions should be inaccessible until the data has been imported successfully, or if they want to graph certain data, they need to select which data to graph before hitting the 'graph' or 'export' button. Even in the simple programs I've built these relationships seems to get complicated quickly. It seems simple to say \"User shouldn't be able to hit button 'A' until 'B' and 'C' have been completed, then 'A' should be disabled if button 'D' or the 'Cancel' button. But that's a lot to track for one button. Thus far, I've tried two things:\n\nChanging\/Checking button states in the callback functions for the button. So in the above example, I would have code in buttons B's and C's callback to check if A should be enabled. And in buttons D's and Cancel's callbacks I would have code to disable button A. This gets complicated quickly and is difficult to maintain as code changes.\nSetting boolean variables in every buttons callback (or just checking the states later using cget()) and checking the variables in a polling function to determine which buttons should be enabled or disabled.\n\nI'm just not sure about this. I would like to make code as short and easy to understand as possible (and easy to edit later), but I don't like the idea of polling all the button states every few hundred milliseconds just for button 'management'. You can extend the same idea to check boxes, menu items, etc... but I'd like to here what others have done and why they do it the way they do.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":851,"Q_Id":4172426,"Users Score":1,"Answer":"You are only changing button states based on events, right? There is no reason to 'poll' to see if a button state has changed. What you can do is build a function which does all of the calling for you, then call it with something like disable_buttons([okButton, graphButton, printButton]). When an event takes place that modifies the appropriate user interface options (such as importing data), have another function that turns them on: enable_buttons([graphButton]). You could do this with each object's methods, of course, but making a wrapper allows you to be consistent throughout your application.","Q_Score":0,"Tags":"python,button,tkinter,state","A_Id":4187733,"CreationDate":"2010-11-13T12:11:00.000","Title":"How to handle button states efficiently in Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How practical would it be to use Cython as the primary programming language for a game?\nI am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C.\nI understand that I'll probably need to learn a bit of C\/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison.\nSo, is it practical? And would I still be able to use C\/C++ libraries like OpenGL, OpenAL, and Bullet Physics?","AnswerCount":6,"Available Count":4,"Score":0.1651404129,"is_accepted":false,"ViewCount":9169,"Q_Id":4180836,"Users Score":5,"Answer":"I've found that a lot of the time, especially for larger libraries, you wind up spending a tremendous amount of time just configuring the Cython project to build, knowing which structures to import, bridging the C code into Python in either direction etc. While Cython is a nice stopgap (and significantly more pleasant than pure C\/C++ development), the amount of C++ you'd have to learn to effectively use it basically means you're going to have to bite the bullet and learn C++ anyway.\nHow about PyGame?","Q_Score":19,"Tags":"python,c,cython","A_Id":4180878,"CreationDate":"2010-11-15T01:46:00.000","Title":"Using Cython for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How practical would it be to use Cython as the primary programming language for a game?\nI am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C.\nI understand that I'll probably need to learn a bit of C\/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison.\nSo, is it practical? And would I still be able to use C\/C++ libraries like OpenGL, OpenAL, and Bullet Physics?","AnswerCount":6,"Available Count":4,"Score":-0.0333209931,"is_accepted":false,"ViewCount":9169,"Q_Id":4180836,"Users Score":-1,"Answer":"Threads!!! A good modern game must use threads. Cython practically forbids their use, holding to GIL (global interpreter lock) the entire time, making your code run in sequence.\nIf you are not writing a huge game, than Python\/Cython is okay. But Cython is no good as a modern language without good thread support.","Q_Score":19,"Tags":"python,c,cython","A_Id":4445486,"CreationDate":"2010-11-15T01:46:00.000","Title":"Using Cython for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How practical would it be to use Cython as the primary programming language for a game?\nI am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C.\nI understand that I'll probably need to learn a bit of C\/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison.\nSo, is it practical? And would I still be able to use C\/C++ libraries like OpenGL, OpenAL, and Bullet Physics?","AnswerCount":6,"Available Count":4,"Score":1.0,"is_accepted":false,"ViewCount":9169,"Q_Id":4180836,"Users Score":7,"Answer":"at this date (12th of April 2011) unixmab83 is wrong.\nCython doesn't forbid the use of threads, you just needs to use the no_gil special statements.\nBeside the bindins of c++ is now functional in cython. \nWe do use it for something which is close to gamedev. So while I cannot be final on this, cython is a valid candidate.","Q_Score":19,"Tags":"python,c,cython","A_Id":5638409,"CreationDate":"2010-11-15T01:46:00.000","Title":"Using Cython for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How practical would it be to use Cython as the primary programming language for a game?\nI am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C.\nI understand that I'll probably need to learn a bit of C\/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison.\nSo, is it practical? And would I still be able to use C\/C++ libraries like OpenGL, OpenAL, and Bullet Physics?","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":9169,"Q_Id":4180836,"Users Score":0,"Answer":"I know Cython and you do not have to know C\/C++.\nYou will use static typing but very easy.\nThe hardest part is to get the compiling working, I think on Windows this is done over visual studio thing.\nThere is something like a standard library including math for example. The speed gain is not too big but this depends on your scope.\nctypes was much faster (pure C) but the connection to Python was very slow so that i decided to look for Cython which can still be dynamic.\nFor speed gain in a game Cython will be the right choice but i would name this performance also limited.","Q_Score":19,"Tags":"python,c,cython","A_Id":17047294,"CreationDate":"2010-11-15T01:46:00.000","Title":"Using Cython for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can I program for Android using Python? I seem to have stumbled upon many links while searching... however neither of them is concrete.\nAny suggestions? I want to write apps for Android but really don't want to get into Java for all this.\nPS: My question is whether I can write proper, full fledged apps for Android.","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":84928,"Q_Id":4185061,"Users Score":1,"Answer":"No, not currently. ASE (Android Scripting Environment) allows you to do simple script apps, but you can only write proper Android apps in Java.","Q_Score":112,"Tags":"python,android","A_Id":4185138,"CreationDate":"2010-11-15T14:03:00.000","Title":"Android Python Programming","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've got an option menu that's about 60 items long and, needless to say, I can't see it all on the screen at once. Is there a way that I can make the OptionMenu widget in tkinter scrollable?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1975,"Q_Id":4186981,"Users Score":2,"Answer":"Short answer is no, but you could try a ComboBox mega-widget (quick search will throw some suitable examples up there) which could be a 'good enough' alternative (in fact with it being a combined entry field and scrolled list you could make it 'smart' by including auto-search \/ auto-complete - 60 items in a drop down is a lot :)","Q_Score":1,"Tags":"python,tkinter","A_Id":4194418,"CreationDate":"2010-11-15T17:13:00.000","Title":"Make OptionMenu Widget Scrollable?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I get an integer type from the Tkinter Entry widget?\nIf I try to get the value using variable_name.get(), it says it is a str. If I try to change the type using int(variable_name.get()), it says int can only accept a string or number.\nAny help would be welcome!","AnswerCount":6,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":34695,"Q_Id":4199278,"Users Score":4,"Answer":"In the end I just initialized the variable as tk.IntVar() instead of tk.StringVar()\nThat way you don't have to cast it as an int, it will always be one, and the default value from the Entry element will now be 0 instead of ''\nThat's how I approached it anyway, seems the simplest way and avoid the need for a lot of the validation you'd need to do otherwise...","Q_Score":5,"Tags":"python,tkinter","A_Id":22458776,"CreationDate":"2010-11-16T21:41:00.000","Title":"Get an Integer from Entry","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Like the subject says: Does the latest stable pygame release work with python2.7?\nI've got both versions installed on my OSX Snow Leopard, but import pygame only works on python2.6 - That's the official distro which is 2.6.6, not the pre-installed one which is 2.6.1).\nAnd if it does work, how can I make it work on my machine? What am I doing wrong?\nThanks in advance.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":324,"Q_Id":4200644,"Users Score":0,"Answer":"My guess is that you installed it for 2.6 and so it is residing in 2.6's library directory. Install it in 2.7's library directory and you should be good to go. I don't know OSX so I can't help with the details but a little bit of googling shouldn't be too hard. The problem is that the two python installations have distinct import paths.","Q_Score":0,"Tags":"python,macos,pygame","A_Id":4200863,"CreationDate":"2010-11-17T01:10:00.000","Title":"Does the latest stable pygame release work with python2.7?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for a Python GUI library that I can rewrite the rendering \/ drawing.\nIt has to support basic widgets (buttons, combo boxes, list boxes, text editors, scrolls,), layout management, event handling\nThe thing that I am looking for is to use my custom Direct3D and OpenGL renderer for all of the GUI's drawing \/ rendering.\nedit suggested by S.Lott: I need to use this GUI for a 3D editor, since I have to drag and drop a lot of things from the GUI elements to the 3d render area, I wanted to use a GUI system that renders with Direct3D (preffered) or OpenGL. It also has to have a nice look. It is difficult to achieve this with GUI's like WPF, since WPF does not have a handle. Also it needs to be absolutly free for commercial use.\nedit: I would also like to use the rendering context I initialized for the 3d part in my application","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":2152,"Q_Id":4203614,"Users Score":1,"Answer":"You can use Qt Scene Framework with OpenGL rendering. There are many examples on Nokia site.","Q_Score":8,"Tags":"python,user-interface,opengl,directx","A_Id":4250496,"CreationDate":"2010-11-17T10:51:00.000","Title":"Python GUI with custom render\/drawing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to embed some python code in a c++ application i am developing with ms visual studio c++ 2010. But when i run the program, it exits with code 0x01 when i call Py_initialize().\nI dont know how to find out what went wrong. the help file says, Py_Initialize can't return an error value, it only fails fataly.\nBut, why did it fail?\nI am using a self-compiled python27_d.dll, which i created with the msvs project files in the source downloads from python.org.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1264,"Q_Id":4216988,"Users Score":0,"Answer":"Well, i finally found out what went wrong.\nI did compile my python27_d.dll with the same VC10 as my program itself.\nBut my program is normally compiled as 64 bit executable. I just forgot to compile the dll for x64, too. I didnt think this would lead to such annoying behavoiur, as i believed i would get a linkr error then.","Q_Score":1,"Tags":"c++,python,visual-studio-2010,python-c-api,python-embedding","A_Id":4277222,"CreationDate":"2010-11-18T16:16:00.000","Title":"Tried to embed python in a visual studio 2010 c++ file, exits with code 1","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to embed some python code in a c++ application i am developing with ms visual studio c++ 2010. But when i run the program, it exits with code 0x01 when i call Py_initialize().\nI dont know how to find out what went wrong. the help file says, Py_Initialize can't return an error value, it only fails fataly.\nBut, why did it fail?\nI am using a self-compiled python27_d.dll, which i created with the msvs project files in the source downloads from python.org.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1264,"Q_Id":4216988,"Users Score":0,"Answer":"Is there simple 'hello world' type example of the Py_Initilize code in the python sdk you can start with?\nThat will at least tell you if you have the compiler environment setup correctly, or if the error is in your usage.","Q_Score":1,"Tags":"c++,python,visual-studio-2010,python-c-api,python-embedding","A_Id":4217625,"CreationDate":"2010-11-18T16:16:00.000","Title":"Tried to embed python in a visual studio 2010 c++ file, exits with code 1","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I get the width and height of a Tkinter window?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":22438,"Q_Id":4220295,"Users Score":32,"Answer":"You use the winfo_width method of the widget to get the actual width. You can use winfo_reqwidth to get the size that the widget is requesting, which may be different.\nNote that if you call this before the window appears on the screen, you won't get the answer you expect. Tkinter needs to have actually drawn the window before it can know the size. A simple fix if you're trying to get the window size before your program starts is to call the update method on the window before trying to get the size.","Q_Score":22,"Tags":"python,tkinter","A_Id":4221002,"CreationDate":"2010-11-18T22:31:00.000","Title":"Get Tkinter Window Size","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I get the width and height of a Tkinter window?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":22438,"Q_Id":4220295,"Users Score":1,"Answer":"to create an exact window size you can simple do:\nwindow.geometry(\"400x400\") as an example but you have to make sure it is like a string otherwise it wont work like I have experience","Q_Score":22,"Tags":"python,tkinter","A_Id":71922330,"CreationDate":"2010-11-18T22:31:00.000","Title":"Get Tkinter Window Size","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Wondering if there's a menu event I can bind to that's related to the currently selected menu item? By menu item I mean the items that show up in a popup menu like New, Open, Save, etc.\nUse case: I would like to update a statusbar area of our application with a description of the currently selected menu item.\nAny ideas appreciated.\nThank you,\nMalcolm","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1525,"Q_Id":4220441,"Users Score":2,"Answer":"You need to bind to the <> event.","Q_Score":0,"Tags":"python,menu,tkinter","A_Id":4220839,"CreationDate":"2010-11-18T22:49:00.000","Title":"Python\/Tkinter: bind to event related to currently selected menu item","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The widgets in my application are the old style mac widgets. How do I make them become the new style ones. I am using pyqt 4.6.3-1 with python 2.7 on os x 10.6. Everything was installed using fink and I installed both qt4-mac and qt4-x11. Not sure which is being used or how to select one or the other.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":475,"Q_Id":4232228,"Users Score":1,"Answer":"I switched from Fink to Macports, and I got the nice widgets.","Q_Score":0,"Tags":"python,cocoa,qt4,pyqt","A_Id":4365030,"CreationDate":"2010-11-20T10:16:00.000","Title":"getting pyqt to use cocoa widgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing a little gui application with Tkinter, which requires me to have a path to icon files. I am planning on embedding the file into the exe that I make with py2exe, and then retrieving it from there. The only problem is that I need to know where that file is. Does anyone know a way of getting the currently running exe file\/path? Thanks for the help in advance!","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1490,"Q_Id":4234697,"Users Score":0,"Answer":"Oops! I found out the answer! sys.executable should do the trick. It returns the path and filename of the currently running exe, although I must test to see that it works with py2exe.","Q_Score":0,"Tags":"python,py2exe","A_Id":4234727,"CreationDate":"2010-11-20T19:56:00.000","Title":"Get path to exe file on py2exe","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am creating a series of buttons(Or windows) etc on RUN time.\nNow how do i identify when user clicks on these buttons?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":77,"Q_Id":4239896,"Users Score":1,"Answer":"HI,\nI did an R&D on wx.Event(GetEventObject) and found out that i can get object details. \nSO i solved my problem using this.","Q_Score":0,"Tags":"python,wxpython","A_Id":4240158,"CreationDate":"2010-11-21T19:36:00.000","Title":"How to Identify Dynamically created window\/buttons in wxpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"(Or, \"Can PyPy\/RPython be used to compile\/translate Python to C\/C++ without requiring the Python runtime?\")\nI have tried to comprehend PyPy with its RPython and its Python, its running and its compiling and its translating, and have somewhat failed.\nI have a hypothetical Python project (for Windows); I would like to keep its size down, in the order of a hundred kilobytes (O.N.O.) rather than the several megabytes that using py2exe entails (after UPX). Can I use PyPy1 in any way to produce a standalone executable which does not depend on Python26.dll? If I can, does it need to follow the RPython restrictions like for only working on builtin types, or is it full Python syntax?\nI do realise that if this can be done I almost certainly couldn't use C modules from Python directly.\n\n1 (Since the time of asking, the situation has become clearer, and this part of the toolchain is more clearly branded as RPython rather than PyPy; it wasn't so in 2010.)","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":6144,"Q_Id":4251964,"Users Score":18,"Answer":"Yes, PyPy can produce standalone executables from RPython code. That means, you need to follow all the awkward RPython rules when it comes to writing code. Your Python code is completely unlikely to function out of the box and porting existing Python code is usually not fun. It won't make executables as small as C, but for example rpystone target (from pypy\/translator\/goal) using boehm GC is 80k on 64bit after stripping.","Q_Score":27,"Tags":"python,compiler-construction,translate,pypy,rpython","A_Id":4253643,"CreationDate":"2010-11-23T01:41:00.000","Title":"Can PyPy\/RPython be used to produce a small standalone executable?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have created a gtkMenu using gtk.Menu(), appended a couple of items and now I want to remove some menu items. How can I do that?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3084,"Q_Id":4258771,"Users Score":0,"Answer":"Maybe using destroy() could save some RAM:\nmenu.foreach(lambda child: child.destroy())","Q_Score":8,"Tags":"python,pygtk","A_Id":65870271,"CreationDate":"2010-11-23T17:10:00.000","Title":"How to remove an item from a gtkMenu?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pygame to create a small scene. Right now, I'm working with lines.\nI have an array of lines which are drawn to the screen and when a line is deleted from the array, I would like the line to disappear from the screen.\nThe problem I've found is that the line is drawn on the screen and remains static. I can't find a way to reset the screen (I'm using a JPEG as the background).\nIs there a way to remove a drawn line from the screen?\nThanks","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4502,"Q_Id":4276342,"Users Score":1,"Answer":"If you use screen.fill([0,0,0]) it will fill in the background (or whatever you have set to be your background).\nThis will erase any lines drawn on the image, essentially removing anything drawn on the background.","Q_Score":0,"Tags":"python,line,pygame","A_Id":4276397,"CreationDate":"2010-11-25T11:10:00.000","Title":"Python (pygame): How can I delete a line?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to display PyGame surfaces with controllable alpha? I would like to take a surface with its own per pixel alpha and display it with variable level of translucency without affecting the surface data and keep the transparency intact i.e. the objects on the surface would keep their shapes but their \"contents\" becoming more or less translucent.\nIn other words I want to combine per-pixel alpha from the source image with per-surface alpha calculated at the runtime.","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":7315,"Q_Id":4276850,"Users Score":4,"Answer":"After checking both PyGame and SDL documentations I came to conclusion that what I asked wasn't doable in PyGame using standard functions.\nSDL docs state that per-pixel alpha and per-surface alpha cannot be combined with the former always taking the precedence. The only way to achieve the effect I want is by writing a code which updates per-pixel alpha values of the source surface before the blit.","Q_Score":13,"Tags":"python,pygame,transparent","A_Id":4535566,"CreationDate":"2010-11-25T12:05:00.000","Title":"PyGame: translucent sprites with per pixel alpha","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to expose a file-like object from a C library that i'm wrapping with a Cython module. I want to reuse python's generic io code for stuff like buffering, readline(), etc.\nThe new IO module seems to be just what i need, but actually using it from Cython seems to be non-trivial, I've tried several aproaches:\n\nMy code in a cdef class that inherits from IO.RawIOBase - This fails because cdef classes can inherit only from other cython cdef classes, while IO is \"raw\" C.\nMy code in a cdef class, another (non-cdef) class that inherits both my cdef class and RawIOBase - Fails with \"TypeError: multiple bases have instance lay-out conflict\"\nMy code in a (non-cdef) class that inherits from RawIOBase - This works, but i loose the ability to store my c-level (that i need to talk to the underlying library) stuff inside the class, so i need a make a cdef wrapper around it and store that as a member... this looks like a mess.\nMy code in cdef class that doesn't inherit (Raw)IOBase rather reimplements it's functionality, Python code gets my object wrapped in BufferedReader\/BufferedWriter - This one seems to work and less messy than the previous option.\n\nMy questions(s): \n1) Am I missing something and reinventing the wheel here?\n2) What is the exact stuff from IOBase that I need to implement to keep BufferedReader\/Writer happy with my object in current and future versions of python? Is this documented anywhere?\n3) How will that work in python 2.6 where IO is pure python? I guess that performance will suffer but it will work, right?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1145,"Q_Id":4278444,"Users Score":1,"Answer":"Would it be too inefficient to call os.fdopen() on the file descriptor number returned by the underlying library, and then to dispatch normal Python method calls to the resulting file object in order to do your input and output? With most I\/O, I would be surprised if you could see a difference with whether you called a C routine directly or let the Python method dispatch logic call it for you \u2014 but, of course, you might be in an unusual situation and I could be wrong!","Q_Score":20,"Tags":"python,file-io,cython","A_Id":8262264,"CreationDate":"2010-11-25T15:08:00.000","Title":"Exposing a file-like object from Cython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was thinking that for a learning project for myself, I would try to make a GUI for ffdshow on linux, using tkinter. Wanted to make sure this project would be feasible first, before I get halfway through and run into something that cant be done in python.\nBasic idea is to have a single GUI window with a bunch of drop down boxes that have the various presets (like format or bitrate), as well as a text box where a custom number can be entered if applicable. Then when all the options are selected, the user hits the Start button on the GUI and it shows a progress little bar with a percentage. All the options selected would just send the relevant selections as cli arguments for ffdshow, and begin the conversion progress (essentially turning all the user's input into a single perfect cli command).\nIs all this doable with python and tkinter? and is it something that a relative newb with only very basic tkinter experience could pull off with books and other python resources?\nThanks","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":446,"Q_Id":4278461,"Users Score":1,"Answer":"That is precisely the type of thing that python and Tkinter excel at. And yes, a relative newbie can easily do a task like that.","Q_Score":1,"Tags":"python,user-interface,tkinter,ffdshow","A_Id":4278800,"CreationDate":"2010-11-25T15:10:00.000","Title":"making a python gui for ffdshow","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is a bit of a vague question but bear with me. I am in the process of writing a game using Python\/Pyglet and openGL. I currently have it structured so that there is an object called 'world', in this are other objects with other objects inside them etc. I did it this way because for instance one part of the game is a platform with other objects on it, and when I tilt the platform I want the objects on it to tilt with it. So I do platform.draw() which calls glRotate, glTranslate, then draw each of the objects saving the modelview matrix inbetween, this way all the objects on the platform move together.\nThe first question is, is this a sensible way to organise things or should I be using some other method?\nI don't have a camera class, currently I am just translating the whole world or parts of it to give the illusion of movement. However, in the future I want to be able to switch viewpoints between objects, so for instance switch from looking down onto the world from above to a 1st person view from one of the objects in the world. So the second question is what is the best way to structure my program so that this will be achievable in the future?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":382,"Q_Id":4291566,"Users Score":0,"Answer":"You could put the logic into a seperate module \/ into seperate classes\/functions.\nIn my 2D-Game I have a GameLogic class which simplifies registering it's methods for certain events or scheduling them (and unregistering+unscheduling them), and I created a @state_wrapper decorator which injects a simple new-style object as state-storage for that method. If you do it like that you don't have to pass the pointer to all your world objects, only the event-methods have to get access to your objects.\nBut I wouldn't claim that this is the best solution ;)","Q_Score":2,"Tags":"python,architecture,3d,pyglet","A_Id":4368817,"CreationDate":"2010-11-27T12:10:00.000","Title":"How to organise the structure of a 3D game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Tkinter app written in python, and I want to make \"native\" (easy to run) mac and windows executables of it. I've successfully built a windows .exe using py2exe, but the equivalent process with py2app isn't working.\nHere's my setup.py:\nfrom setuptools import setup\nimport sys\nMAIN_SCRIPT = \"myapp.py\"\nWINDOWS_ICON = \"myicon.ico\"\nMAC_ICON = \"myicon.icns\"\nif sys.platform in (\"win32\", \"win64\"): # does win64 exist?\n import py2exe\n setup( windows=[{ \"script\":MAIN_SCRIPT,\n \"icon_resources\":[(0x0004, WINDOWS_ICON)]\n }],\n )\nelif sys.platform == \"darwin\":\n import py2app\n setup( app=[MAIN_SCRIPT], # doesn't include the icon yet\n setup_requires=[\"py2app\"],\n )\n\nI just cd to my app directory and run python setup.py py2app. The .app appears without errors, but it crashes on launch with \"myapp has encountered a fatal error, and will now terminate.\"\nI'm running Snow Leopard, and I've tried this with both the standard Apple Python 2.6 and python25 from MacPorts. I read somewhere that it's better to use a different Python because py2app won't bundle the system version in your app.\nEDIT: Here's what the mac console has to say about it:\n11\/27\/10 1:54:44 PM [0x0-0x80080].org.pythonmac.unspecified.myapp[77495] dlsym(0x10b120, Py_SetProgramName): symbol not found\n11\/27\/10 1:54:46 PM [0x0-0x80080].org.pythonmac.unspecified.myapp[77495] 0x99274242\n11\/27\/10 1:54:46 PM com.apple.launchd.peruser.501[185] ([0x0-0x80080].org.pythonmac.unspecified.myapp[77495]) Exited with exit code: 255","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1470,"Q_Id":4294060,"Users Score":0,"Answer":"Turns out it was a problem with using Snow Leopard. I tried it on a Leopard machine at school and it builds fine.","Q_Score":2,"Tags":"python,tkinter,py2app","A_Id":4300560,"CreationDate":"2010-11-27T21:41:00.000","Title":"Help building a mac application from python using py2app?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to remove focus from a widget manually.","AnswerCount":6,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":16266,"Q_Id":4299432,"Users Score":2,"Answer":"My solution is root.focus() it will remove widget focus.","Q_Score":11,"Tags":"python,tkinter","A_Id":64151502,"CreationDate":"2010-11-28T22:15:00.000","Title":"In Tkinter how do i remove focus from a widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to remove focus from a widget manually.","AnswerCount":6,"Available Count":2,"Score":0.1651404129,"is_accepted":false,"ViewCount":16266,"Q_Id":4299432,"Users Score":5,"Answer":"Set focus to another widget to remove focus from the target widget is a good idea. There are two methods for this: w.focus_set() and w.focus_force(). However, method w.focus_force() is impolite. It's better to wait for the window manager to give you the focus. Setting focus to parent widget or to the root window removes focus from the target widget.\nSome widgets have takefocus option. Set takefocus to 0 to take your widget out of focus traversal (when user hits key).","Q_Score":11,"Tags":"python,tkinter","A_Id":47823400,"CreationDate":"2010-11-28T22:15:00.000","Title":"In Tkinter how do i remove focus from a widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game\/application.\nAre there any recommended guides\/documents we should read on general 3d game programming and perhaps python specific stuff.\nWe are also possibly considering programming it in C++ but for now I think it's easier to use Python as we can fully focus on the 3d mechanics that way.","AnswerCount":8,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":56291,"Q_Id":4303851,"Users Score":0,"Answer":"I would implement the time-critical stuff as 3D and its object handling + rendering in raw C\/C++ and let an embedded Python with external modules handle the game logic (object movement, object properties, scripting and so on).","Q_Score":15,"Tags":"c++,python,3d","A_Id":4303972,"CreationDate":"2010-11-29T12:49:00.000","Title":"3d game with Python, starting from nothing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game\/application.\nAre there any recommended guides\/documents we should read on general 3d game programming and perhaps python specific stuff.\nWe are also possibly considering programming it in C++ but for now I think it's easier to use Python as we can fully focus on the 3d mechanics that way.","AnswerCount":8,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":56291,"Q_Id":4303851,"Users Score":2,"Answer":"If you want to write a 3D game you might want to start by understanding the basics of programming and computer science. Starting with the top and learning a language, then find yourself a good graphics library for example Panda, Pygame are all good choices, then there are other parts to consider like networking with twisted for example or a physics engine. It might also be a good choice to consider using a working engine like the unreal engine as often game designers get too wrapped up in game mechanics and not the game itself","Q_Score":15,"Tags":"c++,python,3d","A_Id":4303913,"CreationDate":"2010-11-29T12:49:00.000","Title":"3d game with Python, starting from nothing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game\/application.\nAre there any recommended guides\/documents we should read on general 3d game programming and perhaps python specific stuff.\nWe are also possibly considering programming it in C++ but for now I think it's easier to use Python as we can fully focus on the 3d mechanics that way.","AnswerCount":8,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":56291,"Q_Id":4303851,"Users Score":2,"Answer":"You should be aware that 3D game consists of\n\nanimated 3D models\n3D environment (including NPCs and objects)\nsimulation of interaction between the environment and the models (game logic and game mechanics)\nuser interface (starting, saving and game settings)\n\nThe game logic and mechanics is going to usually the biggest and most complicated part and you should try to wrap your head against that first.\nModeling 3D objects and environment should be much easier after that.","Q_Score":15,"Tags":"c++,python,3d","A_Id":4304000,"CreationDate":"2010-11-29T12:49:00.000","Title":"3d game with Python, starting from nothing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Using Python 2.6, Twisted 10.1, and GTK+ 2.22, with latest pygtk installed, I'm having problems on shutdown. When I close my application and shut down the reactor (using the gtk2reactor of course), the application simply freezes. \nI've poked around the twisted source and added debug messages. What ends up happening is, the 'shutdown' event fires, PortableGtkReactor.crash is called, which calls gtk.main_quit. The event gets processed at the end of ReactorBase.runUntilCurrent. When the function returns, control goes to ReactorBase.iterate, which returns control to PortableGtkReactor.simulate, which goes back to... the gtk.main() call. It looks like gtk just doesn't quit.\nUnfortunately, when I put together a very simple example with twisted and the gtk \"Hello World\" sample, everything shut down correctly. It must be something my application is doing. Until I can figure it out further, though...\nWhat might be causing this? Like what could an app do that causes gtk to not quit? The app worked fine on Gtk 2.12, with Python 2.5 and Twisted 8.1, if that helps at all.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":426,"Q_Id":4308346,"Users Score":0,"Answer":"Threads, perhaps? The Twisted reactor joins all threads on shutdown, and if you're doing something in a callInThread that hangs, your loop may be unable to stop. (I'm not sure what the behavior would be if you're starting your own threads, either.)","Q_Score":1,"Tags":"python,pygtk,twisted,gtk","A_Id":4310711,"CreationDate":"2010-11-29T21:36:00.000","Title":"Twisted + Gtk - shutdown not working properly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have implemented an informational popup in a python app using a Tkinter Menu widget. I have a Text widget on a canvas in the root window. I created a Menu widget that has root as its parent. When I detect a mouse hover over the text widget I post the popup menu with menuWidget.post(). When I get a leave event from the text widget my intention was to have the popup disappear by calling menuWidget.unpost(), only the popup menu does not disappear until I click elsewhere outside the text widget.\nFirst, is this a sane method for implementing an informational popup? And can anyone tell me why the popup menu won't disappear?","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":2151,"Q_Id":4328603,"Users Score":3,"Answer":"This is not the right way to do an informational popup. On the Mac and on windows machines menus are native controls. Because of this the unpost command doesn't work because tk cedes control to the system event loop in order to get platform-specific behavior. \nWhat you want is to use instead is a toplevel window with the overrideredirect flag set. This lets you display a borderless window anywhere you want. The upside to this is that you aren't limited to simple text -- you can put anything you want in that toplevel -- another text widget, a canvas, buttons, etc.","Q_Score":1,"Tags":"python,tkinter","A_Id":4328747,"CreationDate":"2010-12-01T20:09:00.000","Title":"'hover over' popup with Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"hey all,\nim looking for a way of catching a button held down event in wxpython i cant seem to find anything. theres just wx.EVT_BUTTON which isnt quite what i want. i want my event to continue processing as long as the button is down. any help would be appreciated\nthanks james","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1279,"Q_Id":4329377,"Users Score":2,"Answer":"I think I would catch the EVT_LEFT_DOWN and the EVT_LEFT_UP. Then start a wx.Timer to run your process on EVT_LEFT_DOWN until the EVT_LEFT_UP is fired. Alternatively, you could use a ToggleButton.","Q_Score":1,"Tags":"button,wxpython","A_Id":4329486,"CreationDate":"2010-12-01T21:32:00.000","Title":"wxpython button held down event","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to customize the horizontal padding between an image and text in a Label widget when compound=left or right?\nThe 2 ways I can think of are:\n\nUse PIL to dynamically add columns of pixels to an image\nInsert or append spaces to the text= option of the label to force the separation of image and text\n\nWhat I'm looking for is a way to specify the horizontal padding (between image and text) in pixels.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":912,"Q_Id":4333359,"Users Score":0,"Answer":"There is no built-in way to do what you want. Your own suggestions are good. Another option is to create a frame, and place separate image and label widgets in the frame. You then have complete control of the placement of the widgets","Q_Score":0,"Tags":"python,image,label,tkinter","A_Id":4334872,"CreationDate":"2010-12-02T09:16:00.000","Title":"Python\/Tkinter: Customize horizontal padding between image and text in Label widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to integrate IronPython in my Silverlight application but am unable to do so. After downloading the binaries, every time I try to add the dlls as references in my VS2010 solution all I get is an error about them not being compiled for Silverlight. I have even tried downloading the source distribution, but cannot set the various projects making up the solution to build against Silverlight (the only choices I have are different versions of the .net framework).\nAs the IronPython website explicitly states Silverlight compatibility, why is it not working? Is there any easier way of getting scripting capabilities in my Silverlight app?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":127,"Q_Id":4336935,"Users Score":2,"Answer":"You have to use binaries from IronPython-2.6.1\\Silverlight\\bin folder in Silverlight.","Q_Score":3,"Tags":"silverlight,silverlight-4.0,ironpython","A_Id":4358122,"CreationDate":"2010-12-02T15:56:00.000","Title":"Ironpython 2.6.1 on Silverlight 4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm trying to disable warning C0321 (\"more than one statement on a single line\" -- I often put if statements with short single-line results on the same line), in Pylint 0.21.1 (if it matters: astng 0.20.1, common 0.50.3, and Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)).\nI've tried adding disable=C0321 in the Pylint configuration file, but Pylint insists on reporting it anyway. Variations on that line (like disable=0321 or disable=C321) are flagged as errors, so Pylint does recognize the option properly. It's just ignoring it.\nIs this a Pylint bug, or am I doing something wrong? Is there a way around this?\nI'd really like to get rid of some of this noise.","AnswerCount":13,"Available Count":1,"Score":0.0153834017,"is_accepted":false,"ViewCount":404539,"Q_Id":4341746,"Users Score":1,"Answer":"Python syntax does permit more than one statement on a line, separated by semicolon (;). However, limiting each line to one statement makes it easier for a human to follow a program's logic when reading through it.\nSo, another way of solving this issue, is to understand why the lint message is there and not put more than one statement on a line.\nYes, you may find it easier to write multiple statements per line, however, Pylint is for every other reader of your code not just you.","Q_Score":346,"Tags":"python,pylint","A_Id":48765416,"CreationDate":"2010-12-03T01:41:00.000","Title":"How do I disable a Pylint warning?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"hey.. i have a panel (lets call it mainpanel) with a couple of panels in it and other widgets. i need to know what to bind the wx.EVT_LEFT_DOWN to in order for it to fire an event for clicks anywhere in mainpanel and its children. e.g. if i click on a textctrl in mainpanel i want it to pick that up aswell. binding to mainpanel doesnt work. please help i really need to find a solution to this its making me mad!\np.s. binding everychild to the wx.EVT_LEFT_DOWN is not an option i have hundreds of children i really dont want to go that route","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":242,"Q_Id":4368885,"Users Score":0,"Answer":"Text controls eat mouse clicks so you may just want to catch the focus event for them. I think the rest should work though.","Q_Score":1,"Tags":"wxpython","A_Id":4370204,"CreationDate":"2010-12-06T16:55:00.000","Title":"wxpython, what to bind an application wide mouse event to","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here. \nwith python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False)\nThen the interpreter crashed with Windows error reporting.\nI tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck.\nIs there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":1983,"Q_Id":4369102,"Users Score":1,"Answer":"If you are running that in IDLE, then that is your problem. IDLE and wx don't get along very well because you basically end up with two mainloops fighting each other. Try putting it in a file and then run the file from the command line:\nc:\\python27\\python.exe myPyFile.py\nThat should work just fine. Otherwise, download the correct wxPython for your Python and OS (32\/64 bit), uninstall the current one and install the new one. I've been using wxPython on Windows XP, Vista and 7 with no problems like this.","Q_Score":1,"Tags":"python,wxpython","A_Id":4369662,"CreationDate":"2010-12-06T17:19:00.000","Title":"wx.App (wxPython) crash when calling","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here. \nwith python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False)\nThen the interpreter crashed with Windows error reporting.\nI tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck.\nIs there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1983,"Q_Id":4369102,"Users Score":0,"Answer":"I searched for a while and found that this is the problem with wxPython and Python >2.5. Tried many fix with manyfest file but no luck, so I think switch to PyQt is the only solution now.","Q_Score":1,"Tags":"python,wxpython","A_Id":4496450,"CreationDate":"2010-12-06T17:19:00.000","Title":"wx.App (wxPython) crash when calling","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here. \nwith python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False)\nThen the interpreter crashed with Windows error reporting.\nI tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck.\nIs there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":1983,"Q_Id":4369102,"Users Score":1,"Answer":"In case like me somebody will stumble into this question like I did. Recently installed wxpython on two machines, windows 7 and XP. Testing the sample code in simple.py (provided with the wxpython docs-demos installer), running from a python console, I had the following problem on both machines: First import ok, but when I did a reload of the module, python crash.\nI added this line in the end of the simple.py file: del app\nand that fixed the problem on windows 7 and tomorrow I try it on the XP machine.\nSame solution fitted for the XP machine. So, reloading an un-edited module with a reference to a wx.App with a closed gui seem not to be feasable. Killing the reference with a del statement was enough to solve the problem.","Q_Score":1,"Tags":"python,wxpython","A_Id":16407973,"CreationDate":"2010-12-06T17:19:00.000","Title":"wx.App (wxPython) crash when calling","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm using the Android 2.2 SDK emulator to test out the Scripting Layer for Android and have one annoyance. \nWhen you launch a Python interpreter and start to type code it appears that the parentheses key isn't mapped properly. When I hit the key on the PC keyboard I get ^[[20~ instead. What am I missing?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":669,"Q_Id":4369261,"Users Score":0,"Answer":"Looks like the Control-K button actually toggles the left-ALT key on the PC to mimic the virtual keyboard left-ALT.","Q_Score":0,"Tags":"python,android,sl4a","A_Id":4531739,"CreationDate":"2010-12-06T17:41:00.000","Title":"Android Emulator Keyboard","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I get my filechooser to be able to select both files and folders when the open button on the filechooser dialog is hit ? I want to squeeze the ability to open files and filders in just one filechooser. I am using GTK+ and Python.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1339,"Q_Id":4376500,"Users Score":2,"Answer":"I was thinking about this, and although in your comments you've decided to go another route, I do have a suggestion: Write your own file chooser subclass of the GTK+ one and provide two \"Open\" buttons, one to \"Open File\" and another to \"Open Directory\". That would eliminate the ambiguity discussed above.","Q_Score":7,"Tags":"python,pygtk,gtk,filechooser","A_Id":4831626,"CreationDate":"2010-12-07T12:21:00.000","Title":"GTK+ Filechooser to open both files and folders","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing a Python 2.7.1 \/ Tkinter 8.4 app on Windows XP that checks several lines of input from a RS-232 port. However, if no input arrives it will sit in a loop for ever. \nI am trying to implement an \u2018Abandon Test\u2019 button on the GUI but because the main thread is busy waiting for input it doesn\u2019t appear to every check if a button has been pressed.\nI have tried update_idletasks() and time.sleep(1) with no success. \nAny suggestions?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":987,"Q_Id":4376870,"Users Score":5,"Answer":"Tk is single-threaded, so if the main thread is busy the GUI will freeze. One solution is to use a separate thread to do the reading, so when the read blocks your main thread can continue. When you get a line of input you can push it on a queue which is monitored by the main thread. \nThe other way is to figure out how to do a non-blocking read on your serial port. If there is data, read it. If not, return to the main event loop. You then need to configure the event loop to poll your port every few hundred milliseconds or so, depending on your performance needs.","Q_Score":2,"Tags":"python,tkinter","A_Id":4377125,"CreationDate":"2010-12-07T13:04:00.000","Title":"How can I monitor Tkinter buttons when Python is busy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Currently I'm drawing some things in a subclass of DrawingArea, where I get a cairo context inside an expose-event and call a draw method from there. (according to some PyGTK tutorial I found)\nI'm used to doing a repaint() with java, but how can I get the same effect here?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3673,"Q_Id":4383614,"Users Score":0,"Answer":"I found a solution that uses the queue_draw() method (callable from the Gtk.DrawingArea but seems like a method every gtk widget must have), but there are probably alternatives since this one implies it might get delayed, even though in my tests it didn't happen.","Q_Score":2,"Tags":"python,gtk,drawing,pygtk","A_Id":4383675,"CreationDate":"2010-12-08T02:15:00.000","Title":"(Py)GTK: How can I force my window to be repainted \/ call expose-event?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running a .NET 3.5 C# project in Visual Studio 2008. In the project I am hosting an IronPython script that imports modules that I have compiled to .NET dlls with pyc. The version of IronPython is 2.6.1. I have used ObjectOperations.GetInstance and GetMember to wire up the python methods to the C# code.\nWhen I am debugging the C# code and try to step into the pyc generated IronPython dll, VS won't allow me to do that. Is there any way for me to be able to step into that code?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":242,"Q_Id":4396727,"Users Score":1,"Answer":"There is no way to do this out of the box. You'd need to modify IronPython\/DLR so that the calls from ClrModule.CompileToMethod down would pass an option to emit symbols and then ultimately call LambdaExpression.CompileToMethod to emit symbols.","Q_Score":1,"Tags":".net,visual-studio,dll,ironpython","A_Id":4414812,"CreationDate":"2010-12-09T09:38:00.000","Title":"Is it possible to step into an IronPython dll compiled with pyc?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a pack equivalent of the grid_remove() method where a widget's original pack() settings are restored on a re-pack()?\nUse case: When I show a packed widget that has been hidden via pack_forget(), I would like to have the widget re-packed with its original pack settings when I issue the widget.pack() show request.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2749,"Q_Id":4399237,"Users Score":4,"Answer":"No, there is no equivalent. There is only pack_forget which doesn't remember where the widget was when you restore it. If I need this sort of feature I just use the grid geometry manager.","Q_Score":3,"Tags":"python,tkinter,ttk","A_Id":4399322,"CreationDate":"2010-12-09T14:23:00.000","Title":"Python\/Tkinter: pack equivalent of grid_remove(), eg. pack_remove()?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any best practice tips regarding when one should use pack vs. grid for their layouts?\nFrom what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa.\nTo start the conversation, it appears that one use case that favors grid vs. pack is when one wants to show\/hide widgets.","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":33054,"Q_Id":4401202,"Users Score":18,"Answer":"Neither is intrinsically better than the other. Each have strengths and weaknesses. Learn what those are and the choice of which to use becomes obvious.\ngrid is considerably easier to use if you need to lay things out in a grid. pack is generally easier to use if all you need to do is put some widgets in a single row or single column. There's a whole lot of gray area in-between where neither is necessarily better than the other.\nThe other thing to consider is what you said in your question: if you want to show and hide widgets at run-time, grid is probably the best choice because of the grid_remove method which remembers the values of all of the configured attributes in case you want to re-add the widget. \nPersonally, my first choice is always to use pack because I first learned Tk back when there was no grid command. If I can't do it easily in pack, or if I'm very clearly laying things out in a grid, I'll use grid.","Q_Score":31,"Tags":"python,user-interface,layout,tkinter,ttk","A_Id":4402589,"CreationDate":"2010-12-09T17:23:00.000","Title":"When to use pack or grid layouts in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any best practice tips regarding when one should use pack vs. grid for their layouts?\nFrom what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa.\nTo start the conversation, it appears that one use case that favors grid vs. pack is when one wants to show\/hide widgets.","AnswerCount":3,"Available Count":3,"Score":1.0,"is_accepted":false,"ViewCount":33054,"Q_Id":4401202,"Users Score":10,"Answer":"I always recommend grid over pack for polished applications. There are only a few edge cases where pack is easier and fits the bill (everything in one row or col). grid has better \"composability\" (e.g. megawidgets or gridding elements of gridded elements). The reasons to prefer grid are the extra fine-tuning options that it provides. The use of weight (which effects growing and shrinking btw), minsize and maxsize, as well as convenience features like enforcing uniform rows\/columns.\nA fully gridded app of any size will use (significantly) fewer frames than an equivalent packed app, and have better shrink\/expand control over inner elements.\nBTW, both pack and grid can show\/hide sub-elements, though the syntax differs slightly between the two. Grid is just slightly better because 'remove' (rather than 'forget') will remember the grid options on the slave widget.","Q_Score":31,"Tags":"python,user-interface,layout,tkinter,ttk","A_Id":4411675,"CreationDate":"2010-12-09T17:23:00.000","Title":"When to use pack or grid layouts in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Are there any best practice tips regarding when one should use pack vs. grid for their layouts?\nFrom what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa.\nTo start the conversation, it appears that one use case that favors grid vs. pack is when one wants to show\/hide widgets.","AnswerCount":3,"Available Count":3,"Score":0.1325487884,"is_accepted":false,"ViewCount":33054,"Q_Id":4401202,"Users Score":2,"Answer":"I personally just think grid is a lot easier to work with, so I would use that. Of course, you've probably read the one thing you should never do is try to use both at the same time in the same container. Thank you Bryan Oakley for making that distinction.","Q_Score":31,"Tags":"python,user-interface,layout,tkinter,ttk","A_Id":4401215,"CreationDate":"2010-12-09T17:23:00.000","Title":"When to use pack or grid layouts in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"one topic that has always been of highest interest to me is 3D Programming. I've made several attempts at programming small games and never really successed. After experiences with DirectX and C++, XNA and C#, as well as Unity3d and C#, I would like to try OpenGL. Just being curious. When using C++ the way to go is rather clear. However Java (and Scala that I'm currently learning), Python ... are way more comfortable. After about 2 years of struggling with C++ without any remarkable success, I turned away from it. Now for Java\/Scala\/... there are many OpenGL bindings and I would like to choose the right one. On the contrary there are few books on them. Java 3d and\/or JOGL books are available but when looking at Scala or Python things aren't that good.\nWhat layer\/wrapper\/binding would you recommend (Java or Scala). Is there a kind of standard ?\nIs it possible to learn this binding by reading for eyample \"OpenGL Superbible\" ? \nIf not, can you recommend a book ?\nAny advice is welcome. If there's a good IDE (plugin), tool, website, tutorial, ... please let me know it.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1677,"Q_Id":4403150,"Users Score":3,"Answer":"I have used JOGL in many of my 3D projects. Learning how to use a binding is not as important as learning the actual api. Using opengl in c and java are pretty much the same. The only thing that differs is the way you set up your rendering windows and buffers. I use netbeans ide with the opengl for netbeans plugin because it sets everything up for you and all you have to worry about is the opengl part. To learn opengl any book is fine. If you have a good background in programming then you should catch on quite easily.","Q_Score":3,"Tags":"java,python,scala,opengl,jogl","A_Id":4435696,"CreationDate":"2010-12-09T21:10:00.000","Title":"Key to OpenGL. Java \/ Scala \/ Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to make a gtk SpinButton, but for inputting dates.\n\nIs there an easier way to input dates into GTK?\nIf not, how can I create a SpinButton look-alike, but whose output is text representing dates instead of integers? Ideally I'd re-use the arrows, the clicks, the integration with the adjustment, etc. I really just need the output to look different, as I can even represent dates as integers.","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":847,"Q_Id":4404825,"Users Score":3,"Answer":"The calendar is a bit large, but you can find code putting it in a popup. Personally I use a regular text entry and parse the date.\nAs for SpinButton, it is based on a text entry, so you might be able to modify its display only by fiddling with inherited signals and returning False. See also the update-policy and numeric properties.","Q_Score":1,"Tags":"python,user-interface,gtk,pygtk","A_Id":4450091,"CreationDate":"2010-12-10T01:22:00.000","Title":"gtk custom spin button","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have done coding for mathematical simulation of Theory of Computation concepts in Python such as grammar checking and other stuff. My Problem is that I have to build a decent looking GUI for it .\nI have looked at PyQt4 and the lack of documentation is really a big deterrent. I have looked at other graphical libraries in Python and they are not helping me so is there a way that I can write the GUI stuff in some other language and integrate python in it.\nThe problem is that I want mathematical stuff like circles, epsilon on runtime which have drag and drop events available on them. So simply creating an image is not an option.\nI am sorry for being a little non specific here but the problem is that I am looking for things that can help here. I have asked a question before too for GUI and unfortunately I could'nt find the right answers for it.\nIs there a way I can get around this problem.\nThanks a lot....","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":77,"Q_Id":4413692,"Users Score":0,"Answer":"Most python guis I recommend tkinter but drag 'n drop isn't built into tkinter yet and I'm not a huge fan of the other libraries.\nHave you thought about IronPython in .Net and WPF? You'll need to learn the xaml syntax but it's not much harder than html (technically, it's stricter and simpler but you need to learn some library controls it will instantiate). There are free versions of visual studio for all of this.\nAnother simple way would be to expose a command line or webservice interface to your python routines.","Q_Score":1,"Tags":"python","A_Id":4413768,"CreationDate":"2010-12-10T22:02:00.000","Title":"Interlinking GUI in some other language and Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have done coding for mathematical simulation of Theory of Computation concepts in Python such as grammar checking and other stuff. My Problem is that I have to build a decent looking GUI for it .\nI have looked at PyQt4 and the lack of documentation is really a big deterrent. I have looked at other graphical libraries in Python and they are not helping me so is there a way that I can write the GUI stuff in some other language and integrate python in it.\nThe problem is that I want mathematical stuff like circles, epsilon on runtime which have drag and drop events available on them. So simply creating an image is not an option.\nI am sorry for being a little non specific here but the problem is that I am looking for things that can help here. I have asked a question before too for GUI and unfortunately I could'nt find the right answers for it.\nIs there a way I can get around this problem.\nThanks a lot....","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":77,"Q_Id":4413692,"Users Score":1,"Answer":"I'd look again at PyQT4 if you want something decent looking. PyQt has an an example directory in the source code. KDE uses QT and they have a lot examples too. You have to understand that it is a binding against QT4. When I use it with python I usually just have the QT docs open. Its pretty easy to translate.\nYou could look at PyGTK also, but again, it is a binding against GTK.","Q_Score":1,"Tags":"python","A_Id":4413875,"CreationDate":"2010-12-10T22:02:00.000","Title":"Interlinking GUI in some other language and Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there anyway I could register button pushes on a joystick without using any function from pygame?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":916,"Q_Id":4415649,"Users Score":1,"Answer":"If you're looking for a way to do it with just the standard Python library, the answer is probably \"no\" - or at the very least, \"not in any straightforward manner\". There are many things in the standard library, but gaming hardware support is not one of them.","Q_Score":1,"Tags":"python","A_Id":4415722,"CreationDate":"2010-12-11T07:05:00.000","Title":"Detecting an arbittrary button press on a USB joystick WITHOUT pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Every time I need to load a local file using webkit in python I need to start with \"file:\/\/\" which I need to include in all files I am working with. How can I eliminate the need to do that? I want to load files like webview.load_uri('file.html') instead of webview.load_uri('file:\/\/file.html')?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":2182,"Q_Id":4416570,"Users Score":3,"Answer":"You can't. webview.load_uri() takes a string containing a URI. 'file.html' isn't a URI, 'file:\/\/file.html' is.","Q_Score":2,"Tags":"python,webkit,gtk","A_Id":4421093,"CreationDate":"2010-12-11T11:50:00.000","Title":"Problem loading local files with webkit in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Every time I need to load a local file using webkit in python I need to start with \"file:\/\/\" which I need to include in all files I am working with. How can I eliminate the need to do that? I want to load files like webview.load_uri('file.html') instead of webview.load_uri('file:\/\/file.html')?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":2182,"Q_Id":4416570,"Users Score":1,"Answer":"webview.load_string() takes the text of an html file. you can load the file into a file object without the file:\/\/ and read it into the load_string function.","Q_Score":2,"Tags":"python,webkit,gtk","A_Id":7470386,"CreationDate":"2010-12-11T11:50:00.000","Title":"Problem loading local files with webkit in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Has anyone figured out a way to change the brace matching colours in WingIDE? I have managed to manually port my favourite colour scheme across from my text editor and the default green just doesn't do it for me. I've been unable to find instructions on how to do this in the UI, user manual and mailing lists.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":135,"Q_Id":4418839,"Users Score":1,"Answer":"I've contacted Wingware support and they have confirmed that there is no way to set the brace matching colour.","Q_Score":3,"Tags":"python,wing-ide","A_Id":4431943,"CreationDate":"2010-12-11T20:40:00.000","Title":"WingIDE brace matching colours","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using a wxPython listbox on Windows to get a choice from the user, and I would like them to be able to select an item using the ENTER key, as if they had double-clicked. I know how to do this in C or C++ using the Windows API directly, but can't seem to find how to do it using wxPython. Anyone know how? It seems like an obvious thing to want to do.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":721,"Q_Id":4451166,"Users Score":1,"Answer":"The simple answer is that the wx.ListBox doesn't support that. Try using a one column wx.ListCtrl (in Report mode) instead.","Q_Score":2,"Tags":"python,windows,wxpython","A_Id":4465221,"CreationDate":"2010-12-15T14:50:00.000","Title":"Keyboard interface to wxPython listbox","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using a wxPython listbox on Windows to get a choice from the user, and I would like them to be able to select an item using the ENTER key, as if they had double-clicked. I know how to do this in C or C++ using the Windows API directly, but can't seem to find how to do it using wxPython. Anyone know how? It seems like an obvious thing to want to do.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":721,"Q_Id":4451166,"Users Score":1,"Answer":"Maybe I'm missing some nuance, there wasn't much info to go on, but it sounds like you could accomplish this by catching the keydown event, matching for enter and then calling your on_doubleclick function. Unless there's an implicit double-click handling you should be good to go.","Q_Score":2,"Tags":"python,windows,wxpython","A_Id":4451586,"CreationDate":"2010-12-15T14:50:00.000","Title":"Keyboard interface to wxPython listbox","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to decide if it is better to use a pre-rendered large image for a scrolling map game or to render the tiles individual on screen each frame. I have tried to program the game both ways and don't see any obvious difference in speed, but that might be due to my lack of experiences. \nBesides for memory, is there a speed reasons to not use a pre-rendered map?","AnswerCount":4,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":2637,"Q_Id":4451464,"Users Score":0,"Answer":"Depends on the size of the map you want to make, however, with the actual technologies it's very hard to see a tile-map \"rendered\" to take longer than expected, tiled based games are almost extinguished, however is always a good practice and a starting point to the world of game programming","Q_Score":5,"Tags":"python,pygame","A_Id":4474154,"CreationDate":"2010-12-15T15:12:00.000","Title":"Pygame: Tiled Map or Large Image","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to decide if it is better to use a pre-rendered large image for a scrolling map game or to render the tiles individual on screen each frame. I have tried to program the game both ways and don't see any obvious difference in speed, but that might be due to my lack of experiences. \nBesides for memory, is there a speed reasons to not use a pre-rendered map?","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":2637,"Q_Id":4451464,"Users Score":1,"Answer":"Memory and speed are closely related. If your tile set fits in video memory, but the pre-rendered map doesn't, speed will suffer.","Q_Score":5,"Tags":"python,pygame","A_Id":4451504,"CreationDate":"2010-12-15T15:12:00.000","Title":"Pygame: Tiled Map or Large Image","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to decide if it is better to use a pre-rendered large image for a scrolling map game or to render the tiles individual on screen each frame. I have tried to program the game both ways and don't see any obvious difference in speed, but that might be due to my lack of experiences. \nBesides for memory, is there a speed reasons to not use a pre-rendered map?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":2637,"Q_Id":4451464,"Users Score":5,"Answer":"The only reason I can think of for picking one over the other on modern hardware (anything as fast and with as much ram as, say, an iPhone), would be technical ones that make the game code itself easier to follow. There's not much performance wise to distinguish them.\nOne exception I can think of, is if you are using a truly massive background, and doing tile rendering in a GPU, tiles can be textures and you'll get a modest speed bump since you don't need to push much data between cpu and gpu per frame, and it'll use very little video ram.","Q_Score":5,"Tags":"python,pygame","A_Id":4451490,"CreationDate":"2010-12-15T15:12:00.000","Title":"Pygame: Tiled Map or Large Image","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a small Python app ready that I'd like to distribute around to my friends in the company. \nI have used wxWidgets for the GUI, with SQLite for the database.\nI'm planning on using py2exe for packaging the entire thing.\nI'd like to know if bundling the Python interpreter is required ? Does py2exe does it by default ? My friends wont have Python installed on their systems.\nAre there any extra libraries that I should bundle for the GUI ?\nI want this to run only on Windows, nothing else.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":725,"Q_Id":4463097,"Users Score":0,"Answer":"py2exe must bundle the Python interpreter--how else would your friends without Python use your program without it? But it does, of course.\npy2exe mostly includes what needs to be included based on what is imported into your app, so if you have import sqlite3 in there, it will be included. I'd try using GUI2Exe, it makes using py2exe so much more intuitive and easier.","Q_Score":0,"Tags":"python,installation,wxwidgets,executable,py2exe","A_Id":4467946,"CreationDate":"2010-12-16T16:37:00.000","Title":"Do I need to bundle the Python interpreter (in py2exe) when I am distributing my app?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to change my progrssbar color to Black which is green. i think by default it is green\nI am trying with \nself.progress_bar.color \nbut doesnot reflect any change i think there will be any inbuilt method but i am unable to find it.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1414,"Q_Id":4468326,"Users Score":1,"Answer":"I'm guessing here, but because wxPython wraps native widgets whenever possible, those widgets may or may not support the changing of certain colors. I know that's true with StaticText on some OSes. So you may want to try with the generic progress bar, PyProgress, since it's written in pure Python and can be hacked easily.","Q_Score":1,"Tags":"wxpython","A_Id":4471136,"CreationDate":"2010-12-17T06:42:00.000","Title":"Want to change progress bar color to Black in wx python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently in the process of discovering OpenCL via the Python binding Clyther. So\nfar I am messing with a very simple script to get the sin or cos of a buffer of 65536. \nApparently 65536 is the limit for buffers on my card but say I'd have 16 million numbers in my buffer how would I go about it without constantly bringing the CPU into it to retrieve\/send data?\nWhat I have do so far is, fill buffer, run kernel, retrieve buffer, in a loop but that also\nhits the CPU badly.\nI looked a bit at OpenCL docs but I just failed to understand how that is achieved. \nThank you","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":156,"Q_Id":4470246,"Users Score":2,"Answer":"This awfully looks like you are using __constant memory. The solution is to use __global memory instead, but you have to be careful about how you access it for best performance.\n__constant memory is a special address space for often used constant values, but is restricted in size on current GPUs.","Q_Score":0,"Tags":"python,opencl","A_Id":4478655,"CreationDate":"2010-12-17T12:02:00.000","Title":"Processing buffers bigger than 65536 in Clyther\/OpenCL","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I checked some other question and websites, and I've come to the conclusion that Python does allow (correct me if I'm wrong) you to make GUI programs using different cross-platform toolkits like Qt, wxWidgets and some others.\nBut what if I don't want cross-platform portability. Primary, I want to develop native application using native libraries like Cocoa for Mac, native libraries of Windows for window, GTK for GNOME and Qt for KDE apps different with different code. Different code is not an issue here. Can I do this? I just don't need cross-platform portability but I need to make native apps?\nAny insights from pro programmers ?","AnswerCount":3,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":1951,"Q_Id":4471056,"Users Score":8,"Answer":"Don't waste your time. Use wxPython, which will use the native toolkit for you.","Q_Score":1,"Tags":"python,windows,qt,macos,wxwidgets","A_Id":4471107,"CreationDate":"2010-12-17T13:52:00.000","Title":"Python and native GUI","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I were to write several classes in c++ then use swig to do the conversion so I could later use them in python, would they run faster or slower than if I completely rewrote them in python? Or is there no noticable speed difference?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3456,"Q_Id":4476663,"Users Score":6,"Answer":"The quality and speed of wrappers generated by SWIG is very good, and they will probably perform just as good as handcrafted wrappers. \nFrom my experience, the wrappers themselves are very thin and add very little overhead to the native functions they wrap, making it a perfectly valid choice to use wrapped libraries in python or any other supported language, and is a good way to reuse code.\nhowever, to be if you are interested in performance in addition to code reuse, wrapping native code will probably only pay off if you have some computationally intensive native functions, like multiplying matrices, computing MD5 or CRC, folding proteins etc.\non the other hand, sometimes you can just rewrite everything in an easy language like python or C# and enjoy better code and better tools, with comparable performance.","Q_Score":9,"Tags":"c++,python,performance,swig","A_Id":4484174,"CreationDate":"2010-12-18T04:38:00.000","Title":"Speed of swig wrappers","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create a configuration file for a C# app in IronPython. Is there any way I can have that python file just return a value, or do I have to go through variables\/functions to access the results of the script?\ni.e., right now I've got Config.py that looks like\nx = \"test\"\nand C# code that goes\n\n dynamic pyfile = Python.CreateRuntime().ExecuteFile(\"Config.py\");\n Console.WriteLine(pyfile.x);\n\nIs there any way to remove the x?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":618,"Q_Id":4479679,"Users Score":3,"Answer":"You can create a ScriptSource with SourceCodeKind.AutoDetect and it will return the last expression in the file.","Q_Score":2,"Tags":"c#,dynamic,interop,ironpython","A_Id":4480156,"CreationDate":"2010-12-18T19:21:00.000","Title":"How to create an IronPython file that simply returns a single value to C#?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a messagebox class where I can just display a simple message box without a huge GUI library or any library upon program success or failure. (My script only does 1 thing). \nAlso, I only need it to run on Windows.","AnswerCount":6,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":53872,"Q_Id":4485610,"Users Score":2,"Answer":"You can also use the messagebox class from tkinter:\n from tkinter import messagebox\nunless tkinter is that huge GUI you want to avoid.\nUsage is simple, ie:\n messagebox.FunctionName(title, message [, options])\nwith FuntionName in (showinfo, showwarning, showerror, askquestion, askokcancel, askyesno, askretrycancel).","Q_Score":43,"Tags":"python,windows,user-interface,windows-7","A_Id":40915752,"CreationDate":"2010-12-19T22:58:00.000","Title":"Python Message Box Without huge library dependency","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am C\/C \/Java programmer, but lately I have started learn Python. \nMoreover I have 3D Graphics on my studies. I have to create 3D model of my apartment, with dynamic camera. I am wondering if this is a good idea to merge this two issues, by writing this 3D model in python. \nHowever as I said, I am a python beginner, so I don't know possibilities, which python can give me in this area. Which libraries\/engine will be the best for a start?","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":425,"Q_Id":4490991,"Users Score":2,"Answer":"If you're solely trying to learn how to do a 3d model go for the language you're the most familiar with. I'd recommend C++ or C# in that case (whichever of the 2 you meant with the second C).\nIf you also want to learn more about the language Python is the better choice.\nBut pure language wise I wouldn't say that C++\/c#\/python beats the other.","Q_Score":5,"Tags":"python,3d","A_Id":4491082,"CreationDate":"2010-12-20T15:19:00.000","Title":"Is python is a good choice as language used to implementing my first 3D model?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data that should be there. For example from PyQt4.QtCore import QT_VERSION_STR is an import error. There were no errors or warnings given when building the packages and I have also tried with the PyQt packages from yum but I have the same problem.\nHas anyone else encountered this problem before?\nThanks.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":856,"Q_Id":4499204,"Users Score":0,"Answer":"If it's really an ImportError, that suggests that it's failing to import the library altogether. Check that it's definitely somewhere that's in your sys.path, and that from PyQt4 import QtCore works.\nIf the library exists, and QT_VERSION_STR doesn't exist, it will give you a NameError rather than an ImportError.","Q_Score":0,"Tags":"python,linux,qt4,pyqt","A_Id":4499868,"CreationDate":"2010-12-21T12:25:00.000","Title":"PyQt4.QtCore doesn't contain many of its classes and attributes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data that should be there. For example from PyQt4.QtCore import QT_VERSION_STR is an import error. There were no errors or warnings given when building the packages and I have also tried with the PyQt packages from yum but I have the same problem.\nHas anyone else encountered this problem before?\nThanks.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":856,"Q_Id":4499204,"Users Score":0,"Answer":"The reason for this problem was a conflict in my python path. I had two modules named sip.py in different locations on my python path, the python path was using the first one but I wanted it to use the second one. I removed the first entry from the python path as it wasn't necessary.","Q_Score":0,"Tags":"python,linux,qt4,pyqt","A_Id":4592960,"CreationDate":"2010-12-21T12:25:00.000","Title":"PyQt4.QtCore doesn't contain many of its classes and attributes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"With wxPython, how does one trigger an event whenever the whole window goes into\/out of focus? \nTo elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground. My application is just a single window derived from wx.Frame.","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":2304,"Q_Id":4505097,"Users Score":2,"Answer":"In addition to what these fellows are saying, you might also want to try EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. I think these are fired when you move the mouse into and out of the frame widget, although I don't think the frame has to be in focus for those events to fire.\n@ Hugh - thanks for the readership!","Q_Score":1,"Tags":"python,wxpython,wxwidgets","A_Id":4510733,"CreationDate":"2010-12-22T00:01:00.000","Title":"wxPython Whole Window Focus Event","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"With wxPython, how does one trigger an event whenever the whole window goes into\/out of focus? \nTo elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground. My application is just a single window derived from wx.Frame.","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":2304,"Q_Id":4505097,"Users Score":2,"Answer":"as WxPerl programmer i know there is \nEVT_SET_FOCUS(\nEVT_KILL_FOCUS(\nif you initialize this event by listening to the frame as first parameter it should work as in Perl since the API is almost the same","Q_Score":1,"Tags":"python,wxpython,wxwidgets","A_Id":4505382,"CreationDate":"2010-12-22T00:01:00.000","Title":"wxPython Whole Window Focus Event","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"With wxPython, how does one trigger an event whenever the whole window goes into\/out of focus? \nTo elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground. My application is just a single window derived from wx.Frame.","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":2304,"Q_Id":4505097,"Users Score":5,"Answer":"The correct answer for this case is to use an EVT_ACTIVATE handler bound to the frame. There will be an event whenever the frame is activated (brought into the foreground relative to other windows currently open) or deactivated. You can use the event object's GetActive method to tell which just happened.","Q_Score":1,"Tags":"python,wxpython,wxwidgets","A_Id":4521758,"CreationDate":"2010-12-22T00:01:00.000","Title":"wxPython Whole Window Focus Event","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. \nI made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http:\/\/ocw.mit.edu\/courses\/electrical-engineering-and-computer-science\/6-00-introduction-to-computer-science-and-programming-fall-2008\/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. \nWhen I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. \nThank you","AnswerCount":5,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":352,"Q_Id":4514389,"Users Score":0,"Answer":"Python is a good beginning language, but you need to ensure that you do more than just course work.\nWhy not just run through tutorials on Android development right off the bat? If you are worried about wasting time by not using Java immediately, then why not just start there?","Q_Score":1,"Tags":"iphone,python,android","A_Id":4514409,"CreationDate":"2010-12-22T22:41:00.000","Title":"Beginner's Language app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. \nI made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http:\/\/ocw.mit.edu\/courses\/electrical-engineering-and-computer-science\/6-00-introduction-to-computer-science-and-programming-fall-2008\/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. \nWhen I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. \nThank you","AnswerCount":5,"Available Count":2,"Score":0.0399786803,"is_accepted":false,"ViewCount":352,"Q_Id":4514389,"Users Score":1,"Answer":"Learn to program first before learning how to develop for the iPhone. That will give you a much better chance at success. Python a perfectly good language for learning to program, especially in the context of an Intro to CS course environment. But any intro programming language environment will do (even one designed for kids).\nOnce you're comfortable writing non-trivial programs in Python (or whatever first computer language you choose), learning Objective C and the iOS APIs (or Java and the Android APIs) will become much much easier, compared with starting from scratch and zero programming background.","Q_Score":1,"Tags":"iphone,python,android","A_Id":4514481,"CreationDate":"2010-12-22T22:41:00.000","Title":"Beginner's Language app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have a wx.FileDialog (with the wx.FD_OPEN flag) & I would like to know if I can (& how) I could change the button in the bottom right of the FileDialog from \"Open\" to \"Create\" or \"Delete\", etc.\nWhat I am doing is I have a button with the text \"Delete Portfolio\", when pressed it opens a FileDialog & allows the user to select a portfolio file(.db) to delete. So instead of the File Dialog's bottom right confirm button displaying \"Open\" I would like to be able to change the text to \"Confirm\" or \"Delete\" or whatever.\nIs this possible, its a rather superficial thing to do, but if the button says open when the user wants to select a file to delete, it can be a little confusing even if the title of the dialog says \"please select a file to delete\"","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":691,"Q_Id":4529991,"Users Score":0,"Answer":"If you are using the native controls, which wx tends to use, then you probably can't.","Q_Score":2,"Tags":"python,wxpython","A_Id":4530426,"CreationDate":"2010-12-25T10:17:00.000","Title":"wxPython: Change a buttons text in a wx.FileDialog","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wx.FileDialog (with the wx.FD_OPEN flag) & I would like to know if I can (& how) I could change the button in the bottom right of the FileDialog from \"Open\" to \"Create\" or \"Delete\", etc.\nWhat I am doing is I have a button with the text \"Delete Portfolio\", when pressed it opens a FileDialog & allows the user to select a portfolio file(.db) to delete. So instead of the File Dialog's bottom right confirm button displaying \"Open\" I would like to be able to change the text to \"Confirm\" or \"Delete\" or whatever.\nIs this possible, its a rather superficial thing to do, but if the button says open when the user wants to select a file to delete, it can be a little confusing even if the title of the dialog says \"please select a file to delete\"","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":691,"Q_Id":4529991,"Users Score":1,"Answer":"Yeah, I agree with Arafangion. wxPython uses the native widgets and can only manipulate them in whatever way that native widgets allow. You would need to create a custom dialog to do this.","Q_Score":2,"Tags":"python,wxpython","A_Id":4539977,"CreationDate":"2010-12-25T10:17:00.000","Title":"wxPython: Change a buttons text in a wx.FileDialog","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so cards on table will adapt.\nI thought Python will be best for it, because it easy to develop with it and I know it pretty well. Also I have a little of experience with PyQt and Pygame. But I can't decide which one is better for that purpose. What do you think will be easier to use: PyQt, Pygame or something else?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":2261,"Q_Id":4530901,"Users Score":3,"Answer":"if you want just a simple animation and want to finish your game fast. use the pyqt's scene view. refer to (Rapid GUI programming using python and pyqt) book if you want to learn more about scene view.","Q_Score":1,"Tags":"python,pyqt,pygame","A_Id":4562183,"CreationDate":"2010-12-25T17:02:00.000","Title":"what framework to use for python card game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so cards on table will adapt.\nI thought Python will be best for it, because it easy to develop with it and I know it pretty well. Also I have a little of experience with PyQt and Pygame. But I can't decide which one is better for that purpose. What do you think will be easier to use: PyQt, Pygame or something else?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2261,"Q_Id":4530901,"Users Score":0,"Answer":"Both pygame and pyqt will work for what you want to do, but I'd recommend pyqt: you'll be able to use standard widgets (like listboxes, textboxes, menus, buttons, ...).\nI've never worked with pyqt myself, but I image that drag 'n drop is something built-in, which will be really useful for a card game.\nWith pygame on the other hand you'll have to make everything yourself. This will give it more of a game feel as you can draw everything exactly like you want it to look like, but it'll take more work as you have to implement basic stuff yourself.","Q_Score":1,"Tags":"python,pyqt,pygame","A_Id":4562270,"CreationDate":"2010-12-25T17:02:00.000","Title":"what framework to use for python card game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to pyglet. I'd like to change a pixel from black to white at each on_draw iteration. So after 1000 iterations, there should be exactly 1000 white pixels in the window. However, I'd like to avoid calling 1000 draw operations in on_draw for that. So I'd like to create an image, do an RGB putpixel on the image, and blit the image to the screen. How can I do that? The pyglet documentation, the examples and the source code aren't too helpful on this.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1298,"Q_Id":4532008,"Users Score":0,"Answer":"It seems there is no easy way to do this in pyglet. So I've given up on using pyglet.","Q_Score":1,"Tags":"python,image,pyglet","A_Id":5832879,"CreationDate":"2010-12-25T22:51:00.000","Title":"putpixel with pyglet","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a PyQt application that reads and writes data files. I am including a 'version number' in each file written. This is a simple number similar to: 1.2 or something (major and minor versions).\nI am doing this so that I can change the format of these data files in future versions and then still correctly parse them simply by checking to see what the version is inside the file.\nMy question is what is the best practice for keeping this number stored inside the app itself. I.e. do I just hard-code the app version number into the class that is responsible for reading and writing files? Or should I have some sort of object\/variable stored at the top-level of the app and somehow access it from the class responsible for reading and writing these files. If the latter, how do I store it and how do I access it?\nThanks.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3932,"Q_Id":4535895,"Users Score":0,"Answer":"Personally, I wouldn't do it manually this way. I'd save my code in Subversion and let it maintain the revision numbers for me.","Q_Score":5,"Tags":"python,version,global-variables","A_Id":4535921,"CreationDate":"2010-12-26T23:43:00.000","Title":"Python: Best practice for including a version number in an app?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've incorporated IronPython into my XNA game on Windows, but, of course, that won't work on the compact framework since the DLR stuff isn't available.\nAre there any scripting object implementations available that will work with the compact framework? It's really convenient to be able to tweak the system real-time without having to recompile.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":446,"Q_Id":4556096,"Users Score":1,"Answer":"Most things in IronRuby will work on the compact framework (it runs on Windows Phone today). You may need to deploy the DLR yourself but because it's just an additional library it is possible to run it. IronPython could be made to work but it'll require some work to avoid doing code generation where it does today which is not possible on the compact framework.","Q_Score":1,"Tags":"ironpython,xbox360,xna-4.0","A_Id":4566611,"CreationDate":"2010-12-29T17:05:00.000","Title":"XNA - scripting on XBOX?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to check if part or an entire window is over\/under another window in python?\nI have two windows and I'd like to make them not appear over each other. This is in Windows, using Tkinter.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":79,"Q_Id":4566330,"Users Score":1,"Answer":"You can use the methods winfo_rootx and winfo_rooty to get the x\/y in the upper left corner. You can use winfo_width and winfo_height to get the width and height of the window. From that it's just a little math to figure out if two windows overlap. You can then use the geometry method to position the windows anywhere on the screen.","Q_Score":1,"Tags":"python,tkinter","A_Id":4570554,"CreationDate":"2010-12-30T21:15:00.000","Title":"Making windows not appear over each other","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to create a somehow complex application:\nIt is a game level editor. You can put in tiles and other objects for a level. Then \"compress\" the level data into a file.\nWith another application, it will read the file's data and play the game.\nThe application is for Windows mainly. Other platforms are yet to be considered.\nSo I need help deciding:\nIf you were to do something like what I described, which programming language would you choose?\nI want to decide between Ruby or Python.\nI want you to help me choose depending on my following needs:\n\nEasy GUI platform for making the editor.\nCan show sprites, move, transform them etc.\nCan play audio.\nCan compress data, graphics and audio. The compressed file can only be read by another application I make.","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":955,"Q_Id":4577156,"Users Score":1,"Answer":"I've never used Ruby but I'm sure there is virtually no difference between the 2 when it comes to libraries. I know what you want can be done with Python using wxPython or pygame (or the combination of two). But I'm sure there are similar libs for Ruby. So just look at both languages and use the one you like better.","Q_Score":0,"Tags":"python,ruby,user-interface","A_Id":4577169,"CreationDate":"2011-01-02T04:38:00.000","Title":"Making a somehow complex application: Ruby vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I want to create a somehow complex application:\nIt is a game level editor. You can put in tiles and other objects for a level. Then \"compress\" the level data into a file.\nWith another application, it will read the file's data and play the game.\nThe application is for Windows mainly. Other platforms are yet to be considered.\nSo I need help deciding:\nIf you were to do something like what I described, which programming language would you choose?\nI want to decide between Ruby or Python.\nI want you to help me choose depending on my following needs:\n\nEasy GUI platform for making the editor.\nCan show sprites, move, transform them etc.\nCan play audio.\nCan compress data, graphics and audio. The compressed file can only be read by another application I make.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":955,"Q_Id":4577156,"Users Score":4,"Answer":"Python + PyGame. Hands down. You will benefit from:\n\nGood docs for both the language and PyGame\nGUI, sprites, and audio all in one, again with PyGame\nBetter Windows support than Ruby (you can install both Python and PyGame from .exes)\n\nDesktop applications (esp. for Windows) aren't really Ruby's sweet spot. PyGame will serve your purposes perfectly, though.\nThat's not to say you couldn't do it with Ruby; you could write this in any language. But for ease of use, Python is the way to go.","Q_Score":0,"Tags":"python,ruby,user-interface","A_Id":4577168,"CreationDate":"2011-01-02T04:38:00.000","Title":"Making a somehow complex application: Ruby vs Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? \nI am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?","AnswerCount":5,"Available Count":4,"Score":0.1586485043,"is_accepted":false,"ViewCount":13393,"Q_Id":4578307,"Users Score":4,"Answer":"The kind of game matters immensely. High performance games like the big name PC or console games are almost exclusively the domain of C++.\nCasual games can be written in almost any language, including slower languages like Python.\nIf you're a garage type developer who gets his hands wet with some simple game development for this first time, Python would be more than enough. If you however have the ambition to work for a game developer studio, I would definitely recommend learning C++.","Q_Score":8,"Tags":"python,performance","A_Id":4578373,"CreationDate":"2011-01-02T12:15:00.000","Title":"How \"slow\" is python for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? \nI am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?","AnswerCount":5,"Available Count":4,"Score":1.0,"is_accepted":false,"ViewCount":13393,"Q_Id":4578307,"Users Score":6,"Answer":"Elebenty-seven.\nNo, really, it's fast enough for most things, and can drop to C when you really need speed. Profile twice, optimize once.","Q_Score":8,"Tags":"python,performance","A_Id":4578311,"CreationDate":"2011-01-02T12:15:00.000","Title":"How \"slow\" is python for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? \nI am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?","AnswerCount":5,"Available Count":4,"Score":-0.1194272985,"is_accepted":false,"ViewCount":13393,"Q_Id":4578307,"Users Score":-3,"Answer":"C++ is much more easier for object orientation. When you're doing things, it's easier to keep track of everything, because most IDEs for C++ are more based on projects, were as IDLE is more based on single files. \nThe bottom line is for game development, use what you're comfortable with using. I mean, game development is about what you want to do, not what would be better, because better == what you want.","Q_Score":8,"Tags":"python,performance","A_Id":15419304,"CreationDate":"2011-01-02T12:15:00.000","Title":"How \"slow\" is python for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? \nI am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?","AnswerCount":5,"Available Count":4,"Score":0.0798297691,"is_accepted":false,"ViewCount":13393,"Q_Id":4578307,"Users Score":2,"Answer":"Many if not most top-end commercial games these days include some kind of scripting engine for game logic. Game logic decisions, for the most part, aren't particularly performance-sensitive in the way that e.g. the rendering engine is.\nBTW - I'm not claiming any insider knowledge of game development - this is fairly well known outside the industry. Some games publishers have even allowed users access to the scripting stuff and other tools for games modding - for years.\nIf you find a game engine that is wrapped to be used in Python, you'll be dealing with the same basic principles. Write the game logic in Python, and you'll probably be fine.\nPyGame is basically SDL wrapped for Python, supporting basic 2D games for the most part (though OpenGL can be used for 3D in SDL - not sure for PyGame).\nIt's a good starting point. You may hit a performance issue with managing your game objects and running your blit loop, since only very basic graphics stuff is handled by SDL, but you should find that it's just fine for most things.\nAs Ignacio implies - worry about performance problems when you know you have performance problems, not before. Some performance problems are predictable in advance, but if you're not writing the actual game engine in Python, you should be OK - don't fall into the premature optimisation trap, IOW.","Q_Score":8,"Tags":"python,performance","A_Id":4578381,"CreationDate":"2011-01-02T12:15:00.000","Title":"How \"slow\" is python for game development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a PyQt3 (Or 4) Windows binary installer for Python 2.3? I've googled around for an hour now but to no avail. Why am I using version 2.3? With my project file size is paramount. Without the interface, un-needed modules and compressing using UPX the resulting .exe size is a mear 750KB's. Just need to add the interface which will beaf the size up considerably I know but it will still be a good size.\nSo anyone know how I can install PyQt3 or 4 with Python2.3?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":209,"Q_Id":4588045,"Users Score":3,"Answer":"Python 2.3 is extremely old. You really shouldn't be using it at all. I seriously doubt there's any qt bindings for it that would even compile. Why do you think using python 2.3 will save you so much file size?\nAdding pyqt will probably increase your file size by 10s of megabytes at least. Just use python at least 2.6. This is definitely a case of premature optimization. And optimizing something stupid like file size.","Q_Score":0,"Tags":"python,pyqt,python-2.3","A_Id":4588075,"CreationDate":"2011-01-03T20:24:00.000","Title":"PyQt & Python2.3","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am building a window application written in C++. I'd like to utilize several python libraries. \nI don't need any fancy Python interop here. My method is like this:\n\nOpen a thread to run Python interpreter. \nSend commands from C++ to the Python interpreter. The C++ may need to write some intermediate files for the interop. \n\nThis method is dirty, but it will work for a lot of interpreter-like environments, e.g. gnuplot, lua.\nMy question is that what kind of API are there for me to use for this task. Maybe I need some Win32 API?\nEDIT: I don't need any Python specific. I really want the general method. So that my application could also work with gnuplot, etc..","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1517,"Q_Id":4596013,"Users Score":2,"Answer":"ActivePython (http:\/\/www.activestate.com\/activepython\/downloads) installs itself as an ActiveScript engine.The ProgID is Python.AXScript.2 . So you can use it with COM via the Windows standard IActiveScript interface. Read up on it.\nDistribution is another matter. Either you require that customers have it, or you could try and extract the juicy bits from the ActiveState's package, or maybe there's an official way to do unattended setup...","Q_Score":4,"Tags":"c++,python,winapi,api","A_Id":4596102,"CreationDate":"2011-01-04T16:38:00.000","Title":"Embed a Python interpreter in a (Windows) C++ application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am trying to display a simple graph using pydot.\nMy question is that is there any way to display the graph without writing it to a file as currently I use write function to first draw and then have to use the Image module to show the files. \nHowever is there any way that the graph directly gets printed on the screen without being saved ??\n\nAlso as an update I would like to ask in this same question that I observe that while the image gets saved very quickly when I use the show command of the Image module it takes noticeable time for the image to be seen .... Also sometimes I get the error that the image could'nt be opened because it was either deleted or saved in unavailable location which is not correct as I am saving it at my Desktop..... Does anyone know what's happening and is there a faster way to get the image loaded.....\nThanks a lot....","AnswerCount":7,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":27874,"Q_Id":4596962,"Users Score":0,"Answer":"I'm afraid pydot uses graphviz to render the graphs. I.e., it runs the executable and loads the resulting image.\nBottom line - no, you cannot avoid creating the file.","Q_Score":28,"Tags":"python,pydot","A_Id":4597838,"CreationDate":"2011-01-04T18:19:00.000","Title":"Display graph without saving using pydot","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've created a little screensaver-type program with Python, and I'd like to get it working properly under gnome-screensaver. The documentation is all written for C, and there don't appear to be libraries for Python. Is there any way to get this working?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":567,"Q_Id":4597080,"Users Score":2,"Answer":"gnome-screensaver doesn't integrate with the screensavers any more than with a small config file that sets the name, some other properties, and a command to execute to start the screensaver. This is documented in the gnome-screensaver FAQ.\nThe program that gets started needs to get the Window ID from the environment (XSCREENSAVER_WINDOW), and start displaying on that window. This is the tricky part, as it's not always obvious how to do that. Most toolkits should have methods to get a handle on an already existing window by giving the ID, so search your GUI-toolkit documentation for something like that.","Q_Score":2,"Tags":"python,gnome,screensaver","A_Id":4597542,"CreationDate":"2011-01-04T18:34:00.000","Title":"Gnome-Screensaver with Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there any way to get what lines are currently visible in a Tkinter text widget? I'm trying to make a scrollbar. \nCurrently I'm trying to coordinate my scroll bar with the other methods of scrolling (ie, the arrow keys and scroll wheel). So that when I scroll with the arrow keys or mouse, my bar scrolls too.","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1674,"Q_Id":4610074,"Users Score":4,"Answer":"You can get the character (and thus, the line number) at a pixel position using an index of @x,y (eg: @0,0 for the top-left-most visible character). Since you know the width and height of the widget (using the winfo_width and winfo height methods) you can calculate what lines are at the bottom of the widget too.\nYou can also use the yview method to get the relative portion of the text that is in view (eg: a value of .5 means you are half way through the document)","Q_Score":1,"Tags":"python,tkinter","A_Id":4611229,"CreationDate":"2011-01-05T22:59:00.000","Title":"Visible lines in Tkinter text widget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i am trying below code still it is giving me horizontal line..i am missing something?\nself.ln = wx.StaticLine(self,-1,wx.Point(620,0), wx.Size(687,7),wx.LI_VERTICAL)\nself.ln.SetForegroundColour(wx.Colour(255,0,255))","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":6448,"Q_Id":4623031,"Users Score":0,"Answer":"thanks for ur reply\ngot it now..i was missing style keyword ..earliar it has not given error thats why \ndidnot found it\nself.ln = wx.StaticLine(self, -1, size=(4,479),style=wx.LI_VERTICAL)","Q_Score":4,"Tags":"wxpython","A_Id":4623890,"CreationDate":"2011-01-07T06:24:00.000","Title":"How to draw vertical line using wxpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Simply, I'm developing a wireless ECG (electrocardiogram, or EKG from the German Elektrokardiogramm) and I need to choose the best language for a desktop application that allows the following:\n\nwireless transmission of data over WiFi\nreal-time graphing of ECG data signal\na good DSP library\n\nThanks.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":883,"Q_Id":4623047,"Users Score":1,"Answer":"From the viewpoint of a normal program (i.e., not a device driver) a Wi-Fi connection is just a network connection -- not noticeably different from (for example) a wired Ethernet connection.\nReal-time graphing and digital signal processing libraries are probably a little less common, but not much. \"Real time\" is one of those slippery phrases that it's hard to pin down exactly what it means (different people use it differently). At a guess, you just mean you want to update the graph as data arrives. In that case, the important question is what bandwidth you're dealing with -- i.e., how many updates of how much information, how fast?\nBottom line -- none of what you've told us gives much in the way of real criteria for picking a language to use. The obvious open question would be performance -- how much data you need to process, and how much processing you need to do on it. That might at least hint at one being better than another.","Q_Score":1,"Tags":"c#,java,c++,python,c","A_Id":4623129,"CreationDate":"2011-01-07T06:26:00.000","Title":"ECG\/EKG software language advice","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i' have downloaded boost 1.45.0, installed Python 3.1.3 on my mac.\nI have the build Boost with Python succesfully.\nFor this i had to edit my \"project-config.jam\" and add \"using python : 3.1 : \/Library\/Frameworks\/Python.framework\/Versions\/3.1;\" into it.\nAt this point all seems to be allright.\nNow when i try to use this lib in an xcode project, i have link errors:\n\nUndefined symbols:\n \"boost::python::objects::make_nurse_and_patient(_object*, _object*)\", referenced from:\n _object* boost::python::with_custodian_and_ward_postcall<0ul, 1ul, boost::python::default_call_policies>::postcall<_object*>(_object* const&, _object*)in libFluxCore.a(Python.o)\n \"boost::python::objects::enum_base::enum_base(char const*, _object* ()(void const), void* (*)(_object*), void (*)(_object*, boost::python::converter::rvalue_from_python_stage1_data*), boost::python::type_info, char const*)\", referenced from:\n sandbox::BindComponentState() in libFluxCore.a(Python.o)\n sandbox::BindCallOptions() in libFluxCore.a(Python.o)\n sandbox::BindFrameRate() in libFluxCore.a(Python.o)\n\nAnd lot of more...\nPaths and lib are well set in my project.\nDoes someone have an idea of what can happen ?\nThanks.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":380,"Q_Id":4623930,"Users Score":0,"Answer":"I'v finally found this error. buid boost python with \n.\/bjam toolset=darwin-4.2 architecture=x86 address-model=32 link=static threading=multi runtime-link=static\ndid the job, as i am on i86 arch.","Q_Score":0,"Tags":"xcode,boost-python","A_Id":4627509,"CreationDate":"2011-01-07T09:01:00.000","Title":"Linker issue with boost python on Xcode","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to draw to ttkinter.Canvas like javascript or .NET canvas?\nI.E drawline() without storing an object for that line which can be manipulated later.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":248,"Q_Id":4625108,"Users Score":1,"Answer":"I'm not sure what you mean by \"storing an object\". The canvas gives each thing you draw an id, but you don't have to store it. You can't prevent the canvas from assigning an id to the object but are free to completely ignore it.\nWhat problem are you trying to solve where you perceive this to be an issue?\n[edit] To clarify: yes, the interpreter keeps some sort of data for each thing that is drawn. It's not an object in the sense of a Python object though. It's more like a location in memory that describes the thing that was drawn.","Q_Score":1,"Tags":"python,python-3.x,tkinter","A_Id":4625172,"CreationDate":"2011-01-07T11:38:00.000","Title":"Using tkinter.Canvas stateless-ly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to implement 1024x1024 monochromatic grid , i need read data from any cell and insert rectangles with various dimensions, i have tried to make list in list ( and use it like 2d array ), what i have found is that list of booleans is slower than list of integers.... i have tried 1d list, and it was slower than 2d one, numpy is slower about 10 times that standard python list, fastest way that i have found is PIL and monochromatic bitmap used with \"load\" method, but i want it to run a lot faster, so i have tried to compile it with shedskin, but unfortunately there is no pil support there, do you know any way of implementing such grid faster without rewriting it to c or c++ ?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":651,"Q_Id":4637190,"Users Score":0,"Answer":"One thing I might suggest is using Python's built-in array class (http:\/\/docs.python.org\/library\/array.html), with a type of 'B'. Coding will be simplest if you use one byte per pixel, but if you want to save memory, you can pack 8 to a byte, and access using your own bit manipulation.","Q_Score":3,"Tags":"python,bitmap,performance","A_Id":4637207,"CreationDate":"2011-01-09T01:31:00.000","Title":"Python Fast monochromatic bitmap","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to implement 1024x1024 monochromatic grid , i need read data from any cell and insert rectangles with various dimensions, i have tried to make list in list ( and use it like 2d array ), what i have found is that list of booleans is slower than list of integers.... i have tried 1d list, and it was slower than 2d one, numpy is slower about 10 times that standard python list, fastest way that i have found is PIL and monochromatic bitmap used with \"load\" method, but i want it to run a lot faster, so i have tried to compile it with shedskin, but unfortunately there is no pil support there, do you know any way of implementing such grid faster without rewriting it to c or c++ ?","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":651,"Q_Id":4637190,"Users Score":2,"Answer":"Raph's suggestin of using array is good, but it won't help on CPython, in fact I'd expect it to be 10-15% slower, however if you use it on PyPy (http:\/\/pypy.org\/) I'd expect excellent results.","Q_Score":3,"Tags":"python,bitmap,performance","A_Id":4637284,"CreationDate":"2011-01-09T01:31:00.000","Title":"Python Fast monochromatic bitmap","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having problem with drawing in pydot. \nThe problem lies in defining the layout of the nodes created. Currently everything is drawn vertically and is not spread. This gives me the problem of going down to see the nodes created.\nIs there any way I can define the nodes to be created horizontally whenever they are very large in number??\nAlso I want to display mathematical symbols in the labels. But I have not been able to find how to do that. \nIf anyone knows please do tell how I can write epsilon and lambda in the labels from one node to another....\nThanks a lot...","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":419,"Q_Id":4638806,"Users Score":0,"Answer":"I found out that writing the string in unicode representation shows mathematical symbols as edges...\nFor example you can write node = pydot.Node(\"ε\",shape = \"ellipse\", style=\"filled\", fillcolor=\"turquoise\")\nUsing this we get epsilon as label of the node....\nSimilarly we can get rest of the mathematical symbols....","Q_Score":1,"Tags":"python,pydot","A_Id":4844143,"CreationDate":"2011-01-09T11:07:00.000","Title":"changing layout and inserting mathematical symbols with pydot","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython application that is almost done & I would like to place it in my portfolio. I have to consider when someone attempts to run my app that they may not have Python, or wxPython, so if they just click the main script\/python file its not going to run, right?\nHow should I distribute my app (how do you distribute ur apps) so that it can be run & also so that it could be run on the 3 major OS's (Unix, Windows, MacOSX)?\nI know of py2exe for releasing under windows, but what can I use for Unix & MacOSX to compile the program? Whats the easiest way?","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":1685,"Q_Id":4643247,"Users Score":1,"Answer":"I suggest both, script for all platforms and frozen binary for lazy windows users.\nTo answer your latest question, you don't compile python. Python is an interpreted language, it gets compiled on the fly when run. A python frozen binary is actually the python interpreter with your script hardcoded in it. And frozen binaries are windows-only, AFAIK. Besides, Unix and MacOS (usually) come with python pre-installed.","Q_Score":3,"Tags":"python,wxpython","A_Id":4643279,"CreationDate":"2011-01-10T02:33:00.000","Title":"Releasing a wxPython App: Give out scripts or compile in Exe, etc?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"My cocoa app runs background tasks, which I would like to stop when the user becomes idle (no keyboard\/mouse input) and then resume when the user becomes active again. Is there a way to register for idle-state notifications?","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":3011,"Q_Id":4643579,"Users Score":1,"Answer":"I used a different approach. \nSubclassing UIApplication I override the sendEvent method filtering touches (actually you can filter any kind of event, acceleration, touches, etc.).\nUsing a shared variable and a background timer I managed the \"idle\".\nEvery time the user touch the screen the variable is set with current timeInterval (current time). \nThe timer fire method checks for the elapsed time since last touch, if greater than the threshold (in my case was around 90seconds) you can POST your own notification. \nI used this simple approach to create a custom set of apps that after some idle time automatically call the \"screensaver\" app. \nNothing clever, it just do the job.\nHope that helps.","Q_Score":7,"Tags":"objective-c,time,python-idle","A_Id":9402960,"CreationDate":"2011-01-10T03:59:00.000","Title":"Objective C: Get notifications about a user's idle state","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"is it possible to convert a Python program to C\/C++?\nI need to implement a couple of algorithms, and I'm not sure if the performance gap is big enough to justify all the pain I'd go through when doing it in C\/C++ (which I'm not good at). I thought about writing one simple algorithm and benchmark it against such a converted solution. If that alone is significantly faster than the Python version, then I'll have no other choice than doing it in C\/C++.","AnswerCount":8,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":475467,"Q_Id":4650243,"Users Score":163,"Answer":"If the C variant needs x hours less, then I'd invest that time in letting the algorithms run longer\/again\n\n\"invest\" isn't the right word here.\n\nBuild a working implementation in Python. You'll finish this long before you'd finish a C version.\nMeasure performance with the Python profiler. Fix any problems you find. Change data structures and algorithms as necessary to really do this properly. You'll finish this long before you finish the first version in C. \nIf it's still too slow, manually translate the well-designed and carefully constructed Python into C.\nBecause of the way hindsight works, doing the second version from existing Python (with existing unit tests, and with existing profiling data) will still be faster than trying to do the C code from scratch.\n\nThis quote is important.\n\nThompson's Rule for First-Time Telescope Makers\n It is faster to make a four-inch mirror and then a six-inch mirror than to make a six-inch mirror.\nBill McKeenan\n Wang Institute","Q_Score":202,"Tags":"c++,python,c,code-generation","A_Id":4650953,"CreationDate":"2011-01-10T18:46:00.000","Title":"Convert Python program to C\/C++ code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"is it possible to convert a Python program to C\/C++?\nI need to implement a couple of algorithms, and I'm not sure if the performance gap is big enough to justify all the pain I'd go through when doing it in C\/C++ (which I'm not good at). I thought about writing one simple algorithm and benchmark it against such a converted solution. If that alone is significantly faster than the Python version, then I'll have no other choice than doing it in C\/C++.","AnswerCount":8,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":475467,"Q_Id":4650243,"Users Score":12,"Answer":"I know this is an older thread but I wanted to give what I think to be helpful information.\nI personally use PyPy which is really easy to install using pip. I interchangeably use Python\/PyPy interpreter, you don't need to change your code at all and I've found it to be roughly 40x faster than the standard python interpreter (Either Python 2x or 3x). I use pyCharm Community Edition to manage my code and I love it. \nI like writing code in python as I think it lets you focus more on the task than the language, which is a huge plus for me. And if you need it to be even faster, you can always compile to a binary for Windows, Linux, or Mac (not straight forward but possible with other tools). From my experience, I get about 3.5x speedup over PyPy when compiling, meaning 140x faster than python. PyPy is available for Python 3x and 2x code and again if you use an IDE like PyCharm you can interchange between say PyPy, Cython, and Python very easily (takes a little of initial learning and setup though). \nSome people may argue with me on this one, but I find PyPy to be faster than Cython. But they're both great choices though.\nEdit: I'd like to make another quick note about compiling: when you compile, the resulting binary is much bigger than your python script as it builds all dependencies into it, etc. But then you get a few distinct benefits: speed!, now the app will work on any machine (depending on which OS you compiled for, if not all. lol) without Python or libraries, it also obfuscates your code and is technically 'production' ready (to a degree). Some compilers also generate C code, which I haven't really looked at or seen if it's useful or just gibberish. Good luck.\nHope that helps.","Q_Score":202,"Tags":"c++,python,c,code-generation","A_Id":37192125,"CreationDate":"2011-01-10T18:46:00.000","Title":"Convert Python program to C\/C++ code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a project that is based on Urdu language in Ubuntu platform. I'm using Python language and have almost achieved my task.\nThe problem is that, the Urdu text is rendered in reverse order.\nFor example, consider the word \u06a9\u0627\u0645 (which means work)\nconsisting of the three letters: \n\u06a9 ,\n\u0627 , and\n\u0645\nThe output is rendered in reverse order as \u0645\u0627\u06a9\nconsisting of the three letters:\n\u0645, \n\u0627, and\n\u06a9\nWhen copying this text to Open Office or opening the generated XML file in Firefox,\nthe generated result is absolutely desired.\nI Am using Python 2.6 IDLE, its working perfect with Windows platform, which clearly shows its not the problem of IDLE. Am working on TKINTER GUI library.\nHow can this problem be solved?","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":824,"Q_Id":4668985,"Users Score":-1,"Answer":"Use a toolkit that isn't terrible, such as PyQt, PyGTK, or wxPython.","Q_Score":2,"Tags":"python,linux,fonts,tkinter,right-to-left","A_Id":4669402,"CreationDate":"2011-01-12T12:50:00.000","Title":"Reverse rendering of Urdu fonts","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm trying to use clr.AddReference to add sqlite3 functionality to a simple IronPython program I'm writing; but everytime I try to reference System.Data.SQLite I get this error:\n\nTraceback (most recent call last):\n File \"\", line 1, in \n IOError: System.IO.IOException: Could not add reference to assembly System.Data.SQLite\n at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean&shouldOptimize)\n at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0)\n at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\n at CallSite.Target(Closure , CallSite , CodeContext , Object , Object )\n at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)\n at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)\n at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)\n at IronPython.Runtime.FunctionCode.Call(CodeContext context)\n at IronPython.Runtime.Operations.PythonOps.QualifiedExec(CodeContext context, Object code, PythonDictionary globals, Object locals)\n at Microsoft.Scripting.Interpreter.ActionCallInstruction4.Run(InterpretedFrame frame)\n at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)\n\nI've been testing out the imports and references in the interpreter mainly, and these are the lines I test:\n\nimport sys\n import clr\n sys.path.append(\"C:\/Program Files (x86)\/SQLite.NET\/bin\")\n clr.AddReference(\"System.Data.SQLite\") \n\nThe error happens after the clr.AddReference line is entered. How would I add System.Data.SQLite properly?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":1695,"Q_Id":4682960,"Users Score":1,"Answer":"My first guess is that you're trying to load the x86 (32-bit) System.Data.SQLite.dll in a x64 (64-bit) process, or vice versa. System.Data.SQLite.dll contains the native sqlite3 library, which must be compiled for x86 or x64, so there is a version of System.Data.SQLite.dll for each CPU.\nIf you're using the console, ipy.exe is always 32-bit (even on 64-bit platforms) while ipy64.exe is AnyCPU, so it matches the current platform. If you're hosting IronPython, and the host app is AnyCPU, you need to load the right copy of System.Data.SQLite.dll for the machine you're running on (or just force the host app x86).","Q_Score":1,"Tags":"ado.net,ironpython,system.data.sqlite","A_Id":4696478,"CreationDate":"2011-01-13T17:11:00.000","Title":"Adding System.Data.SQLite reference in IronPython","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm having a database (sqlite) of members of an organisation (less then 200 people). Now I'm trying to write an wx app that will search the database and return some contact information in a wx.grid. The app will have 2 TextCtrls, one for the first name and one for the last name. What I want to do here is make it possible to only write one or a few letters in the textctrls and that will start to return result. So, if I search \"John Smith\" I write \"Jo\" in the first TextCtrl and that will return every single John (or any one else having a name starting with those letters). It will not have an \"search\"-button, instead it will start searching whenever I press a key.\nOne way to solve this would be to search the database with like \" SELECT * FROM contactlistview WHERE forname LIKE 'Jo%' \" But that seems like a bad idea (very database heavy to do that for every keystroke?). Instead i thought of use fetchall() on a query like this \" SELECT * FROM contactlistview \" and then, for every keystroke, search the list of tuples that the query have returned. And that is my problem: Searching a list is not that difficult but how can I search a list of tuples with wildcards?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":697,"Q_Id":4698933,"Users Score":0,"Answer":"If you are searching for a string matching the start using LIKE, eg 'abc%' (rather than anywhere in the string - '%abc%'), the search should be quite fast if you have an index on the field, as the db can use the index to help find the matches.","Q_Score":0,"Tags":"python,sqlite,tuples","A_Id":4699909,"CreationDate":"2011-01-15T09:49:00.000","Title":"Searching a list of tuples in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm having a database (sqlite) of members of an organisation (less then 200 people). Now I'm trying to write an wx app that will search the database and return some contact information in a wx.grid. The app will have 2 TextCtrls, one for the first name and one for the last name. What I want to do here is make it possible to only write one or a few letters in the textctrls and that will start to return result. So, if I search \"John Smith\" I write \"Jo\" in the first TextCtrl and that will return every single John (or any one else having a name starting with those letters). It will not have an \"search\"-button, instead it will start searching whenever I press a key.\nOne way to solve this would be to search the database with like \" SELECT * FROM contactlistview WHERE forname LIKE 'Jo%' \" But that seems like a bad idea (very database heavy to do that for every keystroke?). Instead i thought of use fetchall() on a query like this \" SELECT * FROM contactlistview \" and then, for every keystroke, search the list of tuples that the query have returned. And that is my problem: Searching a list is not that difficult but how can I search a list of tuples with wildcards?","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":697,"Q_Id":4698933,"Users Score":2,"Answer":"I think that generally, you shouldn't be afraid of giving tasks to a database. It's quite possible that the LIKE clause will be very fast. Sqlite is implemented in fairly robust C code, and will happily deal with queries like this.\nIf you're worried about sending too many requests, why not send a query once a user has entered a threshold of characters, such as three?\nA list comprehension is probably the best way to return the result if you want to do added filtering.","Q_Score":0,"Tags":"python,sqlite,tuples","A_Id":4698981,"CreationDate":"2011-01-15T09:49:00.000","Title":"Searching a list of tuples in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I have a Python package that depends on some C libraries (like say the Gnu Scientific Library (GSL) for numerical computations), is it a good idea to bundle the library with my code?\nI'd like to make my package as easy to install as possible for users and I don't want them to have to download C libraries by hand and supply include-paths. Also I could always ensure that the version of the library that I ship is compatible with my code.\nHowever, is it possible that there are clashes if the user has the library installed already, or ar there any other reasons why I shouldn't do this?\nI know that I can make it easier for users by just providing a binary distribution, but I'd like to avoid having to maintain binary distributions for all possible OSs. So, I'd like to stick to a source distribution, but for the user (who proudly owns a C compiler) installation should be as easy as python setup.py install.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":629,"Q_Id":4700178,"Users Score":0,"Answer":"You could have two separate branches of the src, one containing the libraries and another that doesn't. That way you can explicitly warn your users in case they have installed the libraries. Another solution could be (if the licences of the libraries allow you) is to wrap 'em up in a single file.\nI think there's no unique solution, but this are the ideas I could think so far.\nGood luck","Q_Score":7,"Tags":"python,c,distutils","A_Id":4700264,"CreationDate":"2011-01-15T14:47:00.000","Title":"Should I bundle C libraries with my Python application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am thinking about to learn new language or framework. Now I deal with C# and WPF, WCF, Winforms. I have some free time so I would like get new skills.\nBut I have dilema, start with some C++ framework (such as Platinum, Reason, Evocosm, ACF)\nor try Python \/ python framework.\nI you are on my place which possibility you choose?\nI am 17 years student, I have basic skills in C++ (OOP, little with STL), with Python I haven\u2019t any experience.\nWhat would be your choice and why?","AnswerCount":6,"Available Count":4,"Score":1.2,"is_accepted":true,"ViewCount":438,"Q_Id":4708482,"Users Score":0,"Answer":"Personally I prefer Python, but profesionally, that is if you want a good job C++ is a better choice.","Q_Score":3,"Tags":"c++,python,frameworks","A_Id":4708502,"CreationDate":"2011-01-16T22:20:00.000","Title":"Start with some C++ framework or python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am thinking about to learn new language or framework. Now I deal with C# and WPF, WCF, Winforms. I have some free time so I would like get new skills.\nBut I have dilema, start with some C++ framework (such as Platinum, Reason, Evocosm, ACF)\nor try Python \/ python framework.\nI you are on my place which possibility you choose?\nI am 17 years student, I have basic skills in C++ (OOP, little with STL), with Python I haven\u2019t any experience.\nWhat would be your choice and why?","AnswerCount":6,"Available Count":4,"Score":0.0333209931,"is_accepted":false,"ViewCount":438,"Q_Id":4708482,"Users Score":1,"Answer":"I recommend you to keep learning C++. Before you started looking for framework learn some popular search algorithm and try implement them. After that try implement some structures, like queues, list, stack, binary trees and some operation on them. Meanwhile play with I\/O (for example, try write your stack to file and read it back to stack - in plain text and binary). \nIt was my university tour on programming class. C++ is good choice because it is hard and multiparadigmats language so in future u will find much in common with other languages and you will be familiar with memory management system.","Q_Score":3,"Tags":"c++,python,frameworks","A_Id":4708519,"CreationDate":"2011-01-16T22:20:00.000","Title":"Start with some C++ framework or python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am thinking about to learn new language or framework. Now I deal with C# and WPF, WCF, Winforms. I have some free time so I would like get new skills.\nBut I have dilema, start with some C++ framework (such as Platinum, Reason, Evocosm, ACF)\nor try Python \/ python framework.\nI you are on my place which possibility you choose?\nI am 17 years student, I have basic skills in C++ (OOP, little with STL), with Python I haven\u2019t any experience.\nWhat would be your choice and why?","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":438,"Q_Id":4708482,"Users Score":0,"Answer":"Well. Learning Python basics will take a week, and you will save the time spent in a year since it is such a good language for small hacks and scripts. So I suggest you learn it first.\nLearning C++ well will take you five to ten years, so there is not the same immediate benefit :)","Q_Score":3,"Tags":"c++,python,frameworks","A_Id":4708899,"CreationDate":"2011-01-16T22:20:00.000","Title":"Start with some C++ framework or python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am thinking about to learn new language or framework. Now I deal with C# and WPF, WCF, Winforms. I have some free time so I would like get new skills.\nBut I have dilema, start with some C++ framework (such as Platinum, Reason, Evocosm, ACF)\nor try Python \/ python framework.\nI you are on my place which possibility you choose?\nI am 17 years student, I have basic skills in C++ (OOP, little with STL), with Python I haven\u2019t any experience.\nWhat would be your choice and why?","AnswerCount":6,"Available Count":4,"Score":0.0,"is_accepted":false,"ViewCount":438,"Q_Id":4708482,"Users Score":0,"Answer":"I'd pick C++ for the sole reason that it's nothing like the languages you already know, even though it shares some syntax.","Q_Score":3,"Tags":"c++,python,frameworks","A_Id":4708606,"CreationDate":"2011-01-16T22:20:00.000","Title":"Start with some C++ framework or python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a main window and I want that when I maximize it the widgets inside it should automatically be resized ....\nIs there any way I can do that ????","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1134,"Q_Id":4712705,"Users Score":2,"Answer":"Yes. Use layout objects (such as QHBoxLayout or QGridLayout) to organize your widgets inside, and set the widgets' resize modes accordingly. Note that standard Qt-supplied widgets support resizing by default.","Q_Score":1,"Tags":"python,pyqt4","A_Id":4712851,"CreationDate":"2011-01-17T11:39:00.000","Title":"PyQt4 - Maximize window along with inside widgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a main window and I want that when I maximize it the widgets inside it should automatically be resized ....\nIs there any way I can do that ????","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":1134,"Q_Id":4712705,"Users Score":1,"Answer":"If you want to save you a lot of work, don't hand-code the ui. Use Qt Creator to create a ui file and then load this file dynamically using PyQt4.uic module. There is also a \"static\" approach that generates python code from Qt Creator ui files.","Q_Score":1,"Tags":"python,pyqt4","A_Id":4713335,"CreationDate":"2011-01-17T11:39:00.000","Title":"PyQt4 - Maximize window along with inside widgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create a menu bar in wxPython 2.8.11.0 and Python 2.7 where most of the menus are left aligned (as normal) but one is - ideally - right aligned, or at least separated in some way from the rest.\nIs this possible?\nEDIT: This needs to be a cross-platform solution.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":608,"Q_Id":4730785,"Users Score":1,"Answer":"If the native menubar doesn't support it, then wxPython probably won't either. There is a pure Python implementation of the menubar though. It's called FlatMenu. I would try that. If it doesn't work, at least you can hack it or submit a patch in Python code rather than trying to figure out the C++ for fixing wxWidgets.","Q_Score":2,"Tags":"python,menu,cross-platform,wxpython,menubar","A_Id":4763966,"CreationDate":"2011-01-19T01:08:00.000","Title":"Is it possible to align a menu to the right of the menu bar using wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on Qtdesigner for generating a GUI for my python app.\nThe problem is that I had manually made the widgets and then compiled it to py. But then I found out that the components did not resize when maximised.\nSo I opened the .ui file in designer and selected the group box for my widgets and chose layout in grid by right clicking on it.\nEven now the widgets do not resize on maximising....\nDo I have to do something else ???\nThanks a lot...","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":316,"Q_Id":4737324,"Users Score":0,"Answer":"To have the widgets resized with the window, you must apply a layout to your top-level object (usually QMainWindow), and then place your new widgets where you want in the layout (and maybe other layouts for a more complicated window).\nNOTE: the menu items allowing to apply a layout on the main window will be available only once you have placed your first widget in it.","Q_Score":0,"Tags":"python,qt,pyqt4,qt-designer","A_Id":4741509,"CreationDate":"2011-01-19T15:47:00.000","Title":"Help in designing layout with qtdesigner for python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"HI, guys,\nI am using wxpython to develop a GUI for software configuration, launching and interaction. I want something like a CLI shell window (like pycrust) embedded inside the GUI to interact with a long-term running background process. I could give the input via this shell window and print the output on this window. My current code works very well. But there is problem of editing style, because wx.TextCtrl is simply an editable text window. e.g., I could overwrite or remove any previous text characters or type new input at any location. This is not desirable. \nHow can I make the wx.TextCtrl like a shell window, i.e. make the output readonly, while keep input editable? e.g.,\n1) when input new command, the position only starts after prompt. \n2) The user cannot change or replace any previous output text.\nI want to force certain restriction, for interaction purpose. \nIs there a way to fix the curse prompt? If so, then my problem will be solved, because the user will have no chance to move the curse. \nOr is there a way to set certain part of the text (the output and the prompt) readonly?\nOr another solution, thanks to 9000's answer, is that I make a grid of windows (a StaticTextCtrl or readonly TextCtrl for output in the upper window; prompt \">>>\" on the bottom left area; invisible-border editable window or entry dialog on the bottom right area for input). \nany suggestions? Is there any better choice?\nThanks a lot!","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1237,"Q_Id":4747944,"Users Score":1,"Answer":"In our product we have a console made up of two edit windows, separated by a thin line. The upper window is the output window, it is read-only. The lower window is editable. Once you have written a command in it and submitted it, the command is removed from the lower window and goes to the upper window, along with command's output.\nYou can click the upper window, select something from it, scroll it up, etc, all without removing the command you're currently editing from sight. Then you click on the lower window or press any key, and the control returns to the lower window, where you continue to craft your next command.","Q_Score":1,"Tags":"shell,formatting,input,wxpython,wxwidgets","A_Id":4748126,"CreationDate":"2011-01-20T13:53:00.000","Title":"output readonly, input editable with wx.textctrl?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"HI, guys,\nI am using wxpython to develop a GUI for software configuration, launching and interaction. I want something like a CLI shell window (like pycrust) embedded inside the GUI to interact with a long-term running background process. I could give the input via this shell window and print the output on this window. My current code works very well. But there is problem of editing style, because wx.TextCtrl is simply an editable text window. e.g., I could overwrite or remove any previous text characters or type new input at any location. This is not desirable. \nHow can I make the wx.TextCtrl like a shell window, i.e. make the output readonly, while keep input editable? e.g.,\n1) when input new command, the position only starts after prompt. \n2) The user cannot change or replace any previous output text.\nI want to force certain restriction, for interaction purpose. \nIs there a way to fix the curse prompt? If so, then my problem will be solved, because the user will have no chance to move the curse. \nOr is there a way to set certain part of the text (the output and the prompt) readonly?\nOr another solution, thanks to 9000's answer, is that I make a grid of windows (a StaticTextCtrl or readonly TextCtrl for output in the upper window; prompt \">>>\" on the bottom left area; invisible-border editable window or entry dialog on the bottom right area for input). \nany suggestions? Is there any better choice?\nThanks a lot!","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1237,"Q_Id":4747944,"Users Score":1,"Answer":"Just keep track of the location of the prompt each time you display it. Intercept all keypresses and releases, and if anything causes text before the prompt to change, veto that event. It's not that hard, it just takes a little attention to detail and some diligence to capture all text-modification events.","Q_Score":1,"Tags":"shell,formatting,input,wxpython,wxwidgets","A_Id":4764075,"CreationDate":"2011-01-20T13:53:00.000","Title":"output readonly, input editable with wx.textctrl?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"We are building an app where in there will be a need to display the updates\/notification (ex : like status updates\/wall posts on FB). These needs to be displyed at the lower right corner of the window(like any other notifications). So was trying on some alternatives to best display the updates. Some option explored are PopupWindow (which was not that great for status update) and dialog (seems ok). Are there any other good options for this and is there any pre-defined end corners position constants? Plz suggest.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2743,"Q_Id":4755963,"Users Score":0,"Answer":"I second the ToasterBox suggestion. You can also create your own Dialog though and position it by grabbing the screen resolution and the size of the dialog and setting its position. I've done the latter for a custom popup. On Macs, you can access Growl through a Python API that's mentioned on their website.","Q_Score":4,"Tags":"python,user-interface,wxpython","A_Id":4763861,"CreationDate":"2011-01-21T06:16:00.000","Title":"wxPython PopUp notifications","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Considering the following requirementes:\n\nMust be supported on Windows. Preferably works also on other platforms.\nMust support multi threading. By that I mean that the engine can work in parallel in multiple threads.\nReadability is important.\nLicense must be compatible with closed-source projects.\n\nI like Python for its readablity. I am also have more experience with Python than other scripting languages. However CPython is not multi-threaded, and IronPython requires hosting the CLR and a compatible language (C++\/CLI or C#).","AnswerCount":12,"Available Count":5,"Score":0.0166651236,"is_accepted":false,"ViewCount":4208,"Q_Id":4756544,"Users Score":1,"Answer":"Im pretty sure Stackless Python is going to be the only one supporting multithreading out the box. Stackless Python was chosen by CCP for their MMO: Eve-Online specifically because the stackless nature of the code allowed them to schedule the continuations on any OS thread they needed once they'd built the necessary primitives in to make the whole thing thread safe.\nLua can be used in a multi threaded environment, but each concurrent thread would need a separate lua_State object so you'd need to build your own interthread message passing system for lua code, executing in the context of separate lua states, to communicate.","Q_Score":17,"Tags":"javascript,python,ruby,windows,lua","A_Id":4774036,"CreationDate":"2011-01-21T07:51:00.000","Title":"Which scripting language is better for embedding in multi-threaded C\/C++ application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Considering the following requirementes:\n\nMust be supported on Windows. Preferably works also on other platforms.\nMust support multi threading. By that I mean that the engine can work in parallel in multiple threads.\nReadability is important.\nLicense must be compatible with closed-source projects.\n\nI like Python for its readablity. I am also have more experience with Python than other scripting languages. However CPython is not multi-threaded, and IronPython requires hosting the CLR and a compatible language (C++\/CLI or C#).","AnswerCount":12,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":4208,"Q_Id":4756544,"Users Score":0,"Answer":"Entirely preference-based. Most languages have a way to embed in C with options for exports into the scripting environment.\nIf it were me, I'd go with V8 Javascript.","Q_Score":17,"Tags":"javascript,python,ruby,windows,lua","A_Id":4855161,"CreationDate":"2011-01-21T07:51:00.000","Title":"Which scripting language is better for embedding in multi-threaded C\/C++ application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Considering the following requirementes:\n\nMust be supported on Windows. Preferably works also on other platforms.\nMust support multi threading. By that I mean that the engine can work in parallel in multiple threads.\nReadability is important.\nLicense must be compatible with closed-source projects.\n\nI like Python for its readablity. I am also have more experience with Python than other scripting languages. However CPython is not multi-threaded, and IronPython requires hosting the CLR and a compatible language (C++\/CLI or C#).","AnswerCount":12,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":4208,"Q_Id":4756544,"Users Score":0,"Answer":"By \"multithreaded\" I'm assuming you mean \"can effectively exploit multiple cores\"? If your system only has a single CPU, then you're only going to be done one thing at a time regardless of the scripting language you choose.\nIf you do decide to go the CPython route, then there the main thing to remember is that it is only the scripting engine itself that is protected by the global interpreter lock. If the script being executed spends a lot of time calling out to non-Python code (including I\/O and other system level operations) then it can exploit multiple threads quite happily.\nAnother factor to consider is that Python's introspection capabilities make it inherently difficult to secure properly (Google have done it for AppEngine, but they had to disallow quite a few things in the process).\nGiven the prevalence of Javascript engines in browsers and Lua engines in PC games, one of those is likely to be an easier way forward.","Q_Score":17,"Tags":"javascript,python,ruby,windows,lua","A_Id":4859076,"CreationDate":"2011-01-21T07:51:00.000","Title":"Which scripting language is better for embedding in multi-threaded C\/C++ application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Considering the following requirementes:\n\nMust be supported on Windows. Preferably works also on other platforms.\nMust support multi threading. By that I mean that the engine can work in parallel in multiple threads.\nReadability is important.\nLicense must be compatible with closed-source projects.\n\nI like Python for its readablity. I am also have more experience with Python than other scripting languages. However CPython is not multi-threaded, and IronPython requires hosting the CLR and a compatible language (C++\/CLI or C#).","AnswerCount":12,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":4208,"Q_Id":4756544,"Users Score":11,"Answer":"I've been in the same dilemma an choose Lua over Python and JScript. \nThe thing which Lua does best is the great interop with C\/C++ code using libraries like luabridge and luabind. That is, you can call lua from C++ and have the script call back into C++ without a problem, access c++ data from the script and vice versa.\nThe problem with languages like Python and Lua is that the language is not really multi-threaded in the regular sense of the word: if one C++ thread it using the language scripting engine to run a script, you cannot use the same engine to run another script. Both languages has an engine-wide lock which can be used in those cases to make sure the engine integrity is maintained. However, both languages are multi-threaded in the sense that you can run function in the background and interact with any synchronization object you want (just like from C++). So I choose to have all threads created from C++ and scripting code only run in a dedicated threads (thread per engine) and interact with other threads in the application in the regular ways.\nIf you need to pass data and control from C++ to a script and vice versa, Lua is much better than Python. Beside that, I would not host the CLR in a C++ project. It's too messy.","Q_Score":17,"Tags":"javascript,python,ruby,windows,lua","A_Id":4769506,"CreationDate":"2011-01-21T07:51:00.000","Title":"Which scripting language is better for embedding in multi-threaded C\/C++ application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Considering the following requirementes:\n\nMust be supported on Windows. Preferably works also on other platforms.\nMust support multi threading. By that I mean that the engine can work in parallel in multiple threads.\nReadability is important.\nLicense must be compatible with closed-source projects.\n\nI like Python for its readablity. I am also have more experience with Python than other scripting languages. However CPython is not multi-threaded, and IronPython requires hosting the CLR and a compatible language (C++\/CLI or C#).","AnswerCount":12,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":4208,"Q_Id":4756544,"Users Score":12,"Answer":"Lua is the best choice. Python, Ruby and JavaScript are big languages and they are not designed for to embed. But Lua is different, designed to embed.\nYou should consider the \"restriction\" more than any other things for your script language. Embed scripts can use for hack (bad meaning) easily.\nFor example, by default Lua can not print to console. As I know, Blizzard uses the Lua because of that.","Q_Score":17,"Tags":"javascript,python,ruby,windows,lua","A_Id":4808596,"CreationDate":"2011-01-21T07:51:00.000","Title":"Which scripting language is better for embedding in multi-threaded C\/C++ application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to draw a Grid World (similar to a table), where cells may contain robots or obstacles. A dot\/arrow would do to represent the robot and colouring the cells in black for examples could represent the obstacles. \nI am not looking for anything complicated, just a simple python library that would help me do this. Any suggestions?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3612,"Q_Id":4783462,"Users Score":1,"Answer":"tkinter has a canvas widget that is pretty easy to work with. It has primitives for lines and filled polygons and circles and so on. And with the event loop its pretty easy to do simple animations.","Q_Score":3,"Tags":"python,grid,draw","A_Id":4784164,"CreationDate":"2011-01-24T14:59:00.000","Title":"How to draw Grid World using Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have made an application using Python and recently i found that i can use py2exe to make executables for windows.\nThe problem is that a library i am using (xmpppy) produces this error\n\nDeprecationWarning: the md5 module is deprecated; use hashlib instead\n\nand when i try to run the executable a dialog appears saying this\n\nSee the logfile 'C:\\Python26\\P2E\\MyApp\\dist\\MyApp.exe.log' for details\n\nany ideas how to fix that?","AnswerCount":2,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":974,"Q_Id":4793250,"Users Score":-2,"Answer":"when a python script .py has any error it shows in console but when you run python .exe file it genrates .exe.log file when error accured.so go to your folder and see that there is a .exe.log file is there showing errors.","Q_Score":0,"Tags":"python,pyqt4,xmpppy","A_Id":50261727,"CreationDate":"2011-01-25T12:03:00.000","Title":"PyQt4 - \"See the log file for details\" error","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to build my first wx application\nI have a browse button in my panel, the user adds his file. i do some processing on the file.\nNow i want to show the information in a TextCtrl so that the user may modify it. Then i need to write it in a file.\nBut I dont know how many TextCtrl box is needed before processing the file. \nUsing the browse button event i have got the file, extracted the information also. But i dont know how to show the information back to the user. \nany suggestion is appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":439,"Q_Id":4802134,"Users Score":0,"Answer":"If all you're doing is showing one file, then all you need is one TextCtrl. I would give the widget the wx.TE_MULTILINE style and add it to a sizer with an EXPAND flag:\nsizer.Add(myTxtCtrl, 0, wx.EXPAND)\nThen the user can see the file and you can save the data with a Save button or menu item. The handler for that would basically just grab the text control's contents using it's GetValue() method.","Q_Score":0,"Tags":"wxpython,textctrl","A_Id":4807514,"CreationDate":"2011-01-26T07:10:00.000","Title":"wxPython: TextCtrl problem","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using python 3 \/ tkinter if that matters.\nIn looking at code samples I noticed that the main loop is typically in the GUI part of the code, and the rest of the code provides callbacks for GUI to call when needed.\nBut my simulation runs independently of the user interaction; the UI is there to provide a view, from time to time, into what's going on in the simulation, but it doesn't control what goes on in the simulation. So I would like the main loop to be concerned with the simulation rather than UI. How would I do that?","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":816,"Q_Id":4812323,"Users Score":1,"Answer":"Write your own main loop that calls the functions that check for and process GUI events.","Q_Score":2,"Tags":"python,design-patterns,user-interface,tkinter","A_Id":4812333,"CreationDate":"2011-01-27T03:02:00.000","Title":"Can the main loop of a program be moved out of GUI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using python 3 \/ tkinter if that matters.\nIn looking at code samples I noticed that the main loop is typically in the GUI part of the code, and the rest of the code provides callbacks for GUI to call when needed.\nBut my simulation runs independently of the user interaction; the UI is there to provide a view, from time to time, into what's going on in the simulation, but it doesn't control what goes on in the simulation. So I would like the main loop to be concerned with the simulation rather than UI. How would I do that?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":816,"Q_Id":4812323,"Users Score":2,"Answer":"Why not seperate your logic and presentation. Write your sim backend to respond to a single text based protcol to receive cmds and send back results, and then just talk to it from your gui program over e.g. unix sockets.","Q_Score":2,"Tags":"python,design-patterns,user-interface,tkinter","A_Id":4812403,"CreationDate":"2011-01-27T03:02:00.000","Title":"Can the main loop of a program be moved out of GUI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using the pyBluez module on Python 2.6 on WindowsXP. I'd like to get the RSSI of other bluetooth devices around.\nI foudn some code but it makes use of _bluetooth, which I cannto find anywhere for Windows.\nIs it available \/ is there another way to circumvent the problem, getting the RSSI without using _bluetooth?\nThank you all!","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1917,"Q_Id":4815088,"Users Score":0,"Answer":"The _bluetooth module is a part of PyBluez. If you have installed a Windows release of PyBluez, it should work.\nI don't know enough about Bluetooth to even know what \"getting the RSSI without using it\" means or why it should be a problem, so can't help you there. :)","Q_Score":1,"Tags":"python,windows,bluetooth,rssi","A_Id":4815494,"CreationDate":"2011-01-27T10:17:00.000","Title":"RSSI with pyBluez on WindowsXP","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently taking a course on Compilers. I don't like the idea of blindly memorising facts without any sort of place to apply them to. I want to learn by hands-on doing. \nSo, I would like to have the complete code of 3-4 compilers, possibly for languages with different syntax rules (python,c, c++, java) while working through the Dragon book.\nIf complete compilers are too much of an ask, examples of parsers(well-written LL, LR, LALR parsers) and intermediate-code generators for these languages would also do. \nThere is a LOT of code out there on the Internet regarding this, but I want something that is considered to be high-quality and standard. I would be grateful for any resources that you can refer me to in this matter. Thanks.","AnswerCount":6,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1318,"Q_Id":4818779,"Users Score":2,"Answer":"You can grab code for the Lua compiler from lua.org, they distribute full source, and you could also get GCC's source code, which is both C and C++ compiling.","Q_Score":1,"Tags":"java,c++,python,parsing,compiler-construction","A_Id":4818927,"CreationDate":"2011-01-27T16:11:00.000","Title":"Good source code for compiler components","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently taking a course on Compilers. I don't like the idea of blindly memorising facts without any sort of place to apply them to. I want to learn by hands-on doing. \nSo, I would like to have the complete code of 3-4 compilers, possibly for languages with different syntax rules (python,c, c++, java) while working through the Dragon book.\nIf complete compilers are too much of an ask, examples of parsers(well-written LL, LR, LALR parsers) and intermediate-code generators for these languages would also do. \nThere is a LOT of code out there on the Internet regarding this, but I want something that is considered to be high-quality and standard. I would be grateful for any resources that you can refer me to in this matter. Thanks.","AnswerCount":6,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1318,"Q_Id":4818779,"Users Score":0,"Answer":"Your course on compilers should be giving you the pieces that will eventually lead to a full blown compiler. \nFor example, the section on lexical analysis can lead to a component called the Lexer. If you keep an eye open to generics and re-usability, you can turn this into a component that can be used later in your compiler.\nI highly suggest you take the approach of having at least two components in every homework project: main and the library component. In the example of lexical analysis, the main component would handle input and testing. The library component would be the lexer. This technique will help greatly after you graduate and develop huge applications in the real world.","Q_Score":1,"Tags":"java,c++,python,parsing,compiler-construction","A_Id":4820418,"CreationDate":"2011-01-27T16:11:00.000","Title":"Good source code for compiler components","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to create a small application for Symbian mobile phones using Python. Being a beginner i am having some trouble in setting up the environment for development. I installed Symbian3 SDK,PyS60 Application Manager ( for creating the .sis files to be installed on phones) and python 2.5.2 . I created a small hello world program and created its equivalent .sis file. But when i try to install it in Symbian 3 SDK, it gives me a 'Python Run time Error' ; i suppose it is because there isnt any python installed on the SDK. But when i tried to install the PythonForS60.sis file, it gives me a certificate error. I tried downloading the file through SDK, again it gives me a certificate error. I tried certifying the application through SymbianSigned.com, then it gives this error \n\"The .sis file contains capabilities that are not permitted for Open Signed (Online)\nFAILURE: Submitted .sis file uses a UID that is not allocated to the account holder matching this email address (0x20022ee8 )\nFAILURE: Submitted .sis file uses a UID that is in protected range and is not allocated to the account holder matching this email address (0x20022ee8)\" . Can somebody help me to solve this..??","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":900,"Q_Id":4825055,"Users Score":1,"Answer":"Open Application Manager on your Symbian phone, go to settings and select Software installation. Change it from Signed to All. This will allow you to install applications which don't have a certificate, such as the SIS file you just packaged. \nAlso note that PythonForS60 2.0 works only with Python 2.5.","Q_Score":1,"Tags":"python,symbian,pys60","A_Id":4825096,"CreationDate":"2011-01-28T05:11:00.000","Title":"Certificate Error on installing PythonForS60","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to optimize the interaction between two scripts I have.\nTwo things I thought of are the c++ program not terminating unless you manually kill it, or generating all info in python before feeding it to c++.\nExplanation of the problem:\nWhat the scripts do:\nC++ program (not made by me, and I can't program in c++ very well): takes a 7 number array and returns a single number, simple. \nPython script (mine, and I can program a bit in python): generates those 7 number arrays, feeds them to the c++ program, waits for an answer and adds it to a list. It then makes the next array. \nIn theory, this works. However, as it is right now, it opens and closes the c++ program for each call. For one array that is no problem, but I'm trying to upscale to 25k arrays, and in the future to 6+ million arrays. Obviously it is then no longer feasible to open\/close it each time, especially since the c++ program first has to load a 130mb VCD file to function.\nTwo options I thought of myself were to generate all arrays first in python, then feed them to the c++ program and then analyze all results. However, I wouldn't know how to do this with 6M arrays. It is not important however that the results I get back are in the same order as the arrays I feed in.\nSecond option I thought of was to make the c++ program not quit after each call. I can't program in c++ though so I don't know if this is possible, keeping it 'alive' so you can just feed arrays into it at times and get an answer.\n(Note: I cannot program in anything else than python, and want to do this project in python. The c++ program cannot be translated to python for speed reasons.)\nThanks in advance, Max.","AnswerCount":5,"Available Count":1,"Score":0.0399786803,"is_accepted":false,"ViewCount":2200,"Q_Id":4826896,"Users Score":1,"Answer":"Firstly, just to be pedantic, there are no C++ scripts in normal use. C++ compiles, ultimately, to machine code, and the C++ program is properly referred to as a \"program\" and not a \"script\".\nBut to answer your question, you could indeed set up the C++ program to stay in memory, where it listens for connections and sends responses to your Python script. You'd want to study Unix IPC, particularly sockets.\nAnother way to approach it would be to incorporate what the C++ program does into your Python script, and forget about C++ altogether.","Q_Score":1,"Tags":"c++,python,optimization,interaction","A_Id":4827083,"CreationDate":"2011-01-28T09:59:00.000","Title":"Python and C++ script interaction","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need a QCombox which Items are filtered based on the text input. If I set the QCombobox editable, the user can insert text and the QCompleter is automatically created. But the items are not filtered and I don\u2019t want the user to add new Items.\nIs there any possibility to add this functionality to the QCombobox?","AnswerCount":5,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":15195,"Q_Id":4827207,"Users Score":5,"Answer":"Both answers posted are correct, however they have a small bug wherein filtering the options in the combobox by typing then clicking a selection doesn't cause an activation signal to fire. You can fix this by placing self.activated[str].emit(self.itemText(index)) in on_completer_activated, on the line after self.setCurrentIndex(index).\nThis fires an activated signal when you select an item from the completer, which contains the name of the item that was clicked.","Q_Score":13,"Tags":"python,qt,pyqt,qcombobox","A_Id":8198846,"CreationDate":"2011-01-28T10:32:00.000","Title":"How do I Filter the PyQt QCombobox Items based on the text input?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to draw arrows (that change size dynamically) within a Label or any other widget. I have these arranged as a grid. How can I do this? Would I need a Canvas? (not used yet ... currently just a grid of labels).\nI am using Python & Tkinter Gui library.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1937,"Q_Id":4830180,"Users Score":0,"Answer":"Tkinter does not support drawing on top of widgets. Your only choice for drawing arrows is to use a canvas. Your only other option is to draw directly on a image that is used by a label or button, but there's no support for that other than to set the value of individual pixels.\nYour only practical choice is to use a canvas.","Q_Score":0,"Tags":"python,tkinter","A_Id":4840199,"CreationDate":"2011-01-28T15:51:00.000","Title":"Python Tkinter: Draw arrows within Label","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am quite confused about the stdin and the key_events of GUI widget.\nUsually in my mind, I thought stdin is the ordinary way to get the keyboard input for a process. E.g., If I have a process, then I could use stdin to have the keyboard inputs. And this is usually used to make I\/O direction for the subprocess to get keyboard inputs. E.g., I could make subprocess.Popen(stdin=PIPE)\nOn the other hand for GUI, I am using wx.TexCtrl or py.Shell.shell, to catch the key events, like inputs. \nSo I am quite confused here, if I have a GUI or pyShell running, when I am typing via the keyboard, is it via the stdin or via the GUI key event catching system? If via the GUI key events system, how can I get the keyboard stdin? Can I still simply redirect the keyboard inputs to my child process (inside the GUI) as the ordinary non-GUI programming?\nThanks a lot for any comments.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":405,"Q_Id":4854486,"Users Score":2,"Answer":"When you type, the input comes from the GUI event mechanism, not from stdin. You asked how to get the \"keyboard stdin\", and the answer to that is the same as for any other type of program: you read it (but it will almost certainly be empty). It's important to realize that the GUI probably doesn't have a stdin if it was started by double-clicking on an icon on the desktop.\nAnd no, you can't \"redirect keyboard inputs to [your] child process\", if I understand your question. Stdin really has absolutely nothing to do with GUIs at all. How keyboard input is read via a GUI is completely disconnected from stdin.","Q_Score":0,"Tags":"user-interface,redirect,event-handling,wxpython,stdin","A_Id":4854744,"CreationDate":"2011-01-31T18:18:00.000","Title":"key_events of GUI widget and stdin","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I can't seem to find the answer to this question anywhere. I realize that you have to use PyOpenGL or something similar to do OpenGL stuff, but I was wondering if its possible to do very basic 3D graphics without any other dependencies.","AnswerCount":14,"Available Count":5,"Score":1.0,"is_accepted":false,"ViewCount":40558,"Q_Id":4865636,"Users Score":16,"Answer":"Well, if you can do 2d you can always do 3d. All 3d really is is skewed 2 dimensional surfaces giving the impression you're looking at something with depth. The real question is can it do it well, and would you even want to. After browsing the pyGame documentation for a while, it looks like it's just an SDL wrapper. SDL is not intended for 3d programming, so the answer to the real question is, No, and I wouldn't even try.","Q_Score":34,"Tags":"python,3d,pygame","A_Id":4865764,"CreationDate":"2011-02-01T17:08:00.000","Title":"Does PyGame do 3d?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I can't seem to find the answer to this question anywhere. I realize that you have to use PyOpenGL or something similar to do OpenGL stuff, but I was wondering if its possible to do very basic 3D graphics without any other dependencies.","AnswerCount":14,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":40558,"Q_Id":4865636,"Users Score":0,"Answer":"If you want to stick with a python-esque language when making games, Godot is a good alternative with both 2D and 3D support, a large community, and lots of tutorials. Its custom scripting language(gdscript) has some minor differences, but overall its mostly the same. It also has support for c# and c++, and has much more features when it comes to game development.","Q_Score":34,"Tags":"python,3d,pygame","A_Id":66323924,"CreationDate":"2011-02-01T17:08:00.000","Title":"Does PyGame do 3d?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I can't seem to find the answer to this question anywhere. I realize that you have to use PyOpenGL or something similar to do OpenGL stuff, but I was wondering if its possible to do very basic 3D graphics without any other dependencies.","AnswerCount":14,"Available Count":5,"Score":0.0,"is_accepted":false,"ViewCount":40558,"Q_Id":4865636,"Users Score":0,"Answer":"Pygame is just a library for changing the color of pixels (and some other useful stuff for programming games). You can do this by blitting images to the screen or directly setting the colors of pixels.\nBecause of this, it is easy to write 2D games with pygame, as the above is all you really need. But a 3D game is just some 3D objects 'squashed' (rendered) into 2D so that it can be displayed on the screen. So, to make a 3D game using only pygame, you would have handle this rendering by yourself, including all the complex matrix maths necessary.\nNot only would this run slowly because of the immense processing power involved in this, but it would require you to write a massive 3D rendering\/rasterisation engine. And because of python being interpreted it would be even slower. The correct approach would be to have this process run on the GPU using (Py)opengl.\nSo, yes it is technically possible to do 3D using only pygame, but definitely not recommended. I would suggest you learn Panda3D or some similar 3D engine.","Q_Score":34,"Tags":"python,3d,pygame","A_Id":51124080,"CreationDate":"2011-02-01T17:08:00.000","Title":"Does PyGame do 3d?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I can't seem to find the answer to this question anywhere. I realize that you have to use PyOpenGL or something similar to do OpenGL stuff, but I was wondering if its possible to do very basic 3D graphics without any other dependencies.","AnswerCount":14,"Available Count":5,"Score":0.0428309231,"is_accepted":false,"ViewCount":40558,"Q_Id":4865636,"Users Score":3,"Answer":"Python Soya can render 3d graphics on pygame surfaces.","Q_Score":34,"Tags":"python,3d,pygame","A_Id":8702727,"CreationDate":"2011-02-01T17:08:00.000","Title":"Does PyGame do 3d?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I can't seem to find the answer to this question anywhere. I realize that you have to use PyOpenGL or something similar to do OpenGL stuff, but I was wondering if its possible to do very basic 3D graphics without any other dependencies.","AnswerCount":14,"Available Count":5,"Score":0.0142847425,"is_accepted":false,"ViewCount":40558,"Q_Id":4865636,"Users Score":1,"Answer":"It is easy to make 3D driver for PyGame. PyGame has some assets for 3D game development.\nI am developing Py3D driver using PyGame now. When I finish, I'll show you link to download Py3D. I tried to make 3D game with PyGame, and I needed just small addon for PyGame. It is wrong you think you must use SDL, PyOpenGL, OpenGL, PyQt5, Tkinter. All of them are wrong for making 3D games. OpenGL and PyOpenGL or Panda3D are very hard to learn. All my games made on those drivers were awful. PyQt5 and Tkinter aren't drivers for making games, but they've got addons for it. Don't try to make any game on those drivers. All drivers where we need to use the math module are hard. You can easily make small addon for them, I think everybody can make driver for PyGame in 1-2 weeks.","Q_Score":34,"Tags":"python,3d,pygame","A_Id":50873427,"CreationDate":"2011-02-01T17:08:00.000","Title":"Does PyGame do 3d?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create a little web server that loads, using webkit, an URL to extract some data from the web page (eg: title, images sizes...).\nI'm using PyQt4 to access from python to webkit. For each request, I'm creating a QThread that:\n- creates an QWebPage object,\n- run an event loop\n- when the loading of the webpage has finished (loadFinished signal), some code extracts data from the mainFrame of the QWebPage and kills the QThread\nThis works very well the first time, the web page is loaded, included all its resources (CSS, images).\nThe second time I ask the server to load an url, the web page is loaded, but none of its resources (no css, no images). So when I try to retrieve image sizes, all size are set to 0,0.\nHere is some code snipset:\n\n# The QThread responsible of loading the WebPage\nclass WebKitThread(QThread):\n def __init__(self, url):\n QThread.__init__(self)\n self.url = url\n self.start()\n def run(self):\n self.webkitParser = WebKitParser(self.url)\n self.exec_()\n\nclass WebKitParser(QWebPage):\n def __init__(self, url, parent=None):\n QWebPage.__init__(self, parent )\n self.loadFinished.connect(self._loadFinished)\n self.mainFrame().load(QUrl(url))\n\n def _loadFinished(self, result):\n self.computePageProperties()\n QThread.currentThread().exit()\n\n def computePageProperties(self):\n # Some custom code that reads title, image size...\n self.computedTitle=XXXXXXXX\n\nThe calling code (that respond to the HTTP request) is executing: \n\nt = WebKitThread(url)\nt.wait()\n# do some stuff with properties of WebKitParser\nprint t.webkitParser.computedTitle","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":628,"Q_Id":4876649,"Users Score":2,"Answer":"I've managed to fix the issue: creating the QWebPage in the GUI thread (the thread of QApplication event loop) fixes the issue.\nIt seems the second time a QWebPage is used, it tries to access to the browser cache (even if it has been disabled by configuration). But if the first QWebPage was not created in the main GUI thread, the cache is somewhat misconfigured and not usable.\nTo create the QWebPage in the main GUI thread I'm using a custom QEvent (QEvent of type User) that triggers QWebPage initialization and result fetching.","Q_Score":2,"Tags":"python,qt,qt4,pyqt4,qtwebkit","A_Id":4885477,"CreationDate":"2011-02-02T15:54:00.000","Title":"Unable to use in the same application a QWebPage twice","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to use PyQt4. I have downloaded its LINUX version and trying to install it with Cygwin(because I have windows on my PC and I want to use linux, therefore I am using Cygwin). I don't know how to install it ? please guide me . There is no such file like setup.py, install....what should I do??","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":526,"Q_Id":4877959,"Users Score":2,"Answer":"PyQt4 and Qt are cross-platform. If you write cross-platform code, you don't need to develop on any specific OS. Testing on different platforms from time to time is a good idea, but good cross-platform code will usually just work.\nDon't use any Windows-specific features, Windows-specific code. In particular, don't use subprocess unless calling shell commands is part of your app, use os.path instead of writing paths yourself, don't hardcode any paths, verify that each library that you're using is cross-platform, and you'd be fine.\nAnd when you're testing on Linux, test on actual Linux. Cygwin is another, different platform. You can try using a virtual machine with VirtualBox.\nP.S. You might also look at Nokia's new PySide which has more liberal license than PyQt4 and supports most of what PyQt4 supports with nearly the same interface. It's a bit young, but by the time you complete your application, it would probably be more common.","Q_Score":1,"Tags":"python,linux,pyqt4","A_Id":4878854,"CreationDate":"2011-02-02T17:53:00.000","Title":"pyqt4 on Linux environment","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to know if it is possible to minimise my python program to the system tray.\nBasically what it does is at every hour it takes a screenshot but I don't want it to stay on the task bar taking space. Could I make it go to the system tray area next to the clock but keep it running?\nI am not using tkinter or anything like that.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":2796,"Q_Id":4878093,"Users Score":0,"Answer":"As opposed to having the program running continuously, why don't you use your system's scheduler? (Cron under *nix, Task Scheduler under windows). There might be a bit more overhead since it has to spin up Python each time, but it would be easier than hooking up a notification icon.\nSince you refer to it as the task bar, I assume Windows. To have a notification icon, you would have to have a hidden window, with a running message pump, so Windows has somewhere to send messages to for the icon.\nSo, in short, much simpler just running a scheduled job.","Q_Score":2,"Tags":"python","A_Id":4878220,"CreationDate":"2011-02-02T18:05:00.000","Title":"Minimize python to system tray in Windows (Vista)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to know if it is possible to minimise my python program to the system tray.\nBasically what it does is at every hour it takes a screenshot but I don't want it to stay on the task bar taking space. Could I make it go to the system tray area next to the clock but keep it running?\nI am not using tkinter or anything like that.","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":2796,"Q_Id":4878093,"Users Score":2,"Answer":"Since you are running on Windows, you may simply want to rename your script to have a .pyw extension, so there is no console window. If you try to make a system tray application, you will need to pick a GUI toolkit like you've suggested, and your simple script will become a LOT bigger and far more complicated.","Q_Score":2,"Tags":"python","A_Id":4878236,"CreationDate":"2011-02-02T18:05:00.000","Title":"Minimize python to system tray in Windows (Vista)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there an equivalent to Tkinter's place geometry manager in wxPython?\nFor those those that don't know, place allows the positioning of widgets based on x y or relative x y coordinates. \nI'm a fan of this geometry manager simply because it offers a lot of control over widget positioning.","AnswerCount":2,"Available Count":2,"Score":-0.0996679946,"is_accepted":false,"ViewCount":231,"Q_Id":4885296,"Users Score":-1,"Answer":"The GridBagSizer or FlexGridSizer are kind of like Tkinter's place. Of course, wx also supports absolute positions, although I do not recommend that.","Q_Score":1,"Tags":"python,geometry,wxpython","A_Id":4888025,"CreationDate":"2011-02-03T11:00:00.000","Title":"Equivalent to Tkinter's place geometry manager in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there an equivalent to Tkinter's place geometry manager in wxPython?\nFor those those that don't know, place allows the positioning of widgets based on x y or relative x y coordinates. \nI'm a fan of this geometry manager simply because it offers a lot of control over widget positioning.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":231,"Q_Id":4885296,"Users Score":1,"Answer":"I think the best answer is \"no, there is no equivalent\". You can use absolute positioning with the \"pos\" keyword argument in the constructor, but that doesn't come close to the power of place.","Q_Score":1,"Tags":"python,geometry,wxpython","A_Id":4888233,"CreationDate":"2011-02-03T11:00:00.000","Title":"Equivalent to Tkinter's place geometry manager in wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have created a gtk window in init\nand then I process a new function\nand i append the values from new function to the gtk window\ntill the second function completes, the window gets unresponsive and can become responsive when second function completes.\ncan anyone tell me whet should i do for the same?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":142,"Q_Id":4886652,"Users Score":2,"Answer":"Windows become unresponsive in gtk (and in windowing systems in general) when you call a function within the Event Loop, which is the thread in charge of keeping the window responsive (this thread repaints the window, handles mouse clicks, etc.). If the function you call returns immediately, you won't notice the unresponsiveness, but if the function makes some heavy work, you'll have the situation you have described in your question.\nYou should execute your second function in a thread of its own (a working thread). If you need to refresh your window after this function returns, make sure you make this update in the Event Loop (for example, invoking glib.idle_add) and not from the working thread! Otherwise, strange crashes may occur.","Q_Score":1,"Tags":"python,gtk","A_Id":4886782,"CreationDate":"2011-02-03T13:17:00.000","Title":"python gtk problem","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The idea is that I would have two or three different windows and I would like to open and close them automatically by calling a function (separate functions to open and close each window). The program itself would be running in the background but when a certain event happens it would call the window opening function. On another event the window would close, or window #2 would open etc.\nThat's the general idea anyway. Right now I would settle for one window I could open by calling a function. So in a nutshell a function that opens a window but lets the program run in the background waiting for a command to destroy the window. \nIs it even possible to do that? \nI've searched for tkinter solutions, none have worked so far. The reason for tkinter is because wxpython won't close a window unless you move the mouse over it.\nAdditionally, in the end I would be making borderless windows that are always on top of everything else. I have a somewhat suitable code for that already but it's nothing definitive.\nPS. Yes I know it's a poorly composed question. That's why I'm asking...","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":149,"Q_Id":4890257,"Users Score":1,"Answer":"In wxWindows you just call the .destroy() method on the dialog\/window to delete it. You don't have to move the mouse over it. That would make wxWindows apps very annoying.\nI suspect your problem is more related to trying to do something outside the wx event framework. Most GUIs are event driven, so if you've got other things going on you either run them in another thread and have them signal the GUI framework to do stuff or run your code in an event handler callback that lets the event handler manage the .destroy() method you called in your code.","Q_Score":0,"Tags":"python","A_Id":4890390,"CreationDate":"2011-02-03T18:39:00.000","Title":"Opening and closing windows by calling a function?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm about to undertake a .NET project: We need to create a create a program that utilize some existing C# code, and I'm hoping to use IronPython. (I'm an experienced Python programmer, but a bit of a .NET newbie). \nMy question is: Is IronPython a good fit for using mostly C# code, or would it be better just to use C#? If IronPython is a good fit, are there any pitfalls to look out for?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":801,"Q_Id":4890407,"Users Score":1,"Answer":"If you are in a Windows environment for reasons beyond your control, there are a lot of advantages in using IronPython.\n\nIts just like Python, only .NET. Once you learn the idosyncratic elements of how to reference an assembly, how to instantiate objects, browse objects, etc. it is really nice.\nYou don't need Visual Studio to develop. Notepad++ or any decent text editor is all you need. If you really must have an IDE you can go with SharpDevelop. Now if you have VS2010, the new plugin for Ironpython is nice and should get better with future releases.\nWith the introduction of Ironpython 2.7 and .NET 4.0, the startup time issues of previous versions have been mostly negated.\nI find the WPF and XAML approach much much easier than wx for creating GUI applications.\nIronpython scripts can be compiled into exe's for easy distribution\n\nThat said, there are downsides.\n\nMost packages do not install directly into Ironpython, forcing you to install into CPython, then copying over the relevant modules.\nPython extension that utilize pyd shared libraries don't work unless you use Ironclad, and even then you can have issues.\nYou give up being cross platform, unless your users are running Mono and even then you lose some of the cool features like WPF.\nYou are a bit behind the development curve. Ironpython is currently at 2.7 Beta 1 and has been since October, when Microsoft released the code into the wild. Prior to that no one outside of MS could submit patches. The community leadership is on track for a 2.7 RTM release in February and then starting the 3.x development.","Q_Score":3,"Tags":"c#,.net,python,ironpython","A_Id":4892791,"CreationDate":"2011-02-03T18:54:00.000","Title":"Using C# code in IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm about to undertake a .NET project: We need to create a create a program that utilize some existing C# code, and I'm hoping to use IronPython. (I'm an experienced Python programmer, but a bit of a .NET newbie). \nMy question is: Is IronPython a good fit for using mostly C# code, or would it be better just to use C#? If IronPython is a good fit, are there any pitfalls to look out for?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":801,"Q_Id":4890407,"Users Score":5,"Answer":"You'll need to compile the C# code into an assembly (DLL) you can use within IronPython. Once you do this, IronPython can use this just like any other .NET assembly.\nThis is a common usage scenario for IronPython.","Q_Score":3,"Tags":"c#,.net,python,ironpython","A_Id":4890442,"CreationDate":"2011-02-03T18:54:00.000","Title":"Using C# code in IronPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to develop a C-based application which embeds one or more Python interpreters. I'm using gtk-things in the C-parts, and logically calling gtk_main() within that.\nThe Python interpreters are created in separate pthreads using Py_NewInterpreter(), and basically running forever (a 'while True' loop is added to the end in case the script terminates).\nNow I'd like to use pyGTK in those scripts, which seems to work until there's a callback (signal emitted). You can register signal handlers to point to parts in the Python scripts ok, but it seems that the gtk main loop can't direct them correctly when they happen, causing segfaults like the log below.\nI'm guessing it might have something to do with the python thread state not being initialized correctly, but not sure. Would anyone have insight on what I'm doing wrong or what to check?\n\n#0 0xb7ecfc9a in PyFrame_New () from \/usr\/lib\/libpython2.5.so.1.0\n#1 0xb7f376ed in PyEval_EvalCodeEx () from \/usr\/lib\/libpython2.5.so.1.0\n#2 0xb7ed09b6 in ?? () from \/usr\/lib\/libpython2.5.so.1.0\n#3 0xb7eae327 in PyObject_Call () from \/usr\/lib\/libpython2.5.so.1.0\n#4 0xb7f30f7c in PyEval_CallObjectWithKeywords () from \/usr\/lib\/libpython2.5.so.1.0\n#5 0xb7eaeb5c in PyObject_CallObject () from \/usr\/lib\/libpython2.5.so.1.0\n#6 0xb424face in ?? () from \/usr\/lib\/pymodules\/python2.5\/gtk-2.0\/gobject\/_gobject.so\n#7 0xb76e113a in g_closure_invoke () from \/usr\/lib\/libgobject-2.0.so.0\n#8 0xb76f761d in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#9 0xb76f8bfc in g_signal_emit_valist () from \/usr\/lib\/libgobject-2.0.so.0\n#10 0xb76f9076 in g_signal_emit () from \/usr\/lib\/libgobject-2.0.so.0\n#11 0xb7ab3a8a in gtk_button_clicked () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#12 0xb7ab5048 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#13 0xb76eecac in g_cclosure_marshal_VOID__VOID () from \/usr\/lib\/libgobject-2.0.so.0\n#14 0xb76df7a9 in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#15 0xb76e113a in g_closure_invoke () from \/usr\/lib\/libgobject-2.0.so.0\n#16 0xb76f6eba in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#17 0xb76f8bfc in g_signal_emit_valist () from \/usr\/lib\/libgobject-2.0.so.0\n#18 0xb76f9076 in g_signal_emit () from \/usr\/lib\/libgobject-2.0.so.0\n#19 0xb7ab3b2a in gtk_button_released () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#20 0xb7ab3b73 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#21 0xb7b70e74 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#22 0xb76df7a9 in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#23 0xb76e113a in g_closure_invoke () from \/usr\/lib\/libgobject-2.0.so.0\n#24 0xb76f7266 in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#25 0xb76f8a7b in g_signal_emit_valist () from \/usr\/lib\/libgobject-2.0.so.0\n#26 0xb76f9076 in g_signal_emit () from \/usr\/lib\/libgobject-2.0.so.0\n#27 0xb7c9d156 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#28 0xb7b694cd in gtk_propagate_event () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#29 0xb7b6a857 in gtk_main_do_event () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#30 0xb79f3dda in ?? () from \/usr\/lib\/libgdk-x11-2.0.so.0\n#31 0xb7636305 in g_main_context_dispatch () from \/lib\/libglib-2.0.so.0\n#32 0xb7639fe8 in ?? () from \/lib\/libglib-2.0.so.0\n#33 0xb763a527 in g_main_loop_run () from \/lib\/libglib-2.0.so.0\n#34 0xb7b6ae19 in gtk_main () from \/usr\/lib\/libgtk-x11-2.0.so.0","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":285,"Q_Id":4896434,"Users Score":0,"Answer":"This is a situation where you are better off making one more Python interpreter and doing all your GTK work by sending Python snippets to that special GTK helper interpreter. That way your C code never uses GTK directly and you only need to worry about coordinating between the Python threads.","Q_Score":2,"Tags":"python,c,multithreading,gtk,pygtk","A_Id":4911145,"CreationDate":"2011-02-04T09:30:00.000","Title":"pygtk and native gtk_main(); mixing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to develop a C-based application which embeds one or more Python interpreters. I'm using gtk-things in the C-parts, and logically calling gtk_main() within that.\nThe Python interpreters are created in separate pthreads using Py_NewInterpreter(), and basically running forever (a 'while True' loop is added to the end in case the script terminates).\nNow I'd like to use pyGTK in those scripts, which seems to work until there's a callback (signal emitted). You can register signal handlers to point to parts in the Python scripts ok, but it seems that the gtk main loop can't direct them correctly when they happen, causing segfaults like the log below.\nI'm guessing it might have something to do with the python thread state not being initialized correctly, but not sure. Would anyone have insight on what I'm doing wrong or what to check?\n\n#0 0xb7ecfc9a in PyFrame_New () from \/usr\/lib\/libpython2.5.so.1.0\n#1 0xb7f376ed in PyEval_EvalCodeEx () from \/usr\/lib\/libpython2.5.so.1.0\n#2 0xb7ed09b6 in ?? () from \/usr\/lib\/libpython2.5.so.1.0\n#3 0xb7eae327 in PyObject_Call () from \/usr\/lib\/libpython2.5.so.1.0\n#4 0xb7f30f7c in PyEval_CallObjectWithKeywords () from \/usr\/lib\/libpython2.5.so.1.0\n#5 0xb7eaeb5c in PyObject_CallObject () from \/usr\/lib\/libpython2.5.so.1.0\n#6 0xb424face in ?? () from \/usr\/lib\/pymodules\/python2.5\/gtk-2.0\/gobject\/_gobject.so\n#7 0xb76e113a in g_closure_invoke () from \/usr\/lib\/libgobject-2.0.so.0\n#8 0xb76f761d in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#9 0xb76f8bfc in g_signal_emit_valist () from \/usr\/lib\/libgobject-2.0.so.0\n#10 0xb76f9076 in g_signal_emit () from \/usr\/lib\/libgobject-2.0.so.0\n#11 0xb7ab3a8a in gtk_button_clicked () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#12 0xb7ab5048 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#13 0xb76eecac in g_cclosure_marshal_VOID__VOID () from \/usr\/lib\/libgobject-2.0.so.0\n#14 0xb76df7a9 in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#15 0xb76e113a in g_closure_invoke () from \/usr\/lib\/libgobject-2.0.so.0\n#16 0xb76f6eba in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#17 0xb76f8bfc in g_signal_emit_valist () from \/usr\/lib\/libgobject-2.0.so.0\n#18 0xb76f9076 in g_signal_emit () from \/usr\/lib\/libgobject-2.0.so.0\n#19 0xb7ab3b2a in gtk_button_released () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#20 0xb7ab3b73 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#21 0xb7b70e74 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#22 0xb76df7a9 in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#23 0xb76e113a in g_closure_invoke () from \/usr\/lib\/libgobject-2.0.so.0\n#24 0xb76f7266 in ?? () from \/usr\/lib\/libgobject-2.0.so.0\n#25 0xb76f8a7b in g_signal_emit_valist () from \/usr\/lib\/libgobject-2.0.so.0\n#26 0xb76f9076 in g_signal_emit () from \/usr\/lib\/libgobject-2.0.so.0\n#27 0xb7c9d156 in ?? () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#28 0xb7b694cd in gtk_propagate_event () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#29 0xb7b6a857 in gtk_main_do_event () from \/usr\/lib\/libgtk-x11-2.0.so.0\n#30 0xb79f3dda in ?? () from \/usr\/lib\/libgdk-x11-2.0.so.0\n#31 0xb7636305 in g_main_context_dispatch () from \/lib\/libglib-2.0.so.0\n#32 0xb7639fe8 in ?? () from \/lib\/libglib-2.0.so.0\n#33 0xb763a527 in g_main_loop_run () from \/lib\/libglib-2.0.so.0\n#34 0xb7b6ae19 in gtk_main () from \/usr\/lib\/libgtk-x11-2.0.so.0","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":285,"Q_Id":4896434,"Users Score":0,"Answer":"This looks like a pretty long stack, and some of the functions called look the same. (For example, g_signal_emit is called repeatedly from itself via g_closure_invoke.)\nIt looks to me like you may be causing a stack overflow, possibly by emitting a signal inside your callback that handles the signal, thus infinitely recursing until you run out of stack space and crash. This is just a guess and I don't know much about the GTK+\/GLIB internals, but that is what it smells like to me. I'd put money on it. :-)\nIf not that, then maybe the GLIB closures are being chained too much (one callback calls another callback which calls another etc. etc. until you run out of space.) Maybe adjusting your stack size would help. (I don't remember offhand if there is an easy way to do this for main(), but if you're creating a new thread pthread_attr_setstacksize() might help.)","Q_Score":2,"Tags":"python,c,multithreading,gtk,pygtk","A_Id":4911173,"CreationDate":"2011-02-04T09:30:00.000","Title":"pygtk and native gtk_main(); mixing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a 2nd year university student, and I thought it would be a good idea to expand my abilities. I will be using python later this year to complete a gui for a C program (using Tkinter), but I want to make a side project as well, and python seems like a great language to do it with. \nI want a project which has multiple levels for me to code, so it's definitely going to have a gui and command-line version, and then maybe some database stuff (since I would like to know more about SQL and other database tech). \nI thought I could make a music player. Start by just making a command line program which plays a music file, then expand it from there, probably using pygtk for the gui.\nConsidering I have no python experience, but I do have a strong background in C and Java, are there going to be any difficulties which will unexpectedly stop me? I have never made a music application before, and I am not sure whats involved in keeping a music library, for example.\nAre there any other projects you might recommend, that can be completed in about an hour a night, for 3 months? (Or get a significant working program out of it, even if its not complete).\nThanks!","AnswerCount":6,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":9115,"Q_Id":4898747,"Users Score":2,"Answer":"Writing a program will help you learn the language, but IMHO joining the development team of an open-source python project would help you learn even more, as reading high-quality code written by other developers will disclose to you features of the language that you would never discover alone.\nSo, my suggestion is to hunt for a smallish and high-quality python open source project, read its code, understand what it does and then start contributing. It might help to choose a project that you use or that you like.","Q_Score":2,"Tags":"python,project,pygtk","A_Id":4898798,"CreationDate":"2011-02-04T13:57:00.000","Title":"A good side-project for learning python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a 2nd year university student, and I thought it would be a good idea to expand my abilities. I will be using python later this year to complete a gui for a C program (using Tkinter), but I want to make a side project as well, and python seems like a great language to do it with. \nI want a project which has multiple levels for me to code, so it's definitely going to have a gui and command-line version, and then maybe some database stuff (since I would like to know more about SQL and other database tech). \nI thought I could make a music player. Start by just making a command line program which plays a music file, then expand it from there, probably using pygtk for the gui.\nConsidering I have no python experience, but I do have a strong background in C and Java, are there going to be any difficulties which will unexpectedly stop me? I have never made a music application before, and I am not sure whats involved in keeping a music library, for example.\nAre there any other projects you might recommend, that can be completed in about an hour a night, for 3 months? (Or get a significant working program out of it, even if its not complete).\nThanks!","AnswerCount":6,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":9115,"Q_Id":4898747,"Users Score":10,"Answer":"Considering I have no python experience, but I do have a strong background in C and Java, are there going to be any difficulties which will unexpectedly stop me? \n\nYes. \n\nI have never made a music application before, and I am not sure whats involved in keeping a music library, for example.\n\nThat will stop you.\nWant advice? \nStep 1. Avoid asking yes\/no questions. \nStep 2. Start smaller. [see below]\nStep 3. Start with a tutorial on Python.\nStep 4. Find related projects, download their code, and read it.\n\nOn Starting Smaller.\n\"about an hour a night, for 3 months\". 90 hours. \nAllocate 40 hours to do enough Python tutorials to understand the language. Ordinarily, I'd suggest 80 hours for this, but your budget is tight.\nAllocate another 40 hours to working out how the sound playback API's work on your platform. This may be too much time, but there are always odd mysteries. OS API and Device Driver issues are often difficult problems to solve.\nAllocate another 40 hours to make enough mistakes to get a PyGTK application that runs respectably well. Ordinarily, I'd allocate at least 120 hours to this, since GUI design includes lots of new concepts, not covered in the language tutorials. Again, your budget is tight.\nLearning SQL and Database design and an ORM API. Perhaps 40 hours. There are a lot of mistakes you can make here, and you'll need time to make those mistakes. \nAllocate another 40 hours to creating some kind of \"music library\" built on existing file system API's. This involves defining some use cases for add, change and delete and figuring out how to implement those use cases.\nThat's my rationale for suggesting that you may want to \"start smaller\".","Q_Score":2,"Tags":"python,project,pygtk","A_Id":4898770,"CreationDate":"2011-02-04T13:57:00.000","Title":"A good side-project for learning python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i've built a com component which utilizes libxml2 python bindings , the build is successfull but when i try to register the component i get \"specified module could not be found , unable to load python dll\" this is the error i get when the component is built using the bundle files option set as 1\nif i build the component with bundle files set as 3 ,then i get a different error saying that the component was loaded but the call to DllRegisterServer Failed with error code 80040201\nif the libxml2 import is removed all works fine.\nany help wold be simply great.\nthanks","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":240,"Q_Id":4899158,"Users Score":1,"Answer":"Most likely, regsvr32.exe which registers you COM component couldn't find a DLL that your COM component needs.\nI'm not familiar with Python COM components but is there some way you can run depends.exe on it? This is the usual way to track down binary dependency problems.","Q_Score":0,"Tags":"python,com","A_Id":4899486,"CreationDate":"2011-02-04T14:33:00.000","Title":"python com component does not register when using libxml2 on win7","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In order to indicate activity, some applications (e.g. Pidgin) highlight their entry in GNOME's Window List panel widget (e.g. via bold font or flashing color). This indication is reset automatically when the window is activated.\nI have a terminal application for which I would like to achieve the same thing (preferably via Perl, but Python would work too) - but I have no idea where to start. I imagine I'd first have to find the terminal window (based on window title) and then trigger some kind of GTK action.\nAny help would be greatly appreciated!","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":495,"Q_Id":4906424,"Users Score":1,"Answer":"I'm not really into GTK programming, but as far as i know you want to set an \"URGENT\"-Flag for the Window which should be highlighted. Maybe this will get you any further. :)","Q_Score":1,"Tags":"python,perl,gtk","A_Id":4906739,"CreationDate":"2011-02-05T10:51:00.000","Title":"highlighting a window in GNOME's window list","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"How can i set up icon for my existing program.exe and icon.ico ( in the same folder ) using some sort of hidden (settings) file ?\nEdit: i am aware of py2exe CustomIcon option, also about WinRar Sfx ...\nQuestion is: it is possible in this specific way i described ?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1915,"Q_Id":4915202,"Users Score":0,"Answer":"do it like this:\nIf you dont have winrar then install it!\nThen right click on your program.exe and select \"Add to archive...\", under \"Archiving options\" select \"Create SFX Archive\". Now go to tab \"Advanced\" and click on \"SFX Options\" on \"General tab\" setup all you need and add \"Run after extraction\" (yourprogram.exe) under \"Modes\" tab select \"Hide All\" under silent groupbox, go to \"Update\" tab and select \"Update Mode\" (Extract and replace files) and \"Overwrite mode\" (Overwrite all files) now go to \"TextAndIcon\" tab and put to title yourprogram.exe name and under \"Load SFX icon from the file\" add an icon you want! Click OK, and click OK again. Now wait to compile and you have your program with icon! \nJust have to watch where you want it to be installed, or if it doesnt have any install direction then you use \"Unpack to temporary folder\" under the \"Modes\" tab in \"SFX Options\"!\nThink this will help you! :)","Q_Score":0,"Tags":"python,icons,exe,ico","A_Id":4915328,"CreationDate":"2011-02-06T18:22:00.000","Title":"How to set up icon for a program?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a program in Python. The first thing that happens is a window is displayed (I'm using wxPython) that has some buttons and text. When the user performs some actions, a plot is displayed in its own window. This plot is made with R, using rpy2. The problem is that the plot usually pops up on top of the main window, so the user has to move the plot to see the main window again. This is a big problem for the user, because he's lazy and good-for-nothing. He wants the plot to simply appear somewhere else, so he can see the main window and the plot at the same time, without having to lift a finger.\nTwo potential solutions to my problem are:\n(1) display the plot within a wxPython frame (which I think I could control the location of), or\n(2) be able to specify where on the screen the plot window appears.\nI can't figure out how to do either.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":757,"Q_Id":4938556,"Users Score":5,"Answer":"Plot to a graphics file using jpeg(), png() or another device, then display that file on your wxWidget.","Q_Score":3,"Tags":"python,r,plot,rpy2","A_Id":4938599,"CreationDate":"2011-02-08T21:17:00.000","Title":"How do I control where an R plot is displayed, using python and rpy2?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an image wiht gtk.gdk. I want to make it look grayed out, so I wanna do something like draw a gray rectangle over it with 50% alpha value. How would I do this? The docs are so confusing.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":246,"Q_Id":4947341,"Users Score":0,"Answer":"i just thought of a way\ntaking half of the color's highest values and taking half of the number directly between them and putting that on the lowest number (Eg: 0,255,255 to 127,255,255 or 0,127,255 to 96,127,255) \nor taking the second highest number and the highest number, finding the 50%, putting that as the second highest number, then doing that again for the absolute lowest number (Eg: 0,128,255 > 112,192,255)\nhope this works for me and for you, right now im recommending to myself and you, the second option, however if you're lazy, the first option is less work","Q_Score":0,"Tags":"python,pygtk,gtk,gdk","A_Id":22739002,"CreationDate":"2011-02-09T16:03:00.000","Title":"gtk.gdk: make image 50% grayer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to read data from a text field. The name of the text field is not defined of found in the other class with methods of reading the text field. The textfield is defined in the Design class. now how do I access this field from another class, so I can read data from it. Thanks!!\nEdit:\nI have 2 Classes: FeatureImportCommonWidget(QtGui.QWidget) and MetaDataBrowser. FeatureImportCommonWidget contains a Text Field called placesGroupBox. I want to access this text field in the MetaDataBrowser Class.\nI tried it using \"filename = get_metadata.placesGroupBox.text()\", but it gives an error about placesGroupBox not being defined in the MetaDataBrowser class.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":179,"Q_Id":4967179,"Users Score":0,"Answer":"If the field's an ordinary attribute called text and your Design instance is called design, you can access (read\/write) it from anywhere as design.text.","Q_Score":0,"Tags":"python,pyqt","A_Id":4968555,"CreationDate":"2011-02-11T09:01:00.000","Title":"Python Referencing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to read data from a text field. The name of the text field is not defined of found in the other class with methods of reading the text field. The textfield is defined in the Design class. now how do I access this field from another class, so I can read data from it. Thanks!!\nEdit:\nI have 2 Classes: FeatureImportCommonWidget(QtGui.QWidget) and MetaDataBrowser. FeatureImportCommonWidget contains a Text Field called placesGroupBox. I want to access this text field in the MetaDataBrowser Class.\nI tried it using \"filename = get_metadata.placesGroupBox.text()\", but it gives an error about placesGroupBox not being defined in the MetaDataBrowser class.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":179,"Q_Id":4967179,"Users Score":0,"Answer":"1. if object of FeatureImportCommonWidget class is created inside of MetaDataBrowser class, you can access your text field anywhere inside MetaDataBrowser class like this: FeatureImportCommonWidgetObjectName.placesGroupBox.text()\n2 if object of FeatureImportCommonWidget class is created before MetaDataBrowser class, you can pass that object as parameter to MetaDataBrowser class and then access your text field anywhere inside MetaDataBrowser class like in step 1","Q_Score":0,"Tags":"python,pyqt","A_Id":17676533,"CreationDate":"2011-02-11T09:01:00.000","Title":"Python Referencing","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Just wondering whether there is any provision\/method to bind clicks on images\/(or include a button) to result into some events. Also is there any kind of way to draw a StaticLine kind of thing in a RichTextCtrl in wxPython.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":239,"Q_Id":4967307,"Users Score":0,"Answer":"You can bind to a button if you like, you could use a bitmapbutton instead, or bind mouse events to your static bitmap. The wxPython demo has examples for all of these methods.\nWith regards to the \"StaticLine kinda thing\", are you trying to resize the richtextctrl on demand? You might want to look at the ExpandoTextCtrl instead, which is also demonstrated in the demo. If not, I would need some more detail than \"kinda thing\".. ;)","Q_Score":1,"Tags":"python,user-interface,wxpython,wxtextctrl,wx.textctrl","A_Id":5696978,"CreationDate":"2011-02-11T09:15:00.000","Title":"wxpython RichtextCtrl event bindings on buttons\/images","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a fast python way to save all data in all widgets to file before app is close?\nAnd of course read it and restore after app is re-run?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2185,"Q_Id":4972429,"Users Score":4,"Answer":"QWidget.saveGeometry saves the geometry of an widget.\nQMainWindow.saveState saves the window's toolbars and dockwidgets.\nTo save other things you can use pickle.","Q_Score":3,"Tags":"python,pyqt","A_Id":4974374,"CreationDate":"2011-02-11T18:01:00.000","Title":"PyQt 4 - save all data in window to file on app close","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'd like to create a PyThreadState since there doesn't appear to be one for the current thread.\nHow do I get the current PyInterpreterState to pass to PyThreadState_New(...), or is that something that I should only do if I'm embedding an interpreter (and thus have created it), rather than calling into a library from python?","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1482,"Q_Id":4987579,"Users Score":1,"Answer":"It turns out that not having a PyThreadState in the main thread is a fatal error. It was caused for me by two different python versions both being linked at the same time, so this question is somewhat moot.","Q_Score":2,"Tags":"python,c,multithreading,python-c-api","A_Id":5002035,"CreationDate":"2011-02-13T23:16:00.000","Title":"How do I get the current PyInterpreterState?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"As a hobbyists who has a little experience making 2D games using PyGame, and has ventured into using C++ with the SDL library (in Visual Studio), I'm curious. Is the library used professionally?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":769,"Q_Id":4993101,"Users Score":3,"Answer":"SDL is used professionally and some great games were made with it. Many times it is used as a cross-platform window creation system to initialize openGL (as I assume it is used for Doom3, UT, etc...). It is also used for as \"raw\" 2d graphics API (for example in Battle For Wesnoth).","Q_Score":4,"Tags":"c++,python,sdl,pygame","A_Id":4993955,"CreationDate":"2011-02-14T14:08:00.000","Title":"Is C++ SDL and (Python PyGame) used by people other than hobbyists?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing a small cross-platform wxPython app, however on every platform I need to use some platform-specific API. On Mac OS it can be done using PyObjC. \nI'm searching for tutorial on how to use PyObjC. However, all I found so far were tutorials with Xcode. I want my app to be able to run on mac\/win\/lin, without changes, and I don't want to develop it in Xcode. Is there a way?\nUPD. To be more specific I need to access some pen-tablet events from Mac OS X and I wanted to use PyObjC for that (I don't see any other ways).","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":3791,"Q_Id":4994058,"Users Score":0,"Answer":"What do you need Xcode for? If you need it for the windows\/gui (*.nib, *.xib files), then you should perhaps search for 'creating *.nib, *xib without Xcode'.\nThat's only a search hint and no satisfying answer.","Q_Score":6,"Tags":"python,macos,wxpython,pyobjc","A_Id":5071853,"CreationDate":"2011-02-14T15:39:00.000","Title":"PyObjC tutorial without Xcode","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a small game that supports Python scripting. I've no problems with using the Python C-API, but I don't know how to ensure that the game will run on a computer with no Python installed.\nI know I need pythonXY.dll -- what else is there? When I try to run the program it tells me it cannot find encodings.utf_8. I tried copying the encodings\/utf_8.py file in the same directory as my program, but the error still pops up.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":258,"Q_Id":4995336,"Users Score":0,"Answer":"You need the encodings\/__init__.py file, otherwise encodings is a folder and not a python package.\nChances are that you'll need a lot of stuff from within the python standard library. To make everything just work you'll need to include the entire standard library along with your program.\nYou can make this a bit better by putting the library in a zip file and adding that to sys.path. Also, you can include only pyc not the original py files.","Q_Score":2,"Tags":"python,embed,python-c-api","A_Id":4995435,"CreationDate":"2011-02-14T17:40:00.000","Title":"C++ Python embedding: Run on machine with no Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to write a python script to convert PNG's into 2-page pdfs (i.e. 2 PNGs per PDF). The software needs to run on both a Mac and Windows 7.\nMy current solution is using ReportLab, but that doesn't install easily on a Mac. According to its website, it only has a compiled version for Windows. It has a cross-platform version that requires a C compiler to install.\nIs there a better way to do this (so that I don't have to install a C compiler on the Mac)? Should I use a different library, or a different language entirely? As long as I can call the program from a python script, I could use any language for the pdf creation. Or, is there a very straightforward (i.e a non-programmer could install it) C compiler that I could install on a Mac?\nWhat do you recommend?","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":8947,"Q_Id":4999660,"Users Score":1,"Answer":"PyCairo could be a good alternative. You'll have full control and less dependencies, but reportlab is a lot simplier.","Q_Score":6,"Tags":"python,pdf-generation,reportlab","A_Id":7099416,"CreationDate":"2011-02-15T03:36:00.000","Title":"Using python to convert PNG's into PDF's","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Have downloaded VLC.py, and placed it in my VLC install directory, where libvlc.dll is also present\nOn typing import vlc\nI get the following error\n\nTraceback (most recent call last):\n File \"C:\\Program Files\n (x86)\\VideoLAN\\VLC\\vlc.py\", line 88,\n in \n dll = ctypes.CDLL('libvlc.dll') File\n \"C:\\Python27\\lib\\ctypes__init__.py\",\n line 353, in init\n self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 is\n not a valid Win32 application\n\nAny ideas why?\nIf needed, my config is:\nWin7 pro 64 bit\n4GB RAM","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2520,"Q_Id":5007455,"Users Score":3,"Answer":"Reposting my comment as an answer, since it fixed the problem:\n\nI'm going to guess that the problem is trying to load a 32-bit DLL from a 64-bit process. You may be able to fix it by using a 32-bit Python build.","Q_Score":0,"Tags":"python,vlc","A_Id":5033072,"CreationDate":"2011-02-15T17:55:00.000","Title":"VLC Python Bindings -- Error 193","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What's the best way to draw rotated text rendered with fonts with pygame? I can just draw the font then rotozoom it, but it seems better result would be gotten if it were possible to draw the glyphs directly rotated, especially taking AA into account?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2142,"Q_Id":5007478,"Users Score":0,"Answer":"You can use a pyOpenGL surface in pygame, if that simplifies it for you.\nPyglet also uses OpenGL. \n(for pygame surfaces) You can cache the rendered text, using that to rotate. Or pre-cache all 32 directions. [ see other answer ]","Q_Score":0,"Tags":"python,fonts,rotation,render,pygame","A_Id":5691673,"CreationDate":"2011-02-15T17:57:00.000","Title":"draw rotated font with pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a wxPython app with one frame and one panel. On that panel are a number of static boxes, each of which has buttons and textboxes.\nI have just begun reading about sizers, but they seem like they might be more than what I need, or it could that they are exactly what I need but I don't know how to use them correctly!\nThe frame currently opens at 1920 x 1080. If the user drags the bottom right corner to resize the app, I just want everything to get smaller or larger as needed to keep the same size ratio.\nIs this possible?\nThank you!\nedit: additional info: I used wxPython 2.8 and Boa to construct the GUI. I am contemplating trying another gui ide.\nSo after reading some more about sizers, I am thinking about doing the following:\nadd a gridsizer and basically divide my window's elements into rows and columns, then set each row and column's size as necessary until I achieve the original layout. Then I guess set the rows and columns to resize correctly? Is this a decent idea?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":301,"Q_Id":5012257,"Users Score":1,"Answer":"For complex layouts, I sketch it out on a piece of paper. Then I draw boxes around the widgets in different ways to decide what sizers to use. You can nest pretty much any sizer inside another one. If the controls naturally fit in a grid, then using a grid sizer of some sort is probably alright. If not, then use BoxSizers. I tend to use those the most.","Q_Score":1,"Tags":"python,wxpython,boxsizer","A_Id":5018264,"CreationDate":"2011-02-16T03:31:00.000","Title":"Simple wxPython Frame Contents Resizing - Ratio?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im currently working on a project with pygame and am in need of being able to view part of a surface, moving around, zooming in and out ect\nCan anyone recommend a way of achieving this efficently, i have it working in a convoluted method at the moment but it is too slow and reduces the game to about 1fps when zoomed out to view the whole area. (my version of only scrolling and no zooming works fine with no lagging)\nLooking though the docs pygame.transform.scroll looks promising but i am unsure how i would correctly implement it with pygame.transform.scale for zooming in and out\nAny help welcome\nupdate:\nI fiddled around for a bit and got it working scaleing objects and their positions before bliting them. I have now hit the problem that the scaling looks unatural because of the low resolution of the pygame scroll wheel events so I am now trying to impliment some kind of smoothing.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":7328,"Q_Id":5014993,"Users Score":0,"Answer":"For a game that I have never finished I used trigonometry to get the new drawing positions with a freely zoomed and turned camera (bit complicated). It didn't really take to much time to calculate but I think it is more efficient to use other libraries. But if you want some examples just ask.","Q_Score":5,"Tags":"python,scroll,zooming,transform,pygame","A_Id":13349846,"CreationDate":"2011-02-16T10:02:00.000","Title":"Pygame zooming\/scrolling window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im currently working on a project with pygame and am in need of being able to view part of a surface, moving around, zooming in and out ect\nCan anyone recommend a way of achieving this efficently, i have it working in a convoluted method at the moment but it is too slow and reduces the game to about 1fps when zoomed out to view the whole area. (my version of only scrolling and no zooming works fine with no lagging)\nLooking though the docs pygame.transform.scroll looks promising but i am unsure how i would correctly implement it with pygame.transform.scale for zooming in and out\nAny help welcome\nupdate:\nI fiddled around for a bit and got it working scaleing objects and their positions before bliting them. I have now hit the problem that the scaling looks unatural because of the low resolution of the pygame scroll wheel events so I am now trying to impliment some kind of smoothing.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":7328,"Q_Id":5014993,"Users Score":0,"Answer":"You can use pygame with OpenGL, since you are already familiar with pygame. Otherwise pyglet is a similar opengl library.","Q_Score":5,"Tags":"python,scroll,zooming,transform,pygame","A_Id":7509780,"CreationDate":"2011-02-16T10:02:00.000","Title":"Pygame zooming\/scrolling window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying automatically generate buttons to a menu using PIL in python.\nThe button should be small rectangular and have a little gradient from one color to another, and a little text in it.\nIs PIL the best way to do this, or is Cairo a better alternative? Any suggestion to how I can accomplish this without having a image to start with..?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":413,"Q_Id":5022891,"Users Score":1,"Answer":"You can do this entirely with PIL if you start with a single pre-made white-to-black gradient image (that you've made in some other program) and then use the ImageChops module to manipulate this together with your primary image to get what you want.\nFor example to if you want to fade from red to blue: multiply red by the gradient, flip the gradient and multiply blue by this, and add these together.\nIf your images vary in size, you can scale the gradient image appropriately in PIL.","Q_Score":1,"Tags":"python,python-imaging-library,cairo","A_Id":5024687,"CreationDate":"2011-02-16T22:25:00.000","Title":"Generating a shaded button using PIL","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For a computer architecture assignment, I am trying to replace a C++ library called \"Sim\" with something in Python.\nI am already using MyHDL for the simulator, but the C++ program has a nice interactive feature that lets students see the components connected together (gates, inputs, outputs, flip flops, etc.) and toggle any signal.\nI am attempting to create that interactive aspect and I just need to pick the library to use. I was wondering if wxPython would be a good choice in this case. The GUI mainly needs to draw gates or devices like flip flops and counters, use lines to connect them, and have some representation of signals (0 and 1 for instance or black and white).\nIs wxPython a good idea, or are there better libraries for this application?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":441,"Q_Id":5038022,"Users Score":0,"Answer":"wxPython and PyQt both are good option. I find Qt easy as compare to wxPython.","Q_Score":3,"Tags":"python,wxpython,computer-architecture","A_Id":5039125,"CreationDate":"2011-02-18T05:40:00.000","Title":"Is wxPython good for a Hardware Simulator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For a computer architecture assignment, I am trying to replace a C++ library called \"Sim\" with something in Python.\nI am already using MyHDL for the simulator, but the C++ program has a nice interactive feature that lets students see the components connected together (gates, inputs, outputs, flip flops, etc.) and toggle any signal.\nI am attempting to create that interactive aspect and I just need to pick the library to use. I was wondering if wxPython would be a good choice in this case. The GUI mainly needs to draw gates or devices like flip flops and counters, use lines to connect them, and have some representation of signals (0 and 1 for instance or black and white).\nIs wxPython a good idea, or are there better libraries for this application?","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":441,"Q_Id":5038022,"Users Score":1,"Answer":"wxPython or pyside (Qt python bindings) are both ideal for this.\nwx is a little better if you have any MFC experience, Qt is perhaps a more modern design.","Q_Score":3,"Tags":"python,wxpython,computer-architecture","A_Id":5038058,"CreationDate":"2011-02-18T05:40:00.000","Title":"Is wxPython good for a Hardware Simulator?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to listen for certain keypresses in a python terminal program without pausing execution with raw_input. I've seen people use a few windows specific ways of listening for keystrokes and I've seen people use large modules like tkinter and pygame which I want to avoid.\nIs there a lightweight module out there that does this cross platform (at least ubuntu, windows, mac)? or is there a way to use just the event system from tkinter, pygame, etc...?\nIf not, how should I approach tackling this? My first thought is to redirect stdin to another process and keep checking to see if it contains one of my event keys.\n\nedit\nThank you @unutbu for taking the time to mark this question that is 3 years old and successfully answered as a duplicate of another question whose answers do not apply to this question because I specifically asked about a non-blocking solution.","AnswerCount":4,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":20515,"Q_Id":5044073,"Users Score":6,"Answer":"Short answer: no\nKeypresses are system-dependent. They are interrupt-driven. They one of the basic things built into most modern OSes. They have different philosophies that can't be unified in a generic way without losing functionality. \nyou might try-\ntermios = unix, posix-style file-descriptor driven\ncurses = portal terminal-style handling (which is a specific console-based paradigm not generic)\nPython wraps certain classes of input that might come from the keyboard: e.g., sys.stdin for console inupt. \nBut trying to get universal keyboard input is a very general problem that's inherently platform-dependent.","Q_Score":21,"Tags":"python,keyboard-events","A_Id":5047120,"CreationDate":"2011-02-18T16:48:00.000","Title":"Python cross-platform listening for keypresses?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a game and now I want to make script system for it.\nNow I have abstract class Object which is inherited by all game objects. I have to write a lot of technical code, add new object type into enum, register parser function for each object (that function parses object's params from file).\nI don't want to make such work. So the idea is to get some script system (boost.python for example, because I'm using boost in my project). Each object will be a simple python-script, at c++ side I just load and run all that scripts.\nPython isn't hard -typed so I can register functions, build types dynamically without storing enum, etc. The only bad part is writing a lot of binding-code but It makes only once.\nAre my ideas right?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":203,"Q_Id":5050372,"Users Score":0,"Answer":"Can you give us a rough idea of how large the game is going to be?\nIf you're not careful, you could give yourself a lot of extra work without much benefit, but with some planning it sounds like it might help. The important questions are \"What parts of the program do I want to simplify?\", \"Do I need a scripting language to simplify them? and \"Can the scripting language simplify them?\". \nYou mentioned that you don't want to have to manually parse files. Python's pickle module could handle serialization for you, but so could .NET. If you're using Visual Studio, then you may find it easier to write the code in C# than in Python. \nYou should also look for ways to simplify your code without adding a new language. For example, you might be able to create a simple binary file format and store your data structures without much parsing. There are probably other things you can do, but that would require more detailed knowledge of the program.","Q_Score":1,"Tags":"c++,python,boost,system","A_Id":5055236,"CreationDate":"2011-02-19T10:57:00.000","Title":"Script system in application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm having a problem with a simple Notepad application I'm writing to teach myself basic Python\/PyQt.\nSpecifically, I want to know how to change the multi-touch pan gesture sensitivity on a QListWidget. \nAs it is now, when I drag up and down with 2 fingers, it seems like the list is moving up\/down one step for each pixel I move with my fingers. This is nothing I've implemented myself, it seems to work out of the box for list widgets\nI want the movement to mimic the speed of my fingers i.e one move up\/down of the widget items for every x*height_of_item_in_pixels. Is this doable without major hacking into the gesture system?\nHow would I go about this?\nI'm using PyQt 4.8.3 with Python 2.6","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1586,"Q_Id":5050817,"Users Score":0,"Answer":"More than likely this functionality exists because the multitouch event is being interpreted by your operating system as a scroll of some type and QT is recieving the scroll action, rather than the multitouch action directly.","Q_Score":3,"Tags":"python,qt4,pyqt,pyqt4,qlistwidget","A_Id":18070801,"CreationDate":"2011-02-19T12:40:00.000","Title":"Customize PyQt multi-touch pan gestures on QListWidget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can i make a smooth circular orbit at a constant speed using pygame?\nHow would i calculate x, y on a circle?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":907,"Q_Id":5058591,"Users Score":1,"Answer":"Try using polar coordinates. It's natural :)\nIf you don't calculate enough frames to make your orbit look smooth, calculate 3-4 intermediate points of orbit to draw shorter line segments, without calculating the game state at these points. Make this radius-dependent. This helps proper collision detection, too.","Q_Score":1,"Tags":"python,math,pygame","A_Id":5058696,"CreationDate":"2011-02-20T17:16:00.000","Title":"Making smooth orbits in pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a little programming experience and I did get to work with Swing (Java) and wxPython. \nSome years ago, I ended up having to port an app I did to OS X and all the problems I've had with wxPython just multiplied. I've started looking at alternatives and I could not find anything better than wxPython. QT was the only one that came even close. GTK was hell on Windows (last time I checked). \nI don't think my predicament is unique, some other people might have reached the same position over the years.\nSo, why isn't there a GUI toolkit to have the following characteristics:\n\nSimple. Basic windows\/dialogs (native open and save) + a basic set of widgets with SOLID Layout management. Additional (composite widgets) implemented as additional libraries. \nActively maintained on OS X, Linux and Windows\nActively maintained bindings to at least 3 high level languages. \nActively maintained documentation for best practices GUI devel with examples using the toolkit. MVC\/MVP properly explained. GUI HIG (Apple style) simply explained, complete with semantics, paradigms, best practices, alignment, proper spacing and TONS of best of their kind examples from successful pieces of software. \nA simple way of building a distributable executable for the 3 targeted platforms in each of the languages. \nImplemented as close to the metal using readily available libs like Clutter, cairo, etc. \n\nAre these requirements too much to ask? If yes, why?\nHelp me understand why isn't there such a tiny lib available?","AnswerCount":6,"Available Count":3,"Score":0.1651404129,"is_accepted":false,"ViewCount":653,"Q_Id":5067578,"Users Score":5,"Answer":"Have you tried Qt? It is a cross platform C++ GUI toolkit for higher level language (PyQt). And it seemed very simple to me.","Q_Score":2,"Tags":"python,user-interface","A_Id":5067597,"CreationDate":"2011-02-21T15:08:00.000","Title":"Why are there no simple, cross-platform, C\/C++ GUI tookits for higher level languages?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a little programming experience and I did get to work with Swing (Java) and wxPython. \nSome years ago, I ended up having to port an app I did to OS X and all the problems I've had with wxPython just multiplied. I've started looking at alternatives and I could not find anything better than wxPython. QT was the only one that came even close. GTK was hell on Windows (last time I checked). \nI don't think my predicament is unique, some other people might have reached the same position over the years.\nSo, why isn't there a GUI toolkit to have the following characteristics:\n\nSimple. Basic windows\/dialogs (native open and save) + a basic set of widgets with SOLID Layout management. Additional (composite widgets) implemented as additional libraries. \nActively maintained on OS X, Linux and Windows\nActively maintained bindings to at least 3 high level languages. \nActively maintained documentation for best practices GUI devel with examples using the toolkit. MVC\/MVP properly explained. GUI HIG (Apple style) simply explained, complete with semantics, paradigms, best practices, alignment, proper spacing and TONS of best of their kind examples from successful pieces of software. \nA simple way of building a distributable executable for the 3 targeted platforms in each of the languages. \nImplemented as close to the metal using readily available libs like Clutter, cairo, etc. \n\nAre these requirements too much to ask? If yes, why?\nHelp me understand why isn't there such a tiny lib available?","AnswerCount":6,"Available Count":3,"Score":0.0,"is_accepted":false,"ViewCount":653,"Q_Id":5067578,"Users Score":0,"Answer":"My guess is that windows developers couldn't be bothered as they have wpf etc and linux developers couldn't be bothered as they are used to it. So only people who are sick of win developement and moving to linux would embrace it. Maybe its time for you to start an open source project :) I was thinking something like wpf but based on opengl would be a good start.","Q_Score":2,"Tags":"python,user-interface","A_Id":5067655,"CreationDate":"2011-02-21T15:08:00.000","Title":"Why are there no simple, cross-platform, C\/C++ GUI tookits for higher level languages?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a little programming experience and I did get to work with Swing (Java) and wxPython. \nSome years ago, I ended up having to port an app I did to OS X and all the problems I've had with wxPython just multiplied. I've started looking at alternatives and I could not find anything better than wxPython. QT was the only one that came even close. GTK was hell on Windows (last time I checked). \nI don't think my predicament is unique, some other people might have reached the same position over the years.\nSo, why isn't there a GUI toolkit to have the following characteristics:\n\nSimple. Basic windows\/dialogs (native open and save) + a basic set of widgets with SOLID Layout management. Additional (composite widgets) implemented as additional libraries. \nActively maintained on OS X, Linux and Windows\nActively maintained bindings to at least 3 high level languages. \nActively maintained documentation for best practices GUI devel with examples using the toolkit. MVC\/MVP properly explained. GUI HIG (Apple style) simply explained, complete with semantics, paradigms, best practices, alignment, proper spacing and TONS of best of their kind examples from successful pieces of software. \nA simple way of building a distributable executable for the 3 targeted platforms in each of the languages. \nImplemented as close to the metal using readily available libs like Clutter, cairo, etc. \n\nAre these requirements too much to ask? If yes, why?\nHelp me understand why isn't there such a tiny lib available?","AnswerCount":6,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":653,"Q_Id":5067578,"Users Score":2,"Answer":"What you ask is a simple lib with enormous flexibility. Be able to build 3 * 3 executables, having good documentation and using other libraries all with a different background. And all of that on different OS platforms. It is quite a challenge it think QT would com the closest but it does not meet all your criteria.","Q_Score":2,"Tags":"python,user-interface","A_Id":5067669,"CreationDate":"2011-02-21T15:08:00.000","Title":"Why are there no simple, cross-platform, C\/C++ GUI tookits for higher level languages?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I make a newly created window in wxPython not take focus? I'd like to be able to create a new window, without focus jumping to it.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":527,"Q_Id":5073054,"Users Score":1,"Answer":"That seems a little counter-intuitive. However, you can also simulate this by creating and showing the second frame and then calling Raise() on the original frame.","Q_Score":2,"Tags":"python,wxpython,focus","A_Id":5082357,"CreationDate":"2011-02-22T01:06:00.000","Title":"Preventing New Windows from Capturing Focus wxPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to convert a QTabBar inside the QTabWidget into a QComboBox?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":161,"Q_Id":5075232,"Users Score":1,"Answer":"That might somehow be possible by overwriting QTabWidget, but I think the much cleaner, faster and easier solution would be to combine QComboBox and QStackedWidget to a new widget.","Q_Score":1,"Tags":"python,qt,pyqt,pyqt4","A_Id":5077111,"CreationDate":"2011-02-22T07:23:00.000","Title":"Is it possible to convert a QTabBar inside the QTabWidget into a QComboBox?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've installed ActivePython 3.1 and ran IDLE with -n parameter as required by the turtle module in documentation. However when I try to use it with call such as turtle.postion(), new windows is opened (with Tk icon), which freezes and shows nothing.\nWhat could be wrong?","AnswerCount":2,"Available Count":2,"Score":0.1973753202,"is_accepted":false,"ViewCount":906,"Q_Id":5081499,"Users Score":2,"Answer":"The immediate cause of the freeze is that the Tk event loop is not being serviced. Without that, Tk windows do not display or update correctly (all GUI toolkits are event based, but Tk is particularly so). Unfortunately, I don't know Python's Tk binding or IDLE nearly well enough to be able to say what that is caused by.","Q_Score":2,"Tags":"python,windows,tk,turtle-graphics,activepython","A_Id":5137220,"CreationDate":"2011-02-22T17:19:00.000","Title":"Why ActivePython freezes after I use the turtle module?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've installed ActivePython 3.1 and ran IDLE with -n parameter as required by the turtle module in documentation. However when I try to use it with call such as turtle.postion(), new windows is opened (with Tk icon), which freezes and shows nothing.\nWhat could be wrong?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":906,"Q_Id":5081499,"Users Score":0,"Answer":"Partially resolved by not running it in IDLE, I execute it as a python script and wait for input to see what is drawn.","Q_Score":2,"Tags":"python,windows,tk,turtle-graphics,activepython","A_Id":5092475,"CreationDate":"2011-02-22T17:19:00.000","Title":"Why ActivePython freezes after I use the turtle module?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Python Tkinter and I want to place a variable number of text box widgets in a frame or canvas. The text boxes are packed vertically down the frame, so the first one is on top, the second one is found below, etc.. I can have all the button, listbox, etc widgets in a \"left section\" of the GUI, while a \"right section\" will only contain the text box widgets. I want the text box widgets to horizontally expand when the master window is maximized, but because there's a variable number of these widgets, the \"right section\" containing the text boxes also needs to be able to vertically scroll to view them all.\nCurrently, I'm using Canvas.create_window to add my variable number of text boxes to the canvas, and while I can scroll the canvas to view all the text boxes, they do not horizontally expand when I resize the window. I have an alternate GUI that uses a frame for the \"right section\", which allows the widgets to horizontally expand, but if too many are packed, I cannot scroll the frame to see the additional text boxes because I can't have a scroll bar tied to a frame.\nIs there any way around this trade-off?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1473,"Q_Id":5082642,"Users Score":0,"Answer":"The solution is pretty simple: bind to the event of the canvas -- this will cause your callback to be called whenever the canvas widget is resized. You then simply need to get the width of the canvas and use that to iteratively resize all the embedded windows.","Q_Score":1,"Tags":"python,canvas,widget,scroll,tkinter","A_Id":5082704,"CreationDate":"2011-02-22T19:03:00.000","Title":"Python Tkinter - Scrollable canvas containing expandable widgets","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm wondering how to go about implementing a macro recorder for a python gui (probably PyQt, but ideally agnostic). Something much like in Excel but instead of getting VB macros, it would create python code. Previously I made something for Tkinter where all callbacks pass through a single class that logged actions. Unfortunately my class doing the logging was a bit ugly and I'm looking for a nicer one. While this did make a nice separation of the gui from the rest of the code, it seems to be unusual in terms of the usual signals\/slots wiring. Is there a better way?\nThe intention is that a user can work their way through a data analysis procedure in a graphical interface, seeing the effect of their decisions. Later the recorded procedure could be applied to other data with minor modification and without needing the start up the gui.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1816,"Q_Id":5093153,"Users Score":1,"Answer":"Thinking in high level, this is what I'd do:\nDevelop a decorator function, with which I'd decorate every event-handling functions.\nThis decorator functions would take note of thee function called, and its parameters (and possibly returning values) in a unified data-structure - taking care, on this data structure, to mark Widget and Control instances as a special type of object. That is because in other runs these widgets won't be the same instances - ah, you can't even serialize a toolkit widget instances, be it Qt or otherwise.\nWhen the time comes to play a macro, you fill-in the gaps replacing the widget-representating object with the instances of the actually running objects, and simply call the original functions with the remaining parameters.\nIn toolkits that have an specialized \"event\" parameter that is passed down to event-handling functions, you will have to take care of serializing and de-serializing this event as well.\nI hope this can help. I could come up with some proof of concept code for that (although I am in a mood to use tkinter today - would have to read a lot to come up with a Qt4 example).","Q_Score":2,"Tags":"python,user-interface,macros,recorder","A_Id":5093338,"CreationDate":"2011-02-23T15:41:00.000","Title":"Implementing a macro recorder for a python gui?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm wondering how to go about implementing a macro recorder for a python gui (probably PyQt, but ideally agnostic). Something much like in Excel but instead of getting VB macros, it would create python code. Previously I made something for Tkinter where all callbacks pass through a single class that logged actions. Unfortunately my class doing the logging was a bit ugly and I'm looking for a nicer one. While this did make a nice separation of the gui from the rest of the code, it seems to be unusual in terms of the usual signals\/slots wiring. Is there a better way?\nThe intention is that a user can work their way through a data analysis procedure in a graphical interface, seeing the effect of their decisions. Later the recorded procedure could be applied to other data with minor modification and without needing the start up the gui.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":1816,"Q_Id":5093153,"Users Score":1,"Answer":"You could apply the command design pattern: when your user executes an action, generate a command that represents the changes required. You then implement some sort of command pipeline that executes the commands themselves, most likely just calling the methods you already have. Once the commands are executed, you can serialize them or take note of them the way you want and load the series of commands when you need to re-execute the procedure.","Q_Score":2,"Tags":"python,user-interface,macros,recorder","A_Id":5093408,"CreationDate":"2011-02-23T15:41:00.000","Title":"Implementing a macro recorder for a python gui?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I've got a problem - I'm writing a game prototype in Python, using Pygame, and I want to save my games. All of the game-related data is in three instances of certain classes, and I want to save these three instances to a file. However, I've tried pickling these instances, and it doesn't work. Instead, I get \"TypeError: can't pickle Surface objects\". This is a problem, because I want to store Surface objects.\nI'm open to any alternatives to pickling that there may be, using any other kind of data type. The important thing is that these instances get stored, and that their data is then retrievable later on. So what can I do to overcome this issue? Please keep in mind, I'm not a very experienced programmer, having learned Python in my spare time a year ago, and I can't write much of any other language, though I'm slowly learning C++.","AnswerCount":2,"Available Count":1,"Score":0.4621171573,"is_accepted":false,"ViewCount":1353,"Q_Id":5145664,"Users Score":5,"Answer":"The basic point of pickling is that you should be able to serialise the object somehow. An SDL surface is an in memory object holding a lot of run time state. Trying to serialise it is not totally sensible. \nWhat you should do is to decouple the state of your game from the rendering components so that you can serialise just those (pickling or whatever). \nIt's like trying to save the state of a video by somehow saving the memory buffers holding the decoded video. This will not work. Instead, how you save it is to serialise the location of the video file and the time offset. Then you can continue playback upon load the next time you restore your application.","Q_Score":3,"Tags":"python,serialization,pygame,pickle","A_Id":5145756,"CreationDate":"2011-02-28T17:58:00.000","Title":"Storing unpicklabe pygame.Surface objects in external files","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I started using SWIG on a huge C++ library (made of of several inter-dependent static libs) to expose it to python. This library defines many primitive classes that are used throughout as parameters (images of different types for example). There is extensive use of STL, inheritance and templating in the lib as well.\nSo far I have a minimal portion of the lib usable from Python but would like to progressively add the remaining 90+%.\nFor my part, working with SWIG is really no fun: Battling with template instantiations, learning all that SWIG syntax and keywords, etc. I recently played a bit with CTypes and found it so enjoyable that I am now considering writing an extern C interface for the whole library instead of using SWIG.\nI would rather be coding in C\/C++ and\/or Python than learning an obscure set of SWIG commands (that counts for SIP also).\nThere are quite a few questions out there already asking similar advice so I'll add something new and specific: \nI would like for the library's internal images classes to be visible from python as PIL images transparently, not as SWIG-Wrapped native classes. Will I have to resort to the plain-old Python External API to accomplish that?\nI welcome any and all advice!","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":982,"Q_Id":5160308,"Users Score":1,"Answer":"Have you considered looking into using Boost.Python?","Q_Score":3,"Tags":"c++,python,python-imaging-library","A_Id":5161325,"CreationDate":"2011-03-01T21:03:00.000","Title":"Exposing C++ library to Python + PIL","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Why doesn't Ctrl+C work to break a Python program that uses PyQt? I want to debug it and get a stack trace and for some reason, this is harder to do than with C++!","AnswerCount":2,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":10443,"Q_Id":5160577,"Users Score":4,"Answer":"I agree with Neil G, and would add this:\nIf you do not call QApplication.exec_() to start the event loop, and instead execute your program in an interactive python shell (using python -i), then pyqt will automatically process events whenever the interactive prompt is waiting, and Ctrl-C should again behave as expected. This is because the Qt event loop will be sharing time with the python interpreter, rather than running exclusively, allowing the interpreter a chance to catch those interrupts.","Q_Score":23,"Tags":"python,pyqt","A_Id":5186213,"CreationDate":"2011-03-01T21:28:00.000","Title":"Ctrl-C doesn't work with PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a list of instances of objects (wxPython widgets). I'd like to be able to tell if an instance within my list has been destroyed. How would one go about this?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":803,"Q_Id":5162773,"Users Score":4,"Answer":"Assuming wxPython is playing by the rules and by \"destroyed\" you mean \"is no longer referenced\", then the weakref module in the standard library should let you do what you want (specifically, you can register a callback when creating a weak reference that is invoked just before the target of the weak reference is destroyed).\nIf wxPython isn't playing by the rules, or has disabled weak referencing for its objects, you may be out of luck.","Q_Score":1,"Tags":"python,list,wxpython,instance","A_Id":5162963,"CreationDate":"2011-03-02T02:28:00.000","Title":"Telling if an Instance has been Destroyed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a list of instances of objects (wxPython widgets). I'd like to be able to tell if an instance within my list has been destroyed. How would one go about this?","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":803,"Q_Id":5162773,"Users Score":0,"Answer":"This is applicable to all wx.Window derived objects. If it has been destroyed or disposed, it won't be None, but it will be False.","Q_Score":1,"Tags":"python,list,wxpython,instance","A_Id":40513866,"CreationDate":"2011-03-02T02:28:00.000","Title":"Telling if an Instance has been Destroyed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When I try to import the 'Rect'-struct from System.Windows, IronPython-Interpreter claims that it cannot import.\nSince I am using the IronPython Tools for Visual Studio, i can also see that the IntelliSense-DropDown does not show this struct.\nIs there a need for a special statement for importing this struct?\nThanks!","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":273,"Q_Id":5189630,"Users Score":2,"Answer":"You probably need to do:\nimport clr\nclr.AddReference('WindowsBase')\nto load the assembly Rect is declared in before importing it.","Q_Score":1,"Tags":"import,ironpython,rect","A_Id":5190602,"CreationDate":"2011-03-04T04:23:00.000","Title":"IronPython: Cannot import 'Rect'-struct from System.Windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there an equivalent to Tkinter's .after() in wxPython? \nFor those that don't know .after() allows the running of functions at some point in the future. This can be used to make loops with functions. \nI'm attempting to make a clock, so this would be handy for making it tick.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1132,"Q_Id":5201876,"Users Score":1,"Answer":"There are several functions in wx.Python to do that.\nYou should check the \"Process and events\" section of the wxPython demos, More especifically those related with wx.Timer\n\nThe wx.Timer class allows you to\n execute code at specified intervals\n from within the wxPython event loop.\n Timers can be one-shot or repeating. \n This demo shows the principle method\n of using a timer (with events) as well\n as the convenient wx.FutureCall class.","Q_Score":1,"Tags":"python,wxpython,tkinter","A_Id":5201931,"CreationDate":"2011-03-05T05:22:00.000","Title":"wxPython Equivalent to Tkinter .after()","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i am looking to start learning. people have told me it is juts as capable. though i haven't really seen any good looking games available. some decent ones on pygame, but none really stand out.\ni would like to know if python really is as capable as other languages.\nEDIT: thanks guys, is python good for game development?","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":161,"Q_Id":5217513,"Users Score":2,"Answer":"Short answer: Yes, it is.\nBut this heavily depends on your problem :)","Q_Score":0,"Tags":"python","A_Id":5217530,"CreationDate":"2011-03-07T08:40:00.000","Title":"is python as capable as other languages like c++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im making a PyQt4 app which calls Imagemagick and ffmpeg, but it takes too much to complete the tasks and im wondering if there is a way to implement threads to this, the app is going to run in a multicore machine, and some of the methods I have seen are not efficient enough. Thanks in advance","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":256,"Q_Id":5224679,"Users Score":0,"Answer":"The answer is yes and no - you can use QThread for threading but you'll still be subject to the GIL, so your threads will run in serial.\nYou could try using multiprocessing to create a worker class in its own process and send work to it (or have it steal work from a queue), however this could introduce its own performance penalties in copying objects and sending objects between processes...\n\nHaving re-read your question, it looks like Imagemagick and ffmpeg are external executables, in which case the GIL is released while you wait for the process to execute. Can I ask how you run these though? I tend to find that it is better to create a work queue and an event loop. Each time round the event loop you check whether your running process(es) have finished and then get their output. For this subprocess.Popen is more useful than os.command.\nIf you use a QTimer you can utilise your QApplication's event loop, which also has the added benefit of allowing your GUI (assuming you have one) to be refreshed between ticks.","Q_Score":0,"Tags":"multithreading,ffmpeg,imagemagick,pyqt4,python-2.6","A_Id":5273687,"CreationDate":"2011-03-07T20:08:00.000","Title":"Threads in PyQt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i hear people say python is just as good as c++ and java but i cant find many good games made in python. a few in pygames but not many\njust trying to choose the right language\nedit: sorry, many games really, i would love to make a roguelike, basically my dream. also an overhead rpg. nothing to complex, i dont want to reinvent the wheel but i would like to make a fun game. i have minor java experience, but like the looks of python. i dont plan on making a 3d game really.","AnswerCount":6,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":90954,"Q_Id":5224759,"Users Score":3,"Answer":"I'd say Python is okay for scripting in a game engine (See: EVE Online, Civ IV), but I wouldn't write a game engine in it. The performance just isn't there for serious real-time games. If you just want to do simple 2d stuff that's fine, but your're not going to write the next Crysis, or even the next Minecraft, in pure Python.","Q_Score":21,"Tags":"python","A_Id":5224812,"CreationDate":"2011-03-07T20:17:00.000","Title":"is python good for making games?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i hear people say python is just as good as c++ and java but i cant find many good games made in python. a few in pygames but not many\njust trying to choose the right language\nedit: sorry, many games really, i would love to make a roguelike, basically my dream. also an overhead rpg. nothing to complex, i dont want to reinvent the wheel but i would like to make a fun game. i have minor java experience, but like the looks of python. i dont plan on making a 3d game really.","AnswerCount":6,"Available Count":2,"Score":0.0333209931,"is_accepted":false,"ViewCount":90954,"Q_Id":5224759,"Users Score":1,"Answer":"For the kind of games you want to make, Python is a perfectly suitable language. The only reason there are few games made in Python is because the professional game development industry nearly exclusively uses C++, which in turn due to a combination of performance concerns and reliance on legacy code. These aren't significant for your situation so don't worry about it.","Q_Score":21,"Tags":"python","A_Id":5261445,"CreationDate":"2011-03-07T20:17:00.000","Title":"is python good for making games?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to manage some Virtual Machines through the vboxapi provided with the SDK.\nSo far I managed to launch the VM and poweroff it, but I'm not able to restore the snapshot.\nLooks like the power off procedure locks the virtual machine until the scripts terminates, as a matter of fact this is the error that I get:\n progress = self.session.console.restoreSnapshot(self.mach.currentSnapshot)\n File \"\", line 3, in restoreSnapshot\nxpcom.Exception: 0x80070005 (The object is not ready)\nAnd following is the specific functions I sequentially call to stop vm and restore snapshot.\n\n def stop(self):\n if self.mach:\n # Poweroff the virtual machine.\n progress = self.session.console.powerDown()\n # Wait for task to complete with a 60 seconds timeout.\n progress.waitForCompletion(VIRTUALBOX_TIMEOUT)\n # Check if poweroff was successful.\n if progress.resultCode != 0:\n log(\"[Virtual Machine] [PowerOff] [ERROR] Unable to poweroff virtual machine \\\"%s\\\".\" % self.mach.name)\n return False\n else:\n log(\"[Virtual Machine] [PowerOff] Virtual machine \\\"%s\\\" powered off successfully.\" % self.mach.name)\n else:\n log(\"[Virtual Machine] [PowerOff] [ERROR] No virtual machine handle.\")\n return False\n\n return True\n\n def restore_snapshot(self):\n if self.mach:\n # Restore virtual machine snapshot.\n progress = self.session.console.restoreSnapshot(self.mach.currentSnapshot)\n # Wait for task to complete with a 60 seconds timeout.\n progress.waitForCompletion(VIRTUALBOX_TIMEOUT)\n # Check if snapshot restoring was successful.\n if progress.resultCode != 0:\n log(\"[Virtual Machine] [Restore Snapshot] [ERROR] Unable to restore virtual machine \\\"%s\\\" snapshot.\" % self.mach.name)\n return False\n else:\n log(\"[Virtual Machine] [Restore Snapshot] Virtual machine \\\"%s\\\" successfully restored to current snashot.\" % self.mach.name)\n else:\n log(\"[Virtual Machine] [Restore Snapshot] [ERROR] No virtual machine handle.\")\n return False\n\n return True\nI think I'm probably missing something, any clue of what that is?\nThanks,\nC.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":2664,"Q_Id":5253832,"Users Score":0,"Answer":"You need to lock the machine first so that the console object get created for you.","Q_Score":3,"Tags":"python,api,virtualbox","A_Id":28183048,"CreationDate":"2011-03-09T23:53:00.000","Title":"VirtualBox Python API restoring snapshot","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create a Listbox in Tkinter that has columns. \nI'm returning from a DB query records and would like to display each entry in it's own column for each record. \nLooking at Listbox, I feel like there should be this functionality there but can't find it. What widget should I be using to do this? I've been searching around online but documentation has been very sparse.","AnswerCount":3,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":62004,"Q_Id":5286093,"Users Score":9,"Answer":"One simple solution is to use two listboxes side-by-side. There's no real magic, you just have to do a little bit of extra work to get one scrollbar to control both (easily done) and have the selection in the two sync up (also easily done).","Q_Score":20,"Tags":"python,listbox,tkinter","A_Id":5290731,"CreationDate":"2011-03-12T22:52:00.000","Title":"Display Listbox with columns using Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to use both Cython and pure python extensions together? Say I'd like to have a wrapper for a C function, returning GdkPixbuf pointer. The ultimate goal would be to have that function available in python, returning gtk.gdk.Pixbuf object.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":272,"Q_Id":5287207,"Users Score":0,"Answer":"Yes it is possible because most of the things that can be done with python can also be done in cython. However, using python extensions or doing anything with python objects (as opposed to statically declared C datatypes) will incur a performance penalty, so Cython will be less of an advantage.\nLook into cdef classes, they are an efficient way to implement objects in cython.","Q_Score":0,"Tags":"python,gtk,pygtk,cython","A_Id":5467143,"CreationDate":"2011-03-13T03:28:00.000","Title":"Cython interface with other extensions","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a QTreeWidget with QComboBoxes inside of it. I would like to be able to hide the combo boxes.\nI am getting the QComboBox out of the tree using the itemWidget function. I have tried using setVisible(False) and hide() but neither work. Can anyone explain why this is the case and possibly offer a soultion? \nI suspect it has something to do with the QTreeWidget or the QTreeWidgetItems controlling the visibility of its widgets.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":220,"Q_Id":5307007,"Users Score":0,"Answer":"Have you tried putting the QComboBoxes inside a layout inside a QWidget, and placing the QWidget in the QTreeWidget?","Q_Score":1,"Tags":"python,qt,user-interface,qt4,pyqt","A_Id":5312332,"CreationDate":"2011-03-15T02:54:00.000","Title":"PyQt Hide QDialogs Inside of QTreeWidget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I created three frames separately. I need to call these child frames \nfrom the click events of buttons located in a main frame. And when a \nchild frame is open, I want the main frame to be hidden or disabled \nuntil the child frame is closed. How can I do this? \nThanks in advance.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":149,"Q_Id":5308263,"Users Score":0,"Answer":"Create an event queue for each frame, when a child frame is opened set a variable that is checked on processing events to join the queue, and then unset this on destruction of the child frame. If this variable is set then throw the message away, otherwise add it to the queue for processing.\nDepending on the libraries you are using there may be a nice built-in way of dong most of this.","Q_Score":0,"Tags":"python,wxpython","A_Id":5308640,"CreationDate":"2011-03-15T06:31:00.000","Title":"Control three frames from main menu","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to write some python, and I'm used to the lispy way of doing things, a REPL in EMACS and the ability to send arbitrary code snippets to the REPL. I like this way of developing code, and python's built-in IDLE seems to do it pretty well. However I do like EMACS as an editor.\nWhat's the best thing analogous to SLIME for Python?\n\nSo far:\nIt seems that the trick is to open a python file, and then to use 'Start Interpreter' from the Python menu, after which you get an Inferior Python buffer. You can then use C-c C-c to load the whole buffer you're editing into the 'REPL', and use normal copy and paste to put snippets into the REPL.\nThis works as far as it goes. Is there any way to say 'reevaluate the big thing that the cursor is in now and display the answer', or 'reevaluate the thing the cursor is just at the end of and display the answer', like M-C-x and C-x-e in SLIME?\nAnd it all seems to work better if you use the python-mode.el from Bozhidar's answer","AnswerCount":3,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":4224,"Q_Id":5316175,"Users Score":3,"Answer":"python-mode is the default mode for editing Python in emacs. It includes commands for evaluating the buffer and running an inferior interpreter instance.","Q_Score":11,"Tags":"python,emacs,slime","A_Id":5316229,"CreationDate":"2011-03-15T18:18:00.000","Title":"What's the closest thing to SLIME for python ? \/ What's the best way to use python from EMACS?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"It might be the bindings (SIP) or even python, but I have a problem with Qt (pyqt4).\nI have a QTabWidget, and inside it I put widgets one can close.\nI have a widget that allocates about 400mb of memory. I have not set a parent, and I call deleteLater() on close but nothing happens. Even calling the python's gc does not work:\n\nimport gc\ngc.collect()\n\nNow when closing the widgets from the QTabWidget without using deleteLater() more and more memory is allocated. So lets say I open up 4 tabs of the memory-heavy widget, I use around 1.6GB memory. If I close them all, and open a new, I am now up to 2GB of memory usage.\nIf I use the deleteLater(), after closing the 4 tabs, I do not go up to 2GB opening a new one, then I have to open 5 tabs. But, and here is the problem, 1.6GB is still allocated for the process (python) even tho all widgets are closed, and deleteLater has been called.\nThanks","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1477,"Q_Id":5341954,"Users Score":3,"Answer":"I had this - somewhere you have an reference to your widget, and that reference has been counted... the only way to delete that widget is to make sure that there are no remaining references so python can garbage-collect it.\nAt least you don't end up with a dangling reference like C++, which can lead to some nasty crashes...\n\nThis can actually be useful - if you create a class with a class-level list of its members, you can recycle old objects and never have them garbage-collected","Q_Score":3,"Tags":"python,qt,garbage-collection,pyqt4","A_Id":5341992,"CreationDate":"2011-03-17T16:19:00.000","Title":"Memory not deallocated - PyQt4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've managed to package my PyQt4 app as a \"standalone\" application on windows, it works.\nHowever this application can upgrade itself, which is done by replacing the actual code written by me (.py files) with new versions, downloaded via the internet.\nHow can I tell PyInstaller do its job (putting together the DLLs, generating the launcher with the shiny icon, etc), BUT let the .py files untouched?\nI need those files directly on disk, in order for the auto-update to work.","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1782,"Q_Id":5366100,"Users Score":0,"Answer":"I think the embedded interpreter in the executable will still search for .py files in the same directory and\/or PYTHONPATH, py2exe uses a zip file for native python components, iirc pyinstaller embeds all of them in the executable, maybe there is an option to keep a zip like in py2exe (or not add them in the spec), then try to run the application without the files and monitor file accesses with procmon.","Q_Score":8,"Tags":"python,installation,pyqt4,pyinstaller","A_Id":6085674,"CreationDate":"2011-03-20T01:12:00.000","Title":"PyInstaller but keeping .py files upgradeable","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to run a Qt application in Batch mode, so basically I need to run it without GUI. \nI've already tried using QCoreApplication but my application relies on the existence of X11 window. So I need the GUI to open regularly, but I need to \"hide\" it from the user.\nI know that I have the ability to create a virtual VNC and change the active display to the virtual VNC window.\nI'm looking for a cleaner, simpler solution that will allow to suppress or \"dump\" the GUI output of the application.\nIf this helps for ideas, it will be used in a script written in Bash, Perl or Python.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":454,"Q_Id":5369290,"Users Score":1,"Answer":"As @utdmr suggested, that solved the problem.\nI've thought that show() was also responsible for the signal\/slot mechanism and other Qt and X11 functions. But apparently, the application works normally, just doesn't show the GUI. \nAnd that was exactly what I needed since it is a fully developed application and the effort to convert it to a console application was enormous.\nThanks utdmr :)","Q_Score":2,"Tags":"python,linux,qt,user-interface,x11","A_Id":5420016,"CreationDate":"2011-03-20T15:08:00.000","Title":"How to suppress a Qt GUI application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a gtk.Window. How do I set it to be the active window? I can call is_active() to see whether it already is, but I don't see where to make it active.\nBonus points: given a gtk.Widget, how do I make the window it is a part of the active window?","AnswerCount":4,"Available Count":1,"Score":-0.049958375,"is_accepted":false,"ViewCount":4336,"Q_Id":5393185,"Users Score":-1,"Answer":"You can also use gtk.Dialog.run (if it's a Dialog) aditional to gtk.Window.present","Q_Score":3,"Tags":"python,window,pygtk,gtk","A_Id":5441492,"CreationDate":"2011-03-22T14:58:00.000","Title":"gtk: set active window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Debugging performance problems using a standard debugger is almost hopeless since the level of detail is too high. Other ways are using a profiler, but they seldom give me good information, especially when there is GUI and background threads involved, as I never know whether the user was actually waiting for the computer, or not. A different way is simply using Control + C and see where in the code it stops.\nWhat I really would like is to have Fast Forward, Play, Pause and Rewind functionality combined with some visual repressentation of the code. This means that I could set the code to run on Fast Forward until I navigate the GUI to the critical spot. Then I set the code to be run in slow mode, while I get some visual repressentation of, which lines of are being executed (possibly some kind of zoomed out view of the code). I could for example set the execution speed to something like 0.0001x. I believe that I would get a very good visualization this way of whether the problem is inside a specific module, or maybe in the communication between modules.\nDoes this exist? My specific need is in Python, but I would be interested in seeing such functionality in any language.","AnswerCount":3,"Available Count":2,"Score":0.0665680765,"is_accepted":false,"ViewCount":182,"Q_Id":5416987,"Users Score":1,"Answer":"The methods you're describing, and many of the comments, seem to me to be relatively weak probabilistic attempts to understand the performance impact. Profilers do work perfectly well for GUIs and other idle-thread programs, though it takes a little practice to read them. I think your best bet is there, though -- learn to use the profiler better, that's what it's for. \nThe specific use you describe would simply be to attach the profiler but don't record yet. Navigate the GUI to the point in question. Hit the profiler record button, do the action, and stop the recording. View the results. Fix. Do it again.","Q_Score":6,"Tags":"java,python,performance,debugging,debuggervisualizer","A_Id":5419956,"CreationDate":"2011-03-24T09:19:00.000","Title":"Debugging visually using >>, >, >|, ||, |<, <, <<","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Debugging performance problems using a standard debugger is almost hopeless since the level of detail is too high. Other ways are using a profiler, but they seldom give me good information, especially when there is GUI and background threads involved, as I never know whether the user was actually waiting for the computer, or not. A different way is simply using Control + C and see where in the code it stops.\nWhat I really would like is to have Fast Forward, Play, Pause and Rewind functionality combined with some visual repressentation of the code. This means that I could set the code to run on Fast Forward until I navigate the GUI to the critical spot. Then I set the code to be run in slow mode, while I get some visual repressentation of, which lines of are being executed (possibly some kind of zoomed out view of the code). I could for example set the execution speed to something like 0.0001x. I believe that I would get a very good visualization this way of whether the problem is inside a specific module, or maybe in the communication between modules.\nDoes this exist? My specific need is in Python, but I would be interested in seeing such functionality in any language.","AnswerCount":3,"Available Count":2,"Score":0.2605204458,"is_accepted":false,"ViewCount":182,"Q_Id":5416987,"Users Score":4,"Answer":"The \"Fast Forward to critical spot\" function already exists in any debugger, it's called a \"breakpoint\". There are indeed debuggers that can slow down execution, but that will not help you debug performance problems, because it doesn't slow down the computer. The processor and disk and memory is still exactly as slow as before, all that happens is that the debugger inserts delays between each line of code. That means that every line of code suddenly take more or less the same time, which means that it hides any trace of where the performance problem is.\nThe only way to find the performance problems is to record every call done in the application and how long it took. This is what a profiler does. Indeed, using a profiler is tricky, but there probably isn't a better option. In theory you could record every call and the timing of every call, and then play that back and forwards with a rewind, but that would use an astonishing amount of memory, and it wouldn't actually tell you anything more than a profiler does (indeed, it would tell you less, as it would miss certain types of performance problems).\nYou should be able to, with the profiler, figure out what is taking a long time. Note that this can be both by certain function calls taking a long time because they do a lot of processing, or it can be system calls that take a long time becomes something (network\/disk) is slow. Or it can be that a very fast call is called loads and loads of times. A profiler will help you figure this out. But it helps if you can turn the profiler on just at the critical section (reduces noise) and if you can run that critical section many times (improves accuracy).","Q_Score":6,"Tags":"java,python,performance,debugging,debuggervisualizer","A_Id":5417219,"CreationDate":"2011-03-24T09:19:00.000","Title":"Debugging visually using >>, >, >|, ||, |<, <, <<","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"My stack for web developing includes Django\/Python and Qt\/C++ for non-web developing.\nWhat is most comfortable OS for a developer with such a stack ?","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":237,"Q_Id":5423404,"Users Score":1,"Answer":"I would say: nobody cares...if you are fine with Windows, use Windows. If you are commandline guy, go with a Unix system...the distro unlikely matters...","Q_Score":1,"Tags":"python,linux,qt","A_Id":5423456,"CreationDate":"2011-03-24T17:57:00.000","Title":"Which OS recommended for Programmers?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"My stack for web developing includes Django\/Python and Qt\/C++ for non-web developing.\nWhat is most comfortable OS for a developer with such a stack ?","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":237,"Q_Id":5423404,"Users Score":1,"Answer":"Once you go linux, you'll never go back (though you might go crazy and move onto bsd). Ubuntu is probably the easiest OS to start with, if only because of the truckloads of documentation, forum assistance, etc. Good luck!","Q_Score":1,"Tags":"python,linux,qt","A_Id":5423449,"CreationDate":"2011-03-24T17:57:00.000","Title":"Which OS recommended for Programmers?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"My stack for web developing includes Django\/Python and Qt\/C++ for non-web developing.\nWhat is most comfortable OS for a developer with such a stack ?","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":237,"Q_Id":5423404,"Users Score":1,"Answer":"If you don't want to use an language that has special requirements (like .net), the question should be which os does the programmer recommend.\nThat's really a personal decision.","Q_Score":1,"Tags":"python,linux,qt","A_Id":5423454,"CreationDate":"2011-03-24T17:57:00.000","Title":"Which OS recommended for Programmers?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I need to know how to do this on a mac because whenever I try quitting it, I have to force quit it. Is there a proper way when the user clicks the exit button that Tkinter will exit normally?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":888,"Q_Id":5427875,"Users Score":2,"Answer":"I figured out how. I just put a simple exit() command after the main loop.","Q_Score":2,"Tags":"python,macos,tkinter,exit","A_Id":5427950,"CreationDate":"2011-03-25T02:21:00.000","Title":"Python: How can I make my tkinter app exit properly?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for a GUI toolkit which also has a good designer (like visual studio) for Python language.\nIt should have\n...Good Documentation\n...Good IDE + Designer\n...Cross Platform Support (if possible)","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1203,"Q_Id":5432871,"Users Score":0,"Answer":"I've used PyQt together with Qt Designer, nice documentation and cross platform support.","Q_Score":3,"Tags":"python,user-interface,toolkit","A_Id":5432925,"CreationDate":"2011-03-25T13:12:00.000","Title":"GUI Toolkit with Good Designer for Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing a 3d shooter game that I would like to run on Computers\/Phones\/Tablets and would like some help to choose which engine to use.\n\nI would like to write the application once and port it over to Android\/iOS\/windows\/mac with ease.\nI would like to make the application streamable over the internet. \nThe engine needs some physics(collision detection) as well as 3d rendering capabilities\nI would prefer to use a scripting language such as Javascript or Python to Java or C++(although I would be willing to learn these if it is the best option)\n\n-My desire is to use an engine that is Code-based and not GUI-based, an engine that is more like a library which I can import into my Python files(for instance) than an application which forces me to rely on its GUI to import assets and establish relationships between them.\n\n\n\nThis desire stems from my recent experience with Unity3d and Blender. The way I had designed my code required me to write dozens of disorganized scripts to control various objects. I cannot help but think that if I had written my program in a series of python files that I would be able to do a neater, faster job. \n\n\n\nI'd appreciate any suggestions. The closest thing to what I want is Panda3d, but I had a difficult time working with textures, and I am not convinced that my application can be made easily available to mobile phone\/device users. If there is a similar option that you can think about, I'd appreciate the tip.","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":1543,"Q_Id":5445166,"Users Score":2,"Answer":"For the requirements that you have Unity3d is probably one of your best bets. As roy said there aren't any other 3D engines out there that will span that wide a range of platforms. Why do you think that going to a completely code based system would save you from creating a variety of classes with various responsibilities ?\nThe coding effort and the amount of code and classes will stay the same. The only thing that does change is the way that you interact with the system that you are producing. With any large scale system you will quickly run into hundreds of files. I am just finishing up a smaller sized unity project 3-4 month coding including learning unity it runs at 10k lines of code plus another 8k from external libraries and over 100 classes. But this amount wasn't driven by how unity works it was driven by the requirements of the project. While coding this I have learned a lot about how unity runs and what kind of patterns it requires and will be able to come up with better solutions for the next project. Look back at what you did and think about how you can organize it better. I think it is a save bet to say that you will need about the same amount of code with any other system to achieve a similar result. \nThe advantages that unity does have are a good multiplattform support and a excellent asset pipeline. Importing and utilising art assets, 2D, 3D and audio is for me one of the most onerous tasks of this kind of development and it is extremely well supported in unity.","Q_Score":0,"Tags":"javascript,python,game-engine","A_Id":5445501,"CreationDate":"2011-03-26T20:41:00.000","Title":"3d game engine suggestions","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am developing a 3d shooter game that I would like to run on Computers\/Phones\/Tablets and would like some help to choose which engine to use.\n\nI would like to write the application once and port it over to Android\/iOS\/windows\/mac with ease.\nI would like to make the application streamable over the internet. \nThe engine needs some physics(collision detection) as well as 3d rendering capabilities\nI would prefer to use a scripting language such as Javascript or Python to Java or C++(although I would be willing to learn these if it is the best option)\n\n-My desire is to use an engine that is Code-based and not GUI-based, an engine that is more like a library which I can import into my Python files(for instance) than an application which forces me to rely on its GUI to import assets and establish relationships between them.\n\n\n\nThis desire stems from my recent experience with Unity3d and Blender. The way I had designed my code required me to write dozens of disorganized scripts to control various objects. I cannot help but think that if I had written my program in a series of python files that I would be able to do a neater, faster job. \n\n\n\nI'd appreciate any suggestions. The closest thing to what I want is Panda3d, but I had a difficult time working with textures, and I am not convinced that my application can be made easily available to mobile phone\/device users. If there is a similar option that you can think about, I'd appreciate the tip.","AnswerCount":3,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1543,"Q_Id":5445166,"Users Score":0,"Answer":"Well I see you've checked Unity3D already, but I can't think of any other engines work on PC, Telephones and via streaming internet that suport 3D (for 2D check EXEN or any others). \nI'm also pretty sure that you can use Unity code-based, and it supports a couple of different languages, but for Unity to work you can't just import unity.dll (for example) into your code, no you have to use your code into unity so that unity can make it work on all these different platforms.","Q_Score":0,"Tags":"javascript,python,game-engine","A_Id":5445300,"CreationDate":"2011-03-26T20:41:00.000","Title":"3d game engine suggestions","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have some .png images and I want to be able to quickly:\n(a) Load a .png from a file.\n(b) Draw some simple lines on top of the .png.\n(c) Get the contents (bytes) of the resulting image to return as the result of an http request.\nIt sounds like PIL is a good candidate for doing this with relatively little code. However, I'm trying to understand how efficient it is, especially when I have, say, thousands of lines to draw in step (b). The alternative is using PyOpenGL, but before getting into that I wanted to understand if PIL was already fast enough.\nI was going to ask if PIL used OpenGL under the covers. But that might be the wrong question, because my understanding is that to get the real speed benefit from PyOpenGL I'd want to submit my line vertexes as NumPy arrays. So presumably even if PIL uses OpenGL, I'm going to lose a lot of that benefit when I make an individual PIL call to draw each of my lines?\nAnybody have concrete data for speed of PIL when drawing lots of primitives?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":2486,"Q_Id":5446816,"Users Score":2,"Answer":"\"Draw some simple lines on top of the .png\" is not a computationally intensive task. \nThis doesn't seems to be a good candidate for the GPU since they are better suited for more complex tasks. You've got to realize that the image is initially loaded on the RAM, making it your job to send this data to the GPU memory and then retrieve it back. This operation consumes a few milliseconds, depending on the size of the image, that could be better used for CPU processing.\nYour application would only benefit from the GPU if it had high arithmetic intensity.","Q_Score":0,"Tags":"python,opengl,python-imaging-library,gpu","A_Id":5446952,"CreationDate":"2011-03-27T02:23:00.000","Title":"How fast is Python Image Library's (PIL) ImageDraw Module, for instance as compared to OpenGL?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have recently converted a library, I originally wrote in C++ with Boost Python wrapping, to C with SWIG wrapping to support more languages.\nI switched from C++ to C because the library consists only of a set of functions and I also want the library to be callable from C (without having to compile the whole program with a C++ compiler).\nHowever there is one thing that was not easy to port, a very small subset of the functions needs the ability to report errors back.\nIn C++\/Boost Python that was very elegantly accomplished with throw and exception translation.\nWhat would be the most elegant way (on both the C and wrapped language side) to have a subset of functions report errors?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1235,"Q_Id":5448257,"Users Score":0,"Answer":"Take a look at Chapter 4 in C Interfaces and Implementations by Richard R. Hanson.","Q_Score":4,"Tags":"python,c,swig","A_Id":5521222,"CreationDate":"2011-03-27T09:11:00.000","Title":"Most elegant way for SWIG wrapped C library to raise exceptions","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve this purpose. However, I don't know how to run USB detection services alongside the Tkinter main loop. Is this possible?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":874,"Q_Id":5453256,"Users Score":0,"Answer":"Might I suggest that instead of trying to constantly monitor the presence of a USB device you include a search or refresh button that will check just once.","Q_Score":2,"Tags":"python,tkinter,pyusb","A_Id":5489197,"CreationDate":"2011-03-27T23:36:00.000","Title":"Tkinter and detection of USB devices","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to make several different pages where I need to show different texts and buttons.\nWhat I did was I created a panel, and then several sizers on it, and then in the next page, I destroyed the panel and recreated the panel again with different contents\/sizers.\nIt worked well in Linux, but when I tried the same source in the windows, the first page was okay, but in the second page and onward, it seems the sizers were not applied. \nI tried various .Update() and .Refresh(), but nothing seems working. \nIt seems only when I maximize the window the sizers get applied and the layout becomes normal.\n(Again, after panel.Destory() and a new panel generation, the layouts are messed up again.)\nHow do I make two different \"pages\" (where I click on a button and it goes to the second page) with different contents and sizers in Windows?","AnswerCount":3,"Available Count":3,"Score":0.1325487884,"is_accepted":false,"ViewCount":3727,"Q_Id":5457644,"Users Score":2,"Answer":"It seems there are better ways to do this, but panel.Layout() solved the problem for now. :)","Q_Score":2,"Tags":"python,user-interface,wxpython","A_Id":5458130,"CreationDate":"2011-03-28T10:28:00.000","Title":"wxPython panel redraw in windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to make several different pages where I need to show different texts and buttons.\nWhat I did was I created a panel, and then several sizers on it, and then in the next page, I destroyed the panel and recreated the panel again with different contents\/sizers.\nIt worked well in Linux, but when I tried the same source in the windows, the first page was okay, but in the second page and onward, it seems the sizers were not applied. \nI tried various .Update() and .Refresh(), but nothing seems working. \nIt seems only when I maximize the window the sizers get applied and the layout becomes normal.\n(Again, after panel.Destory() and a new panel generation, the layouts are messed up again.)\nHow do I make two different \"pages\" (where I click on a button and it goes to the second page) with different contents and sizers in Windows?","AnswerCount":3,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":3727,"Q_Id":5457644,"Users Score":3,"Answer":"Calling Layout on the widget's parent is the best way to do this is you are adding or destroying widgets. Sometimes you also need to call Refresh() to make it redraw too, although that might only be required when you're using Freeze\/Thaw.","Q_Score":2,"Tags":"python,user-interface,wxpython","A_Id":5460406,"CreationDate":"2011-03-28T10:28:00.000","Title":"wxPython panel redraw in windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to make several different pages where I need to show different texts and buttons.\nWhat I did was I created a panel, and then several sizers on it, and then in the next page, I destroyed the panel and recreated the panel again with different contents\/sizers.\nIt worked well in Linux, but when I tried the same source in the windows, the first page was okay, but in the second page and onward, it seems the sizers were not applied. \nI tried various .Update() and .Refresh(), but nothing seems working. \nIt seems only when I maximize the window the sizers get applied and the layout becomes normal.\n(Again, after panel.Destory() and a new panel generation, the layouts are messed up again.)\nHow do I make two different \"pages\" (where I click on a button and it goes to the second page) with different contents and sizers in Windows?","AnswerCount":3,"Available Count":3,"Score":0.0665680765,"is_accepted":false,"ViewCount":3727,"Q_Id":5457644,"Users Score":1,"Answer":"I agree with using Layout(), but might I suggest just hiding the unused panel instead of destroying it? Using the Show()\/Hide() functions of the sizer, you can add both side-by-side and just hide the unused panel instead of destryong it and recreating it each time?","Q_Score":2,"Tags":"python,user-interface,wxpython","A_Id":5461786,"CreationDate":"2011-03-28T10:28:00.000","Title":"wxPython panel redraw in windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to change the mouse pointer using python xlib. I successfully did it using warp_pointer. But when i try to play any games like Secret Maryo Chronicles, the mouse pointer moves to the rightmost corner of the screen and not the specified location. Why is it so? Can anyone help me with this?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1321,"Q_Id":5487301,"Users Score":0,"Answer":"I'm not familiar with SMC. It may be that it uses warp_pointer itself. I know a lot of games do to simulate the relative motion support only recently introduced to XInput and I think some of them use it to stash the mouse \"out of the way\". Have you tried it with games that do different things with the mouse?","Q_Score":1,"Tags":"python,mouse,xlib","A_Id":5499581,"CreationDate":"2011-03-30T13:55:00.000","Title":"Python xlib warp_pointer not working properly inside games","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a great python fan. Recently I got an idea to write RTS engine and\/or maybe a simple RTS game based upon this engine. There are a couple of things I need to think about and maybe you can give me some advice on these:\n\nPerformance. Most games are written in C++. Isn't python too slow for game engine? I am aiming only at 2D, but still it may be too demnading.\nGraphics. Are there any good graphics libraries for python? SDL\/OpenGL bindings or maybe something more suitable for python?\nGame engines. Do you know of any existing RTS engine written in python?\nAny tools\/libraries for python that maybe helpful in developing RTS\n\nThanks in advance!","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":2553,"Q_Id":5544634,"Users Score":7,"Answer":"Performance may be an issue with heavy graphics\/math processing. If so, see Panda3D, NumPy, Cython, and PyPy.\nUse Pyglet, PyOpenGL with Pyglet, Panda3D (although you are writing in 2D, you can still use a 3D engine), or perhaps some other library.\nThere don't seem to be existing RTS libraries, but there are definitely pre-existing generalized engines.\nTry searching for RTS-related libraries in general: you'll need AI, pathfinding, networking, and so on. Therefore, you may be interested in Twisted, for instance, since it helps with networking.","Q_Score":3,"Tags":"python,performance,graphics,real-time-strategy","A_Id":5544725,"CreationDate":"2011-04-04T21:36:00.000","Title":"2D RTS in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a great python fan. Recently I got an idea to write RTS engine and\/or maybe a simple RTS game based upon this engine. There are a couple of things I need to think about and maybe you can give me some advice on these:\n\nPerformance. Most games are written in C++. Isn't python too slow for game engine? I am aiming only at 2D, but still it may be too demnading.\nGraphics. Are there any good graphics libraries for python? SDL\/OpenGL bindings or maybe something more suitable for python?\nGame engines. Do you know of any existing RTS engine written in python?\nAny tools\/libraries for python that maybe helpful in developing RTS\n\nThanks in advance!","AnswerCount":2,"Available Count":2,"Score":0.2913126125,"is_accepted":false,"ViewCount":2553,"Q_Id":5544634,"Users Score":3,"Answer":"I can answer your first two.\n\nPython isn't too slow for games. That all games must be written in C++ is a myth. Sure C++ (or C) might give you the best performance, but it doesn't mean you're unable to write a game in another language.\nTry PyGame: SDL bindings for Python.","Q_Score":3,"Tags":"python,performance,graphics,real-time-strategy","A_Id":5544672,"CreationDate":"2011-04-04T21:36:00.000","Title":"2D RTS in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing an application which has to be able to print a couple of pages with Python. Now I am searching for a method to create these pages and print them. It should work on Linux and Windows. The pages contain tables, images and text.\nI developed the GUI with PyGtk, but I think it's convenient to create an image or PDF and print it. I have no idea how to do this. Anyone knows a good way for this?\nNote: The problem isn't the generation. It is the printing of that file.","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":2696,"Q_Id":5572489,"Users Score":1,"Answer":"Have you considered generating HTML?","Q_Score":2,"Tags":"python,pdf,printing,pygtk","A_Id":5572506,"CreationDate":"2011-04-06T20:22:00.000","Title":"OS independent printing with Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Can anybody recommend how to switch between scenes in pyglet. \nI.e. \n\nmenu > game\ngame > menu\nmenu > help\nect\n\nThe only way that i can think to do it off the top of my head is by using different windows, which i am quite sure would be the complete wrong way to do it. Or by overloading all of the window's event functions.\nSorry if i haven't made myself clear but any help would be appreciated","AnswerCount":4,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":3236,"Q_Id":5581447,"Users Score":2,"Answer":"The cocos2d.org framework is built on pyglet and includes scene management.","Q_Score":3,"Tags":"python,pyglet","A_Id":5590220,"CreationDate":"2011-04-07T12:58:00.000","Title":"Switching scenes with pyglet","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a gtk.Table to which I've attached a number of gtk.Buttons, some of which overlap others. I can't figure out how to bring a specific button to the front, however. How do I do it?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":200,"Q_Id":5584398,"Users Score":1,"Answer":"I've struggled with an issue similar to this, and came to the conclusion that it wasn't possible in an officially documented manner... gtk.Table doesn't seem to have been designed to deal with the idea that things might overlap. Widgets seemed to be rendered in an order related to (but not exactly) the order they were added into the table.\nWhat I ended up doing was determining which widgets were overlapping, and wrote code to toggle their visibility, depending on which one was appropriate for the current state. That was only possible because of the particular nature of my app, it might not work for you.\nOne avenue which I didn't research to far, but might be viable: intercepting the expose event on the gtk table, and propagating it to the children in a specific order (this got complicated quickly, but might work). My understanding of the gtk.Widget events is incomplete, there may be other events that need intercepting as well.","Q_Score":1,"Tags":"python,pygtk","A_Id":5585600,"CreationDate":"2011-04-07T16:29:00.000","Title":"How do I bring a PyGTK Button to the front?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Does anyone know of any articles or code samples to get me started customising the WxPython rich text control?\nI am trying to extend the rich text control to allow me to insert controls (buttons, text boxes etc) into the editing area e.g. instead of just inserting images or formatted text I would like to be able to insert a control such as a button (similar to the output provided by the HTML controls but I need to provide an editable interface).\nLooking through the documentation for wxpython and wxWidgets it seems there is the infrastructure built into the controls to support this but I cannot find any help or examples to get me started.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":328,"Q_Id":5637677,"Users Score":1,"Answer":"Download the wxpython demo from their site, it should provide you with an in-depth example of a wxRichTextCtrl. Without providing any information about your specific customizations, there is not much else I can help with.","Q_Score":0,"Tags":"python,wxpython,richtext","A_Id":5696733,"CreationDate":"2011-04-12T15:25:00.000","Title":"Where do I start if I want to customise the WxPython rich text control?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"hi i am working on a VR engine \"vizard\" it has (like any other game engine) its mainloop, i want to integrate it with a multi-touch framework \"kivy\" which has its own mainloop , is it possible to do so?\nand if you can help me finding references about this topic\nthank you in advance :D","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":368,"Q_Id":5646943,"Users Score":0,"Answer":"It is technically possible, but you should not do it.\nSimply open up the source, get the code for the two main loops and stitch it together. \nThe results will probably be broken, though.","Q_Score":2,"Tags":"python,multi-touch,kivy","A_Id":5647086,"CreationDate":"2011-04-13T09:17:00.000","Title":"how to integrate two apps (mainloop) together in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a relative newbie with Python and was trying to install wxPython 2.9 using Python 2.6. I did a build from source and then installed the package both being done in a non-standard (local) path. When I try and import wx (having provided the path to the installation folder in my environment variable), I get the following error message: \n\n\"ImportError:\n libwx_gtk2u_xrc-2.9.so.1: cannot open\n shared object file: No such file or\n directory\". \n\nCan someone please tell me if I need to build gtk separately? And if yes, how do I go about doing it?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":380,"Q_Id":5660354,"Users Score":0,"Answer":"Add the directory containing the library given in the error to your ld search paths. See the ldconfig(8) man page for details.","Q_Score":0,"Tags":"python,gtk,wxpython","A_Id":5660469,"CreationDate":"2011-04-14T08:14:00.000","Title":"Error while installing wxPython package in a non-standard path","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Which is the most efficient method to display a grid of about 1000 clickable images in wxPython ?\nCurrently i am using a GridSizer filled with StaticBitmap objects. But its quite slow for 500+ images. \nOne more thing is that, i have a listbox of categories on the left. That is to filter the images. Categories will be like \"All\", \"Cat 1\", \"Cat 2\" etc. When i click \"All\", all the image have to be displayed.\nHow i am doing this currently :\n\nA VERTICAL BoxSizer will contain n\nGridSizer objects, one for each\ncategory. I add the StaticBitmap\nobjects to multiple GridSizers\ndepending on the categories it\nbelongs to. \nThen i display only that GridSizer\ndepending on which category is\nselected\n\nThis method is also terribly slow for anything over 300 images. So, how do i achieve the same effect efficiently ?\n.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":796,"Q_Id":5680487,"Users Score":0,"Answer":"I would think a ListCtrl in ICON style would be the best way to do this.\nIf you look at the wxPython Demos, the UltimateListCtrl sample in the wx.LC_ICON style is a good example of what you could create.","Q_Score":1,"Tags":"python,image,performance,wxpython","A_Id":5681008,"CreationDate":"2011-04-15T17:50:00.000","Title":"Efficient method for a grid of clickable images in wxPython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I really like D(2) language and would like to use it for multi-platform GUI application, but I see that its ecosystem is not quite developed. After moving from Linux to (Free)PC-BSD, I see there is even no 64bit compiler ready in the ports and one is not sure if any of GUI libs (QtD, gtkD, wxD) are ready for serious project and we would like to start with the project as soon as possible.\nOtoh, I was previously recommended to try with Python which is mature, with many tools, GUI libs etc. but there was question about speed - we have to use one C lib for calculating Ephemeris and write several libraries which would use that C-lib. \nHowever, this might be good (perfect) job for Cython, so my question is what do you think about writing GUI-part in Python (Qt,EFL) and use Cython for performance-critical stuff (binding external C lib and writing our own libraries) instead of (waiting for) D to become ready for serious projects?","AnswerCount":4,"Available Count":3,"Score":0.049958375,"is_accepted":false,"ViewCount":1579,"Q_Id":5685078,"Users Score":1,"Answer":"Well, its a typical usecase to just write your number crunching code in C\/C++ or any language that can be linked into a C module and just add the non performance critical stuff with a scripting language easily. The Python C interface is okay to work with and using SWIG or even writing the binding code manually isn't too hard (unless you talk about threads and need to handle CPythons idiotic GIL...).","Q_Score":4,"Tags":"python,user-interface,d,cython,cpython","A_Id":5687119,"CreationDate":"2011-04-16T07:14:00.000","Title":"multi-platform gui app in C(P)ython or D","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I really like D(2) language and would like to use it for multi-platform GUI application, but I see that its ecosystem is not quite developed. After moving from Linux to (Free)PC-BSD, I see there is even no 64bit compiler ready in the ports and one is not sure if any of GUI libs (QtD, gtkD, wxD) are ready for serious project and we would like to start with the project as soon as possible.\nOtoh, I was previously recommended to try with Python which is mature, with many tools, GUI libs etc. but there was question about speed - we have to use one C lib for calculating Ephemeris and write several libraries which would use that C-lib. \nHowever, this might be good (perfect) job for Cython, so my question is what do you think about writing GUI-part in Python (Qt,EFL) and use Cython for performance-critical stuff (binding external C lib and writing our own libraries) instead of (waiting for) D to become ready for serious projects?","AnswerCount":4,"Available Count":3,"Score":0.0996679946,"is_accepted":false,"ViewCount":1579,"Q_Id":5685078,"Users Score":2,"Answer":"Writing the GUI in a dynamic language and writing performance-sensitive code in another language is a great way to write an application. This can be done in Python, it can also be done really easily in Tcl\/Tk and several other scripting languages.","Q_Score":4,"Tags":"python,user-interface,d,cython,cpython","A_Id":5687640,"CreationDate":"2011-04-16T07:14:00.000","Title":"multi-platform gui app in C(P)ython or D","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I really like D(2) language and would like to use it for multi-platform GUI application, but I see that its ecosystem is not quite developed. After moving from Linux to (Free)PC-BSD, I see there is even no 64bit compiler ready in the ports and one is not sure if any of GUI libs (QtD, gtkD, wxD) are ready for serious project and we would like to start with the project as soon as possible.\nOtoh, I was previously recommended to try with Python which is mature, with many tools, GUI libs etc. but there was question about speed - we have to use one C lib for calculating Ephemeris and write several libraries which would use that C-lib. \nHowever, this might be good (perfect) job for Cython, so my question is what do you think about writing GUI-part in Python (Qt,EFL) and use Cython for performance-critical stuff (binding external C lib and writing our own libraries) instead of (waiting for) D to become ready for serious projects?","AnswerCount":4,"Available Count":3,"Score":1.2,"is_accepted":true,"ViewCount":1579,"Q_Id":5685078,"Users Score":7,"Answer":"I'm obviously biased as a Cython core developer, but I can certainly recommend it. The combination of CPython and Cython provides an otherwise hard to reach level of developing speed, platform stability, portability, low-level coding and FFI capabilities, and execution performance, including a very easy optimisation path from quick and simple to highly tuned code at C speed.\nI can also warmly recommend Qt as a GUI toolkit. It works very nicely with Python.","Q_Score":4,"Tags":"python,user-interface,d,cython,cpython","A_Id":5686614,"CreationDate":"2011-04-16T07:14:00.000","Title":"multi-platform gui app in C(P)ython or D","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When chatting in IRC yesterday about the possibility to use P(C)ython instead of D for multi-platform GUI application, someone suggested me Enlightenment Foundation Libraries (EFL).\nWe have researched a bit about it and considering we would like to target some mobile-platform in the future as well, EFL looks as nice alternative to Qt.\nSo, what do you think how does EFL (used via Python bindings) compare with Qt (pyqt or pyside, depending on py3k readiness) for multi-platform desktop GUI application?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1308,"Q_Id":5685176,"Users Score":2,"Answer":"EFL looks good and promising, especially its widget toolkit which can do very smart things when resizing windows, but there are problems with it: first, it comes in a very-beta quality. Second, the widgets will look quite unfamiliar for the users. Qt is mature and stable, and it adapts to the platform look and feel (but still may be easily customized). I give PyQt a go.","Q_Score":2,"Tags":"python,qt,pyqt,pyside","A_Id":5688829,"CreationDate":"2011-04-16T07:38:00.000","Title":"Qt or EFL for multi-platform Python application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"There are a number of Tkinter builders out there but none (that I've found) that work for Python 3. I don't have the time to learn Tkinter and don't use it much which is why I'm looking for a builder.","AnswerCount":4,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":12993,"Q_Id":5691674,"Users Score":0,"Answer":"Wow, pity I didn't get any useful responses. Fortunately I have discovered a solution. PyQt4 may not be Tkinter but it works just the same ... and works in python 3.x and comes with a GUI designer that is very neat. Takes a bit of research to know how to use it but well worth it","Q_Score":3,"Tags":"python-3.x,tkinter,builder","A_Id":5743059,"CreationDate":"2011-04-17T05:25:00.000","Title":"Tkinter GUI Builder","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Using PyQt4 and Python 3 do you know how I can change the color of a QLcdNumber during the runtime ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1466,"Q_Id":5692968,"Users Score":1,"Answer":"Didn't use this for some thime, but I think you had to change paletteForegroundColor and change segmentStyle to QLCDNumber::Filled or QLCDNumber::Flat","Q_Score":0,"Tags":"python,qt,python-3.x,pyqt4","A_Id":5693049,"CreationDate":"2011-04-17T10:22:00.000","Title":"Change the color of the text of QLcdNumber","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python code whose output is a .png file. What should I do to get the output in an OpenGL window?\nI searched a few places and the closest I got to converting an Image was StringIO() but that didn't seem very helpful.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":224,"Q_Id":5699508,"Users Score":0,"Answer":"If you want something to handle the more complex details you could setup your OpenGL using pygame then use\nsurface = pygame.image.load(fileobj)\nWhere fileobj is any object with a 'file-like' interface. You would need to modify the PNG generator to write to this object rather than a real file.","Q_Score":0,"Tags":"python,image","A_Id":5699658,"CreationDate":"2011-04-18T06:59:00.000","Title":"How to change a .png output from Python to an OpenGL window output?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I basically want to make a clone of the classic game Pacman using Python. I would like to keep all the original graphics, sounds, etc. Perhaps being able to have the game in windowed mode would be useful.\nWith Java I would just use Swing and be done with it. But I'd really like to use Python and make it possible for the game to work on all major platforms with minimal effort from the users.\nI've used pygame previously but felt that it was a bit 'hacky' and not all that intuitive to use.","AnswerCount":3,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":310,"Q_Id":5743946,"Users Score":1,"Answer":"You could do this with Tkinter about as easily (or easier) than most other toolkits. Since pac-man graphics set the bar pretty low you could code this all by using the canvas widget. This is arguably the most portable solution since Tkinter is the official, bundled GUI toolkit so you won't require people to download any extra libraries.\nThe canvas widget gives you a nice vector-based drawing surface, with nice tagging abilities that let you easily move drawn objects. It supports all the basic drawing primitives -- lines, circles, etc. as well as being able to embed bitmap graphics and even other widgets.","Q_Score":1,"Tags":"python,pygame,pacman","A_Id":5763788,"CreationDate":"2011-04-21T12:15:00.000","Title":"What would be a good python library to use to write a portable version of pacman with nice graphics?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to use qt with python. \n\"import qt\" return me :\"ImportError: No module named qt\". I already instaled pyqt.\nwhat I hve to install in order to activate \"import qt\"\nThank You","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":22987,"Q_Id":5766539,"Users Score":3,"Answer":"import PyQt4 works for me fine.","Q_Score":10,"Tags":"python","A_Id":5766552,"CreationDate":"2011-04-23T19:56:00.000","Title":"problem with import qt in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to expose some kind of graph explorer widget in Python using PyQt and some library. Does such a library exist?","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":5195,"Q_Id":5768566,"Users Score":0,"Answer":"Try the nodebox-gl fork version of nodebox that support unix, but I can't find the fork version graph in nodebox :(\nThanks","Q_Score":2,"Tags":"python,graph,pyqt,graphviz","A_Id":5926728,"CreationDate":"2011-04-24T04:05:00.000","Title":"Python graph visualization and editing with PyQt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking for a Python 2D graphics library that can basically do the following and not necessarily anything more:\n\nCreate a window of specified width and height\nSet the RGB of pixel X, Y on the back buffer.\nSwap buffers\n\n...and that's it basically. I can't find anything that doesn't come with a massive amount of complex baggage.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":4847,"Q_Id":5770944,"Users Score":4,"Answer":"I recommend PyQt for this - it's a GUI library\/framework but it has very good drawing capabilities. If you look at the examples coming with PyQt, focusing on the graphics & drawing samples, it's quite amazing what you can do with very few lines of code.\nOh, and it does the double-buffering you mention automatically so you don't have to worry about it.\n\nAlternatively, you can use PyGame - a library wrapping SDL, used for game development. Naturally it has very strong 2D graphics capabilities.","Q_Score":2,"Tags":"python,graphics,2d","A_Id":5770967,"CreationDate":"2011-04-24T14:04:00.000","Title":"Basic Python 2D graphics?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a project that basically follows a pre-defined structure, like a state machine or a wizard. I stumbled upon QWizard, its nextId() function seemed to be a good way to make my wizard dyamically load further pages. Now, it would be very nice to go back to earlier, already visited pages of the wizard. But even with overloaded nextId() I can't go back to that already visited pages.\nIs is possible to clear the visited pages history? Or is there a better way to do this?\nI use Qt by PyQt4 in Python, but that should make that much of a difference. Another way to do what I ask would be to add a similar page to the wizard and share the previous data with this page, but coming from mostly C++ I don't like the way to create dummy objects that mimic originals.\nEdit:\nWhat I'm trying to do is to replicate a state machine with QWizard (because it almost is a state machine). For example, on page 1 data is loaded, then on page 2 additional computations happen that potentially extend page 1 data. By using the back button I can go back to page 1, but I can not \"go back\" with the next button because page 1 is already visited at this point. I tried it by overloading the nextId() functions but it doesn't work. This means I can not build a cyclic order of pages, which I would like to do.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":607,"Q_Id":5788526,"Users Score":0,"Answer":"I'm not sure I see the logical connection between the different questions you're asking here. If you want to go back to already visited pages, why do you want to delete the history?\nWith the help of overloading the nextID method of either the QWizard or separate QWizardPages you can easily implement any custom visiting order you desire. Use the hasVisitedPage method to find out whether some page was already visited. visitedPages returns the list of IDs of visited pages, in the order in which the pages were visited.\nWhat else do you need?","Q_Score":2,"Tags":"python,qt,pyqt,qwizard","A_Id":5788678,"CreationDate":"2011-04-26T09:40:00.000","Title":"QWizard: delete history of visited pages","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Qt with Python, and I've got a mainwindow with a status bar at the bottom. I can display a message in the bar using a QLabel, and set the color of that message using something like \"In progress<\/font>\" for the QLabel text.\nI would like to also put a temporary message in the status bar, and assign a color to that message as well. However since it's not a QLabel this time (I'm using QStatusBar::showMessage which just takes a QString) I can't change the color anymore. The tags above are not recognized and the entire string \"In progress<\/font>\" is shown in gray.\nDoes anyone have any ideas?","AnswerCount":6,"Available Count":1,"Score":0.0665680765,"is_accepted":false,"ViewCount":10542,"Q_Id":5795214,"Users Score":2,"Answer":"If your showMessages text will be all of the same color, you can define it in the palette of QStatusBar via QtDesigner(window text color) for temporary messages, and then use the QLabel color for normal and permanent messages of different colors.","Q_Score":5,"Tags":"python,qt,qstatusbar","A_Id":11617883,"CreationDate":"2011-04-26T19:06:00.000","Title":"Qt statusbar color","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a toolbar that has the typical buttons: new, save, save as, etc. Is there a way to gray out\/disable\/make unavailable icons that are not useful?\nFor instance, if nothing has been changed, disable and gray out the save button, then re-enabled it when something has changed that requires a save.\nThanks for the help!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":128,"Q_Id":5808881,"Users Score":0,"Answer":"myButton.set_sensitive(True) # make button available\nmyButton.set_sensitive(False) # make button unavailable","Q_Score":1,"Tags":"python,pygtk","A_Id":5810073,"CreationDate":"2011-04-27T18:38:00.000","Title":"Make a pygtk stock icon \"unavailable\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Xcode 3 had templates for building Cocoa subclasses in Python. I've recently upgraded to Xcode 4 but I cannot find out how I can use other languages besides the C family (C, C++, Obj-C) in Xcode 4.\nDoes anyone know?","AnswerCount":3,"Available Count":1,"Score":0.1325487884,"is_accepted":false,"ViewCount":7826,"Q_Id":5843508,"Users Score":2,"Answer":"I've successfully built a MacRuby GUI app in XCode 4.2 on Lion today following a MacRuby tutorial on Apple's site. MacRuby also includes a template in XCode 4.2. I'm a Python programmer and really hoped to use it, but at this point I've given up on PyObjC. I use Tk in Python for quick little apps and maybe switch to MacRuby, but will likely just switch to Objective-c. Ruby is a pretty nice language though. Maybe MacRuby will interest you.","Q_Score":13,"Tags":"python,xcode,xcode4,pyobjc","A_Id":7815044,"CreationDate":"2011-04-30T17:39:00.000","Title":"PyObjC on Xcode 4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"For my sins (and for fun the learning experience) I am writing a window manager (I know, I know).\nI'm using python and XCB (python-xpyb).\nSo far I have figured out that I need to use a SubStructureRedirect mask on the root window(s), and I am successfully being passed events related to applications' top-level windows. I'm testing this by launching xterm.\nI get a ConfigureRequestEvent, followed by a pause, followed by another ConfigureRequestEvent, and then a MapRequestEvent.\nWhen I get the MapRequestEvent I call connection.core.MapWindowChecked(e.window), which works, but maps a window that is only a pixel or two wide\/tall.\nMy question, then, is what should I do with the ConfigureRequestEvent to make the window the correct size (assuming thats what I'm missing)?\nMore accurately, what exactly do i call? MapWindowChecked was an obvious choice, but I can't seem to find how to actually configure the width\/height. I'm guessing it is ConfigureWindow, but the arguments that accepts seem obscure to me. Last time I called it I used xcb.xproto.CW.EventMask, but none of the flags in CW seem to be related to width\/height.\nPS The documentation on all of this seems quite elusive to me. I've looked at a couple of python window managers that supposedly use xcb, and they seem to use their own custom versions with extra functionality. Also, Examining\/debugging a running window manager (which is also responsible for mapping your debugger's window) is a PITA, hence my asking here. probably would be better to use two machines or a VM or something.\nThanks.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":848,"Q_Id":5845717,"Users Score":1,"Answer":"The short answer is configure the window (size, stacking, etc.) by calling ConfigureWindow. The long answer is here you impose policy and honor specs such as XSizeHints. Best to have a look at some existing WMs' source and get a sense of what they do. Exactly what you do depends on your desired UI. \nThe simplest thing to get it working is to just ConfigureWindow exactly as the request asks with no policy or hint overrides. But you'll probably see lots of usability problems quickly and have to add some more smarts.","Q_Score":2,"Tags":"python,x11,window-managers,xcb","A_Id":5851984,"CreationDate":"2011-05-01T01:17:00.000","Title":"What should a Window Manager do with a ConfigureRequestEvent?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I'm just beginning a very simple pygame code that draws a green line on a white background. However, I have to use pygame.display.flip() in order for it to show up, but it seems that I would have to use this every time I made a change and this seems too impractical for me to be doing it right. Am I missing something?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1583,"Q_Id":5851656,"Users Score":3,"Answer":"There's a good reason for this. Double buffering is a technique used to prevent \"flickering\". Basically, you want to draw a frame to memory instead of to the monitor and then push the frame all at once when its drawn. Otherwise, you can see different elements of the same frame go up at different times.\nWhat you want to do is call pygame.display.flip() only once per frame draw, not after every change. Usually, this is done by having a \"draw\" function that is called at the end of a frame once the physics manipulations and game rules are done, and flip()ing at the end of draw.","Q_Score":2,"Tags":"python,pygame","A_Id":5853562,"CreationDate":"2011-05-01T21:46:00.000","Title":"Beginner problem with pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am running Python2.7.1 and OpenCV 2.2 without problems in my WinXP laptop and wrote a tracking program that is working without a glitch. But for some strange reason I cannot get the same program to run in any other computer where I tried to install OpenCV and Python (using the same binaries or appropriate 64 bit binaries). In those computers OpenCV seems to be correctly installed (although I have only tested and CaptureFromCamera() in the webcam of the laptop), but CaptureFromFile() return 'None' and give \"error: Array should be CvMat or IplImage\" after a QueryFrame, for example.\nThis simple code:\nimport cv \/\nvideofile = cv.CaptureFromFile('a.avi') \/\nframe = cv.QueryFrame(videofile) \/\nprint type(videofile) \/\nprint type(frame)\nreturns:\ntype 'cv.Capture' \/\ntype 'NoneType'\n\nOpenCV and Python are in the windows PATH...\nI have moved the OpenCV site-packages content back and forth to the Pyhton27 Lib\\Site-packages folder.\nI tried different avi files (just in case it was some CODEC problem). This AVI uses MJPEG encoding (and GSpot reports that ffdshow Video Decoder is used for reading).\nImages work fine (I think): the simple convert code:\nim = cv.LoadImageM(\"c:\\tests\\colormap3.tif\")\ncv.SaveImage(\"c:\\tests\\colormap3-out.png\", im)\nopens, converts and saves the new image...\nI have tested with AVI files in different folders, using \"c:\\\", \"c:\/\", \"c:\\\" and \"c:\/\/\".\n\nI am lost here... Anyone has any idea of what stupid and noob mistake may be the cause of this? Thanks","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1705,"Q_Id":5858446,"Users Score":0,"Answer":"This must be an issue with the default codecs. OpenCV uses brute force methods to open video files or capture from camera. It goes by trial and error through all sources\/codecs\/apis it can find in some reasonable order. (at least 1.1 did so).\nThat means that on n different systems (or days) you may get n different ways of accessing the same video. The order of multiple webcams for instance, is also non-deterministic and may depend on plugging order or butterflies.\nFind out what your laptop uses, (re)install that on all the systems and retry.\nAlso, in the c version, you can look at the capture's properties\nlook for cvGetCaptureProperty and cvSetCaptureProperty where you might be able to hint to the format.\n[EDIT]\nJust looked i tup in the docs, these functions are also available in Python. Take a look, it should help.","Q_Score":1,"Tags":"opencv,python-2.7,iplimage","A_Id":5859924,"CreationDate":"2011-05-02T14:34:00.000","Title":"IplImage 'None' error on CaptureFromFile() - Python 2.7.1 and OpenCV 2.2 WinXP","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create a simple game where the point is to collect as many blocks as you can in a certain amount of time, say 10 seconds. How can I get a timer to begin ticking at the start of the program and when it reaches 10 seconds, do something (in this case, exit a loop)?","AnswerCount":10,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":148808,"Q_Id":5890304,"Users Score":9,"Answer":"Using time.time()\/datetime.datetime.now() will break if the system time is changed (the user changes the time, it is corrected by a timesyncing services such as NTP or switching from\/to dayligt saving time!).\ntime.monotonic() or time.perf_counter() seems to be the correct way to go, however they are only available from python 3.3. Another possibility is using threading.Timer. Whether or not this is more reliable than time.time() and friends depends on the internal implementation. Also note that creating a new thread is not completely free in terms of system resources, so this might be a bad choice in cases where a lot of timers has to be run in parallel.","Q_Score":43,"Tags":"python,time","A_Id":14132794,"CreationDate":"2011-05-04T21:53:00.000","Title":"Timer for Python game","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a bug in my python script that is using PyQt4 that causes a segmentation fault.\nI could not find the bug using pdb, so now I wanna try it with gdb.\nThe core file is written and when I open it and type where, I just get memory addresses and only question marks as function names.\nI already installed the python-qt4-dbg package on Ubuntu but that did not help.\nIs there any additional parameter I have to pass to gdb to make the function names appear?\nCheers,\nManuel","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":407,"Q_Id":5902379,"Users Score":0,"Answer":"If I remember correctly, you will also need at least libqt4-dbg and python-dbg, maybe a few others..","Q_Score":0,"Tags":"python,gdb,segmentation-fault,pyqt4","A_Id":5913587,"CreationDate":"2011-05-05T18:20:00.000","Title":"Debugging PyQt4 using a core file","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Some details of my machine and installed packages before proceeding further:\nMac OSX version: 10.6.6\nPython version: Activestate Python 2.7.1\nwxpython version: wxpython 2.8 (uses Carbon API hence limited to 32-bit mode arch only)\nI installed wxPython2.8-osx-unicode-py2.7 from wxpython website using their .dmg installer file. This package uses the Carbon API and hence is limited to 32-bit mode only. I have to write my applications using \"arch -i386\" in order to import wx, and due to this limitation I am unable to import certain other packages likes \"MySQLdb\" which are not available in 32-bit mode. So, my best option is to uninstall wxpython 2.8 and install wxpython 2.9 because version 2.9 uses Cocoa API which has both 32-bit and 64-bit support. \nI don't know how to uninstall wxpython2.8 on my Mac OSX. Can anyone please help me?","AnswerCount":1,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":4762,"Q_Id":5920764,"Users Score":8,"Answer":"If you look in the .dmg for wxPython, there is an uninstall_wxPython.py unininstall script. Just drag it to your desktop and run python ~\/Desktop\/uninstall_wxPython.py in a terminal.","Q_Score":5,"Tags":"python,macos,wxpython,uninstallation","A_Id":5922093,"CreationDate":"2011-05-07T11:33:00.000","Title":"How to uninstall wxpython 2.8 on Mac OSX 10.6","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I would like to know where exactly a widget is on the screen.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":469,"Q_Id":5930780,"Users Score":4,"Answer":"You want to use the winfo_rootx and winfo_rooty methods of a widget.","Q_Score":2,"Tags":"python,geometry,screen,tkinter","A_Id":5932003,"CreationDate":"2011-05-08T22:22:00.000","Title":"Is there any way to get a widgets position relative to the entire screen in Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to make a wxPython window only re-sizable to a certain ratio? I know you can disable resizing; however, I'd like it so when the window was resized it stuck to a certain width to height ratio.","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":7440,"Q_Id":6005960,"Users Score":-1,"Answer":"I'm not too familiar with wxPython, but can't you just reset the window size to your max\/min size that you want once the user pass that? Preferably in the event that detects resizing?","Q_Score":5,"Tags":"python,resize,wxpython","A_Id":6006073,"CreationDate":"2011-05-15T01:41:00.000","Title":"Resizing a wxPython Window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking into using sprox but I can't seem to find any information about styling the generated form. I am sure its got to be something obvious but i didn't see it in the docs or find anything using a google\/google groups search. \nIdeally i would use sprox to generate the form but be able to pass in some css for layout. I could just manually create the forms but with the built in validation and select, drop downs pulling in data it seemed worth a look.\nIn a perfect world I would use sprox and pass it to the template and then let my designer have at it for formatting\/styling the resulting widget leaving me to not have to fuss with it.\nTIA!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":160,"Q_Id":6006773,"Users Score":0,"Answer":"You should be able to pass the form to the template, render it there while adding any custom css rule inside the template itself. For example using