Answer
stringlengths 19
4.91k
| A_Id
int64 5.3k
72.3M
| CreationDate
stringlengths 23
23
| Question
stringlengths 35
6.31k
| Q_Id
int64 5.14k
40.5M
| GUI and Desktop Applications
int64 1
1
| Q_Score
int64 0
346
| Available Count
int64 1
31
| Users Score
int64 -6
163
| Title
stringlengths 12
138
| Tags
stringlengths 6
68
| Python Basics and Environment
int64 0
1
| AnswerCount
int64 1
35
| Networking and APIs
int64 0
1
| Score
float64 -1
1.2
| Other
int64 0
1
| is_accepted
bool 2
classes | Database and SQL
int64 0
1
| Data Science and Machine Learning
int64 0
1
| Web Development
int64 0
1
| ViewCount
int64 12
475k
| System Administration and DevOps
int64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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. | 1,659,332 | 2008-08-07T18:47:00.000 | 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.
Do 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? | 5,136 | 1 | 14 | 3 | 5 | Does anyone have experience creating a shared library in MATLAB? | python,c,matlab | 0 | 4 | 0 | 0.244919 | 0 | false | 0 | 1 | 0 | 2,313 | 0 |
I'd also try ctypes first.
Use the Matlab compiler to compile the code into C.
Compile the C code into a DLL.
Use ctypes to load and call code from this DLL
The 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. | 138,534 | 2008-08-07T18:47:00.000 | 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.
Do 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? | 5,136 | 1 | 14 | 3 | 2 | Does anyone have experience creating a shared library in MATLAB? | python,c,matlab | 0 | 4 | 0 | 0.099668 | 0 | false | 0 | 1 | 0 | 2,313 | 0 |
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. | 5,302 | 2008-08-07T18:47:00.000 | 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.
Do 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? | 5,136 | 1 | 14 | 3 | 3 | Does anyone have experience creating a shared library in MATLAB? | python,c,matlab | 0 | 4 | 0 | 1.2 | 0 | true | 0 | 1 | 0 | 2,313 | 0 |
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.
Basically, 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.
In 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. | 3,331,503 | 2008-08-14T13:59:00.000 | 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.
I 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.
The 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.
So 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.
Has anyone got any experiences of something similar to this they would care to share? | 11,060 | 1 | 29 | 5 | 0 | How should I unit test a code-generator? | c++,python,unit-testing,code-generation,swig | 0 | 8 | 0 | 0 | 1 | false | 0 | 0 | 0 | 7,527 | 0 |
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... | 11,443 | 2008-08-14T13:59:00.000 | 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.
I 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.
The 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.
So 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.
Has anyone got any experiences of something similar to this they would care to share? | 11,060 | 1 | 29 | 5 | 5 | How should I unit test a code-generator? | c++,python,unit-testing,code-generation,swig | 0 | 8 | 0 | 0.124353 | 1 | false | 0 | 0 | 0 | 7,527 | 0 |
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. | 11,128 | 2008-08-14T13:59:00.000 | 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.
I 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.
The 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.
So 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.
Has anyone got any experiences of something similar to this they would care to share? | 11,060 | 1 | 29 | 5 | 0 | How should I unit test a code-generator? | c++,python,unit-testing,code-generation,swig | 0 | 8 | 0 | 0 | 1 | false | 0 | 0 | 0 | 7,527 | 0 |
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.
Problem 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?
I'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. | 11,074 | 2008-08-14T13:59:00.000 | 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.
I 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.
The 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.
So 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.
Has anyone got any experiences of something similar to this they would care to share? | 11,060 | 1 | 29 | 5 | 14 | How should I unit test a code-generator? | c++,python,unit-testing,code-generation,swig | 0 | 8 | 0 | 1.2 | 1 | true | 0 | 0 | 0 | 7,527 | 0 |
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.
A 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. | 11,235 | 2008-08-14T13:59:00.000 | 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.
I 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.
The 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.
So 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.
Has anyone got any experiences of something similar to this they would care to share? | 11,060 | 1 | 29 | 5 | 0 | How should I unit test a code-generator? | c++,python,unit-testing,code-generation,swig | 0 | 8 | 0 | 0 | 1 | false | 0 | 0 | 0 | 7,527 | 0 |
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. | 88,457 | 2008-08-25T04:36:00.000 | What is the best way to use PyGame (SDL) within a PyGTK application?
I'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. | 25,661 | 1 | 9 | 2 | 0 | pyGame within a pyGTK application | python,gtk,pygtk,sdl,pygame | 0 | 7 | 0 | 0 | 0 | false | 0 | 0 | 0 | 4,838 | 0 |
There's a simple solution that might work for you.
Write 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. | 199,288 | 2008-08-25T04:36:00.000 | What is the best way to use PyGame (SDL) within a PyGTK application?
I'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. | 25,661 | 1 | 9 | 2 | 0 | pyGame within a pyGTK application | python,gtk,pygtk,sdl,pygame | 0 | 7 | 0 | 0 | 0 | false | 0 | 0 | 0 | 4,838 | 0 |
There is no way to see dragged data in OnEnter and OnDragOver methods.
The only solution I found is to store the dragged item in some instance variable that is then readable inside these methods. | 139,047 | 2008-08-25T19:43:00.000 | 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? | 26,706 | 1 | 6 | 2 | 1 | wxpython: How do I examine dragged data in OnDragOver? | python,user-interface,drag-and-drop,wxpython,wxwidgets | 0 | 2 | 0 | 0.099668 | 0 | false | 0 | 0 | 0 | 584 | 0 |
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). | 26,707 | 2008-08-25T19:43:00.000 | 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? | 26,706 | 1 | 6 | 2 | 1 | wxpython: How do I examine dragged data in OnDragOver? | python,user-interface,drag-and-drop,wxpython,wxwidgets | 0 | 2 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 584 | 0 |
I use pyGtk. I think wxPython is nice but it's too limited, and PyQt is, well, Qt. =) | 36,761 | 2008-08-30T12:19:00.000 | 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..
The 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))
As the title says: are there any nice, "Pythonic" GUI toolkits? | 35,922 | 1 | 19 | 1 | 1 | Are there any "nice to program" GUI toolkits for Python? | python,user-interface | 0 | 5 | 0 | 0.039979 | 0 | false | 0 | 0 | 0 | 10,824 | 0 |
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.
Once 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. | 751,707 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 1 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.01818 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
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).
With 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. | 199,167 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 1 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.01818 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
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. | 106,889 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 5 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.090659 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
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. | 305,667 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 2 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.036348 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
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.
The 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. | 107,959 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 4 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.072599 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
First, start to put this in perspective.
You 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.
The 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.
By now, you are probably vowing to wrap all your GTK interactions in a Model-View-Controller architecture specific to your application. This is good.
Using 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.
Using 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.
One would almost expect GTK GUIs were meant to fail. | 2,149,087 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 2 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.036348 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
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. | 54,313 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 5 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 0.090659 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
Use GtkBuilder instead of Glade, it's integrated into Gtk itself instead of a separate library.
The 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. | 48,136 | 2008-09-07T04:00:00.000 | 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.
The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.
I 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). | 48,123 | 1 | 32 | 8 | 12 | Glade or no glade: What is the best way to use PyGtk? | python,gtk,pygtk,glade,gtk2 | 1 | 11 | 0 | 1 | 0 | false | 0 | 0 | 0 | 8,539 | 0 |
(I used to write customer apps for Windows Mobile.)
Forget about python. Even if it's technically possible:
your app will be big (you'll have to bundle the whole python runtime with your app)
your app will use lots of memory (python is a memory hog, relative to C/C++)
your app will be slow
you wont find any documentation or discussion groups to help you when you (inevitably) encounter problems
Go 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. | 60,945 | 2008-09-13T09:56:00.000 | 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? | 60,446 | 1 | 4 | 1 | 9 | Windows Mobile development in Python | python,windows-mobile | 0 | 4 | 0 | 1 | 0 | false | 0 | 0 | 0 | 7,815 | 0 |
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. | 934,717 | 2008-09-16T16:44:00.000 | Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi?
For 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? | 74,386 | 1 | 5 | 1 | 3 | Using DLR from Unmanaged Code | .net,delphi,ironpython,unmanaged,ironruby | 0 | 6 | 0 | 0.099668 | 1 | false | 0 | 0 | 0 | 877 | 0 |
For plotting with you should also consider matplotlib, which provides a higher level API and integrates well with PyQT. | 453,179 | 2008-09-17T11:28:00.000 | 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? | 82,180 | 1 | 2 | 1 | 0 | PyQt and PyCairo | python,qt,gtk,pyqt | 0 | 2 | 0 | 0 | 0 | false | 0 | 0 | 0 | 2,526 | 0 |
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.
Show 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"
and 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. | 87,121 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 2 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.011428 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
Personally I work on a Java app, but I couldn't get by without perl for some supporting scripts.
I've got scripts to quickly flip what db I'm pointing at, scripts to run build scripts, scripts to scrape data & compare stuff.
Sure 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. | 84,456 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
You 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.
Finally, 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. | 84,443 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
Temp scripts that aren't going to stick around don't need a lot of design time wasted on them.
And 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 :) | 84,423 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
Scala 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. | 84,584 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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. | 85,167 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
If all you have is a hammer, every problem begins to look like a nail.
There are times when having a screwdriver or pair of pliers makes a complicated problem trivial.
Nobody 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.
But before we use any power tools, lets
take a moment to talk about shop safety. Be sure
to read, understand, and follow all the
safety rules that come with your power
tools. Doing so will greatly reduce
the risk of personal injury. And remember
this: there is no more important rule
than to wear these: safety glasses
-- Norm | 85,733 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
...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!). | 85,789 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
Having 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.
Plus you can plug in most scripting languages into most runtimes. So it doesn't have to be either/or. | 85,891 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
Perhaps 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.
The long-term benefits are easier to imagine:
The 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.
It 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.
New 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.
Recruitment. 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. | 85,898 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 2 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.011428 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
The 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. | 85,910 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
Testing.
It'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. | 86,366 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
I think the main benefits of dynamic languages can be boiled down to
Rapid development
Glue
The 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.
The 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. | 86,657 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
Others have already explained why learning more languages makes you a better programmer.
As 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.
If 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. | 86,738 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
For after work work, for freelance jobs...:) and final to be programming literate as possible as...;) | 87,164 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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 =)
Over 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.
And of course, no one would even mention the awful slow ugly thing called Java. It will not be a tool for serious business.
So. 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.
Learning 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."
And of course, you get more stuff done with a high-level language. | 84,571 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 3 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.017141 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
Also, 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.
A 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.
Where 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.
The other thing that dynamic languages are big on is code generation. Creating the C#/C++/Java code. Some examples follow:
The 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.
SQL 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.
It 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.
Also 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.
I 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.). | 84,943 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 80 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 1.2 | 1 | true | 0 | 0 | 0 | 32,287 | 0 |
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.
Lua 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. | 84,400 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
As 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. | 84,441 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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).
It 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. | 84,383 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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
Prototyping- 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.
Testing- right unit tests much much faster in dynamic languages
Performance/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. | 90,403 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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. | 98,291 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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 :) | 114,875 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
A good hockey player plays where the puck is. A great hockey player plays where the puck is going to be.
- Wayne Gretzky
Our 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! | 92,642 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 5 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.028564 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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. | 84,382 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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. | 90,005 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 0 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
Let me turn your question on its head by asking what use it is to an American English speaker to learn another language?
The 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."
Speaking 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.
Finally, you program for a living because you love programming... right? | 84,362 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 21 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 1 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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.
After 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.
Also, 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#. | 84,437 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 9 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 1 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
One big reason to learn Perl or Ruby is to help you automate any complicated tasks that you have to do over and over.
Or if you have to analyse contents of log files and you need more mungeing than available using grep, sed, etc.
Also 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.
HTH
cheers,
Rob | 84,535 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 7 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 1 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
I have found the more that I play with Ruby, the better I understand C#.
1) 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.
2) 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
3) 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.
4) 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.
5) Last, but not least, because new languages are fun :) | 2,870,953 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 1 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 0.005714 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
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. | 89,272 | 2008-09-17T15:16:00.000 | I wonder why would a C++, C#, Java developer want to learn a dynamic language?
Assuming 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?
What 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?
Update
After seeing the first few responses it is clear that there are two issues.
My main interest would be something that is justifiable to the employer as an expense.
That 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
employers are usually looking for some "real" benefit. | 84,340 | 1 | 66 | 31 | 14 | Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language? | c#,java,python,ruby,perl | 0 | 35 | 0 | 1 | 1 | false | 0 | 0 | 0 | 32,287 | 0 |
QDF is proprietary and not really meant for reading other than my Quicken, probably for a reason as it is messy.
I 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.
OFX 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. | 2,278,316 | 2008-09-18T12:02:00.000 | Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken .qdf files.
@Swati: Quicken .qif format is for transfer only and is not kept up to date by the application like the .qdf file is. | 91,890 | 1 | 12 | 1 | 5 | Reading quicken data files | c#,java,python,file-format,quicken | 0 | 3 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 11,880 | 0 |
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.
However, 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.
You can accomplish a similar thing by creating a label widget with an image, then pack your other widgets into the label.
One 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...) | 112,337 | 2008-09-21T21:45:00.000 | 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.
Is it possible to have two states for the pack manager: one for one set of widgets and another for another set? | 112,263 | 1 | 2 | 2 | 2 | How do I overlap widgets with the Tkinter pack geometry manager? | python,tkinter,geometry,pack | 0 | 4 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 3,016 | 0 |
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.
COM/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.
QT will also let you do this in a similar manner.
GTK is slightly harder. | 112,432 | 2008-09-21T21:45:00.000 | 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.
Is it possible to have two states for the pack manager: one for one set of widgets and another for another set? | 112,263 | 1 | 2 | 2 | 0 | How do I overlap widgets with the Tkinter pack geometry manager? | python,tkinter,geometry,pack | 0 | 4 | 0 | 0 | 0 | false | 0 | 0 | 0 | 3,016 | 0 |
If you consider Qt, consider also throwing in kdelibs dependency,
then you'll have marble widget, which handles maps in neat way.
Thanks for advertizing Marble. But you are incorrect:
The Marble Widget doesn't depend on kdelibs at all. It just depends on Qt (>=4.3).
Additionally Marble also has just received Python bindings.
I 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. | 302,298 | 2008-09-21T23:10:00.000 | 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. | 112,483 | 1 | 1 | 3 | 1 | Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states? | python,qt,gtk,desktop | 0 | 5 | 0 | 0.039979 | 0 | false | 0 | 0 | 0 | 906 | 0 |
If you consider Qt, consider also throwing in kdelibs dependency, then you'll have marble widget, which handles maps in neat way.
If you stick only to Qt, then QGraphicsView is a framework to go.
(note: kdelibs != running whole kde desktop) | 146,015 | 2008-09-21T23:10:00.000 | 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. | 112,483 | 1 | 1 | 3 | 2 | Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states? | python,qt,gtk,desktop | 0 | 5 | 0 | 0.07983 | 0 | false | 0 | 0 | 0 | 906 | 0 |
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. | 122,701 | 2008-09-21T23:10:00.000 | 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. | 112,483 | 1 | 1 | 3 | 0 | Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states? | python,qt,gtk,desktop | 0 | 5 | 0 | 0 | 0 | false | 0 | 0 | 0 | 906 | 0 |
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 | 139,056 | 2008-09-26T12:05:00.000 | Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks. | 139,005 | 1 | 0 | 1 | 1 | PyQt - QScrollBar | python,pyqt | 0 | 3 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 3,106 | 0 |
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. | 142,502 | 2008-09-26T20:07:00.000 | 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? | 141,647 | 1 | 1 | 3 | 0 | Socket programming for mobile phones in Python | python,sockets,mobile | 0 | 4 | 0 | 0 | 0 | false | 0 | 0 | 0 | 1,588 | 0 |
Don't you have the "Run script" menu in your interactive Python shell? | 215,001 | 2008-09-26T20:07:00.000 | 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? | 141,647 | 1 | 1 | 3 | 0 | Socket programming for mobile phones in Python | python,sockets,mobile | 0 | 4 | 0 | 0 | 0 | false | 0 | 0 | 0 | 1,588 | 0 |
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? | 142,786 | 2008-09-26T20:07:00.000 | 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? | 141,647 | 1 | 1 | 3 | 0 | Socket programming for mobile phones in Python | python,sockets,mobile | 0 | 4 | 0 | 0 | 0 | false | 0 | 0 | 0 | 1,588 | 0 |
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). | 145,174 | 2008-09-28T03:39:00.000 | 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.
edit 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. | 145,155 | 1 | 1 | 1 | 2 | Something like Explorer's icon grid view in a Python GUI | python,user-interface | 0 | 3 | 0 | 0.132549 | 0 | false | 0 | 0 | 0 | 547 | 0 |
As of wxPython 2.9.2.0 wx.TaskBarIcon will create a menubar icon now instead on OSX, so long as you call SetIcon. | 25,845,284 | 2008-09-28T14:02:00.000 | 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. | 145,894 | 1 | 6 | 1 | 1 | how to set a menubar icon on mac osx using wx | macos,wxpython,wxwidgets | 0 | 4 | 0 | 0.049958 | 0 | false | 0 | 0 | 0 | 4,972 | 1 |
I've used py2Exe myself - it's really easy (at least for small apps). | 153,999 | 2008-09-30T16:50:00.000 | I need to develop a small-medium sized desktop GUI application, preferably with Python as a language of choice because of time constraints.
What 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?
Also, 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)
Addition:
I'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. | 153,956 | 1 | 11 | 1 | 0 | Python GUI Application redistribution | python,user-interface,wxpython,distribution,freeze | 0 | 7 | 0 | 0 | 0 | false | 0 | 0 | 0 | 5,407 | 0 |
I thought I posted my solution already...
Modifying both apps to run under WSGIApplicationGroup ${GLOBAL} in their httpd conf file
and patching sqlalchemy.databases.firebird.py to check if self.dbapi.initialized is True
before calling self.dbapi.init(... was the only way I could manage to get this scenario up and running.
The SQLAlchemy 0.4.7 patch:
diff -Naur SQLAlchemy-0.4.7/lib/sqlalchemy/databases/firebird.py SQLAlchemy-0.4.7.new/lib/sqlalchemy/databases/firebird.py
--- SQLAlchemy-0.4.7/lib/sqlalchemy/databases/firebird.py 2008-07-26 12:43:52.000000000 -0400
+++ SQLAlchemy-0.4.7.new/lib/sqlalchemy/databases/firebird.py 2008-10-01 10:51:22.000000000 -0400
@@ -291,7 +291,8 @@
global _initialized_kb
if not _initialized_kb and self.dbapi is not None:
_initialized_kb = True
- self.dbapi.init(type_conv=type_conv, concurrency_level=concurrency_level)
+ if not self.dbapi.initialized:
+ self.dbapi.init(type_conv=type_conv, concurrency_level=concurrency_level)
return ([], opts)
def create_execution_context(self, *args, **kwargs): | 175,634 | 2008-09-30T20:47:00.000 | I'm trying to develop an app using turbogears and sqlalchemy.
There is already an existing app using kinterbasdb directly under mod_wsgi on the same server.
When both apps are used, neither seems to recognize that kinterbasdb is already initialized
Is 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? | 155,029 | 1 | 1 | 1 | 2 | SQLAlchemy and kinterbasdb in separate apps under mod_wsgi | python,sqlalchemy,kinterbasdb | 0 | 1 | 0 | 0.379949 | 0 | false | 1 | 0 | 0 | 270 | 0 |
You can try pygame, its very easy to handle and similar to SDL under c++ | 1,568,711 | 2008-10-04T05:36:00.000 | 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.
I'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.
Requirements are:
Cross-platform (Linux, MacOS X,
Windows)
Low complexity overhead
Plays well with wxpython (at least won't step on each other's toes unduly)
Interactivity. Detect when objects are clicked on, moused over, etc.
Note that high performance isn't on the list, but the ability to handle ~100 bitmap objects on the screen would be good.
Your thoughts? | 169,810 | 1 | 12 | 1 | 3 | 2D animation in Python | python,animation,2d | 0 | 3 | 0 | 0.197375 | 0 | false | 0 | 1 | 0 | 29,957 | 0 |
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. | 184,571 | 2008-10-05T08:27:00.000 | 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.
Is there a way to easily apply the same SetFont() method to all these text objects without making separate calls each time? | 171,694 | 1 | 3 | 1 | 5 | Applying a common font scheme to multiple objects in wxPython | python,fonts,wxpython | 1 | 4 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 1,595 | 0 |
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:)
Some things I don't like about the platform are:
You can't invoke any graphical functions (module appuifw) from non-main thread.
Python 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
There function sys.exit() is not available.
Again, 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. | 1,195,831 | 2008-10-06T07:37:00.000 | 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.
Please 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. | 173,484 | 1 | 10 | 2 | 0 | Does anyone have experience with PyS60 mobile development | python,mobile,pys60 | 0 | 7 | 0 | 0 | 0 | false | 0 | 0 | 1 | 1,684 | 0 |
I've written a calculator, that I'd like to have, and made a simple game.
I 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.
It was a great experience! | 489,368 | 2008-10-06T07:37:00.000 | 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.
Please 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. | 173,484 | 1 | 10 | 2 | 0 | Does anyone have experience with PyS60 mobile development | python,mobile,pys60 | 0 | 7 | 0 | 0 | 0 | false | 0 | 0 | 1 | 1,684 | 0 |
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.
(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.) | 219,737 | 2008-10-19T06:07:00.000 | 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:
application.py - holds the primary application class (most functional routines)
gui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.
command.py - holds command line automation functions not dependent on data in the application class
state.py - holds the state data persistence class
This 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.
I 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.
Should 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?
EDIT I
Ok, 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.
Should 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.
Thanks for the responses so far. | 216,093 | 1 | 8 | 2 | 0 | How do I coherently organize modules for a PyGTK desktop application? | python,gtk,module,pygtk,organization | 0 | 6 | 0 | 0 | 0 | false | 0 | 0 | 0 | 2,015 | 0 |
"holds the primary application class (most functional routines)"
As in singular -- one class?
I'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.
What'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.
Before 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.)
Break 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.
Later, 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. | 216,386 | 2008-10-19T06:07:00.000 | 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:
application.py - holds the primary application class (most functional routines)
gui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.
command.py - holds command line automation functions not dependent on data in the application class
state.py - holds the state data persistence class
This 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.
I 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.
Should 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?
EDIT I
Ok, 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.
Should 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.
Thanks for the responses so far. | 216,093 | 1 | 8 | 2 | 2 | How do I coherently organize modules for a PyGTK desktop application? | python,gtk,module,pygtk,organization | 0 | 6 | 0 | 0.066568 | 0 | false | 0 | 0 | 0 | 2,015 | 0 |
python 2.6.2 + tkinter 8.5, no problems | 792,527 | 2008-10-20T17:19:00.000 | 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? | 219,215 | 1 | 3 | 3 | -1 | How do I use Tkinter with Python on Windows Vista? | python,windows,windows-vista,tkinter | 1 | 3 | 0 | -0.066568 | 0 | false | 0 | 0 | 0 | 1,345 | 0 |
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.
Though I think you should downgrade to windows XP. | 219,326 | 2008-10-20T17:19:00.000 | 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? | 219,215 | 1 | 3 | 3 | 1 | How do I use Tkinter with Python on Windows Vista? | python,windows,windows-vista,tkinter | 1 | 3 | 0 | 0.066568 | 0 | false | 0 | 0 | 0 | 1,345 | 0 |
Maybe you should downgrade to 2.5 version? | 219,284 | 2008-10-20T17:19:00.000 | 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? | 219,215 | 1 | 3 | 3 | 1 | How do I use Tkinter with Python on Windows Vista? | python,windows,windows-vista,tkinter | 1 | 3 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 1,345 | 0 |
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.
The 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. | 247,409 | 2008-10-22T02:54:00.000 | 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.
However, 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.
I'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.
However, 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.
Are there any tutorials for making "dynamic panels" or better management of a wizard? | 224,337 | 1 | 3 | 2 | 1 | Alternatives to a wizard | python,wxpython,wizard | 0 | 5 | 0 | 0.039979 | 0 | false | 0 | 0 | 0 | 2,843 | 0 |
I'd get rid of wizard in whole. They are the most unpleasant things I've ever used.
The 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:
Bring 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.
I 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.
Benefit: The user can just click a tab, and you are encouraged to put all the processing into the end of filling the page. | 247,633 | 2008-10-22T02:54:00.000 | 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.
However, 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.
I'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.
However, 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.
Are there any tutorials for making "dynamic panels" or better management of a wizard? | 224,337 | 1 | 3 | 2 | 0 | Alternatives to a wizard | python,wxpython,wizard | 0 | 5 | 0 | 0 | 0 | false | 0 | 0 | 0 | 2,843 | 0 |
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. | 239,167 | 2008-10-26T19:54:00.000 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | 238,523 | 1 | 18 | 5 | 6 | Is Python and pygame a good way to learn SDL? | c++,python,sdl,pygame | 1 | 9 | 0 | 1 | 0 | false | 0 | 0 | 0 | 25,055 | 0 |
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.
You'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. | 255,136 | 2008-10-26T19:54:00.000 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | 238,523 | 1 | 18 | 5 | 0 | Is Python and pygame a good way to learn SDL? | c++,python,sdl,pygame | 1 | 9 | 0 | 0 | 0 | false | 0 | 0 | 0 | 25,055 | 0 |
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. | 275,461 | 2008-10-26T19:54:00.000 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | 238,523 | 1 | 18 | 5 | 1 | Is Python and pygame a good way to learn SDL? | c++,python,sdl,pygame | 1 | 9 | 0 | 0.022219 | 0 | false | 0 | 0 | 0 | 25,055 | 0 |
pygame abstracts the SDL interface quite a lot, therefore I don't think there's much of an advantage carried over. | 238,659 | 2008-10-26T19:54:00.000 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | 238,523 | 1 | 18 | 5 | 6 | Is Python and pygame a good way to learn SDL? | c++,python,sdl,pygame | 1 | 9 | 0 | 1 | 0 | false | 0 | 0 | 0 | 25,055 | 0 |
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. | 238,671 | 2008-10-26T19:54:00.000 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | 238,523 | 1 | 18 | 5 | 6 | Is Python and pygame a good way to learn SDL? | c++,python,sdl,pygame | 1 | 9 | 0 | 1 | 0 | false | 0 | 0 | 0 | 25,055 | 0 |
What OpenGL library are you using? What windowing library? What version of Python?
Most 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. | 242,063 | 2008-10-28T02:29:00.000 | 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.
Just to avoid the "just use C" comments, here is why I want to use Python:
There 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.
Thanks for any help. | 242,059 | 1 | 15 | 5 | 1 | OpenGl with Python | python,opengl,fedora | 0 | 6 | 0 | 0.033321 | 0 | false | 0 | 0 | 0 | 18,416 | 1 |
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.
Raytracer 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. | 242,371 | 2008-10-28T02:29:00.000 | 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.
Just to avoid the "just use C" comments, here is why I want to use Python:
There 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.
Thanks for any help. | 242,059 | 1 | 15 | 5 | 0 | OpenGl with Python | python,opengl,fedora | 0 | 6 | 0 | 0 | 0 | false | 0 | 0 | 0 | 18,416 | 1 |
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). | 246,922 | 2008-10-28T02:29:00.000 | 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.
Just to avoid the "just use C" comments, here is why I want to use Python:
There 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.
Thanks for any help. | 242,059 | 1 | 15 | 5 | 0 | OpenGl with Python | python,opengl,fedora | 0 | 6 | 0 | 0 | 0 | false | 0 | 0 | 0 | 18,416 | 1 |
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.
PyOpenGL 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).
The problem doesn't appear if you initialize the display and create the OpenGL rendering context before loading the Python script. | 1,778,664 | 2008-10-28T02:29:00.000 | 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.
Just to avoid the "just use C" comments, here is why I want to use Python:
There 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.
Thanks for any help. | 242,059 | 1 | 15 | 5 | 2 | OpenGl with Python | python,opengl,fedora | 0 | 6 | 0 | 0.066568 | 0 | false | 0 | 0 | 0 | 18,416 | 1 |
Scripts never cause segmentation faults.
But first see if your kernel and kmod video driver working property ...
Extension modules can cause "segmentation fault". | 2,284,461 | 2008-10-28T02:29:00.000 | 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.
Just to avoid the "just use C" comments, here is why I want to use Python:
There 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.
Thanks for any help. | 242,059 | 1 | 15 | 5 | 0 | OpenGl with Python | python,opengl,fedora | 0 | 6 | 0 | 0 | 0 | false | 0 | 0 | 0 | 18,416 | 1 |
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.
There 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. | 253,897 | 2008-10-28T18:35:00.000 | 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? | 244,340 | 1 | 2 | 1 | 0 | wxPython wxDC object from win32gui.GetDC | wxpython,device,win32gui,bitblit | 0 | 2 | 0 | 0 | 0 | false | 0 | 0 | 0 | 1,086 | 0 |
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). | 253,562 | 2008-10-31T08:13:00.000 | 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).
Question: 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)? | 252,859 | 1 | 1 | 1 | 1 | Extending PythonCE to Access gsm/camera/gps Easily from PythonCE | c,windows-mobile,extending,pythonce | 0 | 3 | 0 | 0.066568 | 0 | false | 0 | 0 | 0 | 871 | 0 |
Your best bet is the tkMessageBox module, which should work on all systems (as Python will typically come with Tkinter).
If you can restrict yourself to a specific operating system, better choices might be available. | 257,403 | 2008-11-02T21:22:00.000 | Is there a UI library to create a message box or input box in python? | 257,398 | 1 | 6 | 2 | 11 | Message Box in Python | python,user-controls,user-interface | 0 | 4 | 0 | 1.2 | 0 | true | 0 | 0 | 0 | 6,196 | 0 |
I've heard good things about wx python, which is also multi-platform. | 257,532 | 2008-11-02T21:22:00.000 | Is there a UI library to create a message box or input box in python? | 257,398 | 1 | 6 | 2 | 2 | Message Box in Python | python,user-controls,user-interface | 0 | 4 | 0 | 0.099668 | 0 | false | 0 | 0 | 0 | 6,196 | 0 |
The client will present this as a slide in a presentation in a windows machine
I 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:
Animated Gif
Custom Presentation Scripts
Obviously, 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.
Custom 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.
He 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. | 267,698 | 2008-11-06T04:44:00.000 | Background
I 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.
The 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.
The 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.
My question is what is the best way to do this? What frameworks/libraries are best suited for this job?
I am most fluent in python so python suggestions are most easy for me, but I am open to any elegant way to do this.
The client will present this as a slide in a presentation in a windows machine. | 267,660 | 1 | 1 | 2 | 2 | How to create a picture with animated aspects programmatically | python,image,graphics,animation,drawing | 0 | 3 | 0 | 0.132549 | 0 | false | 0 | 0 | 0 | 902 | 0 |
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).
Finally to actually animate it interpolate between the coordinates based on time.
If 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) | 267,676 | 2008-11-06T04:44:00.000 | Background
I 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.
The 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.
The 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.
My question is what is the best way to do this? What frameworks/libraries are best suited for this job?
I am most fluent in python so python suggestions are most easy for me, but I am open to any elegant way to do this.
The client will present this as a slide in a presentation in a windows machine. | 267,660 | 1 | 1 | 2 | 1 | How to create a picture with animated aspects programmatically | python,image,graphics,animation,drawing | 0 | 3 | 0 | 0.066568 | 0 | false | 0 | 0 | 0 | 902 | 0 |
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.
I 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. | 277,306 | 2008-11-10T00:34:00.000 | 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.
The alternatives I tried were:
Boost.Python
I 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.
SWIG
SWIG's main advantage for us was that it doesn't require end users to install it to use the final program.
What have you used to do this, and what has been your experience with it? | 276,761 | 1 | 41 | 2 | 23 | Exposing a C++ API to Python | c++,python,boost,swig | 0 | 5 | 0 | 1.2 | 1 | true | 0 | 0 | 0 | 12,800 | 0 |
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.
The downside: It takes so long to install and use Boost that all the Tab-completion time-saving won't ever amortize ;-(
So I prefer Swig: No bells and whistles, but works reliably after a short introductory example. | 847,688 | 2008-11-10T00:34:00.000 | 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.
The alternatives I tried were:
Boost.Python
I 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.
SWIG
SWIG's main advantage for us was that it doesn't require end users to install it to use the final program.
What have you used to do this, and what has been your experience with it? | 276,761 | 1 | 41 | 2 | 2 | Exposing a C++ API to Python | c++,python,boost,swig | 0 | 5 | 0 | 0.07983 | 1 | false | 0 | 0 | 0 | 12,800 | 0 |
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.
Later, 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:
PyOpenGL'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.
pyglet'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.
This 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. | 4,246,325 | 2008-11-11T03:17:00.000 | 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
Which would you recommend and why? | 279,912 | 1 | 25 | 5 | 32 | PyOpenGl or pyglet? | python,pyglet,pyopengl | 0 | 9 | 0 | 1 | 0 | false | 0 | 0 | 0 | 18,513 | 0 |
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.
The 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. | 2,396,038 | 2008-11-11T03:17:00.000 | 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
Which would you recommend and why? | 279,912 | 1 | 25 | 5 | 4 | PyOpenGl or pyglet? | python,pyglet,pyopengl | 0 | 9 | 0 | 0.088656 | 0 | false | 0 | 0 | 0 | 18,513 | 0 |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
New: Create and edit this dataset card directly on the website!
Contribute a Dataset Card- Downloads last month
- 3