Maybe the topic should be how to put background colors to sizers, but anyway...
could anyone please help me, I need to have "background color for buttons", like in example blue & red, and then using sizers to center buttons... this task would be so easier if only I could set background color for boxsizer =p
so please try to center these buttons with sizers without removing red&blue background
[code=python]...
User Profile
Collapse
-
wxpython: centering buttons with sizer
-
wxpython: "background text" into MDI parent frame
How do I add "background text" into MDI parent frame, the text will be now erased if I move the MDI Parent frame, or I can also erase text with moving MDI Child frame, need to somehow refresh the text, how to do it?
wx.FULL_REPAINT _ON_RESIZE style on MDI parent frame would help a little, but I would also need to call self.Layout() (and I still can erase the text moving child frame over the text...)
[code=python]... -
wxpython - draw lines on image
I'm trying to draw line to an existing image, the problem is that the image doesn't update/refresh itself.
In the example there's one button, but when pressing the button it changes the image but the image doesn't show up, and if I move other windows over my application window it will then refresh my application window and reveals the image.
so what I'm trying to do is animating (moving) a line over existing image ... -
Just use Tkinter's filedialog =)
google tkFileDialog for more dialog types
[code=python]
import tkFileDialog
path_name = tkFileDialog.as ksaveasfilename (title="Save File", filetypes=[("Python Files",".py"),( "All Files",".*")])
print "in the code, save your file to", path_name[/code]... -
wxpython, updating plot (wx.lib.plot)
Hi! I just moved using wxpython so I'm a quite newbie.
I was wondering how to update plotcanvas?
In my code I made button with event to update plotcanvas with new results, but how to properly do it? because now when I press button it makes new "layer" into my GUI and doesn't delete the old plot. Should I first delete the old one and then create new plot, or just update old one, well either way I don't know how to do... -
forget about above ;)
problem solved...
the problem seemed to be with my installer script (NSIS)Leave a comment:
-
windows shortcut & relative pathnames
I have used relative path names in my application:
for example:
logo_image = Image.open("./data/logo.png")
everything has worked fine until now... I have compiled my code into exe and made installer, but if I make shortcut to windows desktop all those relative pathnames doesn't work anymore.
what is a proper way to write path names?
I can't write absolute path names either because... -
using putpixel with Image module could be one solution?
here's one example which reads image and converts all red values which are over 50 to 255 =)
[code=python]
import Image
pic = Image.open("tes t_bmp.bmp")
x_size, y_size = pic.size
for i in range(0,x_size) :
for j in range(0,y_size) :
pixel = pic.getpixel((i ,j)) #get color value in...Leave a comment:
-
instead of
[code=python]
os.popen("Rundl l32.exe SHELL32.dll, OpenAs_RunDLL testfile.pdf")
[/code]
I tried
[code=python]
os.spawnl(os.P_ NOWAIT, os.environ['WINDIR']+"/system32/Rundll32.exe", "Rundll32.e xe SHELL32.DLL, OpenAs_RunDLL testfile.pdf")
[/code]
os.environ['WINDIR'] points to c:/windows or whatever the win installation directory is
...Leave a comment:
-
ok, I have almost solved the problem
[code=python]
try:
os.startfile("t estfile.pdf")
except Expection, errorcode:
if errorcode[0] = 1155:
os.popen("Rundl l32.exe SHELL32.dll, OpenAs_RunDLL testfile.pdf")
else:
print "other error"
[/code]
this works but as you know os.popen stops python code and not resume...Leave a comment:
-
os.startfile and unknown file extension
I need to open PDF file with my python application, and I'm using os.startfile(fi lename.pdf) command, I would need open command act 100% like clicking the file in the windows explorer
python documentation about os.startfile: "Start a file with its associated application. This acts like double-clicking the file in Windows Explorer, or giving the file name as an argument to the start command from the interactive command shell:... -
hmmh, try using pickle module , google for it ;)
pickle the data, which converts it to string and then send it. and the receiver can unpickle it then from the string... I don't have tried pickle but I think that it might work like that...Leave a comment:
-
you should browse some pygame documentation.
does the windows handle the device like joystick type device?
if so, then this might help you http://www.pygame.org/docs/ref/joystick.html...Leave a comment:
-
could you please show us how have you opened this excel form...Leave a comment:
-
[CODE=python].
number = raw_input("Ente r a Number: ")
if number < "1":
print "invalid"
if number > "100":
print "invalid
else:
print "continue"
[/CODE]
instead of if number < "1":
try this if number < 1:
if you use "" it means that it is text not numbers...Leave a comment:
-
Hello hello
[code=python]
import os
os.system("dir" )
[/code]
here's example sending dir command to command prompt :)Leave a comment:
-
I think that you can't tell address who are you listening to, only the port what are you listening and that's enough
when you have received message then you can block it if it's come from wrong ip address...Leave a comment:
-
maybe zipfile module would be good way to start?
http://docs.python.org/lib/zipfile-objects.htmlLeave a comment:
-
hmmh... would it be possible to make invisible frames with events?
maybe I'll put 100hidden frames and put events to them, so Tkinter would then handle actual collision detection
hmmh, maybe that's bad idea... I don't know... :DLeave a comment:
-
Tkinter - Bounding box - mouse cursor collision
I have up to 100data points over 400x400pixel area, when the user would move mouse cursor over one point, the application would detect it and show additional information about it.
I have all x,y coordinates saved in list ready for use
ofcourse the area needed to activate the operation should be bigger than 1x1pixels, something like 5x5pixels maybe.
but if there are 100 of these 5x5 pixel areas, how I'm...
No activity results to display
Show More
Leave a comment: