Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

In my idle for python 3.8 it shows ======================== RESTART: /home/eric/tmp/foo.py ======================== c chr(c) 128 €‚ƒ„…†‡ 136 ˆ‰Š‹ŒŽ 144 ‘’“”•–— 152 ˜™š›œžŸ 160   >>>
Gribouillis General Coding Help 14 363 Jun-18-2021, 10:27 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

This doesn't tell me which code produced this output.
Gribouillis General Coding Help 14 363 Jun-18-2021, 07:47 AM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

This looks somewhat in contradiction with your previous post. What reproducible steps did you follow to get this output in idle?
Gribouillis General Coding Help 14 363 Jun-17-2021, 12:56 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

This output looks very much like latin-1. Note that characters 127 to 160 don't produce visible output.
Gribouillis General Coding Help 14 363 Jun-17-2021, 08:06 AM
    Thread: find 'yesterdays files'
Post: RE: find 'yesterdays files'

You could simplify this in for f in Path(dirtoscan).iterdir(): ...but you should perhaps consider the case where dirtoscan contains items that are not ordinary files, such as directories... Also ...
Gribouillis General Coding Help 8 297 Jun-17-2021, 06:01 AM
    Thread: find 'yesterdays files'
Post: RE: find 'yesterdays files'

You could use pathlib and datetime modules >>> from pathlib import Path >>> import datetime as dt >>> >>> yesterday = dt.datetime.now().date() - dt.timedelta(days=1...
Gribouillis General Coding Help 8 297 Jun-16-2021, 10:30 PM
    Thread: Open an excel file
Post: RE: Open an excel file

Here perhaps?
Gribouillis General Coding Help 1 185 Jun-16-2021, 09:11 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

Euro sign may be in position 128 for extended ascii, but for unicode it is in position 8364. I wouldn't say € is normally expected to display chr(128). The idle editor correctly displays a euro sign f...
Gribouillis General Coding Help 14 363 Jun-16-2021, 03:55 PM
    Thread: idle and characters with decimal value>127
Post: RE: idle and characters with decimal value>127

I think there is no normalized transcription for control characters 128 to 159. In the french Wikipedia page, they advise against using these characters because of the lack of norm. The character show...
Gribouillis General Coding Help 14 363 Jun-16-2021, 08:26 AM
    Thread: What WERE They Thinking : Python 3.9x
Post: RE: What WERE They Thinking : Python 3.9x

I don't have a solution but just a few comments You can't blame today's developers to not support every outmoded version of every operating system. It is a different job. Using an old unsupported OS ...
Gribouillis News and Discussions 6 174 Jun-16-2021, 06:28 AM
    Thread: Container “Not defined”
Post: RE: Container “Not defined”

You are very far from guruness, being unable to describe an issue in simple understandable words. How can you expect a relevant answer? I'm near to agree on buran's worries that this is spam content. ...
Gribouillis General Coding Help 23 621 Jun-15-2021, 09:20 PM
    Thread: Problem with string and \n
Post: RE: Problem with string and \n

Only actual code can be debugged, not a vague description of what the actual code does.
Gribouillis General Coding Help 6 169 Jun-15-2021, 09:34 AM
    Thread: Convert each element of a list to a string for processing
Post: RE: Convert each element of a list to a string for...

You can also write a glob function that takes several patterns from glob import iglob from itertools import chain def multiglob(ipattern, recursive=False): return chain.from_iterable(iglob(p, rec...
Gribouillis General Coding Help 6 326 Jun-15-2021, 06:00 AM
    Thread: loop running indefinitely
Post: RE: loop running indefinitely

+1 for Dr snippsat's diagnosis: function is too long.
Gribouillis General Coding Help 4 161 Jun-14-2021, 03:38 PM
    Thread: Conditional evaluation
Post: RE: Conditional evaluation

It seems that you inverted the condition implied by your first post! You could also try something like >>> a1, b1 = 140.2, 6543.5 >>> silos1a = b1 - a1 - bool(b1 > a1) * 6553.5 &g...
Gribouillis General Coding Help 7 578 Jun-13-2021, 08:27 PM
    Thread: Dice Roll (Find out how many rolls until specified streak)
Post: RE: Dice Roll (Find out how many rolls until speci...

Here is a shorter version of the infinite sequences method >>> from random import randint >>> import itertools as itt >>> rolls = (randint(1, 6) + randint(1, 6) == 2 for _ i...
Gribouillis General Coding Help 4 316 Jun-13-2021, 09:44 AM
    Thread: first project read from xslx get only 1 column\row?
Post: RE: first project read from xslx get only 1 column...

korenron Wrote:What I will need to change in the code ?You wouldn't use openpyxl any more. Instead you would iterate on the rows of an object returned by a call to csv.reader() as shown in the documen...
Gribouillis Data Science 9 241 Jun-13-2021, 07:20 AM
    Thread: first project read from xslx get only 1 column\row?
Post: RE: first project read from xslx get only 1 column...

Well, the csv reader in the standard csv module processes the file line by line for example. You don't need to keep more than one line at a time in memory.
Gribouillis Data Science 9 241 Jun-13-2021, 06:28 AM
    Thread: "." to "," when writing to .txt
Post: RE: "." to "," when writing to .txt

Try this perhaps print >> d, dt_string,'{:.1f}*C' .format(t).replace('.', ',')
Gribouillis General Coding Help 8 294 Jun-12-2021, 10:53 PM
    Thread: "." to "," when writing to .txt
Post: RE: "." to "," when writing to .txt

What's unclear in my answer? Doesn't it show how to replace "." with "," ?
Gribouillis General Coding Help 8 294 Jun-12-2021, 09:18 PM

User Panel Messages

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