From kbk at shore.net Tue Jun 1 20:48:16 2004 From: kbk at shore.net (Kurt B. Kaiser) Date: Tue Jun 1 20:48:20 2004 Subject: [Idle-dev] Python 2.3 IDLE is randomly freezing. In-Reply-To: <20040519172651.GA2509@neutron> (Markus Ingvarsson's message of "Wed, 19 May 2004 19:26:51 +0200") References: <20040509124430.GA1412@neutron> <87n04673a0.fsf@hydra.localdomain> <20040519172651.GA2509@neutron> Message-ID: <87n03mg4z3.fsf@hydra.localdomain> Markus Ingvarsson writes: >> Sounds like a Tk problem in the Sid environment. Try setting up a >> Tk text widget without using IDLE and see if you can reproduce the >> problem. > > I created a window with just a textbox in it and pressed a key for > quite some time, erased and typing randomly, it didn't hang. IDLE > usually hangs after a few seconds if I do this. > > I say _usually_ because I've been trying different ways to provoke the > bug. > > If I open a new window (no syntax highlighting), I can type for all I > care without it hanging. But in PyShell or when editing a file > (syntax highlighting), it hangs sooner or later - especially when > holding a key pressed for a while. OK, so you are narrowing it down to a Tk problem which shows up when using tags. Keep at it! (It's getting to be more work, now :) Thanks, -- KBK From kbk at shore.net Tue Jun 1 20:54:22 2004 From: kbk at shore.net (Kurt B. Kaiser) Date: Tue Jun 1 20:54:25 2004 Subject: [Idle-dev] IDLE Backspace not working correctly in Win2000 In-Reply-To: (Jason Hopkins's message of "Tue, 25 May 2004 10:20:17 -0500") References: Message-ID: <87iseag4ox.fsf@hydra.localdomain> "Hopkins, Jason (MED, GEMS-IT)" writes: > I am running IDLE 1.0.2 & Python 2.3.3 in Win2000 and XP. On my XP box I > don't have any problems, but in Win2000 when I hit backspace or when I hit > Enter to start a new line a small square box appears. When I hit backspace > the letter to the left becomes a box and then I'm set back to the same > position I was when I started. Looks like this: > >>>> backspace >>>> backspac > > The hex is 08, so it looks like a backspace, but I don't know why it doesn't > work. > > Return creates a new line then puts a box on that line. It's hex is 0d, so > it looks like a newline, again, I don't understand why this works on XP, but > not on my 2k box. Man, I don't know. IDLE works OK on my W2K and XP boxes. All your other apps are OK? How about creating a Tk text widget without using IDLE and see how that functions? -- KBK From dooms at info.ucl.ac.be Mon Jun 14 04:29:40 2004 From: dooms at info.ucl.ac.be (=?ISO-8859-1?Q?Gr=E9goire_Dooms?=) Date: Mon Jun 14 04:31:02 2004 Subject: [Idle-dev] Re: Feature request, evaluate an expression when stopped at a breakpoint Message-ID: <40CD61F4.6020602@info.ucl.ac.be> Sorry for multiple posts, but the original mail has been retained by moderator, I got no news from it and I could not delete it. Al Schapira a.d.schapira at worldnet.att.net wrote on Thu Apr 1 14:23:47 EST 2004 : > I've been using IDLE both for debugging my own code and for learning > about how other folks code works. There is a feature that I'm looking > for that is so basic I believe it must be possible, but I haven't seen > it described anywhere: the ability to enter and evaluate an expression > when stopped at a breakpoint. The expression would be evaluated in the > context of the current breakpoint. > I would need this too. I currently uses the simple pdb comand line debugger included in python to do this. I mostly use it under ipython to benefit from its 'debug at uncaught exception' feature. > Building on this would be the *automatic* evaluation of one or more > previously entered expressions every time a breakpoint was hit. > I envision an additional subwindow of the idle window in which each > user's expression and its value would be automatically displayed when > stopped at a breakpoint. The expressions to be evaluated could be > entered or changed whenever idle is stopped at any breakpoint. > > Other debuggers I used (for C debugging) have a similar capability. If you are referring a feature similar to breakpoint command lists in gdb, i submitted a patch to pdb in order to support this feature: http://sourceforge.net/tracker/index.php?func=detail&aid=790710&group_id=5470&atid=305470 -- Gr?goire Dooms From dooms at info.ucl.ac.be Mon Jun 14 04:43:38 2004 From: dooms at info.ucl.ac.be (=?ISO-8859-1?Q?Gr=E9goire_Dooms?=) Date: Mon Jun 14 04:44:19 2004 Subject: [Idle-dev] Qualified name autocompletion Message-ID: <40CD653A.4080206@info.ucl.ac.be> Sorry for multiple posts, but the original mail has been retained by moderator, I got no news from him and I could not delete it. Hi, I intend to use IDLE for a python course. I patched it so it supports qualified names autocompletion using namespace inspection a la CallTips.py. I was about to submit the patch to the python patch manager when I discovered that this feature is covered (more in-depth) by a large patch (patch 906702) which covers a lot of features. I have been using IDLE with this patch for a few days, and I think it's quite good though I did not review the source code (quite a big patch). The patch is a little hard to apply (had to do a couple diffs by hand), I may submit a context diff against CVS HEAD or any python release if you are interrested. I have just a small comment about the AutoCompleteWindow : I should not pop-up when the word behind the cursor is not a prefix of any word in the list. Currently the window pops up and the item selected is the one where the partial word would be listed if it was present. (Hope I'm clear) Do you think mine is worth posting (to this list or to the patch tracker) ? -- Gr?goire Dooms From kbk at shore.net Tue Jun 15 14:42:08 2004 From: kbk at shore.net (Kurt B. Kaiser) Date: Tue Jun 15 14:59:35 2004 Subject: [Idle-dev] Qualified name autocompletion In-Reply-To: <40CD653A.4080206@info.ucl.ac.be> ( =?iso-8859-1?q?Gr=E9goire_Dooms's_message_of?= "Mon, 14 Jun 2004 10:43:38 +0200") References: <40CD653A.4080206@info.ucl.ac.be> Message-ID: Gr?goire Dooms writes: > Sorry for multiple posts, but the original mail has been retained by > moderator, I got no news from him and I could not delete it. I didn't see your posts in the spam I cleared out (that's the reason for the 'moderation'). Not sure what happened to them. But now you've joined the list, that's the best way. Welcome! > Hi, I intend to use IDLE for a python course. I patched it so it >supports qualified names autocompletion using namespace inspection a >la CallTips.py. > > I was about to submit the patch to the python patch manager when I > discovered that this feature is covered (more in-depth) by a large patch > (patch 906702) which covers a lot of features. I expect that this patch will be applied. I've been working with it for awhile, and I do have a number of comments which will need to be addressed before it can be incorporated. > I have been using IDLE with this patch for a few days, and I think >it's quite good though I did not review the source code (quite a big >patch). The patch is a little hard to apply (had to do a couple diffs >by hand), I may submit a context diff against CVS HEAD or any python >release if you are interrested. You could send your diff to Noam Raphael. Noam has a group of people who are developing and testing this patch. Perhaps you could work with them. The last time I applied the patch, it was clean, but maybe the recent work on CodeContext affected that. I have been using the patch in a sandbox; I think that I'll start a branch for it so everyone can sync up while we work on it. As you said, it's a pretty big patch and it will take some effort to get it acceptable to everyone. > I have just a small comment about the AutoCompleteWindow : I should >not pop-up when the word behind the cursor is not a prefix of any >word in the list. Currently the window pops up and the item selected >is the one where the partial word would be listed if it was >present. (Hope I'm clear) Yes, one of my main comments on the patch would be that it makes for a very noisy interface. Tooltips were bad enough. I'd like to see nothing happen until the user hits a TAB (for any tooltip). > Do you think mine is worth posting (to this list or to the patch >tracker) ? See above. Please don't post patches to the list, they will get lost. -- KBK From Dragonfirebane at aol.com Tue Jun 29 03:24:30 2004 From: Dragonfirebane at aol.com (Dragonfirebane@aol.com) Date: Tue Jun 29 09:53:49 2004 Subject: [Idle-dev] (IOError: [Errno 9] Bad file descriptor) in IDLE Message-ID: <1eb.240353c6.2e12732e@aol.com> Skipped content of type multipart/alternative-------------- next part -------------- ########################################################################## ## Multivert ## ########################################################################## ########################################################################## ## ## ## To - Do: ## ## -------- ## ## ## ## 1. Get converthex(whichconv) to work. ## ## 2. Change convertnum(whichconv) and convertbin(whichconv) so that ## ## when a carat (^) is seen, that number goes up by enough so that ## ## it is considered uppercase. ## ## 3. Treat decimal numbers separated by a space as separate ## ## (original.split()) so that each separate unit can be converted ## ## to its own letter (includes removing int(original) tests early ## ## on). ## ## 4. Implement change in spaces around punctuation in all modules so ## ## that 3 will work. ## ## 5. Allow a calculation to be performed after a conversion ## ## until user declines. ## ## 6. Allow convertbin(whichconv) to recognize punctuation. ## ## 7. Print '\xba' (degrees sign) from string.letters when character ## ## or number isn't recognized (or '[?]' . . . probably easier to ## ## do that one). ## ## ## ########################################################################## ##to see comments, maximize window or scroll all the way to the right def calc(manip): global counter global allcalc if manip == 'exponents': base = float(raw_input("Please enter the base. ")) expon = float(raw_input("Please enter the exponent. ")) results = base ** expon Sitemlist = [] Sitemlist.append("%d to the power of %d equals %d." % (base, expon, results)) Sitemlist = ''.join(Sitemlist) print Sitemlist allcalc.append('____Calculation %d: . . . ' % counter + Sitemlist) manip = 'end' elif manip == 'multiplication': leng = int(raw_input("Please enter number of items to be multiplied: ")) itemlist = [] item1 = float(raw_input("Please enter first item to multiply: ")) itemlist.append(item1) Sitemlist = [] Sitemlist.append(str(item1)) for i in range (1, leng): item2 = float(raw_input("Please enter next item to multiply: ")) itemlist.append(item2) Sitemlist.append(str(item2)) for x in itemlist[:]: try: results = itemlist[0] * itemlist[1] itemlist.remove(itemlist[0]) itemlist.remove(itemlist[0]) itemlist.insert(0, results) except IndexError: pass Sitemlist = ' times '.join(Sitemlist) Sitemlist += ' equals ' + str(results) + '.' print Sitemlist allcalc.append('____Calculation %d: . . . ' % counter + str(Sitemlist)) manip = 'end' elif manip == 'division': leng = int(raw_input("Please enter the number of items to be divided: ")) itemlist = [] item1 = float(raw_input("Please enter number to divide. ")) itemlist.append(item1) Sitemlist = [] Sitemlist.append(str(item1)) for i in range (1, leng): try: item2 = float(raw_input("Please enter number to divide by (default is 10). ")) except ValueError: item2 = 10.0 itemlist.append(item2) Sitemlist.append(str(item2)) for x in itemlist[:]: try: results = itemlist[0] / itemlist[1] itemlist.remove(itemlist[0]) itemlist.remove(itemlist[0]) itemlist.insert(0, results) except IndexError: pass Sitemlist = ' divided by '.join(Sitemlist) Sitemlist += ' equals ' + str(results) + '.' print Sitemlist allcalc.append('____Calculation %d: . . . ' % counter + str(Sitemlist)) manip = 'end' elif manip == 'addition': pass manip = 'end' elif manip == 'subtraction': pass manip = 'end' if manip == 'end': more = raw_input("Would you like to perform more calculations [y/n]? ") if more in 'Yy': counter += 1 elif more in 'Nn': global again again = False allcal = raw_input("Would you like to see all calculations made this session [y/n]? ") if allcal in 'Yy': allcalc = ''.join(allcalc) print allcalc elif allcal in 'Nn': pass conv = raw_input("Would you like to perform a conversion [y/n]? ") if conv in 'Yy': global cal cal = 'conversion' elif conv in 'Nn': pass def convertbin(whichconv): global res global original original = original.split() m = 0 for x in original: if whichconv == 'Decimal': asNum = str(long(str(original[m]),2)) res += asNum res += ' ' m += 1 elif whichconv == 'Hexadecimal': asHex = str(long(str(original[m]),2)) if int(asHex) <= 0: res += '-' asHex = -int(asHex) asHex = "%X" % int(asHex) res += asHex res += ' ' m += 1 elif whichconv == 'Text': asNum = str(long(str(original[m]),2)) if int(asNum) == 0: res += '%s' % chr(int(asNum) + 32) elif 0 < int(asNum) <= 26: res += '%s' % chr(int(asNum) + 96) elif 26 < int(asNum) <= 52: res += '%s' % chr(int(original) + 38) m += 1 else: print """Sorry, you didn't enter a valid number. Please enter only numbers between one and 26 """ def convertnum(whichconv): ##converts numbers from string import split if whichconv == 'Binary': ##if user wants to convert to binary global original if int(original) <= 0: ##if negative number entered global res ##since res is redefined, tells python to use global res and not try to create a local one res += '-' ##adds a minus sign to res original = -int(original) ##converts original to a positive number try: int(original) ##currently redundant, eventually to discriminate between numbers and punctation except ValueError: x = 0 for char in original: if char in punct: res += char x += 1 else: asOctal = "%o" % int(original) for char in asOctal: res += str(binary[char]) elif whichconv == 'Hexadecimal': ##if user wants to convert to hex if int(original) <= 0: ##global res/original already in module res += '-' original = -int(original) asHex = "%X" % int(original) res += asHex elif whichconv == 'Text': ##if user wants to convert to text (only works one letter at a time) if int(original) == 0: ##if number is 0 res += '%s' % chr(int(original) + 32) ##adds a space to res elif 0 < int(original) <= 26: ##if the number is 1-26 res += '%s' % chr(int(original) + 96) ##prints corresponding letter elif 26 < int(original) <= 52: ##if number is between 26 and 52 res += '%s' % chr(int(original) + 38) ##prints corresponding letter else: ##if its not one of those numbers print """Sorry, you didn't enter a valid number. Please enter only numbers between 0 and 26. """ ##prints message def converthex(whichconv): pass def convertxt(whichconv): global res ##results list is modified, so this tells python to use the global list and not create a local one if whichconv == 'Binary': from string import split ##so split and join work for char in original: ##loops over the entire entry x = 0 ##allows checking every character against the entire alphabet list if char in punct: ##if character is punctuation res = split(res) ##prints contents of res into a list and names it res res.append(' ') ##adds a space at the end del res[-1] ##deletes the space res = ' '.join(res) ##returns res to string form res += char ##adds punctuation elif char in alphabet: ##if the character is in the alphabet while x == 0: if char in alphabet[x]: asOctal = "%o" % int(ord(char) - 32) for char in asOctal: res += binary[char] res += ' ' x += 1 while 0 < x <= 26: ##if the character is a lowercase letter or space if char in alphabet[x]: ##redundant. only there to allow x += 1 to stay inside the while loop but outside the ifs asOctal = "%o" % int(ord(char) - 96) ##converts alphabet number (a = 1) to an unsigned octal for char in asOctal: ##for character in resulting octal res += binary[char] ##add the corresponding entry in the binary list to the res list if char not in punct: ##if the character isn't punctuation res += ' ' ##add a space at the end to separate numbers x += 1 ##adds 1 to the value of x so the loop doesnt go on forever while 26 < x <= 52: ##if the character is an uppercase letter if char in alphabet[x]: ##if the character is in the alphabet dictionary res += '^' asOctal = "%o" % int(ord(char) - 64) ##converts alphabet number (A = 1) to an unsigned octal for char in asOctal: res += binary[char] if char not in punct: res += ' ' x += 1 elif whichconv == 'Hexadecimal': ##convert text to hexadecimal from string import split for char in original: x = 0 if char in punct: res = split(res) res.append(' ') del res[-1] res = ' '.join(res) res += char elif char in alphabet: while x == 0: if char in alphabet[x]: asHex = "%X" % int(ord(char) - 32) res += asHex res += ' ' x += 1 while 0 < x <= 26: if char in alphabet[x]: asHex = "%X" % int(ord(char) - 96) ##convert alphabet number to corresponding Hexadecimal number res += asHex ##add hexadecimal number to string if char not in punct: res += ' ' x += 1 while 26 < x <= 52: if char in alphabet[x]: res += '^' asHex = "%X" % int(ord(char) - 64) ##convert alphabet number to corresponding hex number res += asHex if char not in punct: res += ' ' x += 1 elif whichconv == 'Decimal': ##convert text to decimal from string import split for char in original: x = 0 if char in punct: res = split(res) res.append(' ') del res[-1] res = ' '.join(res) res += char elif char in alphabet: while x <= 52: if x == 0: if char == alphabet[x]: ##if character is a space res += '%d' % int(ord(char) - 32) ##add a space to the string if char not in punct: res += ' ' x += 1 elif 0 < x <= 26: ##if character is a lowercase letter if char in alphabet[x]: res += '%d' % int(ord(char) - 96) ##add corresponding number to string if char not in punct: res += ' ' x += 1 elif 26 < x <= 52: ##if character is an uppercase letter if char in alphabet[x]: res += '^' res += '%d' % int(ord(char) - 64) ##add corresponding number to string if char not in punct: res += ' ' x += 1 import time ##for time.sleep(1.1) at end import string ##for split(res), etc. in convertxt modules. alphabet = ' ' + string.ascii_letters ##define alphabet string punct = string.punctuation ##define punctation string binary = {'0':'000','1':'001','2':'010','3':'011','4':'100','5':'101','6':'110','7':'111'} ##define the binary dictionary number = string.digits starmenu = {'1':'Binary','2':'Decimal','3':'Hexadecimal','4':'Text'} bconmenu = {'1':'Decimal','2':'Hexadecimal','3':'Text'} dconmenu = {'1':'Binary','2':'Hexadecimal','3':'Text'} hconmenu = {'1':'Binary','2':'Decimal','3':'Text'} tconmenu = {'1':'Binary','2':'Decimal','3':'Hexadecimal'} counter = 1 allcalc = [] allconv = '' ##defines string containing all conversions res = '' ##defines string containing single conversion i = 0 ##beginning condition for loop again = True cal = raw_input("Would you like to perform a conversion or a calculation? ") while again: if cal == 'calculation': manip = raw_input("""Please enter intended manipulation (exponents, multiplication, division, addition, or subtraction): """) calc(manip) if cal == 'conversion': res = '' ##empties the string so each conversion begins w/ an empty string startype = raw_input("""Which type of text would you like to convert? 1: Binary 2: Decimal 3: Hexadecimal 4: Text ... """) original = raw_input("Please enter %s to be converted. " % starmenu[startype].lower()) ##enter input to be converted startype = starmenu[startype] if startype == 'Binary': whichconv = raw_input("""Convert to" 1: Decimal 2: Hexadecimal 3: Text ... """) whichconv = bconmenu[whichconv] convertbin(whichconv) print res elif startype == 'Decimal': whichconv = raw_input("""Convert to: 1: Binary 2: Hexadecimal 3: Text ... """) ##which conversion? whichconv = dconmenu[whichconv] convertnum(whichconv) ##convert numbers to whatever print res ##print string containing conversion elif startype == 'Hexadecimal': whichconv = raw_input("""Convert to: 1: Binary 2: Decimal 3: Text ... """) whichconv = hconmenu[whichconv] converthex(whichconv) print res elif startype == 'Text': whichconv = raw_input("""Convert to: 1: Binary 2: Decimal 3: Hexadecimal ... """) ##which conversion? whichconv = tconmenu[whichconv] convertxt(whichconv) print res ##print the string containing the conversion i += 1 original = ' '.join(original) allconv += ' ____Conversion %d: . . . ' % i + startype + ' => ' + whichconv + ' ... "' + original + '" => "' + res + '"' ##outside of try-except-else, inside while; adds each conversion to a master conversion list per session more = raw_input("Would you like to convert more text or numbers [y/n]? ") ##more? if more in 'Yy': ##if so, continue loop pass elif more in 'Nn': ##if not, again = False ##break loop callconv = raw_input("Would you like to see all the conversions performed during this session [y/n]? ") if callconv in('y','Y','1','yes','Yes'): print allconv else: pass callcalcon = raw_input("""Would you like to see all the conversions and calculations performed during this session [y/n]? """) if callcalcon in 'Yy': print str(allcalc) + allconv elif callcalcon in 'Nn': pass try: exit = raw_input("""Hit enter or control-c to exit. ... """) except KeyboardInterrupt: pass else: pass print "Thank you for using Multivert. Multivert will now close." ##loop broken, prints message time.sleep(1.1) ##waits for 1.1 seconds so message can be read ##end of program; program closes From jvines at arl.army.mil Tue Jun 29 15:18:02 2004 From: jvines at arl.army.mil (Vines, John (Civ,ARL/CISD)) Date: Tue Jun 29 15:18:07 2004 Subject: [Idle-dev] Import _socket error Message-ID: <64FB06AE9F2A204DA14763D7C45961CC338E2A@ARLABML01.DS.ARL.ARMY.MIL> I have installed Python 2.3.2 on Irix64 and am trying to run the "idle" but keep getting an error stating "no module named _socket". I believe I have my PYTHONPATH correct but am not sure. Any help would be appreciated, thanx John Vines Computational Sciences and Engineering Branch Scientific Visualization Team -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/idle-dev/attachments/20040629/8b99fde3/attachment.html From kbk at shore.net Wed Jun 30 02:35:29 2004 From: kbk at shore.net (Kurt B. Kaiser) Date: Wed Jun 30 02:35:32 2004 Subject: [Idle-dev] Import _socket error In-Reply-To: <64FB06AE9F2A204DA14763D7C45961CC338E2A@ARLABML01.DS.ARL.ARMY.MIL> (John Vines's message of "Tue, 29 Jun 2004 15:18:02 -0400") References: <64FB06AE9F2A204DA14763D7C45961CC338E2A@ARLABML01.DS.ARL.ARMY.MIL> Message-ID: <87pt7hy2mm.fsf@hydra.localdomain> "Vines, John (Civ,ARL/CISD)" writes: > I have installed Python 2.3.2 on Irix64 and am trying to run the > "idle" but keep getting an error stating "no module named _socket". I > believe I have my PYTHONPATH correct but am not sure. Any help would be > appreciated, thanx Without using IDLE, run Python: hydra /home/kbk$ python Python 2.2.1 (#1, Oct 17 2003, 16:36:36) [GCC 2.95.3 20010125 (prerelease, propolice)] on openbsd3 Type "help", "copyright", "credits" or "license" for more information. >>> import _socket >>> dir(_socket) ['AF_APPLETALK', 'AF_INET', 'AF_INET6'.... If you can't get that, Python isn't fully installed on your platform. This doesn't sound like an IDLE bug. Check the output of the configure run when you built Python, look for a problem with the socket module. -- KBK