PythonCard/wxPython....or maybe just a python question?


I have an program that Im trying to make minimize itself....capture the screen and then restore itself...... I just dont know how to make it minimize itself and restore itself..... Im using PythonCard to build it if anyone knows a pythoncard or wxpython shortcut to doing it.....but Im am stuck right now....
Posted On: Friday 28th of December 2012 05:25:05 AM Total Views:  172
View Complete with Replies

RELATED TOPICS OF Python Programming PROGRAMMING LANGUAGE




hang in multithreaded program / python and gdb.

Hi I want to debug a locking situation in my program. http://wiki.python.org/moin/DebuggingWithGdb Where do I get binaries for - debug python 2.5 binary/rpm for FC7 Also, the description of the hang is as follows. 2 therads waiting in sem_wait@GLIBC_2.0 ... from PyThread_acquire_lock() 1 thread in _poll from _socketmodule.so. Any ideas what might be going on. (Isnt PyThread_acquire_lock() trying to get the global interpreter lock )
VIEWS ON THIS POST

141

Posted on:

Monday 5th November 2012
View Replies!

Python app as a Display Manager

I asked that question a while back ... and then gave up: I want to write a simple display manager (*nix / X11) in Python. I'm going through lots of documentation as well as the code of XDM. 1) I currently understand that the "X11 Intrinsics" are what I need to master in order to get there. 2) Also, it seems that The Python app needs to adjust to X11 callbacks ... although I will use TKinter or another Framework to actually do the drawing. I feel at this stage that what I miss is: assuming I manage to get a python-based dialog box started automatically from init.rc (instead of xdm, gdm, ...): how do I start an X11 session with the user/pw information retrieved ... + set the correct *nix environment variables. Can you direct me some info / give me a clue Many
VIEWS ON THIS POST

34

Posted on:

Monday 5th November 2012
View Replies!

Conceptualizing Threading

I have a multi-access problem that I'm pretty sure needs to be solved with threading, but I'm not sure how to do it. This will be my first foray into threading, so I'm a little confused by all of the new landscape. So, I'm going to lay out the problem I'm facing and if someone could point me towards a good example of what I need to do, that would be great. I read THE tutorial, and while it made since to me in an esoteric sense, I'm not sure how to implement it. I have a program which will be logging who took what orders. These orders need to have sequential order numbers. SR001001, SR001002, SR001003, etc. Problem is I'm not sure how many people will be accessing this program at the same time. I thought about separating the order number into its own file and the having a function open it, read it, increment it, write it, and close it really quick to limit the chance of two people pulling the same number. Then I heard found threading. So this sounds like a consumer/producer problem, right So I think I need to use a Queue to crank out quote numbers and have the users connect to the queue to get their number. Does that mean I'm looking at two separate programs, a server and a client Where do I separate the programs I was just about to give up and have quote number assignment be manual (with error checking), but I thought I should check here first and see if someone could help me wrap my brain around this problem. You'll never learn if you never try, right
VIEWS ON THIS POST

93

Posted on:

Monday 5th November 2012
View Replies!

[ANN] httpy 1.0a1 -- smooths out WSGI's worst warts

Greetings, program! I'm pleased to announce version 1.0a1 of httpy, middleware to smooth out WSGI's worst warts. With httpy in your stack, you can return a string, or return or raise an httpy.Response object, instead of mucking with start_response and iterables. This version marks a major change of scope for httpy, from WSGI competitor to itty-bitty middleware. I'm late to the party, but it turns out Kool-Aid is still good warm. Help yourself: http://www.zetadev.com/software/httpy/
VIEWS ON THIS POST

64

Posted on:

Monday 5th November 2012
View Replies!

RELEASED Python 2.3.3 (final)

On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.3.3 (final). Python 2.3.3 is a bug-fix release of Python 2.3. A couple of serious bugs related to weakrefs and the cyclic garbage collector have been fixed, along with a number of bugs in the standard library. See the release notes on the web page for more details. For more information on Python 2.3.3, including download links for various platforms, release notes, and known issues, please see http://www.python.org/2.3.3 Highlights of this new release include: - A couple of serious bugs in the interactions of weakrefs and cyclic GC have been squashed. - At shutdown, the second call to the cyclic garbage collector has been removed. This caused more problems than it solved. - The xml.parsers.expat module now provides Expat 1.95.7. - Bug #823328: urllib2's HTTP Digest Auth support works again. - See http://www.python.org/2.3.3/NEWS.html for other bugfixes. Highlights of the previous major Python release (2.3) are available from the Python 2.3 page, at http://www.python.org/2.3/highlights.html Enjoy the new release, Anthony Anthony Baxter anthony@python.org Python 2.3.x Release Manager (on behalf of the entire python-dev team) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Exmh version 2.5 01/15/2001 iD8DBQE/46/5Dt3F8mpFyBYRApZCAJ44WMEgJirqba0Fc3Dt2l1rYdopPQCgpaLy Kr0IlcKrARqMmDa7bX6/yLQ= =sNpV -----END PGP SIGNATURE-----
VIEWS ON THIS POST

62

Posted on:

Monday 5th November 2012
View Replies!

re.search much slower then grep on some regular expressions

What can be the cause of the large difference between re.search and grep This script takes about 5 min to run on my computer: #!/usr/bin/env python import re row="" for a in range(156000): row+="a" print re.search('[^ "=]*/',row) While doing a simple grep: grep '[^ "=]*/' input (input contains 156.000 a in one row) doesn't even take a second. Is this a bug in python
VIEWS ON THIS POST

127

Posted on:

Wednesday 7th November 2012
View Replies!

sharding research with pyshards

If anyone is interested in sharding or horizontal partitioning, I've started an open source project on Google Code with the intent of building a general purpose sharding framework for python using MySQL. If you have an interest in this area of research, please come on over and get involved. http://code.google.com/p/pyshards/ Devin Venable
VIEWS ON THIS POST

81

Posted on:

Wednesday 7th November 2012
View Replies!

As I promised couple of day a go

When we discuss a global window events. and i wanted to generate event when the user click on a key out of my application. I promised that if will found how to do it i'l show you. I found this article which explain very simply how to hook py width pyHook lib http://mindtrove.info/articles/monit...t-with-pyhook/ now the following code combine between wxpython and phHook. I know this code probably looks not efficient and unorganized. I'm really new width this stuff, but it works fine. before you try it you better install the pyHook from the following link http://mindtrove.info/articles/monit...t-with-pyhook/ *note theirs an image url you would have to edit in order for it to be work #!/usr/bin/python # menu1.py import wx import wx.html as html import pythoncom, pyHook class MyFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(400, 400)) self.SetBackgroundColour('#fef9d8') panel= wx.Panel(self, -1, style=wx.SIMPLE_BORDER, size=(400, 100)); aaa= html.HtmlWindow(panel, -1, style=wx.SIMPLE_BORDER, size=(250, 60)) aaa.LoadPage('aa.html') cnrl=wx.TextCtrl(aaa, 11, '', (20, 20), (120, 20)) wx.Button(aaa, 12, "Translate", (160, 19)) self.Bind(wx.EVT_BUTTON, self.OnClick, id=12) quite = wx.BitmapButton(panel, 20, wx.Bitmap('py/x.gif'),(370, 0), (20, 20), style=wx.ALIGN_RIGHT ) self.Bind(wx.EVT_BUTTON, self.Yehuda, id=20) self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) self.SetFocus() font1= wx.Font(12, wx.NORMAL, wx.NORMAL, wx.BOLD) font2=wx.Font(10, wx.NORMAL, wx.NORMAL, wx.NORMAL) text1=wx.StaticText(panel, 15, "" ,(30, 70) , style=wx.ALIGN_CENTRE) text1.SetFont(font1) text2=wx.StaticText(panel, -1, "Peace, By, Good by", (30, 100), style=wx.ALIGN_CENTRE ) text2.SetFont(font2) self.Show() self.Centre() def Yehuda(self, event): self.Hide() def OnKeyDown(self, event): keycode = event.GetKeyCode() if keycode == wx.WXK_ESCAPE: ret = wx.MessageBox('Are you sure to quit', 'Question', wx.YES_NO | wx.NO_DEFAULT, self) if ret == wx.YES: self.Close() event.Skip() def OnClick(self,event): text1.SetLabel(cnrl.GetValue()) def OnPaint(self, event): dc = wx.PaintDC(frame) dc.DrawBitmap(frame.bitmap, 20, 20) class MyTaskBarIcon(wx.TaskBarIcon): def __init__(self, frame): wx.TaskBarIcon.__init__(self) self.frame = frame self.SetIcon(wx.Icon('menu1.png', wx.BITMAP_TYPE_PNG)) self.Bind(wx.EVT_MENU, self.OnTaskBarActivate, id=1) self.Bind(wx.EVT_MENU, self.OnTaskBarDeactivate, id=2) self.Bind(wx.EVT_MENU, self.OnTaskBarClose, id=3) #self.frame.Bind(wx.EVT_CLOSE, self.OnClose) def CreatePopupMenu(self): menu = wx.Menu() menu.Append(1, 'Show') menu.Append(2, 'Hide') menu.Append(3, 'Close') return menu def OnTaskBarClose(self, event): self.frame.Close() def OnTaskBarActivate(self, event): if not self.frame.IsShown(): self.frame.Show() def OnTaskBarDeactivate(self, event): if self.frame.IsShown(): self.frame.Hide() def OnKeyboardEvent(event): global x, frame, frame2 if event.KeyID == 162: if x==1: frame.Close() frame2= MyFrame(None, -1, 'frame') x=0 else: frame2.Close() frame= MyFrame(None, -1, 'frame2') x=1 x=1 app = wx.App() frame = MyFrame(None, -1, 'Babylon') frame.tskic = MyTaskBarIcon(frame) frame.Show(True) app.SetTopWindow(frame) hm = pyHook.HookManager() hm.KeyDown = OnKeyboardEvent hm.HookKeyboard() pythoncom.PumpMessages() app.MainLoop()
VIEWS ON THIS POST

28

Posted on:

Wednesday 7th November 2012
View Replies!

giving imp.load_module not a real file, HOW?

I am running into a problem with the python interpreter's internals. For some reason imp.load_module insists on getting a real open file as the second parameter. I have not able to fool it with stringIO or overloaded file objects. So now I have two questions: 1) why does load_module insist on a real file 2) is there a way around it that does not involve (say) tempfile Paul
VIEWS ON THIS POST

144

Posted on:

Wednesday 7th November 2012
View Replies!

Re: gdbm objects not iterable?

Laszlo Nagy wrote: > >>> E.g. I would not allow to change the keys of the gdbm object during >>> iteration. I'm not sure how to detect "end of iteration" though. >>> >>> (Maybe I misunderstood your question.) >>> >>> >> I meant was that it's essential to trap this condition. >> > Dictionary size change is easy to detect between two iterations. > Detecting key changes is more difficult but not hard (with a "last > modified" timestamp/counter maybe). > > These would not work when there are multiple threads iterating over the > same gdbm object. I believe I should not do this without locking. (How > it is implemented in Python with dicts What happens if I iterate > through a dict in one thread, and modify it from another thread) > Why don't you try it and see ... (this is just a sneaky way of saying "beats me"...( > I'm just glad that my idea was not rejected instantly. :-) > It seems much more sensible than many of the proposals seen on this list. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden Sorry, the dog ate my .sigline
VIEWS ON THIS POST

58

Posted on:

Wednesday 7th November 2012
View Replies!

RE: Setting Current Dir in Python

Tim and Gabriel, Thank you so much. I was able to find and remove the special character from the line below and another one after it. The error has now gone away.
VIEWS ON THIS POST

85

Posted on:

Wednesday 7th November 2012
View Replies!

Compiling python2.5 on IBM AIX

hi, I'm trying to make a local install of python 2.5 on AIX and I'm getting some trouble with _curses. Here is how I tried to compile it : export BASE=/usr/local/python251 cd Python.2.5.1 ../configure --prefix=${BASE}/\ LDFLAGS="-L\${BASE}/lib/"\ PPFLAGS="-I\${BASE}/include/"\ make make test make altinstall and the compilation stop with the following pb : ld: 0711-317 ERROR: Undefined symbol: _unctrl ld: 0711-317 ERROR: Undefined symbol: .__fixsfsi ld: 0711-317 ERROR: Undefined symbol: .setsyx ld: 0711-317 ERROR: Undefined symbol: ._setqiflush ld: 0711-317 ERROR: Undefined symbol: .initscr32 ld: 0711-317 ERROR: Undefined symbol: wacs_map ld: 0711-317 ERROR: Undefined symbol: ._getsyx ld: 0711-317 ERROR: Undefined symbol: .getattrs ld: 0711-317 ERROR: Undefined symbol: .w32attrset ld: 0711-317 ERROR: Undefined symbol: .w32insch ld: 0711-317 ERROR: Undefined symbol: .p32echochar ld: 0711-317 ERROR: Undefined symbol: .w32echochar ld: 0711-317 ERROR: Undefined symbol: .box32 ld: 0711-317 ERROR: Undefined symbol: .w32addch ld: 0711-317 ERROR: Undefined symbol: .w32attroff ld: 0711-317 ERROR: Undefined symbol: .w32attron ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. *** WARNING: renaming "_curses" since importing it failed: No such file or directory error: No such file or directory make: 1254-004 The error code from the last command is 1. Stop. I've compiled ncurses-5.6 in ${BASE}/lib but this haven't solved the pb. Any clue Best regards -- BL
VIEWS ON THIS POST

135

Posted on:

Saturday 10th November 2012
View Replies!

Python training in Colorado, Oct 7-9

I am holding another 3-day Python class in Longmont, Colorado, on October 7-9. This is a public class, open to individual enrollments, and covers the same topics as the on-site classes I teach. For more details, please see this page: ...
VIEWS ON THIS POST

22

Posted on:

Saturday 10th November 2012
View Replies!

Finding tcltk when building Python on Windows

I'm trying to build Python on Windows using Visual Studio 2005. I have no trouble compiling tcl/tk 8.5, but when I subsequently build Python it doesn't find tcl/tk (I get a message about being unable to find tcl.h). I'm ...
VIEWS ON THIS POST

65

Posted on:

Sunday 11th November 2012
View Replies!

grin 1.1

grin is a new grep-like tool for recursively searching through text files, primarily source code. Download: http://pypi.python.org/pypi/grin Wiki: https://svn.enthought.com/enthought/wiki/Grin SVN: https://svn.enthought.com/svn/sandbox/grin/trunk Basically, it does exactly what I want grep to do 99% of the time with the least amount of ...
VIEWS ON THIS POST

94

Posted on:

Sunday 11th November 2012
View Replies!

property() usage - is this as good as it gets?

I want to manage and control access to several important attributes in a class and override the behaviour of some of them in various subclasses. Below is a stripped version of how I've implemented this in my current bit ...
VIEWS ON THIS POST

52

Posted on:

Sunday 25th November 2012
View Replies!

Re: Trying ZODB, background in Relational: mimic auto_increment?

On Thu, 14 Aug 2008 16:15:11 +0200, "Diez B. Roggisch" wrote: >Jean-Paul Calderone wrote: > >> On Thu, 14 Aug 2008 05:22:35 -0700 (PDT), Phillip B Oldham >> wrote: >>> [snip] >>> >>>How would one assign a unique ...
VIEWS ON THIS POST

108

Posted on:

Sunday 25th November 2012
View Replies!

RE: Extract string from log file

from each line separate out url and request parts. split the request into key-value pairs, use urllib to unquote key-value pairs......as show below... import urllib line = "GET /stat.gifstat=v&c=F-Secure&v=1.1%20Build%2014231&s=av%7BNorton%20360%20%28Symantec%20Corporation%29+69%3B%7Dsw%7BNorton%20360%20%28Symantec%20Corporation%29+69%3B%7Dfw%7BNorton%20360%20%28Symantec%20Corporation%29+5%3B%7Dv%7BMicrosoft%20Windows%20XP+insecure%3BMicrosoft%20Windows%20XP%20Professional+f%3B26027%3B26447%3B26003%3B22452%3B%7D&r=0.9496 HTTP/1.1" words = line.split() for word in words: if word.find('') >= ...
VIEWS ON THIS POST

30

Posted on:

Sunday 25th November 2012
View Replies!

ANN: decorator 2.3

The decorator module is a library written with the purpose of simplifying your life with decorators. It is now more than three years old and it is used in many Python frameworks (more than I know of). Release 2.3 adds ...
VIEWS ON THIS POST

39

Posted on:

Sunday 25th November 2012
View Replies!

Genital Hair Removal

Skin Care Keep those wrinkles away http://medical-beuaty.blogspot.com/2...kles-away.html Laser Hair Removal - What You Need To Know http://medical-beuaty.blogspot.com/2...u-need-to.html Laser Hair Removal Parlors In The City Of Toronto http://medical-beuaty.blogspot.com/2...n-city-of.html Genital Hair Removal http://medical-beuaty.blogspot.com/2...r-removal.html Bikini Line Hair Removal The Easy Way http://medical-beuaty.blogspot.com/2...-easy-way.html 7 ...
VIEWS ON THIS POST

38

Posted on:

Sunday 25th November 2012
View Replies!

Scripting SAP GUI (Windows)

I need to script SAP GUI running on MS-Windows: Open SAP GUI window, if it is not already open, and then batch input some keystrokes. The following solutions were found by google: - autohotkey: not preferred, since it has ...
VIEWS ON THIS POST

39

Posted on:

Sunday 25th November 2012
View Replies!

Using the backing store with mmap

According to the mmap.mmap 2.5 documentation, "Changed in version 2.5: To map anonymous memory, -1 should be passed as the fileno along with the length." I would like to use shared memory to communicate between two processes that otherwise have ...
VIEWS ON THIS POST

78

Posted on:

Sunday 25th November 2012
View Replies!

Trying to Learn Packages

I'm making a project into my first package, mainly for organization, but also to learn how to do it. I have a number of data files, both experimental results and PNG files. My project is organized as a root ...
VIEWS ON THIS POST

24

Posted on:

Sunday 25th November 2012
View Replies!

Re: How to covert ASCII to integer in Python?

Skonieczny, Chris wrote: > YOU SHOULD REMOVE or CORRECT YOUR POST here: > http://mail.python.org/pipermail/pyt...ry/427841.html > > It is not true - eg. try : > a='P' # P is ASCII , isn't it > b=int(a) > and what you ...
VIEWS ON THIS POST

45

Posted on:

Sunday 25th November 2012
View Replies!

Re: PIL and IPTC

On 4/30/08, Jumping Arne (arnlen@mac.com) wrote: >I'm completely new to PIL and I'm trying to read IPTC info, I understand that >it's possible but I can't find out how (and for once Google doesn't seem to >be able to help). ...
VIEWS ON THIS POST

38

Posted on:

Sunday 25th November 2012
View Replies!

newbie question

I'm working with the HTMLParser module and have implemented HTMLParser.handle_starttag() and I see there is a separate handle_data method (which can be implemented), but I am not clear how to tie this together with a given start tag, so I ...
VIEWS ON THIS POST

58

Posted on:

Sunday 25th November 2012
View Replies!

Excel Manipulation using Python

I was trying to delete rows in an existing .xls file using python. How do I do that I was using the following code, it seem to work if I type in python window, but if I save it in ...
VIEWS ON THIS POST

120

Posted on:

Sunday 25th November 2012
View Replies!

sampling without replacement

Greetings -- I am doing a sampling without replacement, taking out random elements from an array. The picked element is then removed from the array. When my arrays were on the order of 10,000 elements long, everything was fast. But ...
VIEWS ON THIS POST

72

Posted on:

Sunday 25th November 2012
View Replies!

segmentation fault when executing PyImport_ImportModule("sys")

Since some time I get the following segmentation fault in an application which used to work fine until recently. I made a backtrace but couldn't find the reason for the segmentaion fault until now. In the hope that somebody ...
VIEWS ON THIS POST

61

Posted on:

Sunday 25th November 2012
View Replies!

xlrd and cPickle.dump

Hi all, I have to work with a very large excel file and I have two questions. First, the documentation says that cPickle.dump would be the best way to work with it. However, I keep getting: Traceback (most recent call ...
VIEWS ON THIS POST

47

Posted on:

Sunday 25th November 2012
View Replies!

Re: Is subprocess.Popen completely broken?

Skip Montanaro wrote: >>> >>> proc = subprocess.Popen ("ls /tmp") >>> >> proc = subprocess.Popen ("ls /tmp", shell=True) >> >> or >> >> proc = subprocess.Popen (["ls", "/tmp"]) >> >> should work. >> > > Why should I need to ...
VIEWS ON THIS POST

57

Posted on:

Sunday 25th November 2012
View Replies!

distutils crashing: $MACOSX_DEPLOYMENT_TARGET mismatch

Hi group, When starting a distutils script (which I mostly consider as a black box) distutils crashes with the following traceback: Traceback (most recent call last): File "pyrexcompile.py", line 50, in cmdclass = {'build_ext': build_ext}) File "/sw/lib/python2.5/distutils/core.py", line 125, ...
VIEWS ON THIS POST

45

Posted on:

Sunday 25th November 2012
View Replies!

Get cgi script to begin execution of another script...

I've posted something similar to this already, but now I'm more sure of what I'm asking. Basically I've a CGI script, that when executed by the user, I want to call another script that does a very long running task ...
VIEWS ON THIS POST

57

Posted on:

Sunday 25th November 2012
View Replies!

metaclasses

What are metaclasses...
VIEWS ON THIS POST

59

Posted on:

Sunday 25th November 2012
View Replies!

using scons as a library

I've been reading up on the SCons build tool. It's intended to work by the end-user calling 'scons' on a buildscript. However, I'd like to use it from my own python project as an imported module, and have my ...
VIEWS ON THIS POST

147

Posted on:

Sunday 25th November 2012
View Replies!

Re: very simple Genetic Algorithm completed

> Another interesting technique, similar to GA, is SA or Simulated > Annealing. You should be able to adapt your quickga.py program to an > SA approach without too much trouble, and comparing the two should > tickle your academic ...
VIEWS ON THIS POST

32

Posted on:

Sunday 25th November 2012
View Replies!

Encryption Recommendation

- I'm still using Python 2.4. In my code, I want to encrypt a password and at another point decrypt it. What is the standard way of doing encryption in python Is it the Pycrypto module Roger...
VIEWS ON THIS POST

25

Posted on:

Sunday 25th November 2012
View Replies!

Re: finding child cpu usage of a running child

had to say, that subject conjoured up an interesting image in my head This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and ...
VIEWS ON THIS POST

91

Posted on:

Sunday 25th November 2012
View Replies!

Re: Another dumb scope question for a closure.

Ben Fisher wrote: > One way to get this to work is: > > def inc(jj): > def dummy(jj = jj): > jj = jj + 1 > return jj > return dummy > > h = inc(33) > print ...
VIEWS ON THIS POST

84

Posted on:

Monday 26th November 2012
View Replies!

introspection question

Hi Guys, What would be the simplest way of enumerating all methods and members (including inherited) of a given object Thank you. Alex...
VIEWS ON THIS POST

35

Posted on:

Monday 26th November 2012
View Replies!

Re: Memory Leaks and Heapy

Jeroen Ruigrok van der Werven wrote: > Aside from that (rant), I seriously dislike Python's memory management and > even more the fairly arcane ways people have to go about > debugging/troubleshooting some 600 MB to 2-3 GB(!) of resident ...
VIEWS ON THIS POST

38

Posted on:

Monday 26th November 2012
View Replies!

Re: which configparse?

Martin Marcher wrote: > > > On 12/6/07, Neal Becker wrote: >> configparse looks like what I want, but it seems last commit was >2years >> ago. >> >> What is the best choice > > that seems ...
VIEWS ON THIS POST

39

Posted on:

Monday 26th November 2012
View Replies!

Re: securing a python execution environment...

Alberto Berti wrote: > maybe using import hooks > > http://www.python.org/dev/peps/pep-0302/ > > I don't think so. Anyone can hook the import statement. And this is just one reason. Some objects are built in. For example, file(). How can you ...
VIEWS ON THIS POST

53

Posted on:

Monday 26th November 2012
View Replies!

wxPython Help

I've got several questions about wxPython, and I'm trying my best to solve them all myself. So, for now, I'll just start with a basic question I've been trying to figure out myself. How do I make a flat button The darker ones that you can not click I have tried... (Toggle Plain Text) but_cancel = wx.Button(panel, ID_CANCEL, "Cancel", style=wxNO_BORDER ) but_cancel = wx.Button(panel, ID_CANCEL, "Cancel", style=wxNO_BORDER )
VIEWS ON THIS POST

83

Posted on:

Tuesday 27th November 2012
View Replies!

Breaking?

why not just: (Toggle Plain Text) import sys #some code if foo == 'ja': print 'stuff' sys.exit(0) #some more code import sys #some code if foo == 'ja': print 'stuff' sys.exit(0) #some more code
VIEWS ON THIS POST

36

Posted on:

Tuesday 27th November 2012
View Replies!

Python Contest #2

- Hall of Fame - sykkn - 76 Points - Gold Medal thechristelegacy - 72 Points - Silver Medal al1986 - 68 Points - Bronze Medal Sane - 64 Points Ooble - 51 Points - Rules - Contest closes next Sunday. Use whatever resources you want, just don't post the answers here. PM them to me and I'll update the standings ASAP. You can send in as many submissions as you wish. - Challenge - This is a bit trickier, as I want a definitely replicated result, no room for fluxuations on the output. The winner will be the one with the least amount of lines, but a tie breaker will be decided by the number of characters. (Toggle Plain Text) (1) 6 Even (2) 0 Even (3) 5 Odd (4) 0 Even (5) 4 Even (6) 9 Odd (7) 8 Even (8) 9 Odd (9) 4 Even (10) 4 Even Average: 4.9 Odd (1) 6 Even (2) 0 Even (3) 5 Odd (4) 0 Even (5) 4 Even (6) 9 Odd (7) 8 Even (8) 9 Odd (9) 4 Even (10) 4 Even Average: 4.9 Odd
VIEWS ON THIS POST

39

Posted on:

Tuesday 27th November 2012
View Replies!

Can anyone help me with this code?

I know this problem will be stupidly easy to solve, but I am a beginner and I can't find any reason for it. The program is supposed to be a character creator program. The math and input works fine. And gives the user a certain number of points to use on 4 different attributes. But for some reason, when you choose to add to strength, it adds the points to it, but sends you back to the home menu. While with the other attributes, it just repeats the last menu shown. It's not real important to the project, but it just bugs the hell out of me. Any help is appreciated. (Toggle Plain Text) print("Welcome to the Character Creator Program!") name = input("Enter your name: ") points = 30 print("Your points pool is ", points, ".") choice = None strength = 0 health = 0 wisdom = 0 dexterity = 0 while choice != "0": print( """ 0 - Quit 1 - Add points 2 - Remove points 3 - Show Stats 4 - Help """ ) choice = input("Choice: ") print() if choice == "0": print("Bye.") elif choice == "1": choice2 = None while choice2 != "0": print( """ 0 - Strength 1 - Health 2 - Wisdom 3 - Dexterity 4 - Back """ ) choice2 = input("Choice: ") print() if choice2 == "0": number = int(input("Enter number: ")) strength += number points -= number if points < 0: strength -= number points += number if strength > 30: strength -= number print( """ You have either entered a number that exceeds your maximum point limit Try removing points to add more to this. """) print("Your Strength is: ",strength) print("Your points pool is: ",points) elif choice2 == "1": number = int(input("Enter number: ")) health += number points -= number if points < 0: health -= number points += number if health > 30: health -= number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Health is: ",health) print("Your points pool is: ",points) elif choice2 == "2": number = int(input("Enter number: ")) wisdom += number points -= number if points < 0: wisdom -= number points += number if wisdom > 30: wisdom -= number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Wisdom is: ",wisdom) print("Your points pool is: ",points) elif choice2 == "3": number = int(input("Enter number: ")) dexterity += number points -= number if points < 0: dexterity -= number points += number if dexterity > 30: dexterity -= number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Dexterity is: ",dexterity) print("Your points pool is: ",points) elif choice2 == "4": break elif choice == "2": choice3 = None while choice3 != "0": print( """ 0 - Strength 1 - Health 2 - Wisdom 3 - Dexterity 4 - Back """ ) choice3 = input("Choice: ") print() if choice3 == "0": number = int(input("Enter number: ")) strength -= number points += number if points > 30: strength += number points -= number if strength < 0: strength += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Strength is: ",strength) print("Your points pool is: ",points) elif choice3 == "1": number = int(input("Enter number: ")) health -= number points += number if points > 30: health += number points -= number if health < 0: health += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Health is: ",health) print("Your points pool is: ",points) elif choice3 == "2": number = int(input("Enter number: ")) wisdom -= number points += number if points > 30: wisdom += number points -= number if wisdom < 0: wisdom += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Wisdom is: ",wisdom) print("Your points pool is: ",points) elif choice3 == "3": number = int(input("Enter number: ")) dexterity -= number points += number if points > 30: dexterity += number points -= number if dexterity < 0: dexterity += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Dexterity is: ",dexterity) print("Your points pool is: ",points) elif choice3 == "4": break elif choice == "3": print("Your name is",name) print("Your Strength is",strength) print("Your Health is",health) print("Your Wisdom is",wisdom) print("Your Dexterity is",dexterity) print("Your Points Pool is",points) elif choice == "4": print( """ If you choose a menu option by mistake, enter four '4'. If you choose a attribute by mistake, enter zero '0'. """) print("Welcome to the Character Creator Program!") name = input("Enter your name: ") points = 30 print("Your points pool is ", points, ".") choice = None strength = 0 health = 0 wisdom = 0 dexterity = 0 while choice != "0": print( """ 0 - Quit 1 - Add points 2 - Remove points 3 - Show Stats 4 - Help """ ) choice = input("Choice: ") print() if choice == "0": print("Bye.") elif choice == "1": choice2 = None while choice2 != "0": print( """ 0 - Strength 1 - Health 2 - Wisdom 3 - Dexterity 4 - Back """ ) choice2 = input("Choice: ") print() if choice2 == "0": number = int(input("Enter number: ")) strength += number points -= number if points < 0: strength -= number points += number if strength > 30: strength -= number print( """ You have either entered a number that exceeds your maximum point limit Try removing points to add more to this. """) print("Your Strength is: ",strength) print("Your points pool is: ",points) elif choice2 == "1": number = int(input("Enter number: ")) health += number points -= number if points < 0: health -= number points += number if health > 30: health -= number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Health is: ",health) print("Your points pool is: ",points) elif choice2 == "2": number = int(input("Enter number: ")) wisdom += number points -= number if points < 0: wisdom -= number points += number if wisdom > 30: wisdom -= number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Wisdom is: ",wisdom) print("Your points pool is: ",points) elif choice2 == "3": number = int(input("Enter number: ")) dexterity += number points -= number if points < 0: dexterity -= number points += number if dexterity > 30: dexterity -= number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Dexterity is: ",dexterity) print("Your points pool is: ",points) elif choice2 == "4": break elif choice == "2": choice3 = None while choice3 != "0": print( """ 0 - Strength 1 - Health 2 - Wisdom 3 - Dexterity 4 - Back """ ) choice3 = input("Choice: ") print() if choice3 == "0": number = int(input("Enter number: ")) strength -= number points += number if points > 30: strength += number points -= number if strength < 0: strength += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Strength is: ",strength) print("Your points pool is: ",points) elif choice3 == "1": number = int(input("Enter number: ")) health -= number points += number if points > 30: health += number points -= number if health < 0: health += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Health is: ",health) print("Your points pool is: ",points) elif choice3 == "2": number = int(input("Enter number: ")) wisdom -= number points += number if points > 30: wisdom += number points -= number if wisdom < 0: wisdom += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Wisdom is: ",wisdom) print("Your points pool is: ",points) elif choice3 == "3": number = int(input("Enter number: ")) dexterity -= number points += number if points > 30: dexterity += number points -= number if dexterity < 0: dexterity += number print( """ You have entered a number that exceeds your maximum point limit. Try removing points to add more to this. """) print("Your Dexterity is: ",dexterity) print("Your points pool is: ",points) elif choice3 == "4": break elif choice == "3": print("Your name is",name) print("Your Strength is",strength) print("Your Health is",health) print("Your Wisdom is",wisdom) print("Your Dexterity is",dexterity) print("Your Points Pool is",points) elif choice == "4": print( """ If you choose a menu option by mistake, enter four '4'. If you choose a attribute by mistake, enter zero '0'. """)
VIEWS ON THIS POST

51

Posted on:

Wednesday 28th November 2012
View Replies!

Only in python!

I apologise. Not fifty years ago, then. I think though that my point that it was around long* before Python still stands. *to within a certain definition of 'long'
VIEWS ON THIS POST

57

Posted on:

Wednesday 28th November 2012
View Replies!

Pygame Key Input

How can I clear the que of buttons pressed, so not to accidently hit enter for something that the user hasn't even seen yet I'm using: for event in pygame.event.get():
VIEWS ON THIS POST

69

Posted on:

Wednesday 28th November 2012
View Replies!

Recursion: yield vs. return

I have been learning Python for a while now. I was browsing old posts in this forum and stumbled across this thread in which Arevos posted the following code: (Toggle Plain Text) def permutations(x): if len(x)
VIEWS ON THIS POST

76

Posted on:

Friday 28th December 2012
View Replies!