Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: and or or surprise
Post: RE: and or or surprise

Thanks for pointing me to the documentation that I should have read. The surprise for my rigid mind is that these normally commutative boolean operators can depending on order return any type or value...
hakelm General Coding Help 3 1,806 Jun-21-2021, 01:35 PM
    Thread: and or or surprise
Post: and or or surprise

Trying to teach my grandchildren (and myself) python I slide into surprises all the time. The last one: >>> x=3 >>> y=5 >>> x and y 5 >>> y and x 3 >>> x o...
hakelm General Coding Help 3 1,806 Jun-21-2021, 12:52 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

with c=127 with open('ci.txt', 'w') as f: while c<160: c=c+1 f.write(chr(c))as cf.py and doing root@nilxx:~# python3 cf.py; hexdump ci.txt 0000000 80c2 81c2 82c2 83c2 84c2 85...
hakelm General Coding Help 14 4,449 Jun-19-2021, 07:32 AM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

c=127 print("c chr(c)") while c<160: c=c+1 if c % 8==0: print() print(c) print(chr(c),end="")
hakelm General Coding Help 14 4,449 Jun-18-2021, 12:45 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

c=127 print("c chr©") while c<160: c=c+1 if c % 8==0: print() print© print(chr©,end="")
hakelm General Coding Help 14 4,449 Jun-18-2021, 12:40 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

c=127 print("c chr©") while c<160: c=c+1 if c % 8==0: print() print© print(chr©,end="")
hakelm General Coding Help 14 4,449 Jun-18-2021, 12:36 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

As I said above, I replaced idle with idle3 H
hakelm General Coding Help 14 4,449 Jun-18-2021, 06:47 AM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

Pasting characters 128-160 directly here results in nothing visible. I don't know what character set idle3 uses but idle3 produces those seen below the only invisible one is chr(160). [attachment=1144...
hakelm General Coding Help 14 4,449 Jun-17-2021, 11:55 AM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

Thanks all, I didn't realise that my freshly installed idle wasn't up to date and didn't use my python3. idle3 works better and delivers "proper" results. Below output for 127<ord©<256. All...
hakelm General Coding Help 14 4,449 Jun-17-2021, 07:52 AM
    Thread: idle and characters with decimal value>127
Post: idle and characters with decimal value>127

If I running python 3.8 in the terminal do print(chr(65)+chr(128)) I get the expected result A� but if I execute the same command in idle 2.7.12 the result is just an empty line. Is this a bug or is ...
hakelm General Coding Help 14 4,449 Jun-16-2021, 07:34 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020