Forum: Python Jun 15th, 2008 |
| Replies: 2 Views: 591 |
Forum: Python Jun 15th, 2008 |
| Replies: 7 Views: 1,195 I was about to try and help, but then I realised this is Tk. :( |
Forum: Python Jun 13th, 2008 |
| Replies: 2 Views: 448 Press F5 whilst in IDLE.
If you choose to run your code outside IDLE, you'll probably see it flicker and disappear, so you'll need to use command prompt instead. |
Forum: Python Jun 11th, 2008 |
| Replies: 6 Views: 914 Here's my advice: http://www.daniweb.com/forums/thread128350.html
My other advice would be Kubuntu.
But kudos for the LOGOWriter reference. |
Forum: Python Jun 11th, 2008 |
| Replies: 4 Views: 461 You don't use colons or semicolons in Python, normally.
Only use colons for:
if
else
elif
def
class
for
while |
Forum: Python Jun 11th, 2008 |
| Replies: 7 Views: 1,687 IIRC, -1 is the ID of the widget. More here: http://wiki.wxpython.org/wxPython%20Style%20Guide
So you should probably replace -1 with wx.ID_ANY. I'd do that in the tutorial but I can't edit my... |
Forum: Python Jun 11th, 2008 |
| Replies: 7 Views: 1,687 No problem. It's not immediately clear what it means by using event.Skip(), and I only figured it out because the focus issue seemed like what was happening with right-clicking.
I find wxPython... |
Forum: Python Jun 11th, 2008 |
| Replies: 127 Views: 46,324 paulthom had an idea of adding help text to a texbox when the programme loads. The help text just explains what to type in the box and needs to disappear once the user types anything or clicks in the... |
Forum: Python Jun 11th, 2008 |
| Replies: 7 Views: 1,687 If you read the documentation for EVT_LEFT_DOWN (or UP, I suppose, but you should use DOWN really), you'll notice it says this:
http://www.wxpython.org/docs/api/wx.MouseEvent-class.html
Add... |
Forum: Python Jun 11th, 2008 |
| Replies: 7 Views: 1,687 Hahaha, wow. I tried this exact same thing. Actually, I thought about trying it (got as far as using SetValue for the textbox when programme loads), but decided instead to use wx.SearchCtrl.
... |
Forum: Python Jun 11th, 2008 |
| Replies: 3 Views: 512 Don't be discouraged! The Python standard documentation is thorough, and there is much information out there for you.
In future if you're wondering if there's, say, a function to break a string up... |
Forum: Python Jun 10th, 2008 |
| Replies: 3 Views: 613 Because if you need to do a graphical game, I'm not entirely sure you have enough time to learn PyGame.
Although I suppose it'd be very easy to modify chimp.py to suit your needs. |
Forum: Python Jun 10th, 2008 |
| Replies: 2 Views: 670 |
Forum: Python Jun 10th, 2008 |
| Replies: 3 Views: 815 We're up to 2.5 now man.
http://www.python.org/download/releases/2.5.2/ |
Forum: Python Jun 9th, 2008 |
| Replies: 4 Views: 1,082 Might I suggest going through the first few chapter of this e-book? Up to chapter 5 (file IO), at least. It covers things like closing your files after access and stuff. Good luck! :)
... |
Forum: Python Jun 9th, 2008 |
| Replies: 18 Views: 1,509 Phew! I thought you were going to say they don't compile. Cheers. :D |
Forum: Python Jun 9th, 2008 |
| Replies: 4 Views: 1,082 Hi. I cleaned up your code. I didn't put it in a class, but you really should consider it.
import random
def run(money):
global go
try:
bet = int(raw_input("\nPlace your bet:... |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Source code for final programme and hard copy of tutorial:
http://www.mediafire.com/?fwdynnltynj
Also, you might be interested in making an executable version of your programme in Windows. I... |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 The end result: http://img291.imageshack.us/img291/711/finalthingwy1.png
If you have any further inquiries, do a google search, read a few forum threads, and read the documentation for the method... |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Message and file browsing dialogues
The widgets we need are wx.FileDialog and wx.MessageDialog. Now, because we only want it when we go to 'File' -> 'Load' on the menubar, we will actually create... |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Creating dropdown menus
import wx
WINDOW_WIDTH = 400
WINDOW_HEIGHT = 500
class MainFrame(wx.Frame):
"""We've finally added menubars."""
def __init__(self): |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Event handling
import wx
WINDOW_WIDTH = 400
WINDOW_HEIGHT = 500
class MainFrame(wx.Frame):
"""A working programme! Event handling, binding, methods, the lot."""
def __init__(self): |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Putting it in classes
One more thing before event handling... let's make our code more shall we say 'standard':
import wx
# Declare constants in capitals and as global variables at the start... |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Sizers
import wx
"""Example with sizers for dynamic resizing."""
app = wx.App(redirect=False)
window = wx.Frame(None, title = 'Sample GUI App',
pos = (100,100), size =... |
Forum: Python Jun 9th, 2008 |
| Replies: 127 Views: 46,324 Well, here's the tutorial like you asked for. I've expanded on it quite a bit. Could people please read over it, in case I've made mistakes? There's a better version at my blog because it features... |
Forum: Python Jun 9th, 2008 |
| Replies: 18 Views: 1,509 I think so, too. Up to vegasat. |
Forum: Python Jun 8th, 2008 |
| Replies: 7 Views: 1,030 Thanks! That would normally work. Unfortunately, that's not possible. This programme is designed to accept a user's own regular expression, so I have to accept the full range of regular expression... |
Forum: Python Jun 8th, 2008 |
| Replies: 7 Views: 1,030 Actually, it it is looking, acting and sounding like a duck. It's a 1-tuple, so it's still a tuple. Python seems to think a 1-tuple is better expressed simply as the element within the 1-tuple,... |
Forum: Python Jun 8th, 2008 |
| Replies: 7 Views: 1,030 I have a problem guys. It's due to duck typing. Now I expected to run into something like this sooner or later, but I can't help but feel there's a better solution.
import re
def... |
Forum: Python Jun 8th, 2008 |
| Replies: 18 Views: 1,509 I hear you! And I'm not sure what this mysterious 'Pythonic' coding style is, but I suspect it is generally how I intuitively code, due to my first programming experiences being Java's pure OO... |
Forum: Python Jun 8th, 2008 |
| Replies: 7 Views: 1,124 Yes, but as wooee says (though I don't really understand his code), you need to split into a list before you can sort it. I'd personally split it at '\n' and then again at ' ', so you have a list of... |
Forum: Python Jun 7th, 2008 |
| Replies: 7 Views: 1,124 We coved this a few threads down:
http://www.daniweb.com/forums/thread127918.html
Hope that helps. |
Forum: Python Jun 7th, 2008 |
| Replies: 4 Views: 715 I discovered what the problem was, and I will not (can't) fix it. It is the chr(0) character.
... |
Forum: Python Jun 7th, 2008 |
| Replies: 18 Views: 1,509 Sure thing! Glad you liked it.
I'll clean it up tomorrow (or soonish) as there are a few errors and typos, as well as elaborate on some points (such as using multiple horizontal box sizers for... |
Forum: Python Jun 7th, 2008 |
| Replies: 4 Views: 871 Why not just create checkboxes, hide them, and then on the event of a tree node expansion, show the corresponding checkboxes? |
Forum: Python Jun 6th, 2008 |
| Replies: 6 Views: 1,339 I suggest the standard IDLE instead. I found ActivePython lacking in features (dedent region, indent region, comment region, uncomment region) yet containing no new (useful) ones.
As for pasting... |
Forum: Python Jun 6th, 2008 |
| Replies: 4 Views: 871 Care to elaborate... a lot? I mean it'd help if you mentioned what GUI module you're using, for a start. |
Forum: Python Jun 6th, 2008 |
| Replies: 5 Views: 1,401 Maybe you can do something fancy with JPython?
Yep: http://www.jython.org/applets/index.html
You'll need to do some fiddling, but I'm guessing it's much easier than re-writing your code in... |
Forum: Python Jun 6th, 2008 |
| Replies: 4 Views: 715 Cheers mate! That's ace.
Sorry if the OP is a jumble; I haven't had sleep. (I repeated myself about the image grabber script.) |
Forum: Python Jun 6th, 2008 |
| Replies: 5 Views: 1,401 You mean like a Java applet? I'm not sure, but I think if you want to do that you need to learn, well, Java.
It's no small task and Java is specifically designed for the job (among other things)... |