Web Development
int64
0
1
Data Science and Machine Learning
int64
0
1
Question
stringlengths
35
6.31k
is_accepted
bool
2 classes
Q_Id
int64
5.14k
40.5M
Score
float64
-1
1.2
Other
int64
0
1
Database and SQL
int64
0
1
Users Score
int64
-6
163
Answer
stringlengths
19
4.91k
Python Basics and Environment
int64
0
1
ViewCount
int64
12
475k
System Administration and DevOps
int64
0
1
Q_Score
int64
0
346
CreationDate
stringlengths
23
23
Tags
stringlengths
6
68
Title
stringlengths
12
138
Networking and APIs
int64
0
1
Available Count
int64
1
31
AnswerCount
int64
1
35
A_Id
int64
5.3k
72.3M
GUI and Desktop Applications
int64
1
1
1
0
Can anyone tell me if its possible to redeclare a C# class in IronPython? If I have a C# class, would I be able to monkey-patch it from IronPython?
false
1,008,686
0
1
0
0
You can monkey-patch from IronPython, but IPy is the only environment that will respect your changes; i.e. if you tried to mock out File.Create from IronPython, this would work fine for any IPy code, but if you called a C# method which called File.Create, it would get the real one, not the mock.
0
324
0
1
2009-06-17T18:08:00.000
c#,ironpython,monkeypatching
Redeclare .net classes in IronPython
0
2
3
1,040,151
1
1
0
Can anyone tell me if its possible to redeclare a C# class in IronPython? If I have a C# class, would I be able to monkey-patch it from IronPython?
true
1,008,686
1.2
1
0
0
You cannot monkey patch from IronPython. IronPython treats all .NET classes just like CPython treats built-in types: they cannot be monkey patched. IronRuby on the other hand does support this.
0
324
0
1
2009-06-17T18:08:00.000
c#,ironpython,monkeypatching
Redeclare .net classes in IronPython
0
2
3
3,155,159
1
0
0
I have an interface that has two toolbars, one attached to the frame and one embedded in a notebook tab. The one in the frame dutifully shows longHelp strings in the statusbar, the one in the notebook tab does not. How do I tell the one on the notebook tab where to display its help, or do I have to manage enter and leave bindings myself?
false
1,014,239
0
0
0
0
from wxPython docs """ longHelpString This string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool """ so toolbar in notebook doesn't get any statusbar to display long help, so either thru src we should invertigate how it inquires abt status bar and supply a ref to main frame status bar else i think better way is to just override wxToolBar::OnMouseEnter and display help directly on status bar
0
948
0
2
2009-06-18T17:57:00.000
wxpython,wxwidgets
wxPython: how to make two toolbars use one statusbar for tooltips?
0
1
3
1,021,396
1
0
0
I have a program that sends and receives images to each other using sockets. The server sends the image data using 'image.tostring()' and the client side receives it and turns it back into an image using 'Image.fromstring', then into a QImage using 'ImageQt.ImageQt(image)', turns it into a QPixmap using 'QPixmap.fromimage(qimage)'then updates my QWidget's QLable's image using 'lable.setPixmap(qpixmap)' Everything works fine with small images, but with images larger than 200x200, python.exe crashes and the console only shows "Process terminated with an exit code of -1073741819" and doesn't tell me what the problem is. I've isolated the problem down to 'setPixmap()' (everything else works as long as I comment out that), but I can't see what the problem is. This only happens on the client side. The server side uses the same steps going from Image to QImage to QPixmap then setPixmap, but that doesn't have any problems. Also tried making it a QBitmap and using setPixmap on the bitmap, which worked (but it's black and white so can't use it). Weird! Any help would be appreciated!
false
1,029,033
0
0
0
0
It may be worth dumping the image data to a file and checking that you have all the data by loading it into an image viewer. If you get incomplete data, you may still be able to obtain a QImage and create a QPixmap, but it may be invalid.
1
1,131
0
4
2009-06-22T19:38:00.000
python,pyqt,qpixmap
"Python.exe" crashes when PyQt's setPixmap() is called with a Pixmap
0
1
1
1,116,190
1
0
0
How do I make any wxPython widget (like wx.Panel or wx.Button) automatically expand to fill its parent window?
false
1,034,399
0
0
0
0
In the case of a Button, to make a button fill its parent window when the parent window (a frame in my case) changes size, put button.SetSize(parent_window.GetSize()) in the parent window's OnSize event handling routine.
0
3,216
0
4
2009-06-23T18:46:00.000
python,user-interface,wxpython
wxPython: Making something expand
0
1
3
5,628,847
1
0
0
Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?
false
1,037,673
1
0
0
8
Tkinter is part of the python standard distribution and is installed by default. Expect to find this on all python installs where there is a graphical display in the first place.
0
5,803
0
9
2009-06-24T10:58:00.000
python,tkinter,pyqt,pygtk,pyobjc
Pure python gui library?
0
6
9
1,037,851
1
0
0
Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?
false
1,037,673
1
0
0
6
Notion of "pure python gui library" is wrong because ultimately you will be using system level calls and widgets, may be thru ctypes but that doesn't change the fact that if you start implementing your idea you will eventually become wxPython
0
5,803
0
9
2009-06-24T10:58:00.000
python,tkinter,pyqt,pygtk,pyobjc
Pure python gui library?
0
6
9
1,038,265
1
0
0
Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?
false
1,037,673
0.088656
0
0
4
For one thing, all those libraries use different abstractions, so anything that worked with all of them is likely to wind up supporting a least-common-denominator set of functionality, or doing a LOT of work to use each to its fullest.
0
5,803
0
9
2009-06-24T10:58:00.000
python,tkinter,pyqt,pygtk,pyobjc
Pure python gui library?
0
6
9
1,037,740
1
0
0
Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?
false
1,037,673
0.088656
0
0
4
Not really sure what you mean by "heavyweight." wx uses native controls on each platform, and is about as easy to use in Python as I can imagine; after all, GUI APIs are complex because GUIs can get complex. I think wx, for the effort required to build a window and the quality of what shows up on screen, is great. I don't think you're likely to roll something better on your own.
0
5,803
0
9
2009-06-24T10:58:00.000
python,tkinter,pyqt,pygtk,pyobjc
Pure python gui library?
0
6
9
1,037,810
1
0
0
Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?
false
1,037,673
0.044415
0
0
2
I think it's about not inventig the wheel. It would work, but why should you do that? All the GUI libraries you mentioned are stable and more or less bullet proofen. I could imagine that there are some experiments implementing a pure python library. But I never saw one. Everything about GUIs is hard work and a pure python library wouldn't have such a big audience.
0
5,803
0
9
2009-06-24T10:58:00.000
python,tkinter,pyqt,pygtk,pyobjc
Pure python gui library?
0
6
9
1,037,705
1
0
0
Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?
true
1,037,673
1.2
0
0
10
The path of least effort and best results would be to learn what it takes to deploy an app using those existing GUI libraries.
0
5,803
0
9
2009-06-24T10:58:00.000
python,tkinter,pyqt,pygtk,pyobjc
Pure python gui library?
0
6
9
1,037,722
1
1
0
How to convert HTML CSS file to wxPython files? That is, how to create slidsheet in wxPython like HTML CSS files?
false
1,038,182
0
0
0
0
stylesheet, not slidesheet. f = open('NAMEOFSTYLESHEET.css','w') f.write('#ID{}\n.class{}')
0
677
0
0
2009-06-24T12:54:00.000
wxpython
HTML conversion
0
1
3
14,180,592
1
0
0
In my wx.Frame based wxpython application, I draw some lines on a panel when some events occur by creating wx.ClientDC instances when needed. The only problem is, if the window is minimized and then restored, the lines disappear! Is there some kind of method that I should override or event to bind to that will allow me to call the drawing method I created when the window is restored? Thanks!
false
1,046,157
0
0
0
0
When the window is restored it is (on some platforms) repainted using EVT_PAINT handler. The solution is e.g. to draw the same lines in OnPaint(). Or buffer what you draw. See the wxBufferedDC class.
0
541
0
1
2009-06-25T20:42:00.000
python,wxpython
wxpython: How can I redraw something when a window is retored?
0
1
2
1,046,259
1
0
0
I am developing an student attendance application in wxpython and I need to know how to ensure that password field doesn't echo characters to the screen. Forexample :if I give the name as moni means then it should be displayed as in format of ****
false
1,048,446
0.197375
0
0
1
You need to give your text control the TE_PASSWORD style. (As Jørn's comment points out, this isn't "encryption" - I'm assuming you're only talking about the visual presentation of the password.)
1
427
0
0
2009-06-26T10:44:00.000
wxpython
Hiding characters typed into password field
0
1
1
1,048,463
1
0
0
I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and calling C from Python. I'm considering an approach involving IPC or RPC (I don't mind having multiple processes); that is, having my pure-Python component run in a separate process (on the same machine) and having my C project communicate with it by writing/reading from a socket (or unix pipe). my python component can read/write to socket to communicate. Is that a reasonable approach? Is there something better? Like some special RPC mechanism? Thanks for the answer so far - however, i'd like to focus on IPC-based approaches since I want to have my Python program in a separate process as my C program. I don't want to embed a Python interpreter. Thanks!
false
1,056,051
0.022219
1
0
1
I haven't used an IPC approach for Python<->C communication but it should work pretty well. I would have the C program do a standard fork-exec and use redirected stdin and stdout in the child process for the communication. A nice text-based communication will make it very easy to develop and test the Python program.
0
79,185
0
52
2009-06-28T23:37:00.000
python,c,interop,cross-domain
How do you call Python code from C code?
0
3
9
1,056,105
1
0
0
I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and calling C from Python. I'm considering an approach involving IPC or RPC (I don't mind having multiple processes); that is, having my pure-Python component run in a separate process (on the same machine) and having my C project communicate with it by writing/reading from a socket (or unix pipe). my python component can read/write to socket to communicate. Is that a reasonable approach? Is there something better? Like some special RPC mechanism? Thanks for the answer so far - however, i'd like to focus on IPC-based approaches since I want to have my Python program in a separate process as my C program. I don't want to embed a Python interpreter. Thanks!
false
1,056,051
0
1
0
0
apparently Python need to be able to compile to win32 dll, it will solve the problem In such a way that converting c# code to win32 dlls will make it usable by any development tool
0
79,185
0
52
2009-06-28T23:37:00.000
python,c,interop,cross-domain
How do you call Python code from C code?
0
3
9
1,621,442
1
0
0
I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and calling C from Python. I'm considering an approach involving IPC or RPC (I don't mind having multiple processes); that is, having my pure-Python component run in a separate process (on the same machine) and having my C project communicate with it by writing/reading from a socket (or unix pipe). my python component can read/write to socket to communicate. Is that a reasonable approach? Is there something better? Like some special RPC mechanism? Thanks for the answer so far - however, i'd like to focus on IPC-based approaches since I want to have my Python program in a separate process as my C program. I don't want to embed a Python interpreter. Thanks!
false
1,056,051
1
1
0
7
Have you considered just wrapping your python application in a shell script and invoking it from within your C application? Not the most elegant solution, but it is very simple.
0
79,185
0
52
2009-06-28T23:37:00.000
python,c,interop,cross-domain
How do you call Python code from C code?
0
3
9
1,056,087
1
0
0
I've made a small tool that parses a chunk of text, does some simple processing (retrieves values from a dictionary, a few regex, etc.) and then spits the results. In order to make easier to read the results, I made two graphic ports, one with tkInter and other with wxPython, so the output is nicely displayed in a Text Area with some words having different colours. The tkInter implementation uses Tkinter.Text object and to apply the colours to the words uses tags (configured with the method Tkinter.Text.tag_config and passing them to Tkinter.Text.insert), and the measured while outputting about 400 different coloured words is < 0.02s. The wxPython implementation uses wx.richtext.RichTextCtrl and to apply the colours to the words uses wx.richtext.RichTextCtrl.BeginTextColour and then wx.richtext.RichTextCtrl.AppendText; the performance is ridiculous, it takes abut 1.4s to do the same job that only took 0.02s to the tkInter port. Is this an intrinsic problem of the RichTextCtrl widget, the wxPython bindings, or there is some way to speed it up? Thanks!
false
1,059,214
0
0
0
0
It kind of avoids the question slightly, but could you use wxStyledTextCtrl instead?
0
1,031
0
0
2009-06-29T16:26:00.000
python,performance,wxpython,tkinter,richtextediting
wxPython RichTextCtrl much slower than tkInter Text?
0
2
2
1,070,836
1
0
0
I've made a small tool that parses a chunk of text, does some simple processing (retrieves values from a dictionary, a few regex, etc.) and then spits the results. In order to make easier to read the results, I made two graphic ports, one with tkInter and other with wxPython, so the output is nicely displayed in a Text Area with some words having different colours. The tkInter implementation uses Tkinter.Text object and to apply the colours to the words uses tags (configured with the method Tkinter.Text.tag_config and passing them to Tkinter.Text.insert), and the measured while outputting about 400 different coloured words is < 0.02s. The wxPython implementation uses wx.richtext.RichTextCtrl and to apply the colours to the words uses wx.richtext.RichTextCtrl.BeginTextColour and then wx.richtext.RichTextCtrl.AppendText; the performance is ridiculous, it takes abut 1.4s to do the same job that only took 0.02s to the tkInter port. Is this an intrinsic problem of the RichTextCtrl widget, the wxPython bindings, or there is some way to speed it up? Thanks!
true
1,059,214
1.2
0
0
1
I'm copying here the comment that solved the problem: Have you tried using Freeze() and Thaw() to only update the display after you are done appending the coloured text? – mghie Jun 30 at 7:20
0
1,031
0
0
2009-06-29T16:26:00.000
python,performance,wxpython,tkinter,richtextediting
wxPython RichTextCtrl much slower than tkInter Text?
0
2
2
1,189,222
1
0
0
I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either WingIDE KomodoIDE which you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself. One con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?) I have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates. Thank you very much all and have a great day!
false
1,065,964
0.022219
0
0
1
Try Aptana Studio... It's eclipse+pydev+web stuff, it doesnt have any specific pylons stuff or mako support. But eclipse+pydev alone is great + all the nice jscript+html+css stuff aptana adds.
0
4,484
0
8
2009-06-30T20:46:00.000
python,ide,pylons
Recommended IDE for developing Pylons apps
0
4
9
3,596,813
1
0
0
I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either WingIDE KomodoIDE which you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself. One con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?) I have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates. Thank you very much all and have a great day!
false
1,065,964
0
0
0
0
Wow, I've also been looking for a good Pylons web app IDE. Seems like KomodoIDE 5.1 kicks some serious ass. I love the support for Mako and that it supports pretty much all of the SCMs. I've been using Textmate, but KomodoIDE will take over from now onwards
0
4,484
0
8
2009-06-30T20:46:00.000
python,ide,pylons
Recommended IDE for developing Pylons apps
0
4
9
2,364,669
1
0
0
I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either WingIDE KomodoIDE which you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself. One con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?) I have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates. Thank you very much all and have a great day!
false
1,065,964
0.022219
0
0
1
+1 for Spyder. Never heard of it before reading this page. Working great so far.
0
4,484
0
8
2009-06-30T20:46:00.000
python,ide,pylons
Recommended IDE for developing Pylons apps
0
4
9
4,134,659
1
0
0
I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either WingIDE KomodoIDE which you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself. One con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?) I have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates. Thank you very much all and have a great day!
true
1,065,964
1.2
0
0
0
after very very careful comparison, KomodoIDE 5.1 is most suitable for my purposes. Reasons: Extensibility Support for Mako and YUI (required by me) Native interface support (no GTK unfamiliarity) Support for Mercurial SCM (required by me) thats all I guess. I am extremely satisfied with KomodoIDE and have just shelled out some money to buy it. I figured when making a choice of tools, spend a day or two (yes, it takes time) trying them out and choosing what best suits your day-to-day purposes. If its just your first time coding, using a standard free tool or open source tool is far more useful than expending the time to find out the best tool. Only after some degree of expertise is acquired, you have a very narrow spectrum of requirements/preferences which will make choosing a tool far easier.
0
4,484
0
8
2009-06-30T20:46:00.000
python,ide,pylons
Recommended IDE for developing Pylons apps
0
4
9
1,085,987
1
0
0
I want to use Python to access MFC document files generically? Can CArchive be used to query a file and view the structure, or does Python, in opening the document, need to know more about the document structure in order to view the contents?
true
1,070,932
1.2
0
0
0
I think that the Python code needs to know the document structure. Maybe you should make a python wrapper of your c++ code. In this case, I would recommend to use http://sourceforge.net/projects/pycpp/>pycpp which is my opinion a great library for making python extensions in c++.
0
216
0
1
2009-07-01T19:37:00.000
python,windows,mfc,file
How To: View MFC Doc File in Python
0
1
1
1,071,011
1
0
0
Developing a project of mine I realize I have a need for some level of persistence across sessions, for example when a user executes the application, changes some preferences and then closes the app. The next time the user executes the app, be it after a reboot or 15 minutes, I would like to be able to retain the preferences that had been changed. My question relates to this persistence. Whether programming an application using the win32 API or the MFC Framework .. or using the newer tools for higher level languages such as wxPython or wxRuby, how does one maintain the type of persistence I refer to? Is it done as a temporary file written to the disk? Is it saved into some registry setting? Is there some other layer it is stored in that I am unaware of?
true
1,077,649
1.2
0
0
3
I would advice to do it in two steps. First step is to save your prefs. as string, for that you can a) Use any xml lib or output xml by hand to output string and read similarly from string b) Just use pickle module to dump your prefs object as a string c) Somehow generate a string from prefs which you can read back as prefs e.g. use yaml, config , JSON etc actually JSON is a good option when simplejson makes it so easy. Once you have your methods to convert to and from string are ready, you just need to store it somewhere where it is persisted and you can read back next time, for that you can a) Use wx.Config which save to registry in windows and to other places depending on platform so you don't have to worry where it saves, you can just read back values in platform independent way. But if you wish you can just use wx.Config for directly saving reading prefs. b) Directly save prefs. string to a file in a folder assigned by OS to your app e.g. app data folder in windows. Benefit of saving to a string and than using wx.Config to save it, is that you can easily change where data is saved in future e.g. in future if there is a need to upload prefs. you can just upload prefs. string.
1
729
0
1
2009-07-03T03:24:00.000
python,windows,wxpython
Windows Application Programming & wxPython
0
1
2
1,077,697
1
0
0
What's the correct way to prevent invoking (creating an instance of) a C type from Python? I've considered providing a tp_init that raises an exception, but as I understand it that would still allow __new__ to be called directly on the type. A C function returns instances of this type -- that's the only way instances of this type are intended to be created. Edit: My intention is that users of my type will get an exception if they accidentally use it wrongly. The C code is such that calling a function on an object incorrectly created from Python would crash. I realise this is unusual: all of my C extension types so far have worked nicely when instantiated from Python. My question is whether there is a usual way to provide this restriction.
false
1,079,690
0
0
0
0
There is a fantastically bulletproof way. Let people create the object, and have Python crash. That should stop them doing it pretty efficiently. ;) Also you can underscore the class name, to indicate that it should be internal. (At least, I assume you can create underscored classnames from C too, I haven't actually ever done it.)
1
339
0
2
2009-07-03T14:49:00.000
python,cpython
Preventing invoking C types from Python
0
1
4
1,080,330
1
0
0
So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.
false
1,080,719
0.057081
0
0
2
There is a way to do this, using the PrintWindow function. It causes the window to redraw itself on another surface.
0
12,921
0
6
2009-07-03T20:22:00.000
python,windows,screenshot
Screenshot an application, regardless of what's in front of it?
0
4
7
3,586,035
1
0
0
So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.
false
1,080,719
0.028564
0
0
1
Maybe you can position the app offscreen, then take the screenshot, then put it back?
0
12,921
0
6
2009-07-03T20:22:00.000
python,windows,screenshot
Screenshot an application, regardless of what's in front of it?
0
4
7
1,270,114
1
0
0
So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.
false
1,080,719
0.028564
0
0
1
If you can, try saving the order of the windows, then move your app to the front, screenshot, and move it back really quickly. Might produce a bit of annoying flicker, but it might be better than nothing.
0
12,921
0
6
2009-07-03T20:22:00.000
python,windows,screenshot
Screenshot an application, regardless of what's in front of it?
0
4
7
1,080,741
1
0
0
So I can use PIL to grab a screenshot of the desktop, and then use pywin32 to get its rectangle and crop out the part I want. However, if there's something in front of the window I want, it'll occlude the application I wanted a screenshot of. Is there any way to get what windows would say an application is currently displaying? It has that data somewhere, even when other windows are in front of it.
false
1,080,719
0
0
0
0
IIRC, not in Windows pre-vista - with Aero each window has it's own buffer, but before that, you would just use your method, of getting the rectangle. I'm not sure if pywin32 has Aero support or not.
0
12,921
0
6
2009-07-03T20:22:00.000
python,windows,screenshot
Screenshot an application, regardless of what's in front of it?
0
4
7
1,080,733
1
0
0
I have neglected my programming skills since i left school and now i want to start a few things that are running around in my head. Qt would be the toolkit for me to use but i am undecided if i should use Python (looks to me like the easier to learn with a few general ideas about programming) or C++ (the thing to use with Qt). In my school we learned the basics with Turbo Pascal, VB and a voluntary C course, though right now i only know a hint of all the things i learned back then. Can you recommend me a way and a site or book (or two) that would bring me on that path (a perfect one would be one that teaches the language with help of the toolkit)? Thank you in advance.
true
1,084,935
1.2
0
0
25
Being an expert in both C++ and Python, my mantra has long been "Python where I can, C++ where I must": Python is faster (in term of programmer productivity and development cycle) and easier, C++ can give that extra bit of power when I have to get close to the hardware or be extremely careful about every byte or machine cycle I spend. In your situation, I would recommend Python (and the many excellent books and URLs already recommended in other answers).
1
4,290
0
8
2009-07-05T22:13:00.000
c++,python,qt
C++ or Python as a starting point into GUI programming?
0
1
4
1,084,958
1
0
0
I'm writing a game in python with pygame and need to render text onto the screen. I want to render this text in one colour with an outline, so that I don't have to worry about what sort of background the the text is being displayed over. pygame.font doesn't seem to offer support for doing this sort of thing directly, and I'm wondering if anyone has any good solutions for achieving this?
false
1,109,498
0.379949
0
0
4
A quick and dirty way would be to render your text multiple times with the outline color, shifted by small amounts on a circle around the text position: 1 8 | 2 \ | / \|/ 7----*----3 /|\ / | \ 6 | 4 5 Edit: Doh you've been faster ! I wont delete my answer though, this ASCII art is just too good and deserves to live ! Edit 2: As OregonGhost mentioned, you may need more or fewer steps for the outline rendering, depending on your outline width.
0
2,637
0
7
2009-07-10T13:24:00.000
python,fonts,pygame
What's a good way to render outlined fonts?
0
1
2
1,109,553
1
0
0
What would you use for a brand new cross platform GUI app, CPython or IronPython ? What about - license / freedom - development - - doc - - editors - - tools - libraries - performances - portability What can you do best with one or the other ? - networking - database - GUI - system - multi threading / processing
false
1,149,692
0.197375
0
0
4
if you like/need to use .net framework, use ironpython, else CPython it's your choice (or you can try PyPy :))
0
5,086
0
7
2009-07-19T11:21:00.000
python,ironpython,cpython
CPython or IronPython?
0
4
4
1,149,740
1
0
0
What would you use for a brand new cross platform GUI app, CPython or IronPython ? What about - license / freedom - development - - doc - - editors - - tools - libraries - performances - portability What can you do best with one or the other ? - networking - database - GUI - system - multi threading / processing
true
1,149,692
1.2
0
0
4
Use CPython, with IronPython you are bound to .Net platform which do not have much cross platform support, mono is there on linux but still for a cross platform app, I wouldn't recommend .Net. So my suggestion is use CPython, for GUI use a framework like wxPython/PyQT and you would be happy.
0
5,086
0
7
2009-07-19T11:21:00.000
python,ironpython,cpython
CPython or IronPython?
0
4
4
1,149,762
1
0
0
What would you use for a brand new cross platform GUI app, CPython or IronPython ? What about - license / freedom - development - - doc - - editors - - tools - libraries - performances - portability What can you do best with one or the other ? - networking - database - GUI - system - multi threading / processing
false
1,149,692
0.099668
0
0
2
cpython is native runtime based python,,,it has a thin runtime level to the hosting os, ironpy is soft vm based python,,,it has a heavy soft interpter embeded in the dotnet vm,,which is called clr overall,,,cpython is made to be a scripting language natively,,it focus on the language,while ironpy is made to accomplished with clr,,,where clr is the main essisal,,then the ironpy language itself,,,it focus on the clr platform... check hellogameprogramming.net for more details
0
5,086
0
7
2009-07-19T11:21:00.000
python,ironpython,cpython
CPython or IronPython?
0
4
4
11,117,032
1
0
0
What would you use for a brand new cross platform GUI app, CPython or IronPython ? What about - license / freedom - development - - doc - - editors - - tools - libraries - performances - portability What can you do best with one or the other ? - networking - database - GUI - system - multi threading / processing
false
1,149,692
0.099668
0
0
2
I can only think of about one "cross platform" GUI app that's remotely tolerable (firefox), and people are complaining wildly about it everywhere I look. If you want to do cross platform, build a nice, solid model that can do the work you need done and build platform-specific GUIs that use it. I don't know how tolerable wxpython or pyqt are on Windows and Linux, but the further you get from plain cocoa on OS X, the harder it gets to build and the less pleasant it gets to use.
0
5,086
0
7
2009-07-19T11:21:00.000
python,ironpython,cpython
CPython or IronPython?
0
4
4
1,150,371
1
0
0
Can anybody help me out in how to activate 'close' button of askquestion() of tkMessageBox??
true
1,151,770
1.2
0
0
0
By 'activate', do you mean make it so the user can close the message box by clicking the close ('X') button? I do not think it is possible using tkMessageBox. I guess your best bet is to implement a dialog box with this functionality yourself. BTW: What should askquestion() return when the user closes the dialog box?
0
1,575
0
1
2009-07-20T05:00:00.000
python,tkmessagebox
tkMessageBox
0
1
1
1,151,900
1
0
0
I am having some issues with the size of qt4 widgets when their content changes. I will illustrate my problems with two simple scenarios: Scenario 1: I have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore. I must select the widget and use the arrow keys to scroll the string in both directions in order to see it all. Scenario 2: I have a QTextEdit widget. Sometimes, when I'm changing its content using QTextEdit.setHtml(), the rendered HTML content doesn't fit into the widget at its current size anymore. The widget starts displaying horizontal and/or vertical scroll bars and I can use them to scroll the HTML content. What I would want in such scenarios is to have some logic that decides if after a content change, the new content won't fit anymore into the widget and automatically increase the widget size so everything would fit. How are these scenarios handled? I'm using PyQt4. Edit: after reading both the comment and the first answer (which mentions typing content into the widget), I went over the question one more time. I was unpleasantly surprised to find out a horrible typo. I meant QTextBrowser when I wrote QTextEdit, my apologies for misleading you. That is: I have a widget which renders HTML code that I'm changing and I would want the widget to grow enough to display everything without having scrollbars. As for QLineEdit instead of QLabel - I went for QLineEdit since I've noticed I can't select text from a QLabel with the mouse for copying it. With QLineEdit it is possible.
false
1,153,714
1
0
0
8
I'm answering in C++ here, since that's what I'm most familiar with, and your problem isn't specific to PyQt. Normally, you just need to call QWidget::updateGeometry() when the sizeHint() may have changed, just like you need to call QWidget::update() when the contents may have changed. Your problem, however, is that the sizeHint() doesn't change when text is added to QLineEdit and QTextEdit. For a reason: People don't expect their dialogs to grow-as-they-type :) That said, if you really want grow-as-you-type behaviour in those widgets you need to inherit from them and reimplement sizeHint() and minimumSizeHint() to return the larger size, and potentially setText(), append() etc. to call updateGeometry() so the sizehint change is noticed. The sizehint calculation won't be entirely trivial, and will be way easier for QLineEdit than for QTextEdit (which is secretly a QAbstractScrollArea), but you can look at the sizeHint() and minimumSizeHint() implementations for inspiration (also the one for QComboBox, which has a mode to do exactly what you want: QComboBox::AdjustToContents. EDIT: Your two usecases (QTextBrowser w/o scrollbars and QLineEdit instead of QLabel just for selecting the text in there) can be solved by using a QLabel and a recent enough Qt. QLabel has gained both link-clicking notification and so-called "text-interaction flags" (one of which is TextSelectableByMouse) in Qt 4.2. The only difference that I was able to make out is that loading new content isn't automatic, there's no history, and there's no micro focus hinting (ie. tabbing from link to link) in QLabel.
0
12,735
0
12
2009-07-20T13:53:00.000
c++,python,qt,qt4,pyqt4
PyQt: how to handle auto-resize of widgets when their content changes
0
2
5
1,166,388
1
0
0
I am having some issues with the size of qt4 widgets when their content changes. I will illustrate my problems with two simple scenarios: Scenario 1: I have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore. I must select the widget and use the arrow keys to scroll the string in both directions in order to see it all. Scenario 2: I have a QTextEdit widget. Sometimes, when I'm changing its content using QTextEdit.setHtml(), the rendered HTML content doesn't fit into the widget at its current size anymore. The widget starts displaying horizontal and/or vertical scroll bars and I can use them to scroll the HTML content. What I would want in such scenarios is to have some logic that decides if after a content change, the new content won't fit anymore into the widget and automatically increase the widget size so everything would fit. How are these scenarios handled? I'm using PyQt4. Edit: after reading both the comment and the first answer (which mentions typing content into the widget), I went over the question one more time. I was unpleasantly surprised to find out a horrible typo. I meant QTextBrowser when I wrote QTextEdit, my apologies for misleading you. That is: I have a widget which renders HTML code that I'm changing and I would want the widget to grow enough to display everything without having scrollbars. As for QLineEdit instead of QLabel - I went for QLineEdit since I've noticed I can't select text from a QLabel with the mouse for copying it. With QLineEdit it is possible.
false
1,153,714
0
0
0
0
Ok implement sizeHint() method. And every time your content change size call updateGeometry() When content change without changing size use update(). (updateGeometry() automatically call update()).
0
12,735
0
12
2009-07-20T13:53:00.000
c++,python,qt,qt4,pyqt4
PyQt: how to handle auto-resize of widgets when their content changes
0
2
5
1,813,475
1
0
0
I have a tkinter GUI that downloads data from multiple websites at once. I run a seperate thread for each download (about 28). Is that too much threads for one GUI process? because it's really slow, each individual page should take about 1 to 2 seconds but when all are run at once it takes over 40 seconds. Is there any way I can shorten the time it takes to download all the pages? Any help is appreciated, thanks.
false
1,155,404
0
0
0
0
You can try using processes instead of threads. Python has GIL which might cause some delays in your situation.
0
373
0
0
2009-07-20T19:20:00.000
python,user-interface,multithreading,download,tkinter
Python accessing multiple webpages at once
0
2
3
1,155,479
1
0
0
I have a tkinter GUI that downloads data from multiple websites at once. I run a seperate thread for each download (about 28). Is that too much threads for one GUI process? because it's really slow, each individual page should take about 1 to 2 seconds but when all are run at once it takes over 40 seconds. Is there any way I can shorten the time it takes to download all the pages? Any help is appreciated, thanks.
false
1,155,404
0.066568
0
0
1
A process can have hundreds of threads on any modern OS without any problem. If you're bandwidth-limited, 1 to 2 seconds times 28 means 40 seconds is about right. If you're latency limited, it should be faster, but with no information, all I can suggest is: add logging to your code to make sure it's actually running in parallel, and that you're not accidentally serializing your threads somehow; use a network monitor to make sure that network requests are actually going out in parallel. It's hard to give anything better without more information.
0
373
0
0
2009-07-20T19:20:00.000
python,user-interface,multithreading,download,tkinter
Python accessing multiple webpages at once
0
2
3
1,155,498
1
0
0
Is there any way to detect which keys are currently pressed using Tkinter? I don't want to have to use extra libraries if possible. I can already detect when keys are pressed, but I want to be able to check at any time what keys are pressed down at the moment.
true
1,181,027
1.2
0
0
4
I think you need to keep track of events about keys getting pressed and released (maintaining your own set of "currently pressed" keys) -- I believe Tk doesn't keep track of that for you (and Tkinter really adds little on top of Tk, it's mostly a direct interface to it).
0
2,295
0
2
2009-07-25T02:38:00.000
python,tkinter,keylistener
How can you check if a key is currently pressed using Tkinter in Python?
0
1
1
1,181,037
1
0
0
I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python? I'd appreciate a simple example - Boost::Python will do
false
1,181,462
0.085505
1
0
3
Here's two possibilities: Perhaps the C++ code is already written & available for use. It's likely the C++ code is faster/smaller than equivalent Python
0
522
0
4
2009-07-25T07:14:00.000
c++,python
Practical point of view: Why would I want to use Python with C++?
0
6
7
1,181,468
1
0
0
I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python? I'd appreciate a simple example - Boost::Python will do
false
1,181,462
0.057081
1
0
2
Here's a real-life example: I've written a DLL in C to interface with some custom hardware for work. Then for the very first stage of testing, I was writing short programs in C to verify that the different commands were working properly. The process of write, compile, run took probably 3-5 times as long as when I finally wrote a Python interface to the DLL using ctypes. Now, I can write testing scripts much more rapidly with much less regards to proper variable initialization and memory management that I would have to worry about in C. In fact, I've even been able to use unit testing libraries in Python to create much more robust tests than before. Would that have been possible in C? Absolutely, but it would have taken me much longer, and it would have been many more lines of code. Fewer lines of code in Python means (in general) that there are fewer things with my main logic that can go wrong. Moreover, since the hardware communication is almost completely IO bound, there's no need to write any supporting code in C. I may as well program in whatever is fastest to develop. So there you go, real-life example.
0
522
0
4
2009-07-25T07:14:00.000
c++,python
Practical point of view: Why would I want to use Python with C++?
0
6
7
1,182,301
1
0
0
I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python? I'd appreciate a simple example - Boost::Python will do
false
1,181,462
0
1
0
0
One nice thing about using a scripting language is that you can reload new code into the application without quitting the app, then making changes, recompile, and then relaunching the app. When people talk about quicker development times, some of that refers to this capability. A downside of using a scripting languages is that their debuggers are usually not as fully featured as what you would have in C++. I haven't done any Python programming so I don't know what the features are of its debugger, if it has one at all. This answer doesn't exactly answer what you asked but I thought it was relevant. The answer is more the pro/cons of using a scripting language. Please don't flame me. :)
0
522
0
4
2009-07-25T07:14:00.000
c++,python
Practical point of view: Why would I want to use Python with C++?
0
6
7
1,182,051
1
0
0
I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python? I'd appreciate a simple example - Boost::Python will do
false
1,181,462
0.085505
1
0
3
Because C++ provides a direct way of calling OS services, and (if used in a careful way) can produce code that is more efficient in memory and time, whereas Python is a high-level language, and is less painful to use in those situations where utter efficiency isn't a concern and where you already have libraries giving you access to the services you need. If you're a C++ user, you may wonder why this is necessary, but the expressiveness and safety of a high-level language has such a massive relative effect on your productivity, it has to be experienced to be understood or believed. I can't speak for Python specifically, but I've heard people talk in terms of "tripling" their productivity by doing most of their development in it and using C++ only where shown to be necessary by profiling, or to create extra libraries. If you're a Python user, you may not have encountered a situation where you need anything beyond the libraries already available, and you may not have a problem with the performance you get from pure Python (this is quite likely). In which case - lucky you! You can forget about all this.
0
522
0
4
2009-07-25T07:14:00.000
c++,python
Practical point of view: Why would I want to use Python with C++?
0
6
7
1,181,481
1
0
0
I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python? I'd appreciate a simple example - Boost::Python will do
false
1,181,462
0.141893
1
0
5
Generally, you'd call C++ from python in order to use an existing library or other functionality. Often someone else has written a set of functions that make your life easier, and calling compiled C code is easier than re-writing the library in python. The other reason is for performance purposes. Often, specific functions of an otherwise completely scripted program are written in a pre-compiled language like C because they take a long time to run and can be more efficiently done in a lower-level language. A third reason is for interfacing with devices. Python doesn't natively include a lot of code for dealing with sound cards, serial ports, and so on. If your device needs a device driver, python will talk to it via pre-compiled code you include in your app.
0
522
0
4
2009-07-25T07:14:00.000
c++,python
Practical point of view: Why would I want to use Python with C++?
0
6
7
1,181,476
1
0
0
I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python? I'd appreciate a simple example - Boost::Python will do
false
1,181,462
0
1
0
0
Performance : From my limited experience, Python is about 10 times slower than using C. Using Psyco will dramatically improve it, but still about 5 times slower than C. BUT, calling c module from python is only a little faster than Psyco. When you have some libraries in C. For example, I am working heavily on SIP. It's a very complicated protocol stacks and there is no complete Python implementation. So my only choice is calling SIP libraries written in C. There are also this kind of cases, like video/audio decoding.
0
522
0
4
2009-07-25T07:14:00.000
c++,python
Practical point of view: Why would I want to use Python with C++?
0
6
7
1,181,567
1
0
0
The Python manual says that you can create modules for Python in both C and C++. Can you take advantage of things like classes and templates when using C++? Wouldn't it create incompatibilities with the rest of the libraries and with the interpreter?
false
1,185,878
0.148885
1
0
3
The boost folks have a nice automated way to do the wrapping of C++ code for use by python. It is called: Boost.Python It deals with some of the constructs of C++ better than SWIG, particularly template metaprogramming.
1
567
0
6
2009-07-26T23:30:00.000
c++,python,c,python-c-api,python-c-extension
Can I use C++ features while extending Python?
0
2
4
1,185,954
1
0
0
The Python manual says that you can create modules for Python in both C and C++. Can you take advantage of things like classes and templates when using C++? Wouldn't it create incompatibilities with the rest of the libraries and with the interpreter?
true
1,185,878
1.2
1
0
9
It doesn't matter whether your implementation of the hook functions is implemented in C or in C++. In fact, I've already seen some Python extensions which make active use of C++ templates and even the Boost library. No problem. :-)
1
567
0
6
2009-07-26T23:30:00.000
c++,python,c,python-c-api,python-c-extension
Can I use C++ features while extending Python?
0
2
4
1,185,907
1
0
0
I have a PyShell, which is supposed to be derived from wx.stc.StyledTextCtrl. How do I change the color scheme that it currently uses?
false
1,211,380
0
0
0
0
You can use styledTextCtrl.StyleSetSpec(wx.stc.STC_STYLE_INDENTGUIDE, "fore:#CDCDCD") (Bunch of .StyleSetSpec properties) ... ... ... styCtrl.SetCaretForeground("BLUE") styCtrl.SetSelBackground(True, wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)) styCtrl.SetSelForeground(True, wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)) ... (Bunch of Set*() commands) Don't know if there is a way to load a pre-defined color scheme. You could define it in YAML and load it up via the commands above and more.
0
828
0
1
2009-07-31T08:51:00.000
python,user-interface,wxpython,color-scheme
wxPython: Changing the color scheme of a wx.stc.StyledTextCtrl
0
1
1
1,272,807
1
0
0
I'm using pygtk with PIL. I've already figured out a way to convert PIL Images to gtk.gdk.Pixbufs. What I do to display the pixbuf is I create a gtk.gdk.Image, and then use img.set_from_pixbuf. I now want to draw a few lines onto this image. Apparently I need a Drawable to do that. I've started looking through the docs but already I have 8-10 windows open and it is not being straightforward at all. So - what magic do I need to type to get a Drawable representing my picture, draw some things on to it, and then turn it into a gdk.Image so I can display it on my app?
false
1,213,090
0.039979
0
0
1
You should connect to the expose-event (GTK 2) or draw (GTK 3) signal. In that handler, simply use image.window to get the widget's gtk.gdk.Window; this is a subclass of gtk.gdk.Drawable, so you can draw on it.
0
5,113
0
3
2009-07-31T15:10:00.000
python,gtk,drawing,pygtk
pygtk: Draw lines onto a gtk.gdk.Pixbuf
0
1
5
6,578,903
1
0
0
I would like to be warned when user selects the whole row in a wxGrid but I do not see an event that handles this.What is the best way to do it?
false
1,215,846
0.099668
0
0
1
Actually, I figured it out. There are events like EVT_GRID_LABEL_LEFT_CLICK and then I test event.GetCol() == -1, to make sure the click is on a whole row, not a whole column.
0
3,008
0
3
2009-08-01T04:40:00.000
events,wxpython
Detect row selection in wxGrid
0
1
2
1,263,720
1
0
0
I'm currently working on a game engine written in pygame and I wanted to add OpenGL support. I wrote a test to see how to make pygame and OpenGL work together, and when it's running in windowed mode, it runs between 150 and 200 fps. When I run it full screen (all I did was add the FULLSCREEN flag when I set up the window), it drops down to 60 fps. I added a lot more drawing functions to see if it was just a huge performance drop, but it always ran at 60 fps. Is there something extra I need to do to tell OpenGL that it's running fullscreen or is this a limitation of OpenGL? (I am running in Windows XP)
false
1,217,939
0
0
0
0
If you are not changing your clock.tick() when you change between full screen and windowed mode this is almost certainly a vsync issue. If you are on an LCD then it's 100% certain. Unfortunately v-sync can be handled in many places including SDL, Pyopengl, your display server and your video drivers. If you are using windows you can adjust the vsync toggle in the nvidia control panel to test, and there's more than likely something in nvidia-settings for linux as well. I'd guess other manufacturers drivers have similar settings but that's a guess.
0
3,949
0
2
2009-08-02T01:22:00.000
python,fullscreen,pygame,pyopengl
PyOpenGL + Pygame capped to 60 FPS in Fullscreen
0
1
3
1,218,011
1
0
0
I'm using pyGTK. I want to layout a large element with 2 smaller ones on each side. For aesthetic reasons, I want the 2 smaller ones to be the same size. As it is, they differ by a few pixels, and the middle element is not centered as a result. I tried using gtk.Table with 3 cells, but having homogeneous=True doesn't have the desired effect. I tried messing with it by making 8 cells, and then having the center one take up more cells, but it doesn't work well. Is there any way to do this?
true
1,229,933
1.2
0
0
6
You should use GtkSizeGroup for this. Create a GtkSizeGroup, add both widgets to it. This will ensure that both widgets have the same size. If you want that widget have the same size in only one direction (width or height), set the "mode" property of SizeGroup.
0
238
0
1
2009-08-04T21:04:00.000
python,layout,gtk,pygtk
How to make two elements in gtk have the same size?
0
1
1
1,229,981
1
0
0
For example, graying out the "X" on windows systems.
false
1,235,417
0.379949
0
0
4
Just call the set_deletable with False on the window in question. It will work as long as GTK can convince the window manager to make the window unclosable.
0
721
0
4
2009-08-05T19:59:00.000
python,windows,gtk,pygtk
In GTK, how do I make a window unable to be closed?
0
1
2
1,235,424
1
0
0
Various examples always use alloc_color() and stuff like gtk.color.parse('red'), etc. I just do gtk.gdk.Color(65535,0,0), and that seems to work. What's the need for alloc_color?
true
1,242,541
1.2
0
0
2
If you're running on a system that uses a palette display (as opposed to a true-colour display), then you must allocate new colours in the palette before you can use them. This is because palette-based displays can only display a limited number of colours at once (usually 256 or sometimes 65536). Most displays these days are capable of true colour display, which can display all available colours simultaneously, so this won't appear to be a problem and you can get away with directly asking for specific colours.
0
236
0
1
2009-08-07T02:03:00.000
python,gtk,colors,pygtk
What's the point of alloc_color() in gtk?
0
1
1
1,242,550
1
0
0
I am assisting with Windows support for a PyGTK app that appears as a system tray applet, but am not so strong on the GTK+ gooey stuff... We have it so when you left-click the systray icon, the window appears right by your tray icon no matter where your system tray is--and on Linux this works great, using the results of gtk.StatusIcon.get_geometry() to calculate the size and position. Of course, the docs for gtk.StatusIcon.get_geometry() point out that "some platforms do not provide this information"--and this includes MS Windows, as I get NoneType as the result. I can make a guess and position the window in the bottom-right corner of the screen, 30 pixels up from the bottom--as this will catch the majority of Windows users who haven't moved the taskbar. But for those that have, it looks all wrong. So is there a Windows-friendly way to get the position of the systray icon so I can place my window there? Please note: I am already using gtk_menu_popup() with gtk_status_icon_position_menu for a pop-up menu which works correctly. But what I am trying to position is a separate gtk.Window, which will not accept gtk_status_icon_position_menu (because it's not a menu). Any other ideas would be appreciated...
false
1,246,552
0.066568
0
0
1
Gtk provides function gtk_status_icon_position_menu that can be passed into gtk_menu_popup as a GtkPositionFunc. This seems to provide the requested functionality.
0
1,237
0
4
2009-08-07T19:27:00.000
python,windows,gtk,pygtk
Getting the position of the gtk.StatusIcon on Windows
0
2
3
1,247,303
1
0
0
I am assisting with Windows support for a PyGTK app that appears as a system tray applet, but am not so strong on the GTK+ gooey stuff... We have it so when you left-click the systray icon, the window appears right by your tray icon no matter where your system tray is--and on Linux this works great, using the results of gtk.StatusIcon.get_geometry() to calculate the size and position. Of course, the docs for gtk.StatusIcon.get_geometry() point out that "some platforms do not provide this information"--and this includes MS Windows, as I get NoneType as the result. I can make a guess and position the window in the bottom-right corner of the screen, 30 pixels up from the bottom--as this will catch the majority of Windows users who haven't moved the taskbar. But for those that have, it looks all wrong. So is there a Windows-friendly way to get the position of the systray icon so I can place my window there? Please note: I am already using gtk_menu_popup() with gtk_status_icon_position_menu for a pop-up menu which works correctly. But what I am trying to position is a separate gtk.Window, which will not accept gtk_status_icon_position_menu (because it's not a menu). Any other ideas would be appreciated...
false
1,246,552
0
0
0
0
The behavior i experienced in windows with gtk_status_icon_position_menu was that it spawns the window at the location the user clicked in the statusicon
0
1,237
0
4
2009-08-07T19:27:00.000
python,windows,gtk,pygtk
Getting the position of the gtk.StatusIcon on Windows
0
2
3
1,874,016
1
0
0
I've just started working with pygame and I'm trying to make a semi-transparent sprite, and the sprite's source file is a non-transparent bitmap file loaded from the disk. I don't want to edit the source image if I can help it. I'm sure there's a way to do this with pygame code, but Google is of no help to me.
false
1,247,921
0.049958
0
0
1
you might consider switching to using png images where you can do any kind of transparency you want directly in the image.
0
7,546
0
4
2009-08-08T03:51:00.000
python,graphics,sprite,pygame
How to make translucent sprites in pygame
0
1
4
1,247,984
1
0
0
How to create a non-editable text box with no cursor in wxPython to dump text in?
true
1,254,819
1.2
0
0
7
wx.StaticText You could also use a regular TextCtrl with the style TE_READONLY but that shows a cursor and the text looks editable, but it isn't.
0
4,502
0
5
2009-08-10T13:16:00.000
python,textbox,wxpython,wxwidgets
Non-editable text box in wxPython
0
1
1
1,254,881
1
0
0
How to change only hight of an object in wxPython, leaving its width automatic? In my case it's a TextCtrl. How to make the height of the window available for change and lock the width?
true
1,265,821
1.2
0
0
6
For the width or height to be automatically determined based on context you use for it the value of -1, for example (-1, 100) for a height of 100 and automatic width. The default size for controls is usually (-1, -1). If a width or height is specified and the sizer item for the control doesn't have wx.EXPAND flag set (note that even if this flag is set some sizers won't expand in both directions by default) you might call it "locked" as it won't chage that dimension. Make sure to study the workings of sizers in depth as it is one of the most important things in GUI design.
0
258
0
2
2009-08-12T12:22:00.000
python,wxpython,size
Changing height of an object in wxPython
0
1
1
1,265,988
1
0
0
In GTK, how can I scale an image? Right now I load images with PIL and scale them beforehand, but is there a way to do it with GTK?
false
1,269,320
-0.033321
0
0
-1
actually when we use gdk_pixbuf_scale_simple(pb,700,700,GDK_INTERP_BILINEAR); this function causes memory leakage (If we monitor task manager the memory requirement goes on increasing till it kills the process) when used with a timer event. How to solve that
0
18,745
0
22
2009-08-12T23:44:00.000
python,user-interface,image,gtk,pygtk
Scale an image in GTK
0
1
6
64,004,356
1
0
0
I am working on a top-down view 2d game at the moment and I am learning a ton about sprites and sprite handling. My question is how to handle a set of sprites that can be rotated in as many as 32 directions. At the moment a given object has its sprite sheet with all of the animations oriented with the object pointing at 0 degrees at all times. Now, since the object can rotate in as many as 32 directions, what is the best way to work with that original sprite sheet. My current best guess is to have the program basically dynamically create 32 more sprite sheets when the object is first loaded into the game, and then all subsequent instances of that type of object will share those sprite sheets. Anyways, any advice in this regard would be helpful. Let me know if I need to rephrase the question, I know its kindof an odd one. Thanks Edit: I guess for more clarification. If I have, for instance an object that has 2 animations of 5 frames a peice, that is a pretty easy sprite sheet to create and organize, its a simple 2x5 grid (or 5x2 depending on how you lay it out). But the problem is that now those 2 animations have to be rotated in 32 directions. This means that in the end there will be 320 individual sprites. I am going to say that (and correct me if im wrong) since I'm concerned about performance and frame-rate, rotating the sprites on the fly every single frame is not an option. So, how should these 320 sprites that make up these 2 animations be organized? Would it be better to Think of it as 32 2x5 sprite sheets split the sprite sheet up into individual frames, and then have an array the 32 different directions per frame (so 10 arrays of 32 directional sprites) Other....? Doesn't matter? Thanks
true
1,275,482
1.2
0
0
1
Typically you will sacrifice either processor time or memory, and you need to balance between the two. Unless you've got some great limit to your processor or you're computing a lot of expensive stuff, there's no real reason to put all that into the memory. Rotating a few sprites with a transform is cheap enough that it is definitely not worth it to store 32x as much information in memory - especially because that information is a bunch of images, and images use up a lot of memory, relatively speaking.
0
1,381
0
2
2009-08-14T00:47:00.000
python,pygame,sprite
What is the best way to handle rotating sprites for a top-down view game
0
2
3
1,296,881
1
0
0
I am working on a top-down view 2d game at the moment and I am learning a ton about sprites and sprite handling. My question is how to handle a set of sprites that can be rotated in as many as 32 directions. At the moment a given object has its sprite sheet with all of the animations oriented with the object pointing at 0 degrees at all times. Now, since the object can rotate in as many as 32 directions, what is the best way to work with that original sprite sheet. My current best guess is to have the program basically dynamically create 32 more sprite sheets when the object is first loaded into the game, and then all subsequent instances of that type of object will share those sprite sheets. Anyways, any advice in this regard would be helpful. Let me know if I need to rephrase the question, I know its kindof an odd one. Thanks Edit: I guess for more clarification. If I have, for instance an object that has 2 animations of 5 frames a peice, that is a pretty easy sprite sheet to create and organize, its a simple 2x5 grid (or 5x2 depending on how you lay it out). But the problem is that now those 2 animations have to be rotated in 32 directions. This means that in the end there will be 320 individual sprites. I am going to say that (and correct me if im wrong) since I'm concerned about performance and frame-rate, rotating the sprites on the fly every single frame is not an option. So, how should these 320 sprites that make up these 2 animations be organized? Would it be better to Think of it as 32 2x5 sprite sheets split the sprite sheet up into individual frames, and then have an array the 32 different directions per frame (so 10 arrays of 32 directional sprites) Other....? Doesn't matter? Thanks
false
1,275,482
0.26052
0
0
4
The 32 directions for the sprite translate into 32 rotations by 11.25 degrees. You can reduce the number of precalculated images to 8 you only calculate the first 90 degrees (11.25, 22.5, 33.75, 45.0, 56.25, 67.5, 78.75, 90.0) and use the flip operations dynamically. Flips are much faster because they essentially only change the order an image is copied from the buffer. For example, when you display an image that is rotated by 101.25 degrees, load the precalculated image of 67.5 degrees and flip it vertically. I just realized that this only works if your graphic is symmetrical ;-) When talking about a modern computer, you might not need to optimize anything. The memory used by precalculating the sprites is certainly negligible, and the cpu usage when rotating the image probably too. When you are programming for a embedded device however, it does matter.
0
1,381
0
2
2009-08-14T00:47:00.000
python,pygame,sprite
What is the best way to handle rotating sprites for a top-down view game
0
2
3
1,277,181
1
1
0
I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development. Some things I'm looking for: It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides. The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets. I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app). Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
false
1,289,941
0
0
0
0
Having looked several ones, like django, pylos, web2py, wt. My recommendation is web2py. It's a python version of "ruby on rails" and easy to learn.
0
10,487
0
12
2009-08-17T19:33:00.000
c++,python,wt
Web Application Frameworks: C++ vs Python
0
2
7
1,475,164
1
1
0
I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development. Some things I'm looking for: It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides. The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets. I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app). Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
false
1,289,941
0.028564
0
0
1
I think you better go firt python in your case, meanwhile you can extend cppCMS functionalities and write your own framework arround it. wt was a good idea design, but somehow not that suitable.
0
10,487
0
12
2009-08-17T19:33:00.000
c++,python,wt
Web Application Frameworks: C++ vs Python
0
2
7
1,290,620
1
0
0
I have a wx.Frame that has only a single child. While setting up the child's wx.Sizer, I can use the wx.SHAPED flag, which keeps the aspect ratio of the child locked. However, the Frame still has complete freedom in it's aspect ratio, and will leave a blank space in the area that is left unused by the child. How can I lock the aspect ratio of the wx.Frame during resizing?
true
1,291,991
1.2
0
0
5
Sizers cannot be applied to top-level windows (in order to define properties of the windows themselves as opposed to their contents), so unfortunately there is no "true" way to lock in the aspect ratio. Your best bet would be to catch your window's OnSize event, get the size that the user wants the window to be (which is stored in the wxSizeEvent), calculate the new width and height according to the aspect ratio and then immediately call SetSize with the new size. This technique has the drawback of visual artifacts during resizing (the operating system will initially paint the window according to how the user has dragged it but then immediately redraw it after you call SetSize, leading to a flickering effect) so it isn't a great solution, however since you cannot lock top-level windows into aspect ratios (and prevent the need to resize with SetSize at all) you'll have to decide whether the flickering is worth it.
0
5,993
0
2
2009-08-18T05:37:00.000
wxpython,resize,wxwidgets,frame,aspect-ratio
wxwidgets/wxPython: Resizing a wxFrame while keeping aspect ratio
0
1
2
1,292,083
1
0
0
I have two PNGs that I am trying to combine into a PDF using ReportLab 2.3 on Python 2.5. When I use canvas.drawImage(ImageReader) to write either PNG onto the canvas and save, the transparency comes out black. If I use PIL (1.1.6) to generate a new Image, then paste() either PNG onto the PIL Image, it composits just fine. I've double checked in Gimp and both images have working alpha channels and are being saved correctly. I'm not receiving an error and there doesn't seem to be anything my google-fu can turn up. Has anybody out there composited a transparent PNG onto a ReportLab canvas, with the transparency working properly? Thanks!
false
1,308,710
0.132549
0
0
2
I've found that mask='auto' has stopped working for me with reportlab 3.1.8. In the docs it says to pass the values that you want masked out. So what works for me now is mask=[0, 2, 0, 2, 0, 2, ]. Basically it looks like this `mask=[red_start, red_end, green_start, green_end, blue_start, blue_end, ] The mask parameter lets you create transparent images. It takes 6 numbers and defines the range of RGB values which will be masked out or treated as transparent. For example with [0,2,40,42,136,139], it will mask out any pixels with a Red value from 0 or 1, Green from 40 or 41 and Blue of 136, 137 or 138 (on a scale of 0-255). It's currently your job to know which color is the 'transparent' or background one. UPDATE: That masks out anything that is rgb(0, 0, 0) or rgb(1, 1, 1) which obviously might not be the right solution. My problem was people uploading png images with a gray color space. So I need to still figure out a way to detect the color space of the image. and only apply that mask on gray space images.
0
11,462
0
29
2009-08-20T20:45:00.000
python,python-imaging-library,reportlab
Transparency in PNGs with reportlab 2.3
0
2
3
28,385,327
1
0
0
I have two PNGs that I am trying to combine into a PDF using ReportLab 2.3 on Python 2.5. When I use canvas.drawImage(ImageReader) to write either PNG onto the canvas and save, the transparency comes out black. If I use PIL (1.1.6) to generate a new Image, then paste() either PNG onto the PIL Image, it composits just fine. I've double checked in Gimp and both images have working alpha channels and are being saved correctly. I'm not receiving an error and there doesn't seem to be anything my google-fu can turn up. Has anybody out there composited a transparent PNG onto a ReportLab canvas, with the transparency working properly? Thanks!
false
1,308,710
0.066568
0
0
1
ReportLab uses PIL for managing images. Currently, PIL trunk has patch applied to support transparent PNGs, but you will have to wait for a 1.1.6 release if you need stable package.
0
11,462
0
29
2009-08-20T20:45:00.000
python,python-imaging-library,reportlab
Transparency in PNGs with reportlab 2.3
0
2
3
1,311,056
1
0
0
I started using Wing IDE and it's great. I'm building a wxPython app, and I noticed that Wing IDE catches exceptions that are usually caught by wxPython and not really raised. This is usually useful, but I would like to disable this behavior occasionally. How do I do that?
true
1,323,361
1.2
0
0
0
There is a Ignore this exception location check box in the window where the exception is reported in wing, or you could explicitly silence that specific exception in you code with a try except block.
1
175
0
0
2009-08-24T16:21:00.000
python,wxpython,wing-ide
Getting Wing IDE to stop catching the exceptions that wxPython catches
0
1
1
1,323,458
1
0
0
I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).
false
1,327,105
0.066568
0
0
1
I maybe don't understand the question well but copying IronMath.dll and IronPython.dll to the folder with main.exe and main.dll should work for Ironpython 1.x. These .dlls are different for IronPython 2.x. Edit: Well, I tried PYC with IP 1.1 and it does not work. That means you have to use it with at least IP 2.0.2 (it is located in Samples\pyc folder). For simple script 'print 'hello' you need to ship (along with hello.dll and hello.exe). IronPython.dll Microsoft.Scripting.Core.dll Microsoft.Scripting.dll Microsoft.Scripting.ExtensionAttribute.dll For more complicated script you will probably need IronPython.Modules.dll as well.
1
3,879
0
0
2009-08-25T09:25:00.000
ironpython,ironpython-studio
Generating EXE out of IronPython script
0
3
3
1,330,323
1
0
0
I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).
false
1,327,105
0
0
0
0
A DLL is a dynamically linked library. It's required for your application to run properly. All applications written in .NET use them. You just don't know it, because support is built into the .NET framework, which most everyone has installed on their systems. Yay, way to go Microsoft. The DLR (Dynamic Language Runtime) isn't built into any .NET destributable at this time, however (this will change in .NET 4.0). That's why you get the dll file. Are you writing software that utilizes any .NET libraries? If not, just write it in good 'ol cpython (the way you're supposed to). Then, uou should look into a program called py2exe. Have you ever used uTorrent? I'm assuming you have. It's build using strait up cpython + py2exe. Enjoy. :)
1
3,879
0
0
2009-08-25T09:25:00.000
ironpython,ironpython-studio
Generating EXE out of IronPython script
0
3
3
1,344,862
1
0
0
I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).
true
1,327,105
1.2
0
0
2
I have created a C# application that uses the IronPython.dll and IronMath.dll to convert the IronPython scripts to executables. This doesn't require IronPython studio to be present. Only the DLLs are enough. The behavior of exe is same as that created by IronPython studio(Integrated with VS2008)
1
3,879
0
0
2009-08-25T09:25:00.000
ironpython,ironpython-studio
Generating EXE out of IronPython script
0
3
3
1,389,659
1
0
0
I want main window to "gray, freeze, stop working", when some other window is opened. Is there some default way to do it? Pretty much the same as gtk.Dialog is working. EDIT: Currently I'm just replacing all contents by a text line, but I guess there should be better way.
true
1,329,076
1.2
0
0
3
You really shouldn't try to make a program become unresponsive. If what you want to do is stop the user from using the window, make the dialog modal: gtk.Dialog.set_modal(True)
0
310
0
0
2009-08-25T15:33:00.000
python,window,pygtk,freeze
How to freeze/grayish window in pygtk?
0
1
1
1,329,140
1
0
0
Quick question. I'm using Linux and I want to try making a GUI with Python. I've heard about something like Qt, GTK+ and PyGTK but I don't know what they are exactly and what the difference between them is. Is there any difference on how they work with different DEs like GNOME, KDE, XFCE etc.? Is there any IDE that allows you to create GUI like Microsoft Visual Studio does (for C#, C, Visual Basic etc.)? Or should I maybe use another language other than Python to make GUI applications?
false
1,355,918
0.07983
0
0
2
Each desktop environment uses a specific toolkit to build it's components. For example, KDE uses Qt and GNOME uses Gtk. Your use of a toolkit will be dependent upon what type of desktop environment you're targeting at, and if you want to target a wide range of desktops then use a toolkit which will work on many desktop environments, like Wx widgets which will work on Linux, Mac OS and Windows. For building simple GUI applications, Tkinter will do.
1
48,034
0
14
2009-08-31T05:25:00.000
python,linux,user-interface,gtk,pygtk
Creating GUI with Python in Linux
0
1
5
1,355,948
1
0
0
I am creating a simple tool to add album cover images to mp3 files in python. So far I am just working on sending a request to amazon with artist and album title, and get the resulting list, as well as finding the actual images for each result. What I want to do is to display a simple frame with a button/link for each image, and a skip/cancel button. I have done some googling, but I can't find examples that I can use as a base. I want to display the images directly from the web. Ie. using urllib to open and read the bytes into memory, rather than go via a file on disk I want to display the images as buttons preferably All examples seems to focus on working on files on disk, rather with just a buffer. The TK documentation in the python standard library doesn't seem to cover the basic Button widget. This seems like an easy task, I have just not had any luck in finding the proper documentation yet.
false
1,356,255
-0.099668
0
0
-1
For displaying jpgs in Python check out PIL
0
7,084
0
5
2009-08-31T07:32:00.000
python,tkinter
Display jpg images in python
0
1
2
1,356,882
1
0
0
I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me. I want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck. I would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me. Thanks in advance for the help! Update: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers. Unfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. This summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular. Sorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!
true
1,359,227
1.2
0
0
18
Allow me to echo what has already been said. I too am a student who just started a Cocoa development project, and at the beginning I thought "Well, I already know Python, I'll just use PyObjC and save myself from having to learn Objective-C, which looks beyond my grasp." I learned quickly that it can't be done. You can develop for OS X without learning Objective-C, but not without learning the Cocoa libraries, which constitute 99% of what you need to learn to write a Cocoa app in Objective-C. Objective-C itself isn't that hard; it's the Cocoa libraries that you need to invest in learning. PyObjC basically uses Cocoa libraries and Python syntax. I gave up with it quickly and decided that if I was going to have to learn Cocoa, I may as well use Objective-C. If you're looking to learn, Aaron Hillegass's book is a good place to start. Good luck!
1
4,914
0
12
2009-08-31T20:19:00.000
python,cocoa,xcode,osx-snow-leopard,pyobjc
PyObjc and Cocoa on Snow Leopard
0
4
6
1,359,605
1
0
0
I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me. I want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck. I would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me. Thanks in advance for the help! Update: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers. Unfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. This summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular. Sorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!
false
1,359,227
0.132549
0
0
4
And as one of the Checkout developers I'll weigh in too (hi Quinn!). From what we've seen PyObjC runs fairly well on Snow Leopard. We've built one of the latest SVN revisions 2.2b with some customizations on Leopard and just moved over the site-packages folder. Theoretically you should be able to use the built in Python/PyObjC (just do import objc, Foundation, AppKit) but as we ship/work with custom versions of both Python and PyObjC I'm not sure what the status exactly is. The mailing list doesn't mention a lot of people having issues (just a few) so that could be a good sign. Good luck with the project, and if you have specific POS questions shoot me an email ;-)
1
4,914
0
12
2009-08-31T20:19:00.000
python,cocoa,xcode,osx-snow-leopard,pyobjc
PyObjc and Cocoa on Snow Leopard
0
4
6
1,359,575
1
0
0
I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me. I want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck. I would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me. Thanks in advance for the help! Update: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers. Unfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. This summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular. Sorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!
false
1,359,227
0.099668
0
0
3
I'm a long time python developer who's been doing iPhone apps for awhile now (and only using my python knowledge to package up build files for the apps in run scripts), then who started making some PyObjC apps. I'd have to say, PyObjC is pretty much STILL having to learn objective C (which I already know via iPhone dev), however you get several pretty cool benefits if you use it instead Easy use of python libraries you know (faster for you) Option to drop it and go to wxPython if styimied by Cocoa Somewhat faster development time (you're writing less code, and the translation between the two languages is pretty darn easy to get used to). Additionally, interface builder is a little tricky to get used to comparatively speaking, but if you're a python dev, it's not like you're exactly used to a functional gui builder anyhow :oP
1
4,914
0
12
2009-08-31T20:19:00.000
python,cocoa,xcode,osx-snow-leopard,pyobjc
PyObjc and Cocoa on Snow Leopard
0
4
6
1,905,283
1
0
0
I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into University. So this is quite important to me. I want to use Python to develop a Cocoa app. I know that I need PyObjc, however all details on the net seem to assume it is pre-installed. Apparently this is the case with Leopard and Snow Leopard but I don't seem to have it on Snow Leopard and never noticed it on Leopard. Also, I have tried installing the latest beta of PyObjc by following the instructions on the Sourceforge page, but with no luck. I would really appreciate it if anyone could shed some light on what needs to be installed, how, and links to any resources or tutorials that could help me. Thanks in advance for the help! Update: I see that this is a popular question, I just got the 'Notable Question' badge for it so I thought I would update anyone coming to this page on what I did after getting the answers. Unfortunately, I wasn't able to use Python to create a Mac application. This was rather disappointing at the time, but probably a good thing. I made a Windows app in C# for my project, it was a tool for creating and running Assembly apps in a simulated environment. My course teacher has now started to use my tool to teach the course instead of his own! I got a very high score on the computing project (over 90%) and this contributed to me getting an A* in my computing A-Level (the highest grade available) and I consequently got in to Southampton University to study Computer Science. This summer, I decided to make an iPad app (soon to be released) and I am glad to say that I know think I could make a Mac OS application in Objective-C as I feel I have learnt enough. I am glad that I took the time to learn it, it is a great language and really useful with iOS becoming so popular. Sorry for all the boasting, but I am really happy about it. What I really want to say is, if you are coming to this page hoping to use PyObjc to create Mac apps easily, don't bother. It takes some time and some effort, but once you have learnt Objective-C, it is really satisfying to create apps with it. Good Luck!
false
1,359,227
0.099668
0
0
3
I hardly use PyObjC myself, but I believe you need to run the Xcode installer on the Snow Leopard DVD in order to use PyObjC. Also, as Quinn said, you will need to understand at least some Objective-C in order to use a Cocoa bridge like PyObjC without tearing your hair out. It just doesn't insulate you that completely.
1
4,914
0
12
2009-08-31T20:19:00.000
python,cocoa,xcode,osx-snow-leopard,pyobjc
PyObjc and Cocoa on Snow Leopard
0
4
6
1,359,428
1
0
0
I want to have a text control that only accepts numbers. (Just integer values like 45 or 366) What is the best way to do this?
true
1,369,086
1.2
0
0
5
IntCtrl, Masked Edit Control, and NumCtrl are all designed to do just this, with different levels of control. Checkout the wx demo under "More Windows/Controls" to see how they work. (Or, if you're instead really looking forward to doing this directly with a raw TextCtrl, I think you'd want to catch EVT_CHAR events, test the characters, and call evt.Skip() if it was an allowed character.)
0
11,475
0
10
2009-09-02T17:27:00.000
wxpython,textctrl
Is it possible to limit TextCtrl to accept numbers only in wxPython?
0
2
7
1,370,281
1
0
0
I want to have a text control that only accepts numbers. (Just integer values like 45 or 366) What is the best way to do this?
false
1,369,086
-0.028564
0
0
-1
Please check "Validator.py" script in wxpython demo. it is exactly what you need
0
11,475
0
10
2009-09-02T17:27:00.000
wxpython,textctrl
Is it possible to limit TextCtrl to accept numbers only in wxPython?
0
2
7
23,052,986
1
0
0
I'm currently working on an application written in C#, which I'm embedding IronPython in. I generally have no problems about it, but there's one thing that I don't know how to deal with. I want to import an external module into the script. How can I do that? Simple import ext_lib doesn't work. Should I add a path to the lib to sys.path? Maybe it is possible to copy the lib's .py file into app directory and import from there? EDIT: I finally chosen another solution - compiled my script with py2exe and I'm just running it from main C# app with Process (without using IronPython). Anyway, thanks for help ;)
false
1,371,994
0.197375
1
0
3
If you have installed IronPython from NuGet packages and you want modules from the CPython Standard Library then the best way to do it is by installing the IronPython.StdLib NuGet package which is from the same authors of IronPython.
1
34,961
0
20
2009-09-03T07:50:00.000
python,import,ironpython
Importing external module in IronPython
0
1
3
67,905,932
1
0
0
I would like to remove border on a gtk.Button and also set its size fixed. How can I accomplish that? My button looks like that: b = gtk.Button() b.set_relief(gtk.RELIEF_NONE) Thanks! p.d: I'm using pygtk
false
1,383,663
-0.099668
0
0
-1
I don't think the EventBox can send button events like "activated" and "clicked".
0
2,081
0
0
2009-09-05T16:01:00.000
python,gtk,pygtk
remove inner border on gtk.Button
0
1
2
1,507,847
1
0
0
I'm developing on Windows, and I've searched everywhere without finding anyone talking about this kind of thing. I made a C++ app on my desktop that embedded Python 3.1 using MSVC. I linked python31.lib and included python31.dll in the app's run folder alongside the executable. It works great. My extension and embedding code definitely works and there are no crashes. I sent the run folder to my friend who doesn't have Python installed, and the app crashes for him during the scripting setup phase. A few hours ago, I tried the app on my laptop that has Python 2.6 installed. I got the same crash behavior as my friend, and through debugging found that it was the Py_Initialize() call that fails. I installed Python 3.1 on my laptop without changing the app code. I ran it and it runs perfectly. I uninstalled Python 3.1 and the app crashes again. I put in code in my app to dynamically link from the local python31.dll, to ensure that it was using it, but I still get the crash. I don't know if the interpreter needs more than the DLL to start up or what. I haven't been able to find any resources on this. The Python documentation and other guides do not seem to ever address how to distribute your C/C++ applications that use Python embedding without having the users install Python locally. I know it's more of an issue on Windows than on Unix, but I've seen a number of Windows C/C++ applications that embed Python locally and I'm not sure how they do it. What else do I need other than the DLL? Why does it work when I install Python and then stop working when I uninstall it? It sounds like it should be so trivial; maybe that's why nobody really talks about it. Nevertheless, I can't really explain how to deal with this crash issue. Thank you very much in advance.
true
1,387,906
1.2
0
0
24
In addition to pythonxy.dll, you also need the entire Python library, i.e. the contents of the lib folder, plus the extension modules, i.e. the contents of the DLLs folder. Without the standard library, Python won't even start, since it tries to find os.py (in 3.x; string.py in 2.x). On startup, it imports a number of modules, in particular site.py. There are various locations where it searches for the standard library; in your cases, it eventually finds it in the registry. Before, uses the executable name (as set through Py_SetProgramName) trying to find the landmark; it also checks for a file python31.zip which should be a zipped copy of the standard library. It also checks for a environment variable PYTHONHOME. You are free to strip the library from stuff that you don't need; there are various tools that compute dependencies statically (modulefinder in particular). If you want to minimize the number of files, you can link all extension modules statically into your pythonxy.dll, or even link pythonxy.dll statically into your application use the freeze tool; this will allow linking the byte code of the standard library into your pythonxy.dll. (alternatively to 2.) use pythonxy.zip for the standard library.
1
11,259
0
23
2009-09-07T06:56:00.000
python,c++,dll,embed
C++ with Python embedding: crash if Python not installed
0
2
4
1,387,977
1
0
0
I'm developing on Windows, and I've searched everywhere without finding anyone talking about this kind of thing. I made a C++ app on my desktop that embedded Python 3.1 using MSVC. I linked python31.lib and included python31.dll in the app's run folder alongside the executable. It works great. My extension and embedding code definitely works and there are no crashes. I sent the run folder to my friend who doesn't have Python installed, and the app crashes for him during the scripting setup phase. A few hours ago, I tried the app on my laptop that has Python 2.6 installed. I got the same crash behavior as my friend, and through debugging found that it was the Py_Initialize() call that fails. I installed Python 3.1 on my laptop without changing the app code. I ran it and it runs perfectly. I uninstalled Python 3.1 and the app crashes again. I put in code in my app to dynamically link from the local python31.dll, to ensure that it was using it, but I still get the crash. I don't know if the interpreter needs more than the DLL to start up or what. I haven't been able to find any resources on this. The Python documentation and other guides do not seem to ever address how to distribute your C/C++ applications that use Python embedding without having the users install Python locally. I know it's more of an issue on Windows than on Unix, but I've seen a number of Windows C/C++ applications that embed Python locally and I'm not sure how they do it. What else do I need other than the DLL? Why does it work when I install Python and then stop working when I uninstall it? It sounds like it should be so trivial; maybe that's why nobody really talks about it. Nevertheless, I can't really explain how to deal with this crash issue. Thank you very much in advance.
false
1,387,906
1
0
0
6
A zip of the Python standard library worked for me with Python27. I zipped the contents of Lib and dll, and made sure there was no additional python27-subfolder or Lib or dll subfolder. i.e. just a zip named python27.zip containing all the files. I copied that zip and the python27.dll alongside the executable.
1
11,259
0
23
2009-09-07T06:56:00.000
python,c++,dll,embed
C++ with Python embedding: crash if Python not installed
0
2
4
9,115,925
1
0
0
How do you embed a vpython plot (animated) within your Qt GUI? so that it has its own display area and would not need to created a new window anymore.
false
1,397,553
0.099668
0
0
1
I contacted maintainer of VPython and he confirmed, that he is not aware of any working solution where Visual is embedded into QT window. That turned me to try VTK and so far I'm pretty happy, no problem with using VTK within PyQT framework.
0
1,265
0
2
2009-09-09T04:40:00.000
python,user-interface,qt
embedding plot within Qt gui
0
1
2
1,414,819
1
1
0
I am using a wxPython wx.html.HtmlWindow to display part of my interface. The user can scroll down a list of links in a window smaller than the list. When they click on a link, I need to repaint the web page, but I want to return the page position back to where they clicked it. I've tried MouseEvent.GetLogicalPosition() on the event, but it wants a DC and the best I've been able to do is get the same information as GetPosition(), so I must not be feeding it the right one. I also tried HtmlWindow.CalcScrolledPosition(), but apparently that isn't available in HtmlWindow because I get a NotImplementedError... What I would like is a scroll position that can be derived from the MouseEvent, or the OnLinkClicked information. I know about HtmlWindow.ScrollToAnchor(), but it's flaky and unaesthetic -- I would prefer to bypass it if possible so that I can scroll back exactly to where the user clicked. Thanks!
false
1,400,179
0
0
0
0
Usually, click events are trigged by MouseUp events. If you track the mouse position by capturing any MouseDown events, you will know where the last click (MouseUp) happened, and that should allow you to reconstruct things. For this particular problem, you might have to do a bit more work in MouseDown like checking if they are within the wxHtmlWindow control and if so, then saving something like a line number.
0
1,216
0
2
2009-09-09T14:45:00.000
python,wxpython
How do I scroll a wxPython wx.html.HtmlWindow back down to where it was when the user clicked a link?
0
1
4
1,579,014
1
0
0
I'm starting to study Python, and for now I like it very much. But, if you could just answer a few questions for me, which have been troubling me, and I can't find any definite answers to them: What is the relationship between Python's C implementation (main version from python.org) and IronPython, in terms of language compatibility ? Is it the same language, and do I by learning one, will be able to smoothly cross to another, or is it Java to JavaScript ? What is the current status to IronPython's libraries ? How much does it lags behind CPython libraries ? I'm mostly interested in numpy/scipy and f2py. Are they available to IronPython ? What would be the best way to access VB from Python and the other way back (connecting some python libraries to Excel's VBA, to be exact) ?
false
1,403,103
1
0
0
18
1) IronPython and CPython share nearly identical language syntax. There is very little difference between them. Transitioning should be trivial. 2) The libraries in IronPython are very different than CPython. The Python libraries are a fair bit behind - quite a few of the CPython-accessible libraries will not work (currently) under IronPython. However, IronPython has clean, direct access to the entire .NET Framework, which means that it has one of the most extensive libraries natively accessible to it, so in many ways, it's far ahead of CPython. Some of the numpy/scipy libraries do not work in IronPython, but due to the .NET implementation, some of the functionality is not necessary, since the perf. characteristics are different. 3) Accessing Excel VBA is going to be easier using IronPython, if you're doing it from VBA. If you're trying to automate excel, IronPython is still easier, since you have access to the Execl Primary Interop Assemblies, and can directly automate it using the same libraries as C# and VB.NET.
0
3,658
0
15
2009-09-10T02:30:00.000
python,excel,vba,ironpython,python.net
Python - IronPython dilemma
0
2
5
1,403,134
1
0
0
I'm starting to study Python, and for now I like it very much. But, if you could just answer a few questions for me, which have been troubling me, and I can't find any definite answers to them: What is the relationship between Python's C implementation (main version from python.org) and IronPython, in terms of language compatibility ? Is it the same language, and do I by learning one, will be able to smoothly cross to another, or is it Java to JavaScript ? What is the current status to IronPython's libraries ? How much does it lags behind CPython libraries ? I'm mostly interested in numpy/scipy and f2py. Are they available to IronPython ? What would be the best way to access VB from Python and the other way back (connecting some python libraries to Excel's VBA, to be exact) ?
false
1,403,103
0.039979
0
0
1
1) The language implemented by CPython and IronPython are the same, or at most a version or two apart. This is nothing like the situation with Java and Javascript, which are two completely different languages given similar names by some bone-headed marketing decision. 2) 3rd-party libraries implemented in C (such as numpy) will have to be evaluated carefully. IronPython has a facility to execute C extensions (I forget the name), but there are many pitfalls, so you need to check with each library's maintainer 3) I have no idea.
0
3,658
0
15
2009-09-10T02:30:00.000
python,excel,vba,ironpython,python.net
Python - IronPython dilemma
0
2
5
1,403,118
1
0
0
I'm using pygame with python 2.6 right now, But I want to use python 3.1.1 instead. The normal pygame only works with 2.x, but the subversion ones work with 3.x I think. But what about pgreloaded? Is that useable yet? The normal pygame actually works with 3.1 too, but not for os x (at least there isn't a download). Does anyone actually use pgreloaded or subversion pygames? So anyway, should I use pygame subversion, pgreloaded, or stick with the current pygame? I don't really care about being compatible with other things or distribution. Thanks! EDIT: Ok, I got rid of python 2.6, installed 3.1, used svn command to get pygame, tried running python3 setup.py, didn't work, changed raw_input in setup.py to input(), worked, now my pygames (that were so simple that they work the same under 2.6 and 3.1) run with python 3.1. :) I didn't get pgreloaded because there's no documentation for it.
true
1,414,258
1.2
0
0
1
Just stick with Python 2.6.
0
1,917
0
3
2009-09-12T04:16:00.000
python,python-3.x,pygame
Should I use pgreloaded? Or subversion of pygame?
0
1
4
1,416,509
1
0
0
I have a computer game I'm working on, and I'm wanting to give the user an option to turn off alpha compositing for speed purposes. Rather than doing checks everywhere, does Pygame have a global option to say "Don't use alpha" such that it would just ignore all my calls to set_alpha and the likes?
true
1,424,734
1.2
0
0
1
Considering the pygame docs I would say "no, there is no global way to disable alpha". However there are at least two 'local' ways to do it: First would be to subclass pygame.Surface and provide your own implementation of set_alpha which in turn could honor your global alpha settings. Second one is a bit more tricky as it depends on the pixel-format in use. To quote the pygame docs: Surface.set_alpha set the alpha value for the whole surface [...] This value is different than the per pixel Surface alpha. If the Surface format contains per pixel alphas, then this alpha value will be ignored. If the Surface contains per pixel alphas, setting the alpha value to None will disable the per pixel transparency. [...] With this you could provide two sets of textures: one with an opaque (per-pixel) alpha channel which will overwrite all your calls to set_alpha() one which has no per-pixel alpha and thus will honor your set_alpha() Hope this will help!
0
570
0
1
2009-09-15T01:49:00.000
python,pygame,alphablending
Turn off Pygame alpha
0
1
2
1,429,443
1
0
0
I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? Thank you very much,
false
1,439,533
0
1
0
0
You can override the library linking with LD_LIBRARY_PATH and make your own exit function. Works fine.
0
1,407
0
7
2009-09-17T15:19:00.000
python,exception,binding,exit
How to catch exit() in embedded C++ module from python code?
0
2
2
8,099,938
1
0
0
I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? Thank you very much,
true
1,439,533
1.2
1
0
7
You must modify the source of the library. There is no "exception handling" in C and exit() does not return to the calling code under any circumstances.
0
1,407
0
7
2009-09-17T15:19:00.000
python,exception,binding,exit
How to catch exit() in embedded C++ module from python code?
0
2
2
1,439,585
1
0
0
I have a wx.TextCtrl that I am using to represent a display with a fixed number of character rows and columns. I would like to hide the vertical scrollbar that is displayed to the right of the text pane since it is entirely unnecessary in my application. Is there a way to achieve this? Also...I would like to hide the blinking cursor that is displayed in the pane. Unfortunately, wx.TextCtrl.GetCaret() is returning None so I cannot call wx.Caret.Hide(). Environment info: Windows XP Python 2.5 wxPython 2.8
true
1,441,502
1.2
0
0
4
How about setting the style wx.TE_NO_VSCROLL for the wx.TxtCtrl?
0
2,839
0
4
2009-09-17T21:47:00.000
python,wxpython,wxtextctrl
Hiding Vertical Scrollbar in wx.TextCtrl
0
1
1
1,442,312
1
0
0
Accelerators on wxPython do not seem to work with nested panels. In other words: ----------------------------------------------- | Main panel | | ----------------- ----------------- | | | Subpanel 1 | | Subpanel 2 | | | | accelerator | | accelerator | | | | key for 'a' | | key for 'b' | | | ----------------- ----------------- | ----------------------------------------------- When a control in subpanel 1 has focus, I want Alt+b to still trigger the control in subpanel 2 that uses b as its accelerator key. How do I do this? If it matters, I'm loading the panel with xrc into a plain old wx.Frame.
false
1,446,672
0
0
0
0
If the main panel has the accelerator table with Alt+b, this should work. Maybe the sub-panels have their own accelerator tables that are conflicting? You might try inactivating these with subpanel.SetAcceleratorTable(wx.NullAcceleratorTable) for each subpanel.
0
336
0
2
2009-09-18T20:28:00.000
wxpython
wxPython, nested panels and accelerators
0
1
1
1,483,678
1
0
0
I'm new to Python and I'm trying to create a simple GUI using Tkinter. So often in many user interfaces, hitting the tab button will change the focus from one Text widget to another. Whenever I'm in a Text widget, tab only indents the text cursor. Does anyone know if this is configurable?
false
1,450,180
-1
0
0
-5
It is really simple in PyQt4 simply use this one single line below and you will be able to change focus by pressing tab button: self.textEdit.setTabChangesFocus(True)
0
13,443
0
15
2009-09-20T03:06:00.000
python,tkinter
Change the focus from one Text widget to another
0
1
3
41,727,157
1
0
0
I'm far from a python expert but I hear this one all the time, about its C/C++ bindings. How does this concept work, and how does Python (and Java) bind to C-based APIs like OpenGL? This stuff has always been a mystery to me.
false
1,475,637
1
0
0
12
Interpreters Written in C89 with Reflection, Who Knew? I have a feeling you are looking for an explanation of the mechanism and not a link to the API or instructions on how to code it. So, as I understand it . . . The main interpreter is typically written in C and is dynamically linked. In a dynamically linked environment, even C89 has a certain amount of reflective behavior. In particular, the dlopen(3) and dlsym(3) calls will load a dynamic (typically ELF) library and look up the address of a symbol named by a string. Give that address, the interpreter can call a function. Even if statically linked, the interpreter can know the address of C functions whose names are compiled into it. So then, it's just a simple matter of having the interpreted code tell the interpreter to call a particular native function in a particular native library. The mechanism can be modular. An extension library for the interpreter, written in the script, can itself invoke the bare hooks for dlopen(3) and dlsym(3) and hook up to a new library that the interpreter never knew about. For passing simple objects by value, a few prototype functions will typically allow various calls. But for structured data objects (imagine stat(2)) the wrapper module needs to know the layout of the data. At some point, either when packaging the extension module or when installing it, a C interface module includes the appropriate header files and in conjunction with handwritten code constructs an interface object. This is why you may need to install something like libsqlite3-dev even if you already had sqlite3 on your system; only the -dev package has the .h files needed to recompile the linkage code. I suppose we could sum this up by saying: "it's done with brute force and ignorance". :-)
0
3,183
0
16
2009-09-25T05:55:00.000
java,python,binding
How do you bind a language (python, for example) to another (say, C++)?
0
1
6
1,475,717
1
0
0
I am trying to display search result data quickly. I have all absolute file paths for files on my network drive(s) in a single, ~50MB text file. The python script makes a single pass over every line in this file [kept on the local drive] in a second or less, and that is acceptable. That is the time it takes to gather results. However, the results are given in a wx.TextCtrl widget. Appending them line by line to a wx TextCtrl would be ridiculous. The best method I have come up with is to write the results to a text file, and call wx.TextCtrl's LoadFile native, which, depending on the number of results, loads the lines of text into the pane in between 0.1 to 5 seconds or so. However there must be a faster way for 10+MB of text inbound. The results are immediately calculated and available in the same process as the GUI... so please, tell me is there any way I can pipe/proxy/hack that data directly into the TextCtrl? Would mmap help this transfer?
false
1,507,075
0
0
0
0
Are people really going to read (or need) all 10MB in a text control? Probably not. Suggest that, you load on demand by paging in portions of the data. Or better still, provide some user search functionality that narrows down the results to the information of interest.
0
1,831
0
0
2009-10-01T23:44:00.000
python,file-io,wxpython,wxwidgets,mmap
wx.TextCtrl.LoadFile()
0
1
2
1,507,087
1