Re: strange thing that disturbs
On Tue, Oct 14, 2014 at 1:13 PM, tntsu...@googlemail.com wrote: it doesnt seem to be present and doesnt react to the python -m tkinter -module not present I don't know how it's spelled in 3.4.x, but in 2.7 it's spelled Tkinter. Give that a try. (Sorry, no 3.4 install handy or I'd verify it myself.) The other alternative is that the tkinter module wasn't built when you installed Python because the build system couldn't find Tcl or Tk libraries to link to. If that's the case, let us know your computing platform (Windows, Linux/Unix, MacOSX) and how 3.4 was installed on your system. Skip -- https://mail.python.org/mailman/listinfo/python-list
Re: strange thing that disturbs
Adding python-list back into the CC list. I know nothing about Windows. Perhaps someone else here can help. (Sorry about the top post all you bottom post mavens. It seemed warranted in this case...) Skip On Tue, Oct 14, 2014 at 2:10 PM, tntsu...@googlemail.com wrote: hi, thank you so much for the quick reply :-D i run win7 home premium... during the installation of python 3.4.2 i have seen the tcl/tk option activated! the change between the T and t i tried but still the module wasnt found... ... ... ... its strange... you know... i dealed with C, C++, and many other programming languages and it was ALWAYS the same... never it was easy and always there was a problem with the instalation or the editor... even buying a book never it was like described in the book and i got stuck at a point where the example in the book and the software didnt match... so that happening noow isnt something new to me... another question that you might be able to help me is if you can recommend me a simple editor for writing python programs... right now i took IEP... any tips? be well and thank you! GD p.s. i only installed 3.4.2... thats enough right? or do i have to install the 2.X version as well? 2014-10-14 20:32 GMT+02:00 Skip Montanaro skip.montan...@gmail.com: On Tue, Oct 14, 2014 at 1:13 PM, tntsu...@googlemail.com wrote: it doesnt seem to be present and doesnt react to the python -m tkinter -module not present I don't know how it's spelled in 3.4.x, but in 2.7 it's spelled Tkinter. Give that a try. (Sorry, no 3.4 install handy or I'd verify it myself.) The other alternative is that the tkinter module wasn't built when you installed Python because the build system couldn't find Tcl or Tk libraries to link to. If that's the case, let us know your computing platform (Windows, Linux/Unix, MacOSX) and how 3.4 was installed on your system. Skip -- https://mail.python.org/mailman/listinfo/python-list
Re: strange thing that disturbs
i run win7 home premium. during the installation of python 3.4.2 i have seen the tcl/tk option activated! Then python -m tkinter in Command Prompt should bring up a tk windows with a bit a text and two buttons, one for exit. First try to find Python 3.4 on the Start menu and start Python 3.4 (command Then try import sys, then import tkinter. If this does not work, try re-installing. If you respond, do so to the list, not me. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: strange thing:
CA, Did you respond to my off-NG msg about FORTRAN? Perhaps it's caught in my spam on the net. -- http://mail.python.org/mailman/listinfo/python-list
Re: strange thing:
On Wed, Sep 7, 2011 at 12:43 PM, W. eWatson wolftra...@invalid.com wrote: CA, Did you respond to my off-NG msg about FORTRAN? Perhaps it's caught in my spam on the net. No, I didn't; as someone else pointed out, you'll get better results asking on a dedicated Fortran list. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: strange thing:
On 9/6/2011 7:48 PM, Chris Angelico wrote: On Wed, Sep 7, 2011 at 12:43 PM, W. eWatsonwolftra...@invalid.com wrote: CA, Did you respond to my off-NG msg about FORTRAN? Perhaps it's caught in my spam on the net. No, I didn't; as someone else pointed out, you'll get better results asking on a dedicated Fortran list. ChrisA OK. -- http://mail.python.org/mailman/listinfo/python-list
Re: strange thing after call PyObject_CallMethod
Why this happenning and who makes Py_INCREF(self)? There are multiple possible explanations, but I think you have ruled out most of them: 1. on_recv might be returning self. So py_result would be the same as self, and hence be an additional reference. However, you said that on_recv raised an exception, so py_result should be NULL (can you confirm?) 2. there might be a reference leak in the implementation of on_recv. However, you say that it is all fine at the end, so this is unlikely 3. The implementation of on_recv stores the object inside another objects. There are too many possibilities for that to enumerate; here are some examples: def on_recv(self, buf): global foo, bar foo = self # creates global reference bar = self.on_send # creates bound method self.foo = self # creates cyclic reference foobar.append(self) # adds self into container If you are using gdb, I recommend to set a watchpoint on changes to ob_refcnt: (gdb) p ((PyObject*)self)-ob_refcnt $1 = (Py_ssize_t *) 0xa0cb5a0 (gdb) watch *(Py_ssize_t *) 0xa0cb5a0 Hardware watchpoint 2: *(ssize_t *) 168605088 (gdb) c Continuing. Hardware watchpoint 2: *(ssize_t *) 168605088 Old value = 2 New value = 1 0xb7d5f406 in list_clear (a=0xa041c74) at Objects/listobject.c:550 550 Py_XDECREF(item[i]); As you can see: this specific object was stored in a list, and the list is now being cleared. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list
Re: strange thing after call PyObject_CallMethod
Thank you for so amazing debugging tutorial :). I owe you a beer. I found source of problem: then unhandled in python code exception occurs frame_dealloc() (Objects/frameobject.c:422) not called. Even if I call PyErr_Print(). But! If I call PyErr_Clear() then all okay! Docs says that both this functions clears error indicator... I hit a bug or my brains overheated? Some gdb output if you are intrested: Without exception: http://dpaste.com/104973/ With exception: http://dpaste.com/104975/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Strange thing with types
TYR wrote: I'm doing some data normalisation, which involves data from a Web site being extracted with BeautifulSoup, cleaned up with a regex, then having the current year as returned by time()'s tm_year attribute inserted, before the data is concatenated with string.join() and fed to time.strptime(). Here's some code: timeinput = re.split('[\s:-]', rawtime) print timeinput #trace statement print year #trace statement t = timeinput.insert(2, year) print t #trace statement t1 = string.join(t, '') timeobject = time.strptime(t1, %d %b %Y %H %M) year is a Unicode string; so is the data in rawtime (BeautifulSoup gives you Unicode, dammit). And here's the output: [u'29', u'May', u'01', u'00'] (OK, so the regex is working) 2008 (OK, so the year is a year) None (...but what's this?) Traceback (most recent call last): File bothv2.py, line 71, in module t1 = string.join(t, '') File /usr/lib/python2.5/string.py, line 316, in join return sep.join(words) TypeError First - don't use module string anymore. Use e.g. ''.join(t) Second, you can only join strings. but year is an integer. So convert it to a string first: t = timeinput.insert(2, str(year)) Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: Strange thing with types
On May 29, 11:09 pm, TYR [EMAIL PROTECTED] wrote: I'm doing some data normalisation, which involves data from a Web site being extracted with BeautifulSoup, cleaned up with a regex, then having the current year as returned by time()'s tm_year attribute inserted, before the data is concatenated with string.join() and fed to time.strptime(). Here's some code: timeinput = re.split('[\s:-]', rawtime) print timeinput #trace statement print year #trace statement t = timeinput.insert(2, year) print t #trace statement t1 = string.join(t, '') timeobject = time.strptime(t1, %d %b %Y %H %M) year is a Unicode string; so is the data in rawtime (BeautifulSoup gives you Unicode, dammit). And here's the output: [u'29', u'May', u'01', u'00'] (OK, so the regex is working) 2008 (OK, so the year is a year) None (...but what's this?) Traceback (most recent call last): File bothv2.py, line 71, in module t1 = string.join(t, '') File /usr/lib/python2.5/string.py, line 316, in join return sep.join(words) TypeError list.insert modifies the list in-place: l = [1,2,3] l.insert(2,4) l [1, 2, 4, 3] It also returns None, which is what you're assigning to 't' and then trying to join. Replace your usage of 't' with 'timeinput' and it should work. -- http://mail.python.org/mailman/listinfo/python-list
Re: Strange thing with types
On May 29, 2:23 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: TYR wrote: I'm doing some data normalisation, which involves data from a Web site being extracted with BeautifulSoup, cleaned up with a regex, then having the current year as returned by time()'s tm_year attribute inserted, before the data is concatenated with string.join() and fed to time.strptime(). Here's some code: timeinput = re.split('[\s:-]', rawtime) print timeinput #trace statement print year #trace statement t = timeinput.insert(2, year) print t #trace statement t1 = string.join(t, '') timeobject = time.strptime(t1, %d %b %Y %H %M) year is a Unicode string; so is the data in rawtime (BeautifulSoup gives you Unicode, dammit). And here's the output: [u'29', u'May', u'01', u'00'] (OK, so the regex is working) 2008 (OK, so the year is a year) None (...but what's this?) Traceback (most recent call last): File bothv2.py, line 71, in module t1 = string.join(t, '') File /usr/lib/python2.5/string.py, line 316, in join return sep.join(words) TypeError First - don't use module string anymore. Use e.g. ''.join(t) Second, you can only join strings. but year is an integer. So convert it to a string first: t = timeinput.insert(2, str(year)) Diez Yes, tm_year is converted to a unicode string elsewhere in the program. -- http://mail.python.org/mailman/listinfo/python-list
Re: Strange thing with types
On May 29, 2:24 pm, alex23 [EMAIL PROTECTED] wrote: On May 29, 11:09 pm, TYR [EMAIL PROTECTED] wrote: I'm doing some data normalisation, which involves data from a Web site being extracted with BeautifulSoup, cleaned up with a regex, then having the current year as returned by time()'s tm_year attribute inserted, before the data is concatenated with string.join() and fed to time.strptime(). Here's some code: timeinput = re.split('[\s:-]', rawtime) print timeinput #trace statement print year #trace statement t = timeinput.insert(2, year) print t #trace statement t1 = string.join(t, '') timeobject = time.strptime(t1, %d %b %Y %H %M) year is a Unicode string; so is the data in rawtime (BeautifulSoup gives you Unicode, dammit). And here's the output: [u'29', u'May', u'01', u'00'] (OK, so the regex is working) 2008 (OK, so the year is a year) None (...but what's this?) Traceback (most recent call last): File bothv2.py, line 71, in module t1 = string.join(t, '') File /usr/lib/python2.5/string.py, line 316, in join return sep.join(words) TypeError list.insert modifies the list in-place: l = [1,2,3] l.insert(2,4) l [1, 2, 4, 3] It also returns None, which is what you're assigning to 't' and then trying to join. Replace your usage of 't' with 'timeinput' and it should work. Thank you. -- http://mail.python.org/mailman/listinfo/python-list