Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Peter Pearson
On Sat, 6 May 2023 14:50:40 +0100, Chris Green wrote: [snip] > So, what do those =?utf-8? and ?= sequences mean? Are they part of > the string or are they wrapped around the string on output as a way to > show that it's utf-8 encoded? Yes, "=?utf-8?" signals "MIME header encoding". I've only

Re: Precision Tail-off?

2023-02-17 Thread Peter Pearson
On Fri, 17 Feb 2023 10:27:08, Stephen Tucker wrote:[Head-posting undone.] > On Thu, Feb 16, 2023 at 6:49 PM Peter Pearson > wrote: >> On Tue, 14 Feb 2023 11:17:20 +, Oscar Benjamin wrote: >> > On Tue, 14 Feb 2023 at 07:12, Stephen Tucker >> wrote: >>

Re: Precision Tail-off?

2023-02-16 Thread Peter Pearson
On Tue, 14 Feb 2023 11:17:20 +, Oscar Benjamin wrote: > On Tue, 14 Feb 2023 at 07:12, Stephen Tucker wrote: [snip] >> I have just produced the following log in IDLE (admittedly, in Python >> 2.7.10 and, yes I know that it has been superseded). >> >> It appears to show a precision tail-off as

mailbox misbehavior with non-ASCII

2022-07-29 Thread Peter Pearson
The following code produces a nonsense result with the input described below: import mailbox box = mailbox.Maildir("/home/peter/Temp/temp",create=False) x = box.values()[0] h = x.get("X-DSPAM-Factors") print(type(h)) # The output is the desired "str" when the message file contains this: To:

Re: fill out bulletins

2022-06-14 Thread Peter Pearson
On Tue, 14 Jun 2022 00:41:07 +0200, jak wrote: [snip] > > If you are interested in seeing what I called "post office bulletin" > (English is not my language and I don't know the name, sorry), you can > find a sample pdf (fillable) but it works badly here: > >

Re: What to do to correct the error written below:

2022-04-12 Thread Peter Pearson
On Tue, 12 Apr 2022 04:56:22 -0700 (PDT), NArshad wrote: > >>By looping over elements in "books" and incrementing counter i, >>which is used as an index both for "books" and for "students", >>you will produce an error whenever the number of books exceeds >>the number of students. Is there some

Re: What to do to correct the error written below:

2022-04-11 Thread Peter Pearson
On Mon, 11 Apr 2022 00:14:49 -0700 (PDT), NArshad wrote: [snip] > books = list(models.Book.objects.filter(isbn=i.isbn)) > students = list(models.Student.objects.filter(user=i.student_id)) > i=0 > for l in books: > >

Re: What to do to correct the error written below:

2022-04-10 Thread Peter Pearson
On Sat, 9 Apr 2022 04:59:05 -0700 (PDT), NArshad wrote: > I have accidentally deleted one account in a Django project because of > which one of the pages is no more accessible and is giving the error > written below: > > IndexError at /view_issued_book/ > list index out of range > > and the error

Re: strange problem building non-pure wheel for apple M1 arm64

2022-03-08 Thread Peter Pearson
On Mon, 7 Mar 2022 16:22:10 +, Robin Becker wrote: [snip] > > gcc -bundle -undefined dynamic_lookup -g -arch arm64 [snip] > -L/usr/local/lib > -L/usr/lib > -L/Library/Frameworks/Python.framework/Versions/3.9/lib > -lfreetype [snip] > > ld: warning: ignoring file

Re: A problem with itertools.groupby

2021-12-17 Thread Peter Pearson
On Fri, 17 Dec 2021 09:25:03 +0100, ast wrote: [snip] > > but: > > li = [grp for k, grp in groupby("aahfffddnnb")] > list(li[0]) > > [] > > list(li[1]) > > [] > > It seems empty ... I don't understand why, this is > the first read of an iterator, it should provide its > data. Baffling.

Re: Recursion on list

2021-11-04 Thread Peter Pearson
On Thu, 4 Nov 2021 08:57:14 +0100, ast wrote: > > li = [] > > li.append(li) > > li > [[...]] > > >li[0][0][0][0] > [[...]] > > That's funny After the coming AI upheaval, such cruelty to machines will be considered punishable and not funny. -- To email me, substitute nowhere->runbox,

Re: installazione numpy

2021-10-12 Thread Peter Pearson
On Mon, 11 Oct 2021 07:56:27 +0200, stefano felli wrote: > l'installazione di numpy con > pip install numpy > fornisce errore > Building wheel for numpy (PEP 517) > > ERROR: Failed building wheel for numpy > Failed to build numpy > ERROR: Could not build wheels for numpy which use PEP 517 and

Re: nrfutil icorrect installation

2021-10-12 Thread Peter Pearson
On Fri, 8 Oct 2021 14:46:34 -0500, Gerhard van Rensburg wrote: > > I installed Python 3.10.0 > I then install > pip install nrfutil > > When I try to run nrfutil, I get > ModuleNotFoundError: No module named 'constants' I just asked duckduckgo.com about "nrfutil constants", and got this

Re: on floating-point numbers

2021-09-03 Thread Peter Pearson
On Thu, 2 Sep 2021 07:54:27 -0700 (PDT), Julio Di Egidio wrote: > On Thursday, 2 September 2021 at 16:51:24 UTC+2, Christian Gollwitzer wrote: >> Am 02.09.21 um 16:49 schrieb Julio Di Egidio: >> > On Thursday, 2 September 2021 at 16:41:38 UTC+2, Peter Pearson wrote: >> &

Re: on floating-point numbers

2021-09-02 Thread Peter Pearson
On Thu, 02 Sep 2021 10:51:03 -0300, Hope Rouselle wrote: > import sys sys.version > '3.8.10 (tags/... > ls = [7.23, 8.41, 6.15, 2.31, 7.73, 7.77] sum(ls) > 39.594 > ls = [8.41, 6.15, 2.31, 7.73, 7.77, 7.23] sum(ls) > 39.61 Welcome to the

Re: Ask for help on using re

2021-08-05 Thread Peter Pearson
On Thu, 5 Aug 2021 02:40:30 -0700 (PDT), Jach Feng wrote: I want to distinguish between numbers with/without a dot attached: >>> text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n' >>> re.compile(r'ch \d{1,}[.]').findall(text) ['ch 1.', 'ch 23.'] >>> re.compile(r'ch

Re: PYTHON

2021-06-21 Thread Peter Pearson
On Mon, 21 Jun 2021 10:33:26 +0530, Ayaana Soni wrote: > have installed python from your site. After installation my IDLE doesn't > work. IDLE is not in my search list. Plz help!! "Your site" is ambiguous. Does your computer run Windows, Linux, Apple something, ... ? -- To email me,

Re: Comparing text strings

2021-04-18 Thread Peter Pearson
On Sun, 18 Apr 2021 06:38:16 GMT, Gilmeh Serda wrote: > On Mon, 12 Apr 2021 16:11:21 -0700, Rich Shepard wrote: > >> All suggestions welcome. > > Assuming you want to know which is the oldest version and that the same > scheme is used all the time, could this work? >

Re: Uninstall error

2021-03-13 Thread Peter Pearson
On Fri, 12 Mar 2021 17:52:33 +, Premmy wrote: > Hi. I am trying to uninstall python on my computer because i found a better > one but its not getting deleted from control panel. can you please help me Windows? Apple? Linux? -- To email me, substitute nowhere->runbox, invalid->com. --

Re: "unexpected argument"

2021-03-09 Thread Peter Pearson
On Tue, 9 Mar 2021 15:03:54 -0500, Quentin Bock wrote: > Error 1: > Space Invaders.py:90: SyntaxWarning: "is" with a literal. Did you mean "=="? > if bullet_state is "fire": > > Error 2: > line 66, in > if event.key == pygame.K_SPACE: > AttributeError: 'Event' object has no attribute 'key'

Re: Not able to use python properly

2021-02-27 Thread Peter Pearson
On Sat, 27 Feb 2021 17:45:42 -0500, Sahaj Verma wrote: >  > >I am not able to install and use pip . > >I have installed python 3.9.2 version on my laptop but I am unable to use >pip function. > >Kindly look into this matter as soon as possible. > >Thanking You. > >

Re: Python cannot count apparently

2021-02-07 Thread Peter Pearson
On Sun, 7 Feb 2021 20:49:52 + (UTC), Kevin M. Wilson wrote: > Set i = 0 at the begin of the code, that way each entry starts at > Logical 0 of the array/container/list... No. The original code, as posted, was >>I recently coded this snippet of code: >>myString=„hello“ >>for i

Re: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Peter Pearson
On Wed, 13 Jan 2021 21:46:08 - (UTC), Grant Edwards wrote: > On 2021-01-13, Peter Pearson wrote: [snip] >> Browsergui is not widely popular (I don't think anybody but me has >> mentioned it on this newsgroup), but it was written to be simple and >> Pythonic, a

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Peter Pearson
On Mon, 11 Jan 2021 15:37:58 -0500, DonK wrote: [snip] > > I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they > look kinda like adding a family room onto a 1986 double wide mobile > home, Agreed. Browsergui is not widely popular (I don't think anybody but me has mentioned

Re: How to copy the entire outlook message content in python

2020-12-29 Thread Peter Pearson
On Tue, 29 Dec 2020 05:38:53 -0800 (PST), nikhil k wrote: ...[snip]... > import win32com.client as win32 > > ### Functions > def getMailBody(msgFile): > start_text = "" > end_text = "" > with open(msgFile) as f: > data=f.read() > return

Re: 2 sample chi-square test

2020-12-29 Thread Peter Pearson
On Tue, 29 Dec 2020 02:52:15 -0800 (PST), Priya Singh wrote: [snip] > I have two spectra with wavelength, flux, and error on flux. I want to > find out the variability of these two spectra based on the 2 sample > Chi-square test. I am using following code: > > def

Re: EnvironmentError

2020-11-20 Thread Peter Pearson
On Thu, 19 Nov 2020 13:19:07 +0100, Usman Musa wrote: > When I try to install a package or upgrade pip, using pip install I got > this error massage. > WARNING: Retrying (Retry(total=4, connect=None, read=None, > redirect=None, status=None)) after connection broken by >

Re: returning totals in functions of math

2020-11-08 Thread Peter Pearson
On Sun, 8 Nov 2020 13:50:19 -0500, Quentin Bock wrote: > Errors say that add takes 1 positional argument but 3 were given? Does this > limit how many numbers I can have or do I need other variables? > Here is what I have: > def add(numbers): >total = 1 >for x in numbers: > total

Re: Is there a conflict of libraries here?

2020-11-06 Thread Peter Pearson
On Fri, 6 Nov 2020 02:25:25 -0500, Steve wrote: > In my program, I have the following lines of code: > import random > import re > import time > import datetime At this point, the name "datetime" points to a module. > from datetime import timedelta > from time import

Re: Best way to determine user's screensize?

2020-11-03 Thread Peter Pearson
On Sun, 1 Nov 2020 15:31:57 - (UTC), Grant Edwards wrote: > > I have no objection to saving the most recent window size and using > that on the next startup, but I hate applications that force the > _location_ of the window. I've configured my window manager to open > windows where I want them

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-10 Thread Peter Pearson
On Sat, 10 Oct 2020 18:17:26 -0400, Steve wrote: > I would like to use the line: > HoursDiff = int((d2-d1).total_seconds()/3600) > to determine the difference in hours between two timedate entries. > > The variable d2 is from datetime.now() > and d1 is read from a text file. > > I can save d2 to

Python's carbon guilt

2020-10-10 Thread Peter Pearson
Python advocates might want to organize their thoughts on this subject before their bosses spring the suggestion: >From >https://www.sciencemag.org/news/2020/10/we-re-part-problem-astronomers-confront-their-role-and-vulnerability-climate-change > : . . . Astronomers should also abandon

Re: Truncation error

2020-10-07 Thread Peter Pearson
On Wed, 7 Oct 2020 13:29:26 +0530, Meghna Karkera wrote: > On Wed, Oct 7, 2020, 11:24 Marco Sulla wrote: >> On Wed, 7 Oct 2020 at 05:23, Meghna Karkera wrote: >> > >> > How is PYTHON better than other software's(MATLAB) in case of >> > truncation or rounding off error. > >> [snip] > > When I

Re: ValueError: arrays must all be same length

2020-10-03 Thread Peter Pearson
On Fri, 2 Oct 2020 13:34:46 +0100, Shaozhong SHI wrote: > Hello, > > I got a json response from an API and tried to use pandas to put data into > a dataframe. > > However, I kept getting this ValueError: arrays must all be same length. > > Can anyone help? > > The following is the json text.

Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Peter Pearson
On Tue, 21 Apr 2020 21:42:42 + (UTC), Eli the Bearded wrote: > This just arrived at my newserver: > > Path: >

Re: Help building python application from source

2020-02-29 Thread Peter Pearson
On Fri, 28 Feb 2020 18:49:58 -0800, Mr. Lee Chiffre wrote: [snip] > I am a python noob. This is why I ask the python masters. There is a > python software I want to install on the server it is called Electrumx. > https://github.com/kyuupichan/electrumx is the link. I am having troubles > with

Re: fugacity cofficient

2020-02-17 Thread Peter Pearson
On 17 Feb 2020 18:40:00 GMT, Peter Pearson wrote: > > Welcome, Alberto. > > Can you make this look more like a Python question and less like a > do-my-homework question? Show us what you've tried. Sorry. I see you already did exactly that. -- To email me, substitute nowhere-&

Re: fugacity cofficient

2020-02-17 Thread Peter Pearson
On Sun, 16 Feb 2020 14:17:28 -0800 (PST), alberto wrote: > Hi, > how I could realize a script to calculate fugacity coefficients > with this formula > [snip] > > regards > > Alberto Welcome, Alberto. Can you make this look more like a Python question and less like a do-my-homework question?

Re: Help

2020-01-13 Thread Peter Pearson
On Sun, 12 Jan 2020 22:23:58 +0530, kiran chawan wrote: > Whenever Iam trying to run this 'New latest version python software 3.8.4 > python ' but it doesn't show any install option tell me how to run this > software and install new latest version of python plz reply sir thank you To get a

Re: Complaints on installing packages

2020-01-13 Thread Peter Pearson
On Sun, 12 Jan 2020 15:21:52 +0100, ofomi matthew wrote: > Good day Python Team, > I'm Matt by name and I have been having difficulties in installing packages > on my pycharm.it keeps telling me "error installing package". Please how do > I rectify this issues step by step. > Looking forward to

Re: Randomizing Strings In A Microservices World

2019-12-10 Thread Peter Pearson
On Mon, 9 Dec 2019 21:38:43 -0600, Tim Daneliuk wrote: > On 12/9/19 8:54 PM, Dennis Lee Bieber wrote: >> On Mon, 9 Dec 2019 18:52:11 -0600, Tim Daneliuk >> declaimed the following: >> >>> - Each of these services needs to produce a string of ten digits >>> guaranteed to be unique on a per

Re: graphics with python

2019-10-24 Thread Peter Pearson
On Thu, 24 Oct 2019 16:06:21 +0800, Maggie Q Roth wrote: [snip] > Can you show me the correct way to programming with graphics? > > I want to take some action detection, for instance, recognize dancing etc. That description of your goals is very vague. The more specific you can be about what

Re: Hello, I need help.

2019-10-15 Thread Peter Pearson
On Tue, 15 Oct 2019 18:57:04 +0300, Damla Pehlivan wrote: [snip] > . . . I downloaded the python program, and I > also downloaded Pycharm to use it. To be fair, I do not know what I am > doing, but I made some progress last night and I was happy about it. Today > when I came back from

Re: Angular distribution rose diagram in Python

2019-09-27 Thread Peter Pearson
On Fri, 27 Sep 2019 02:13:31 -0700 (PDT), Madhavan Bomidi wrote: > > Can someone help me to make python code (with some arbitrary data) for > the angular distribution rose diagram as shown in figure 7 in the > paper accessible through the web-link: > >

Re: Xlabel and ylabel are not shown

2019-08-18 Thread Peter Pearson
On Sat, 17 Aug 2019 10:58:43 -0700 (PDT), Amirreza Heidari wrote: > plt.figure(1) > plt.plot(history.history["loss"], "b", label="Mean Square Error of training") > plt.plot(history.history["val_loss"], "g", label="Mean Square Error [snip] > plt.legend() > plt.xlabel("Epoche") > plt.ylabel("Mean

Re: Creating time stamps

2019-07-23 Thread Peter Pearson
On Mon, 22 Jul 2019 16:25:32 -0500, Michael F. Stemper wrote: > On 22/07/2019 15.58, Chris Angelico wrote: >> On Tue, Jul 23, 2019 at 6:34 AM Michael F. Stemper >> wrote: >>> [snip] >>> from datetime import datetime >>> from time import strftime >>> timestamp = datetime.now().strftime(

Re: How to sort the files based on the date?

2019-07-15 Thread Peter Pearson
On Mon, 15 Jul 2019 09:20:51 +0200, Peter Otten <__pete...@web.de> wrote: > Madhavan Bomidi wrote: > [snip] >> >> 3RIMG_01APR2018_0514_L2G_AOD.h5 >> 3RIMG_01APR2018_0544_L2G_AOD.h5 >> 3RIMG_01APR2018_0644_L2G_AOD.h5 >> 3RIMG_01APR2018_0714_L2G_AOD.h5 >> 3RIMG_01APR2018_0744_L2G_AOD.h5 [snip] >>

Re: Seeking help regarding Python code

2019-07-11 Thread Peter Pearson
On Thu, 11 Jul 2019 06:54:21 +0100, Debasree Banerjee wrote: > > I have a dataset like this: > > RecTime > > NO2_RAW > > NO2 > > LAQN_NO2 > > 10980 > > 06/6/19 01:45 > > 17.9544 [snip] > > Can someone please help? Your question might appear intelligibly on the mailing list (I can't tell), but

Re: finding a component in a list of pairs

2019-06-24 Thread Peter Pearson
[snip] > print( dict( pairs ).get( 'sun', '(unknown)' )) You probably know this, but . . . just in case . . . If you're doing this many times, you'll want to construct the dict just once and then make many references to the dict, rather than re-constructing the dict every time you want to look

Re: finding a component in a list of pairs

2019-06-23 Thread Peter Pearson
On 22 Jun 2019 13:24:38 GMT, Stefan Ram wrote: [snip] > > print( next( ( pair for pair in pairs if pair[ 0 ]== 'sun' ), > ( 0, '(unbekannt)' ))[ 1 ]) > print( next( itertools.dropwhile( lambda pair: pair[ 0 ]!= 'sun', pairs )) > [ 1 ]) [snip] > > The last two lines of

Re: Why am a getting wrong prediction when combining two list of samples, which individually gives correct prediction?

2019-06-12 Thread Peter Pearson
On Wed, 12 Jun 2019 04:12:34 -0700 (PDT), Rishika Sen wrote: > So I am coding in Python. I have to set of samples. Set1 contains > samples of class A and the other set, Set2 contains samples of class > B. When I am predicting set1 and set2 individually, the classification > is perfect. Now when I

Re: Read the table data from PDF files in Python

2019-04-24 Thread Peter Pearson
On Wed, 24 Apr 2019 02:36:27 -0700 (PDT), mrawat...@gmail.com wrote: > Hello, > Anyone knows how to fetch the data from PDF file having tables with > other text in Python. Need to fetch some cell values based on > condition from that table. You might find pdftotext useful. The command . . .

Re: Trying to read in data for a file to a python application

2019-02-26 Thread Peter Pearson
On Tue, 26 Feb 2019 15:51:38 +, Paul Sutton wrote: > Hi > > I have been trying to write a small application that is essentially user > information application. > > https://raw.githubusercontent.com/zleap/AboutMe/master/Aboutme.py > > So far I have managed to write the data generated to a

Re: JPEGImage() hangs

2018-09-28 Thread Peter Pearson
On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote: > Chris Green wrote: >> Brian Oney wrote: >> > Could you please try another tool like `convert'? E.g. >> > >> > $ convert 102_PANA/P1020466.JPG test.png >> > >> > >> > What does that say? >> >> Well, after having returned home with the

Re: GUI, Python2.7- how to build a loop with a button + textbox

2018-09-12 Thread Peter Pearson
On Tue, 11 Sep 2018 19:51:01 -0700 (PDT), alon.naj...@gmail.com wrote: > hi, > > on python 2.7 how do I build a loop with a button + textbox? > > for example: > > I want the user to enter is name and then press "ok" button, I want > his name to be printed 5 times. Tested on Python 3.5.3: import

Re: Python Probability

2018-09-11 Thread Peter Pearson
On Tue, 11 Sep 2018 20:54:23 +0200 (CEST), Bat erdene endzis wrote: [snip] > def dice(): > attacker_dice=[random.randint(1,6) for _ in range(3)] > defender_dice=[random.randint(1,6) for _ in range(2)] > a=max(attacker_dice) > b=max(defender_dice) > for i in range(1000): >

Re: perplexing error

2018-09-10 Thread Peter Pearson
On 8 Sep 2018 19:10:09 GMT, Stefan Ram wrote: > Peter Pearson writes: >>On 8 Sep 2018 17:25:52 GMT, Stefan Ram wrote: >>>In such cases, I do: >>>print( 'at position 1' ) >>This approach is especially valuable when it turns out that >>the file you're

Re: perplexing error

2018-09-08 Thread Peter Pearson
On 8 Sep 2018 17:25:52 GMT, Stefan Ram wrote: > Sharan Basappa writes: >> 66 # get the label for each log >> 67 data_df['label'] = (data_df['label'] != '-').astype(int) >>---> 68 #logger.debug("data frame %s \n", data_df) >> 69 logger.debug("\n") >>

Re: Pass a list of values as options to 3 dropdown menus

2018-09-05 Thread Peter Pearson
On Sun, 2 Sep 2018 13:40:18 -0700 (PDT), Nick Berg wrote: > how can i be able to store a list of values to drop-down menu and then > grab the value that the user selects? > > ** > name = month = year = '' > > # populate names, months, years >

Re: Pass a list of values as options to 3 dropdown menus

2018-09-04 Thread Peter Pearson
On Tue, 4 Sep 2018 10:13:07 -0700 (PDT), Nick Berg wrote: [snip] > > May i ask how you managed to send an email with a domain > nowhere.invalid ? I would like to do the same. I don't post by sending email, I post by using a news client (slrn), which interacts with the Usenet system

Re: Pass a list of values as options to 3 dropdown menus

2018-09-04 Thread Peter Pearson
On Sun, 2 Sep 2018 13:40:18 -0700 (PDT), Nick Berg wrote: > how can i be able to store a list of values to drop-down menu and then > grab the value that the user selects? > > ** > name = month = year = '' > > # populate names, months, years >

Re: Help Needed : script weird result.

2018-09-01 Thread Peter Pearson
On Sat, 1 Sep 2018 10:11:59 -0700 (PDT), moha...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given > array of numbers. The script works fine for various combination of > inputs but fails in a weird way for a particular set of inputs, can > anyone point

Re: Verifying the integrity/lineage of a file

2018-09-01 Thread Peter Pearson
On Fri, 31 Aug 2018 12:51:58 -0600, Malcolm Greene wrote: > Thanks for the replies! I'm going to investigate the use of > python-gnupg which is a Python wrapper for the GPG command line > utility. This library is based on gpg.py written by Andrew Kuchling. > I'm all ears if f anyone has any

Re: Verifying the integrity/lineage of a file

2018-08-31 Thread Peter Pearson
On Fri, 31 Aug 2018 08:36:52 -0600, Malcolm Greene wrote: > I have use case where I need to distribute binary files to customers and > want to provide a way for our customers to verify the > "integrity/lineage" (I know there's a better description, but can't > think of it) of these files, eg. to

Re: zpifile.py error - no crc 32 attribute

2018-08-22 Thread Peter Pearson
On Wed, 22 Aug 2018 13:12:59 +0200, jacob m wrote: [snip] > That's my error: > "import zipfile > File "/home/lib/python3.7/lib/python3.7/zipfile.py", line 19, in > crc32 = zlib.crc32 > AttributeError: module 'zlib' has no attribute 'crc32' " > > I have no idea what to do with that :/ I

Re: curses, ncurses or something else

2018-07-24 Thread Peter Pearson
On Mon, 23 Jul 2018 23:24:18 +0100, John Pote wrote: > I recently wrote a command line app to take a stream of numbers, do some > signal processing on them and display the results on the console. There > may be several output columns of data so a title line is printed first. > But the stream of

Re: What is the pattern for this number set?

2018-07-18 Thread Peter Pearson
On Wed, 18 Jul 2018 17:16:21 -0400, no@none.invalid wrote: [snip] > Anyone care to figure out the pattern and make a new copy of the > chart? > > https://imgur.com/a/thF6U43 I've only looked at infantry and carrier, but those two seem to be fairly well approximated by y = a + 1/(b*x + c), for a,

Morning after

2018-07-15 Thread Peter Pearson
As if in a wake for Guido, grief was grieved, drinks were drunk, voices were raised, and some furniture was broken. Now, please, let's resume being the most civil newsgroup on the net. -- To email me, substitute nowhere->runbox, invalid->com. --

Re: translating foreign data

2018-06-21 Thread Peter Pearson
On Thu, 21 Jun 2018 10:12:27 -0700, Ethan Furman wrote: > I need to translate numeric data in a string format into a binary > format. I know there are at least two different methods of > representing parts less that 1, such as "10.5" and "10,5". The data > is encoded using code pages, and can

Re: write the values of an ordered dictionary into a file

2018-06-21 Thread Peter Pearson
On Thu, 21 Jun 2018 22:41:48 +0530, Ganesh Pal wrote: [snip] [what I think OP wants:] > > *.* > > *||STUDENT NAME||STUDENT AGE||MARKS SCORED||PASSED YEAR||FEES PAID||* > > *||John|| 28 || 13|| 2018 || 250

Re: Understanding memory location of Python variables

2018-06-17 Thread Peter Pearson
On Sat, 16 Jun 2018 09:38:07 -0700 (PDT), ip.b...@gmail.com wrote: > Hi everyone, > > I'm intrigued by the output of the following code, which was totally > contrary to my expectations. Can someone tell me what is happening? > myName = "Kevin" id(myName) > 47406848 id(myName[0]) >

Re: What data types does matplotlib pyplot take?

2018-06-15 Thread Peter Pearson
On Wed, 13 Jun 2018 12:53:57 -0400, C W wrote: > Hi everyone, > > I'm curious what data types pyplot takes. It seems that it can take numpy > series, pandas series, and possibly pandas dataframe? How many people data > types are out there? Is that true for all functions in like hist(), bar(), >

Re: Sorting NaNs

2018-06-08 Thread Peter Pearson
On Fri, 8 Jun 2018 02:15:02 + (UTC), Steven D'Aprano wrote: > On Thu, 07 Jun 2018 20:43:10 +0000, Peter Pearson wrote: [snip] >> >> But gosh, if there are only 2**32 different "random" floats, then you'd >> have about a 50% chance of finding a collision am

Re: Sorting NaNs

2018-06-07 Thread Peter Pearson
On Thu, 07 Jun 2018 19:02:42 +1200, Gregory Ewing wrote: > Steven D'Aprano wrote: >> But if it were (let's say) 1 ULP greater or less >> than one half, would we even know? > > In practice it's probably somewhat bigger than 1 ULP. > A typical PRNG will first generate a 32-bit integer and > then

Re: Stefan's headers [was:Names and identifiers]

2018-06-07 Thread Peter Pearson
On Thu, 7 Jun 2018 01:23:31 + (UTC), Steven D'Aprano wrote: > Disclaimer: Ido not see Stefan's original post. I recall that he has set > some sort of header on his posts which means they are not processed by > Gmane, but unfortunately I no longer have any of his posts in my cache > where I

Re: Attachments (was: How can an int be '+' with a tuple?)

2018-06-04 Thread Peter Pearson
On Sun, 3 Jun 2018 20:20:32 +0200, Peter J. Holzer wrote: [snip] > On 2018-06-03 13:57:26 +1000, Ben Finney wrote: >> (For good reasons, attachments are dropped when messages are distributed >> on the forum.) > > By "the forum" you mean Gmane? (I got the attachment over the mailing > list)

Re: Indented multi-line strings

2018-06-01 Thread Peter Pearson
On Fri, 1 Jun 2018 15:57:58 +0100, Paul Moore wrote: > On 1 June 2018 at 15:36, Dan Strohl via Python-list > wrote: >> So... how does one go about suggesting changes to the built in types? [snip] > > Why does this need to be a string method? Why can't it be a standalone > function? Yes, please,

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-10 Thread Peter Pearson
On Wed, 09 May 2018 12:51:15 -0700, Paul Rubin wrote: > Dennis Lee Bieber writes: >> Yes, code reviews may catch such errors... and later, when the >> summary of errors is analyzed for suggestions on how to reduce them -- >> the odds are good that "assignment

Re: Where has the practice of sending screen shots as source code come from?

2018-01-30 Thread Peter Pearson
On Mon, 29 Jan 2018 14:46:59 -0500, Dennis Lee Bieber wrote: > On 29 Jan 2018 17:26:32 GMT, Peter Pearson <pkpearson@nowhere.invalid> > declaimed the following: > >> >>In 1964, the IBM exhibit at the World's Fair in New York demonstrated >>a system that read

Re: checksum problem

2018-01-30 Thread Peter Pearson
On Tue, 30 Jan 2018 11:24:07 +0100, jak wrote: > Hello everybody, > I'm using python 2.7.14 and calculating the checksum with the sha1 > algorithm and this happens: the checksum is wrong until I read the whole > file in one shot. Here is a test program: > > import hashlib > >

Re: Where has the practice of sending screen shots as source code come from?

2018-01-29 Thread Peter Pearson
On Sun, 28 Jan 2018 20:24:55 -0800, Dan Stromberg wrote: [snip] > > Is it really true that OCR appeared long before Neural Networks > (NN's)? I first heard of NN's in the 80's, but OCR more like the > 90's. In 1964, the IBM exhibit at the World's Fair in New York

Re: Compression of random binary data

2018-01-28 Thread Peter Pearson
On Sat, 27 Jan 2018 21:26:06 -0800 (PST), pendrysamm...@gmail.com wrote: > If it is then show him this > > 387,420,489 >= > 00110011 00111000 00110111 00101100 00110100 00110010 0011 0 ... To save the casual reader a moment of disorientation, the above binary string is just the ASCII

Re: RegExp - please help me!

2017-12-26 Thread Peter Pearson
On Tue, 26 Dec 2017 05:14:55 -0800 (PST), szykc...@gmail.com wrote: [snip] > So: I develop regexp which to my mind should work, but it doesn't and > I don't know why. The broken regexp is like this: > struct (.+)\s*{\s*(.+)\s*}; [snip] You'll probably get better help faster if you can present

Re: Python bug report

2017-12-22 Thread Peter Pearson
On Thu, 21 Dec 2017 23:54:17 +0100, Ranya wrote: > Hi, > Am trying to use clr.AddReference and clr.AddReferenceToFile, but > python(2.7) keeps making this error: > > Traceback (most recent call last): > File "", line 1, in >

Re: Repeated Names (Repeated Names)

2017-12-16 Thread Peter Pearson
On Sat, 16 Dec 2017 12:56:07 +1300, Gregory Ewing wrote: > Anyone else now getting duplicate posts with the sender's > name repeated in parentheses? Yes. Both of the posts on this thread appear twice, once with and once without the parenthesized name. In each pair, the Date field differed by

Re: Artificial creating of [Lists], is it possible? the best way...

2017-11-16 Thread Peter Pearson
On Thu, 16 Nov 2017 10:47:53 -0800 (PST), jakub.raj...@gmail.com wrote: > Hello, im working on school project, its deck game Sorry! > I need to create specific lists: > My idea is about to using for > For i in range (n): >i=[] This will create n different empty lists, in succession, and

Re: Python Mailing list moderators

2017-11-06 Thread Peter Pearson
On Sun, 5 Nov 2017 17:28:05 -0500, Terry Reedy wrote: > On 11/5/2017 4:14 PM, Cameron Simpson wrote: >> On 05Nov2017 13:09, Στέφανος Σωφρονίου >> wrote: >>> Folks, >>> More and more nonsense are coming in and I find it really difficult to >>>

Re: Compression of random binary data

2017-10-28 Thread Peter Pearson
On Thu, 26 Oct 2017 19:26:11 -0600, Ian Kelly wrote: > > . . . Shannon entropy is correctly calculated for a data source, > not an individual message . . . Thank you; I was about to make the same observation. When people talk about the entropy of a particular message, you

Re: Compression of random binary data

2017-10-24 Thread Peter Pearson
On Tue, 24 Oct 2017 14:51:37 +1100, Steve D'Aprano wrote: On Tue, 24 Oct 2017 01:27 pm, danceswithnumb...@gmail.com wrote: > Yes! Decode reverse is easy..sorry so excited i could shout. Then this should be easy for you:

Re: A Good Tutorial on Python Decorators

2017-06-28 Thread Peter Pearson
On Tue, 27 Jun 2017 16:43:38 +, Andre Müller wrote: > Peter Pearson <pkpearson@nowhere.invalid> schrieb am Di., 27. Juni 2017 um > 18:35 Uhr: > >> On Tue, 27 Jun 2017 15:10:53 + (UTC), Saurabh Chaturvedi wrote: >> > https://opensource.google.com/p

Re: A Good Tutorial on Python Decorators

2017-06-27 Thread Peter Pearson
On Tue, 27 Jun 2017 15:10:53 + (UTC), Saurabh Chaturvedi wrote: > https://opensource.google.com/projects/py-decorators-tutorial "No Results found." -- To email me, substitute nowhere->runbox, invalid->com. -- https://mail.python.org/mailman/listinfo/python-list

Re: plot time on X axis

2017-06-07 Thread Peter Pearson
On Wed, 07 Jun 2017 09:20:25 -0300, jorge.conr...@cptec.inpe.br wrote: [snip] > I was an IDL user and I'm using Python. I have several meteorological > daily time seriee for several years. Please can someone help me. I would > like to plot on X axis only the values o the year. Is matplotlib

Re: Bug or intended behavior?

2017-06-07 Thread Peter Pearson
On Tue, 6 Jun 2017 13:16:00 -0400, Terry Reedy <tjre...@udel.edu> wrote: > On 6/5/2017 1:01 PM, Peter Pearson wrote: >> On Fri, 2 Jun 2017 10:17:05 -0700 (PDT), sean.diza...@gmail.com wrote: >> [snip] >>>>>> print "foo %s" % 1-2 >>>

Re: Bug or intended behavior?

2017-06-06 Thread Peter Pearson
On Tue, 6 Jun 2017 03:10:05 +1000, Chris Angelico wrote: > On Tue, Jun 6, 2017 at 3:01 AM, Peter Pearson wrote: [snip] >> Say >> "foo %s" % (1-2) >> not >> ("foo %s" % 1) - 2 >> . >> >> Personally I prefer a less com

Re: How to change variable from list to float

2017-06-05 Thread Peter Pearson
On Mon, 5 Jun 2017 11:13:54 +0100, Paul Barry wrote: > On 3 June 2017 at 15:42, Gary Barker wrote: > >> I have searched for a solution to this but have not found a suitable >> example. >> >> The attached code generates this error: Traceback (most recent call last): >>

Re: Bug or intended behavior?

2017-06-05 Thread Peter Pearson
On Fri, 2 Jun 2017 10:17:05 -0700 (PDT), sean.diza...@gmail.com wrote: [snip] print "foo %s" % 1-2 > Traceback (most recent call last): > File "", line 1, in > TypeError: unsupported operand type(s) for -: 'str' and 'int' Others have already pointed out that you're assuming the wrong

Re: Nested Loop to Generate Triangle

2017-05-25 Thread Peter Pearson
On Thu, 25 May 2017 09:28:31 -0700 (PDT), Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested > loop to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O > > When I actually need it to be

Re: Promiscuous ports under Linux

2017-05-04 Thread Peter Pearson
On Thu, 4 May 2017 18:04:02 + (UTC), Grant Edwards wrote: > On 2017-05-04, Peter Pearson <pkpearson@nowhere.invalid> wrote: > >> I'm curious to survey all my LAN traffic in various ways, and it seems >> likely that I will see phenomena that I don't understand, and

Re: Promiscuous ports under Linux

2017-05-04 Thread Peter Pearson
On Thu, 04 May 2017 10:26:45 GMT, alister <alister.w...@ntlworld.com> wrote: > On Wed, 03 May 2017 23:57:49 +0000, Peter Pearson wrote: > >> Cobbling together a minimalist ethernet-sniffing program, I was hoping >> to use this simple mechanism for setting the socket

Re: Promiscuous ports under Linux

2017-05-03 Thread Peter Pearson
On Wed, 3 May 2017 18:09:08 -0700, Rob Gaddi wrote: > On 05/03/2017 04:57 PM, Peter Pearson wrote: >> Cobbling together a minimalist ethernet-sniffing program, I was hoping >> to use this simple mechanism for setting the socket to "promiscuous >> mode" (to see

  1   2   3   4   >