Re: Getting ASCII encoding where unicode wanted under Py3k

2013-05-13 Thread Peter Pearson
On Mon, 13 May 2013 10:59:33 -0500, Jonathan Hayward wrote: > --e89a8f3b9db145cbab04dc9b9a23 > Content-Type: text/plain; charset=windows-1252 > Content-Transfer-Encoding: quoted-printable > [snipped many lines of quoted-printable muck] > My code is below. What should I be doing differently to be,

Re: password protect file

2013-06-30 Thread Peter Pearson
On Sat, 29 Jun 2013 10:28:47 -0700 (PDT), gmsid...@gmail.com wrote: > I was wondering if there was a couple of words or things i > could add to the top of my python script to password > protect it so that it asks user for the password and then > after three tries it locks them out or says "access >

Re: howto handle nested for

2012-09-28 Thread Peter Pearson
On Fri, 28 Sep 2012 09:49:36 -0600, Ian Kelly wrote: > > levels = 6 > for combination in itertools.product(xrange(n_syms), levels): > # do stuff >>> n_syms = 3 >>> levels = 6 >>> for combination in itertools.product(xrange(n_syms), levels): ... print combination ... Traceback (most recent

Re: SSH Connection with Python

2012-10-25 Thread Peter Pearson
On Thu, 25 Oct 2012 12:16:58 +0200, Schneider wrote: > how can i create a SSH-Connection with python? I have to send some > commands to the remote host and parse their answers. > greatz Johannes I've been using Twisted (twistedmatrix.com). It is especially convenient for the server end. Its or

Re: SSH Connection with Python - Oops

2012-10-25 Thread Peter Pearson
On 25 Oct 2012 16:55:46 GMT, Peter Pearson wrote: > On Thu, 25 Oct 2012 12:16:58 +0200, Schneider wrote: >> how can i create a SSH-Connection with python? I have to send some >> commands to the remote host and parse their answers. >> greatz Johannes > &

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Peter Pearson
On Tue, 11 Dec 2012 16:39:27 +, duncan smith wrote: [snip] > >>> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" > >>> key = "XPMGTDHLYONZBWEARKJUFSCIQV" > >>> mapping = {} > >>> for i, ch in enumerate(alpha): > mapping[ch] = key[i] mapping = dict(zip(alpha, key)) -- To email me, substitute nowhe

Re: Password hash

2012-12-27 Thread Peter Pearson
On Sun, 23 Dec 2012 20:38:12 -0600, Robert Montgomery wrote: > I am writing a script that will send an email using an account I set up > in gmail. It is an smtp server using tls on port 587, and I would like > to use a password hash in the (python) script for login rather than > plain text. Is this

Re: Need some help confirming transactions using sha256

2013-01-31 Thread Peter Pearson
On Thu, 31 Jan 2013 08:43:03 -0800 (PST), kryptox.excha...@gmail.com wrote: > I'm wondering if anyone can help me as I can't seem to get > this to work. There is an online dice game that is > provably fair by calculating the 'dice roll' using using a > sha256 hash calculated against my transaction

Re: Python usage numbers

2012-02-12 Thread Peter Pearson
On 12 Feb 2012 09:12:57 GMT, Steven D'Aprano wrote: > > Suppose you're a fan of Russian punk bank Наӥв and you have a directory > of their music. Sigh. Banking ain't what it used to be. I'm sticking with classical Muzak. -- To email me, substitute nowhere->spamcop, invalid->net. -- http://ma

Re: pygame.Rect question

2012-04-09 Thread Peter Pearson
On Sun, 8 Apr 2012 16:58:01 -0700 (PDT), Scott Siegler wrote: [snip] > I set rect.left to 30, rect.top to 30 and rect.width = 20 > > This works fine. However, when looking at rect.right() it > shows that it is equal to 50. I suppose this is equal to > 30+20. However, since the first pixel is on l

Re: syntax for code blocks

2012-04-29 Thread Peter Pearson
On Fri, 27 Apr 2012 13:24:35 +0200, Kiuhnm wrote: > I'd like to change the syntax of my module 'codeblocks' to make it more > pythonic. > > Current Syntax: > > with res << func(arg1) << 'x, y': > print(x, y) > > with res << func(arg1) << block_name << 'x, y': > print(x

Re: Python and Tkinter by John E Grayson

2012-05-17 Thread Peter Pearson
On Wed, 16 May 2012 23:55:29 -0400, Mark R Rivet wrote: > I have a copy of this book and was wondering how relevant the content > is considering the publish date is 2000. Are people still using this > information? Anyone have any experience with this book? I bought the book years ago, hoping to

Re: Python and Tkinter by John E Grayson

2012-05-17 Thread Peter Pearson
On Thu, 17 May 2012 07:48:50 -0400, Mark R Rivet wrote: > > I am in the process of learning python, and want to learn tkinter for > GUI stuff. Is tkinter what people are using for GUI? Tkinter is one option. PyGUI is another. More suggestions will probably accrete on this thread. -- To email

Re: Email Id Verification

2012-05-25 Thread Peter Pearson
On Fri, 25 May 2012 13:36:18 + (UTC), Grant Edwards wrote: [snip] > . . . Nothing will make your users swear at > you as certainly as when you refuse to accept the e-mail address at > which the reeive e-mail all day every day. Amusingly, every time I log into Discovercard's web site, I get a

Re: usenet reading

2012-06-03 Thread Peter Pearson
On Sat, 26 May 2012 16:05:23 +0100, duncan smith wrote: > On 25/05/12 23:38, Jon Clements wrote: [snip] >> Is there a server out there where I can get my news groups? > > If you don't mind paying a small fee there are several companies > providing usenet access such as http://www.newsdemon.com. (I

Re: International translation of docs - is it a scam?

2011-06-07 Thread Peter Pearson
On Tue, 07 Jun 2011 16:55:28 +0200, Alain Ketterlin wrote: > Chris Gonnerman writes: > >> On the 30th of May, I received an email from a man (I'll leave out his >> name, but it was properly male) offering to translate the docs for the >> gdmodule (which I maintain) into Belorussian. [...] > > The

Re: Is the mailing list to usenet gateway borked?

2011-06-20 Thread Peter Pearson
On 20 Jun 2011 01:41:44 GMT, Steven D'Aprano wrote: > The last couple of messages on this list show up > fine on the mailman archives, but are empty posts on comp.lang.python. Is > there a problem with the mail -> usenet gateway? I don't see any empty posts on comp.lang.python. Can we talk abo

Re: Is the mailing list to usenet gateway borked?

2011-06-21 Thread Peter Pearson
On 20 Jun 2011 23:49:11 GMT, Steven D'Aprano wrote: [snip] > I will treat this as a bug in Pan, and take it to the appropriate forums, > but for anyone who cares, here's one example: > > From: Steven D'Aprano > Subject: Re: What is this syntax ? > Newsgroups: comp.lang.python > References:

Re: problem with bcd and a number

2011-08-05 Thread Peter Pearson
On Thu, 04 Aug 2011 21:52:45 +0200, Christoph Hansen wrote: > MRAB schrieb: > >> The value is MSB * 100 + (LSB>> 4) * 10 + (LSB& 0xF) > > i would say > > (MSB >> 4)*100 + (MSB & 0xF)*10 + (LSB >> 4) > > but who knows I concur. I think the documentation is trying to say that the low-order nibb

Re: lists and for loops

2011-08-18 Thread Peter Pearson
On Wed, 17 Aug 2011 20:08:23 -0700 (PDT), Emily Anne Moravec wrote: > I want to add 5 to each element of a list by using a for loop. > > Why doesn't this work? > > numbers = [1, 2, 3, 4, 5] > for n in numbers: > n = n + 5 > print numbers Because integers are immutable. You cannot turn 1 into

Re: List spam

2011-08-18 Thread Peter Pearson
On Thu, 18 Aug 2011 16:58:04 +0200, Alain Ketterlin wrote: > Ghodmode writes: > > [...] >> Make an effort to curb the spam even if it means killing the newsgroup >> availability. Choose mailman or Google Groups, or another single >> solution. Make it members only, but allow anyone to register wi

Re: List spam

2011-08-18 Thread Peter Pearson
On Thu, 18 Aug 2011 12:15:59 -0400, gene heskett wrote: [snip] > What is wrong with the mailing list only approach? In the mailing-list approach, how do I search for prior discussions on a subject? (I'm not particularly opposed to the mailing list, I'm just an NNTP follower worried about the unc

Re: Python problem

2011-03-28 Thread Peter Pearson
On Mon, 28 Mar 2011 11:38:29 -1000, John Parker wrote: [snip] > I have written the following code so far but get an error. > > infile = open("scores.txt", "r") > lines = infile.readlines() > infile.close() > tokens = lines.split(",") [snip] > error: > Traceback (most recent call last): > File

Re: scope of function parameters

2011-05-29 Thread Peter Pearson
On Sun, 29 May 2011 04:30:52 -0400, Henry Olders wrote: [snip] > def main(): > a = ['a list','with','three elements'] > print a > print fnc1(a) > print a > > def fnc1(b): > return fnc2(b) > > def fnc2(c): > c[1] = 'having' > return c > > This is the

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: http://marknelson.us/2012/10/09/the-random-compression-challenge-

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 can bet they're headed

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 >>> follow any new post that may come and I have to eith

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 di

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 one

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 > clr.AddReference("UnityEngine")AttributeError: 'module' object has

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 you

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 represent

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 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 > > def Checksum(fname,

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 > declaimed the following: > >> >>In 1964, the IBM exhibit at the World's Fair in New York demonstrated >>a system that read dates that visitors wrote by hand

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: > > https://www.guardiacostiera.gov.it/ven

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

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 t

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: >> [sni

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 bl

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 it

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 >> Python

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 in

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. > >Sahaj

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: 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. -- htt

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? > s1='atftp-0.7.2-x86_64-2_

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, substitut

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 \d{1,}[^.]').findall(tex

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 excit

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: 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 helpful-lo

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 can

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, invalid->c

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. Here'

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 /usr/l

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: 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: > > t=(students[i].user,students[i].user_i

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 rea

Re: How to split value where is comma ?

2016-09-07 Thread Peter Pearson
On Wed, 7 Sep 2016 08:51:36 -0700 (PDT), Asad ur Rehman wrote: [snip] > sofia/external/1203632525,CS_EXECUTE, > Outbound Call, > 12036325259, > ,12036325259, > , > ,ACTIVE, > 9047125683, > 9047125683, > RECV, > 75a9d3ee-7511-11e6-a115-89a1f4981d2c, > vb-pmedia,7841c6c0-7511-11e6

Re: Can this be easily done in Python?

2016-09-28 Thread Peter Pearson
On Tue, 27 Sep 2016 12:58:40 -0700 (PDT), TUA wrote: > Is the following possible in Python? > > Given how the line below works > > TransactionTerms = 'TransactionTerms' > > > have something like > > TransactionTerms = > > that sets the variable TransactionTerms to its own name as string > represe

Re: How to call this method from main method

2016-09-28 Thread Peter Pearson
On Tue, 27 Sep 2016 23:44:11 -0700 (PDT), prasanthk...@gmail.com wrote: [snip] > > if __name__ == '__main__': > > GenAccessToken("This_is_a_Test_QED_MAC_Key_Which_Needs_to_be_at_Least_32_Bytes_Long", > "default", "default", 6, >"g,m,a,s,c,p,d") > > When i am calling the abov

Re: Counting words in a string??

2016-09-30 Thread Peter Pearson
On Fri, 30 Sep 2016 11:37:19 -0700 (PDT), Jake wrote: > Hi, I need a program which: > 1) Asks the user for a sentence of their choice (not including punctuation) > 2) Ask the user which word they would like to know is repeated > 3) Print out to the user how many times the word came up which they c

Re: Need help for the print() function with a better order

2016-10-02 Thread Peter Pearson
On Sat, 1 Oct 2016 18:12:29 -0700 (PDT), 38016226...@gmail.com wrote: > I am trying to print a simple decision tree for my homework. > The answer must keep in this format: > > Top 7,4,0.95 > career gain = 100 > 1.Management 2, 3, 0.9709505944546686 > 2.Service 5, 1, 0.6500224216483541 >

Re: python (scipy) TypeError

2016-10-03 Thread Peter Pearson
On Mon, 3 Oct 2016 09:14:23 -0700 (PDT), chrischris201...@gmail.com wrote: [snip] > > i try to follow some tutorial but i have that error : > > Traceback (most recent call last): > File "C:\Python27\test\test\earth.py", line 42, in > slope_array = np.ones_like(data_array) * nodataval > TypeE

Re: Overlapping co-ordiantes of rectangles fail to print in python

2016-11-17 Thread Peter Pearson
On Thu, 17 Nov 2016 06:27:49 -0800 (PST), aruns...@gmail.com wrote: > I am working with following code in which I am trying to output co > ordinates of overlapping rectangles.. However the code fails to > output the co ordinates. I am customizing the following code [about 100 lines of code remo

Re: OT - "Soft" ESC key on the new MacBook Pro

2016-12-14 Thread Peter Pearson
On Tue, 13 Dec 2016 19:06:45 -0600, Skip Montanaro wrote: > I know this isn't a Python-specific question, but [snip] > Yes, I know I can use C-[ or the Alt key instead of ESC. I know this isn't the sort of answer you wanted, but . . . Train your fingers to use C-[. I did, decades ago, because

Re: OT - "Soft" ESC key on the new MacBook Pro

2016-12-15 Thread Peter Pearson
On Wed, 14 Dec 2016 11:50:30 -0600, Skip Montanaro wrote: > On Wed, Dec 14, 2016 at 11:40 AM, Peter Pearson > wrote: >> Train your fingers to use C-[. > > As I recall, the location of the Ctrl key was one of the differences > between Sun and PC101 keyboards. Doesn't

Re: [OT] Security question

2016-12-22 Thread Peter Pearson
On Thu, 22 Dec 2016 12:10:40 +0200, Frank Millman wrote: [snip] > > What about the second part of my query? Is it acceptable that they keep > passwords on their system in clear text? Absolutely not. Keeping the passwords, even encrypted, is a reckless invitation to disaster. Chris has done a f

Re: I need a lot of help...

2016-12-24 Thread Peter Pearson
On Sat, 24 Dec 2016 02:27:05 -0800 (PST), raulmaqueda6...@gmail.com wrote: > I do not know how to do this exercise, does anyone help me? > > Define the matrix_range (m) function that returns the range of an > array calculated by the Gaussian method. > > It should work with any number of rows and c

Sockets: IPPROTO_IP not supported

2017-01-15 Thread Peter Pearson
Trying to sniff Ethernet packets, I do this: s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) but it results in this: $ sudo python3 sniff_survey.py Traceback (most recent call last): File "sniff_survey.py", line 118, in s = socket.socket(socket.A

Re: Sockets: IPPROTO_IP not supported

2017-01-16 Thread Peter Pearson
On Mon, 16 Jan 2017 10:17:06 +, Joseph L. Casale wrote: >> Trying to sniff Ethernet packets, I do this: >> >>s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) >> >> but it results in this: >> >> $ sudo python3 sniff_survey.py >> Traceback (most recent call last)

Re: String Replacement

2017-01-24 Thread Peter Pearson
On Mon, 23 Jan 2017 13:23:38 -0800 (PST), subhabangal...@gmail.com wrote: > I have a string like > > "Trump is $ the president of USA % Obama was $ the president > of USA % Putin is $ the premier of Russia%" > > Here, I want to extract the portions from $...%, which would be > > "the president of

Re: count points where is within the polygons using shapely and fiona

2017-01-29 Thread Peter Pearson
On Sun, 29 Jan 2017 11:42:47 -0800 (PST), Xristos Xristoou wrote: > i tried to count points from the point shapefile where is within in > the polygon shapefile but i fail.Maybe my code is complete wrong but i > tried. > any idea how to fix my code ? > i want fast method because i have big data feat

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Peter Pearson
On Wed, 1 Feb 2017 07:10:39 -0800 (PST), Νίκος Βέργος wrote: > # Give user the file requested > url = "http://superhost.gr/data/files/%s"; % realfile > > user, password = 'user', 'passwd' > > r = requests.get( url, auth = (user, password) ) # send auth unconditionally > r.raise_for_status() >==

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 expressions" will be banned in th

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, l

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) Comp.l

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 c

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 map

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 collisi

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(), > li

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]) > 36

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: 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 va

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. -- https://mail.python.org/mailman/listinfo/python-l

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,

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: 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: 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 g

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 altern

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: 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 > names.ad

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 (en.wikipedia.o

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 > names.ad

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: 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 f

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: 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 b

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 l

  1   2   3   4   >