RE: A problem with str VS int.

2023-12-12 Thread AVI GROSS via Python-list
Roel, I sent a similar reply in private to someone who may not be listening as their mind is made up. This points to a serious problem with people not testing hypotheses adequately. Perhaps for homework, we can assign a request for a Python program that creates a random sample of quite a few

Re: A problem with str VS int.

2023-12-12 Thread dn via Python-list
On 12/12/23 21:22, Steve GS wrote: With all these suggestions on how to fix it, no one seems to answer why it fails only when entering a two-digit number. One and three work fine when comparing with str values. It is interesting that the leading 0 on a two digit worked. Still, one digit and thre

Re: A problem with str VS int.

2023-12-12 Thread Roel Schroeven via Python-list
Op 12/12/2023 om 9:22 schreef Steve GS via Python-list: With all these suggestions on how to fix it, no one seems to answer why it fails only when entering a two-digit number. One and three work fine when comparing with str values. It is interesting that the leading 0 on a two digit worked. Stil

RE: A problem with str VS int.

2023-12-12 Thread Steve GS via Python-list
now more of a curiosity as I did use the integer comparisons. SGA -Original Message- From: Python-list On Behalf Of dn via Python-list Sent: Sunday, December 10, 2023 12:53 AM To: python-list@python.org Subject: Re: A problem with str VS int. On 10/12/23 15:42, Steve GS via Python-list

Re: A problem with str VS int.

2023-12-09 Thread dn via Python-list
On 10/12/23 15:42, Steve GS via Python-list wrote: If I enter a one-digit input or a three-digit number, the code works but if I enter a two digit number, the if statement fails and the else condition prevails. tsReading = input(" Enter the " + Brand + " test strip reading: ")

Re: A problem with str VS int.

2023-12-09 Thread Thomas Passin via Python-list
On 12/9/2023 9:42 PM, Steve GS via Python-list wrote: If I enter a one-digit input or a three-digit number, the code works but if I enter a two digit number, the if statement fails and the else condition prevails. tsReading = input(" Enter the " + Brand + " test strip reading: ")

RE: A problem with str VS int.

2023-12-09 Thread AVI GROSS via Python-list
user can enter any text, they might enter ".01" or "hello" or al kinds of nonsense. If you converted to numbers and tested whether it failed, ... -Original Message- From: Python-list On Behalf Of Steve GS via Python-list Sent: Saturday, December 9, 2023 9:42 PM To: pyth

A problem with str VS int.

2023-12-09 Thread Steve GS via Python-list
If I enter a one-digit input or a three-digit number, the code works but if I enter a two digit number, the if statement fails and the else condition prevails. tsReading = input(" Enter the " + Brand + " test strip reading: ") if tsReading == "": tsReading = "0" print(t

Re: Silly/crazy problem with sqlite

2023-11-26 Thread Chris Green via Python-list
Stefan Ram wrote: > Chris Green writes: > >I have to say this seems very non-pythonesque to me, the 'obvious' > >default simply doesn't work right, and I really can't think of a case > >where the missing comma would make any sense at all. > > |6.15 Expression lists > ... > |an expression list co

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Thomas Passin via Python-list
On 11/24/2023 4:49 PM, Rimu Atkinson via Python-list wrote: I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a string.

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Mats Wichmann via Python-list
On 11/24/23 14:10, Chris Green via Python-list wrote: Chris Green wrote: This is driving me crazy, I'm running this code:- OK, I've found what's wrong:- cr.execute(sql, ('%' + "2023-11" + '%')) should be:- cr.execute(sql, ('%' + x + '%',) ) I have to say this seems very

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Sibylle Koczian via Python-list
Am 24.11.2023 um 22:49 schrieb Rimu Atkinson via Python-list: I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a strin

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Chris Green via Python-list
Chris Green wrote: > This is driving me crazy, I'm running this code:- OK, I've found what's wrong:- > cr.execute(sql, ('%' + "2023-11" + '%')) should be:- cr.execute(sql, ('%' + x + '%',) ) I have to say this seems very non-pythonesque to me, the 'obvious' default simply doesn'

Silly/crazy problem with sqlite

2023-11-25 Thread Chris Green via Python-list
This is driving me crazy, I'm running this code:- #!/usr/bin/env python3 # # # Show the electric fence history, default to last 24 hours # import sqlite3 import datetime import sys today = datetime.datetime.now()

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Rimu Atkinson via Python-list
I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a string. PyDev console: starting. Python 3.9.15 (main, Oct 28 2022

Re: Problem with accented characters in mailbox.Maildir()

2023-05-09 Thread Peter J. Holzer
On 2023-05-08 23:02:18 +0200, jak wrote: > Peter J. Holzer ha scritto: > > On 2023-05-06 16:27:04 +0200, jak wrote: > > > Chris Green ha scritto: > > > > Chris Green wrote: > > > > > A bit more information, msg.get("subject", "unknown") does return a > > > > > string, as follows:- > > > > > > > >

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Peter J. Holzer
On 2023-05-06 16:27:04 +0200, jak wrote: > Chris Green ha scritto: > > Chris Green wrote: > > > A bit more information, msg.get("subject", "unknown") does return a > > > string, as follows:- > > > > > > Subject: > > > =?utf-8?Q?aka_Marne_=C3=A0_la_Sa=C3=B4ne_(Waterways_Continental_Europe)?=

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread jak
Chris Green ha scritto: Chris Green wrote: A bit more information, msg.get("subject", "unknown") does return a string, as follows:- Subject: =?utf-8?Q?aka_Marne_=C3=A0_la_Sa=C3=B4ne_(Waterways_Continental_Europe)?= So it's the 'searchTxt in msg.get("subject", "unknown")' that's failing.

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
Chris Green wrote: > A bit more information, msg.get("subject", "unknown") does return a > string, as follows:- > > Subject: > =?utf-8?Q?aka_Marne_=C3=A0_la_Sa=C3=B4ne_(Waterways_Continental_Europe)?= > > So it's the 'searchTxt in msg.get("subject", "unknown")' that's > failing. I.e. for so

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
A bit more information, msg.get("subject", "unknown") does return a string, as follows:- Subject: =?utf-8?Q?aka_Marne_=C3=A0_la_Sa=C3=B4ne_(Waterways_Continental_Europe)?= So it's the 'searchTxt in msg.get("subject", "unknown")' that's failing. I.e. for some reason 'in' isn't working when th

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread jak
Chris Green ha scritto: I have a custom mail filter in python that uses the mailbox package to open a mail message and give me access to the headers. So I have the following code to open each mail message:- # # # Read the message from standard input and make a message object from

Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
I have a custom mail filter in python that uses the mailbox package to open a mail message and give me access to the headers. So I have the following code to open each mail message:- # # # Read the message from standard input and make a message object from it # msg = mailb

Re: Problem with Matplotlib example

2023-04-14 Thread Martin Schöön
Den 2023-04-13 skrev MRAB : > On 2023-04-13 19:41, Martin Schöön wrote: >> Anyone had success running this example? >> https://tinyurl.com/yhhyc9r >> >> As far as I know I have an up-to-date matplotlib installed. Pip has >> nothing more modern to offer me. >> > All I can say is that it works for

Re: Problem with Matplotlib example

2023-04-13 Thread MRAB
On 2023-04-13 19:41, Martin Schöön wrote: Anyone had success running this example? https://tinyurl.com/yhhyc9r When I try I get this error: "TypeError: __init__() got an unexpected keyword argument 'transform'" This is for the line "m = MarkerStyle(SUCESS_SYMBOLS[mood], transform=t)" Yes,

Re: Problem with Matplotlib example

2023-04-13 Thread Thomas Passin
On 4/13/2023 2:41 PM, Martin Schöön wrote: Anyone had success running this example? https://tinyurl.com/yhhyc9r When I try I get this error: "TypeError: __init__() got an unexpected keyword argument 'transform'" This is for the line "m = MarkerStyle(SUCESS_SYMBOLS[mood], transform=t)" Yes,

Problem with Matplotlib example

2023-04-13 Thread Martin Schöön
Anyone had success running this example? https://tinyurl.com/yhhyc9r When I try I get this error: "TypeError: __init__() got an unexpected keyword argument 'transform'" This is for the line "m = MarkerStyle(SUCESS_SYMBOLS[mood], transform=t)" Yes, I know, I could dive into the documentation

RE: Problem with __sub__

2023-03-23 Thread David Raymond
I believe your problem is __rsub__, not __sub__. When you havethen that uses the "r" version of the operators. In your __rsub__ (used when you have - ) you instead return - which is backwards. Notice how the final return should also be -4,95 and not the +4,95 it's returning. > If on th

Problem with __sub__

2023-03-23 Thread Egon Frerich
The class Betragswert is used for numerical values as string or integer and for additions and subtraction. If on the left side is '0' the result of a subtraction is wrong. *    b1 = Betragswert(500)     b2 = 0 + b1     b3 = 0 - b1     b4 = 5 + b1     b5 = 5 - b1* print(b1, b2, b3, b4, b5) show

Re: Problem with wxPython form

2023-03-12 Thread aapost
On 3/10/23 15:15, Chris wrote: Hi everyone. I'm new to Python and wxPython. I've got a form I use to calculate the Sq In of a leather project. I'm using python 3.9.13 and wxPython 4.20 I'm having the following issues: 1) When I come into the form, no grid cell has the focus set - I start typi

Problem with wxPython form

2023-03-10 Thread Chris
Hi everyone. I'm new to Python and wxPython. I've got a form I use to calculate the Sq In of a leather project. I'm using python 3.9.13 and wxPython 4.20 I'm having the following issues: 1) When I come into the form, no grid cell has the focus set - I start typing and nothing happens. I have t

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: A problem with itertools.groupby

2021-12-17 Thread Chris Angelico
On Sat, Dec 18, 2021 at 2:32 AM ast wrote: > > Python 3.9.9 > > Hello > > I have some troubles with groupby from itertools > > from itertools import groupby > > li = [grp for k, grp in groupby("aahfffddnnb")] > list(li[0]) > > [] > > list(li[1]) > > [] > > It seems empty ... I don't understand

Re: A problem with itertools.groupby

2021-12-17 Thread Antoon Pardon
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. The group-iterators are connected. Each group-iterator is a wrapper around the original it

A problem with itertools.groupby

2021-12-17 Thread ast
Python 3.9.9 Hello I have some troubles with groupby from itertools from itertools import groupby for k, grp in groupby("aahfffddnnb"): print(k, list(grp)) print(k, list(grp)) a ['a', 'a'] a [] h ['h'] h [] f ['f', 'f', 'f'] f [] d ['d', 'd'] d [] s ['s', 's', 's', 's'] s [] n ['n

RE: Problem with concatenating two dataframes

2021-11-08 Thread Schachner, Joseph
be shocked if you couldn't do it. Joseph S. Teledyne Confidential; Commercially Sensitive Business Data -Original Message- From: Mahmood Naderan Sent: Saturday, November 6, 2021 6:01 PM To: python-list@python.org; MRAB Subject: Re: Problem with concatenating two datafram

Re: Problem with concatenating two dataframes

2021-11-06 Thread Mahmood Naderan via Python-list
>The second argument of pd.concat is 'axis', which defaults to 0. Try >using 1 instead of 0. Unfortunately, that doesn't help... dict[name] = pd.concat( [dict[name],values], axis=1 ) {'dummy': Value M1  0 M2  0 M3  0, 'K1':Value  Value 0   10.0NaN 15.0NaN 2  

Re: Problem with concatenating two dataframes

2021-11-06 Thread MRAB
On 2021-11-06 20:12, Mahmood Naderan wrote: >Try this instead: > > >    dict[name] = pd.concat([dict[name], values]) OK. That fixed the problem, however, I see that they are concatenated vertically. How can I change that to horizontal? The printed dictionary in the end looks like {'dummy':

Re: Problem with concatenating two dataframes

2021-11-06 Thread Mahmood Naderan via Python-list
>Try this instead: > > >    dict[name] = pd.concat([dict[name], values]) OK. That fixed the problem, however, I see that they are concatenated vertically. How can I change that to horizontal? The printed dictionary in the end looks like {'dummy': Value M1  0 M2  0 M3  0, 'K1':

Re: Problem with concatenating two dataframes

2021-11-06 Thread MRAB
On 2021-11-06 16:16, Mahmood Naderan via Python-list wrote: In the following code, I am trying to create some key-value pairs in a dictionary where the first element is a name and the second element is a dataframe. # Creating a dictionary data = {'Value':[0,0,0]} kernel_df = pd.DataFrame(data,

Problem with concatenating two dataframes

2021-11-06 Thread Mahmood Naderan via Python-list
In the following code, I am trying to create some key-value pairs in a dictionary where the first element is a name and the second element is a dataframe. # Creating a dictionary data = {'Value':[0,0,0]} kernel_df = pd.DataFrame(data, index=['M1','M2','M3']) dict = {'dummy':kernel_df} # dummy  -

Re: Problem with python

2021-09-06 Thread Grant Edwards
On 2021-09-04, Hope Rouselle wrote: > Igor Korot writes: > >> Hi, >> Will this syntax work in python 2? > > If you say > > print(something) > > it works in both. But it doesn't always work the _same_ in both. If you're expecting some particular output, then one or the other might not won't "wo

Re: Problem with python

2021-09-04 Thread Grant Edwards
On 2021-09-04, Peter J. Holzer wrote: > On 2021-09-04 14:29:47 -0500, Igor Korot wrote: >> Will this syntax work in python 2? > > Yes. It's just a redundant pair of parentheses. Not really. With the parens, it doesn't produce the same results in 2.x unless you import the print function from the f

Re: Problem with python

2021-09-04 Thread Terry Reedy
On 9/4/2021 2:27 PM, Igor Korot wrote: Hi, ALL, [code] igor@WaylandGnome ~/bakefile $ python Python 3.9.6 (default, Aug 8 2021, 17:26:32) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. from distutils import sysconfig In 3.10, distutils and d.sysc

Re: Problem with python

2021-09-04 Thread Dennis Lee Bieber
On Sat, 4 Sep 2021 22:41:12 +0200, "Peter J. Holzer" declaimed the following: >Python 3 to be time well spent in 2021, especially not to someone who >apparently just wants to report a bug to some unnamed project (whose >maintainers may or may not care about Python2 compatibility). > Give

Re: Problem with python

2021-09-04 Thread Hope Rouselle
Igor Korot writes: > Hi, > Will this syntax work in python 2? If you say print(something) it works in both. So, stick to this syntax. -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem with python

2021-09-04 Thread Peter J. Holzer
On 2021-09-04 21:07:11 +0100, Rob Cliffe via Python-list wrote: > Well, up to a point. > In Python 2 the output from >     print 1, 2 > is '1 2' > In Python 3 if you add brackets: >     print(1, 2) > the output is the same. > But if you transplant that syntax back into Python 2, the output from >  

Re: Problem with python

2021-09-04 Thread Rob Cliffe via Python-list
Well, up to a point. In Python 2 the output from     print 1, 2 is '1 2' In Python 3 if you add brackets:     print(1, 2) the output is the same. But if you transplant that syntax back into Python 2, the output from     print(1, 2) is '(1, 2)'.  The brackets have turned two separate items into a s

Re: Problem with python

2021-09-04 Thread Peter J. Holzer
On 2021-09-04 14:29:47 -0500, Igor Korot wrote: > Will this syntax work in python 2? Yes. It's just a redundant pair of parentheses. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stros

Re: Problem with python

2021-09-04 Thread Igor Korot
Hi, Will this syntax work in python 2? Thank you. On Sat, Sep 4, 2021 at 1:52 PM dn via Python-list wrote: > > On 05/09/2021 06.27, Igor Korot wrote: > > Hi, ALL, > > > > [code] > > igor@WaylandGnome ~/bakefile $ python > > Python 3.9.6 (default, Aug 8 2021, 17:26:32) > > [GCC 10.3.0] on linux

Re: Problem with python

2021-09-04 Thread Igor Korot
Thx guys. I submitted a bug report for the project that uses it. On Sat, Sep 4, 2021 at 1:42 PM Joel Goldstick wrote: > > On Sat, Sep 4, 2021 at 2:29 PM Igor Korot wrote: > > > > Hi, ALL, > > > > [code] > > igor@WaylandGnome ~/bakefile $ python > > Python 3.9.6 (default, Aug 8 2021, 17:26:32) >

Re: Problem with python

2021-09-04 Thread dn via Python-list
On 05/09/2021 06.27, Igor Korot wrote: > Hi, ALL, > > [code] > igor@WaylandGnome ~/bakefile $ python > Python 3.9.6 (default, Aug 8 2021, 17:26:32) > [GCC 10.3.0] on linux > Type "help", "copyright", "credits" or "license" for more information. from distutils import sysconfig print sysc

Re: Problem with python

2021-09-04 Thread Mats Wichmann
On 9/4/21 12:27 PM, Igor Korot wrote: Hi, ALL, [code] igor@WaylandGnome ~/bakefile $ python Python 3.9.6 (default, Aug 8 2021, 17:26:32) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. from distutils import sysconfig print sysconfig.get_python_inc()

Re: Problem with python

2021-09-04 Thread Joel Goldstick
On Sat, Sep 4, 2021 at 2:29 PM Igor Korot wrote: > > Hi, ALL, > > [code] > igor@WaylandGnome ~/bakefile $ python > Python 3.9.6 (default, Aug 8 2021, 17:26:32) > [GCC 10.3.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> from distutils import sysconfig >

Problem with python

2021-09-04 Thread Igor Korot
Hi, ALL, [code] igor@WaylandGnome ~/bakefile $ python Python 3.9.6 (default, Aug 8 2021, 17:26:32) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils import sysconfig >>> print sysconfig.get_python_inc() File "", line 1 print sysc

Re: Problem with pip installation

2021-05-27 Thread Mats Wichmann
On 5/27/21 1:08 PM, Dennis Lee Bieber wrote: On Thu, 27 May 2021 09:22:09 +0300, ? ??? declaimed the following: Good morning. I have o Windows 10 system and i can install pip. I try to follow the instruction that i find on internet but the did not work. Also itry to write the c

Problem with pip installation

2021-05-27 Thread ΔΗΜΗΤΡΙΟΣ ΠΟΥΛΟΠΟΥΛΟΣ
Good morning. I have o Windows 10 system and i can install pip. I try to follow the instruction that i find on internet but the did not work. Also itry to write the command pip install pip but again did not work. Also the command py. did not work. Thank you! -- Yours sincerely Dimitris --

Re: Problem with printing statement when condition is false

2021-03-05 Thread Terry Reedy
On 3/4/2021 4:28 PM, Terry Reedy wrote: Quentin privately sent me 12 lines (which should have been posted here instead), which can be reduced to the following 4 that exhibit his bug. if a == b:     print('correct')     if a != b:     print('incorrect') The bug is a != b will never be t

Re: Problem with printing statement when condition is false

2021-03-04 Thread Terry Reedy
On 3/4/2021 3:15 PM, Terry Reedy wrote: On 3/4/2021 12:10 PM, Quentin Bock wrote: I won't paste the code into this because it's 164 lines so I will attach a file copy, The alternative to posting too much is to reduce your code to the minimum needed to exhibit the behavior you want to change.

Re: Problem with printing statement when condition is false

2021-03-04 Thread Terry Reedy
On 3/4/2021 12:10 PM, Quentin Bock wrote: I won't paste the code into this because it's 164 lines so I will attach a file copy, The alternative to posting too much is to reduce your code to the minimum needed to exhibit the behavior you want to change. Doing so may reveal to you the solutio

Problem with printing statement when condition is false

2021-03-04 Thread Quentin Bock
Okay so, this is my biggest project, I'm not advanced in Python in any way so don't expect it to be perfect. I made a trivia game and for the most part, it works but I can't get it to print "Incorrect" and then what the answer was for all but one of my questions and I don't know why. I use PyCharm

Re: A problem with opening a file -- again

2020-11-30 Thread Chris Angelico
On Tue, Dec 1, 2020 at 5:36 AM Dennis Lee Bieber wrote: > Off-hand, since you aren't explicitly using "del lf" it means that > __del__() is being called during the process shutdown. Thing is, there is > no guarantee during shutdown of when things are deleted. There is a faint > possibility

Re: A problem with opening a file -- again

2020-11-29 Thread Eryk Sun
On 11/29/20, Chris Angelico wrote: > > This seems like a really REALLY bad idea. You're putting a lot of work > into your __del__ function, and that's not getting called until > everything's shutting down. (Also, xrange doesn't exist, hence the > "exception ignored" thing.) > > Avoid putting this

Re: A problem with opening a file -- again

2020-11-29 Thread dn via Python-list
On 30/11/2020 10:36, Gabor Urban wrote: Hi guys, I tried to solve the problem once again. I have inserted some print statements the check the variables. The actual code (naplo.py) is copy-pasted here: Thanks = helpful +1 @Chris' response! Meantime, what happens if you start python, and ent

Re: A problem with opening a file -- again

2020-11-29 Thread Chris Angelico
On Mon, Nov 30, 2020 at 8:37 AM Gabor Urban wrote: > class Naplo: > def __del__(self): > if self.sor != 0: > if self.start: > trc = open(self.logNev,self.startMode) > else: > trc = open(self.logNev,self.mode) > for idx

A problem with opening a file -- again

2020-11-29 Thread Gabor Urban
Hi guys, I tried to solve the problem once again. I have inserted some print statements the check the variables. The actual code (naplo.py) is copy-pasted here: class Naplo: def __init__(self, pNeve, pMeret, pMode = 'a'): self.logNev = pNeve self.meret = pMeret

Re: A problem with opening a file

2020-11-29 Thread Dieter Maurer
Gabor Urban wrote at 2020-11-29 08:56 +0100: >I am facing an issue I was not able to solve yet. I have a class saving >messages to a file. The relevant code is: > > > >import OS >import sys > >class MxClass: > >def __init__(self, fName, fMode,): >self.fileName = fName >s

Re: A problem with opening a file

2020-11-29 Thread dn via Python-list
On 29/11/2020 20:56, Gabor Urban wrote: Hi, I am facing an issue I was not able to solve yet. I have a class saving messages to a file. The relevant code is: import OS if you're wanting the Python Standard Library, this should not be in upper-case import sys are these two imports

A problem with opening a file

2020-11-28 Thread Gabor Urban
Hi, I am facing an issue I was not able to solve yet. I have a class saving messages to a file. The relevant code is: import OS import sys class MxClass: def __init__(self, fName, fMode,): self.fileName = fName self.fileMode = fMode def writeMetho

Re: Problem with rearanging list with paired letters next to each others

2020-11-11 Thread dn via Python-list
On 12/11/2020 00:45, Bischoop wrote: I see now I overcomplicated it, what is a good idea then? This is a variation on a data-compression technique called RLE=Run-Length Encoding (excepting that in this case there is no need to count the repetitions). Web.Ref: https://stackabuse.com/run-len

Re: Problem with rearanging list with paired letters next to each others

2020-11-11 Thread Bischoop
On 2020-11-11, MRAB wrote: >> > Points to note in your first code: > > 1. Modifying a list while iterating over it is a bad idea. > > 2. You're modifying the list that you're passing in and also returning > it. That's a bad idea. Either modify it in place or modify and return a > copy. > > 3. T

Re: Problem with rearanging list with paired letters next to each others

2020-11-10 Thread MRAB
On 2020-11-11 01:26, Bischoop wrote: Can anybody help?Here's the code that gives me a hedeache for second day https://bpa.st/XLOA If I have letter_list = ["a","a",,"b","b","c","c"] it's working correctly but if I have three or more of any letters for example:letter_list = ["a","a","a","b","b","

Problem with rearanging list with paired letters next to each others

2020-11-10 Thread Bischoop
Can anybody help?Here's the code that gives me a hedeache for second day https://bpa.st/XLOA If I have letter_list = ["a","a",,"b","b","c","c"] it's working correctly but if I have three or more of any letters for example:letter_list = ["a","a","a","b","b","c","c"], I'm ending up with some pair

Re: PROBLEM WITH PYTHON IDLE

2020-05-14 Thread Mats Wichmann
On 5/14/20 5:15 AM, aduojo samson wrote: > Hello, my name is Samson Haruna and I am from Nigeria.I have a problem with > my python 3.8, any time I click on it to write my python code I get this > error message "IDLE subprocess didn't make connection". I have uninstalled &

Re: PROBLEM WITH PYTHON IDLE

2020-05-14 Thread Souvik Dutta
What is your os? Where have you downloaded it from? What type of package did you download? Souvik flutter dev On Thu, May 14, 2020, 5:36 PM aduojo samson wrote: > Hello, my name is Samson Haruna and I am from Nigeria.I have a problem with > my python 3.8, any time I click on it to wr

PROBLEM WITH PYTHON IDLE

2020-05-14 Thread aduojo samson
Hello, my name is Samson Haruna and I am from Nigeria.I have a problem with my python 3.8, any time I click on it to write my python code I get this error message "IDLE subprocess didn't make connection". I have uninstalled and reinstalled several times, I have even deleted and d

Re: Help Problem with python : python-3.8.3rc1-amd64

2020-05-13 Thread Mats Wichmann
On 5/11/20 9:25 PM, Michael Torrie wrote: > On 5/11/20 8:33 PM, Buddy Peacock wrote: >> I am trying to install python on my surface with windows 10, version 1903, >> build 18362.778. The installer seems to think everything worked. But there >> is no Python folder anywhere on the system. I looked

Re: Help Problem with python : python-3.8.3rc1-amd64

2020-05-12 Thread Terry Reedy
On 5/11/2020 11:34 PM, Michael Torrie wrote: On 5/11/20 9:25 PM, Michael Torrie wrote: On 5/11/20 8:33 PM, Buddy Peacock wrote: I am trying to install python on my surface with windows 10, version 1903, build 18362.778. The installer seems to think everything worked. But there is no Python fol

Re: Help Problem with python : python-3.8.3rc1-amd64

2020-05-11 Thread Michael Torrie
On 5/11/20 9:25 PM, Michael Torrie wrote: > On 5/11/20 8:33 PM, Buddy Peacock wrote: >> I am trying to install python on my surface with windows 10, version 1903, >> build 18362.778. The installer seems to think everything worked. But there >> is no Python folder anywhere on the system. I looked

Re: Help Problem with python : python-3.8.3rc1-amd64

2020-05-11 Thread Michael Torrie
On 5/11/20 8:33 PM, Buddy Peacock wrote: > I am trying to install python on my surface with windows 10, version 1903, > build 18362.778. The installer seems to think everything worked. But there > is no Python folder anywhere on the system. I looked in the root directory > as well as "Program Fil

Help Problem with python : python-3.8.3rc1-amd64

2020-05-11 Thread Buddy Peacock
I am trying to install python on my surface with windows 10, version 1903, build 18362.778. The installer seems to think everything worked. But there is no Python folder anywhere on the system. I looked in the root directory as well as "Program Files" and "Program Files (x86)" and not in any user

Re: Problem with doctest

2020-05-04 Thread Dieter Maurer
ast wrote at 2020-5-4 15:20 +0200: >doctest of the sample function funct() doesn't works >because flag used by funct() is the one defined in >first line "flag = True" and not the one in the >doctest code ">>> flag = False". > >Any work around known ? > > >flag = True # <- funct() alway

Re: Problem with doctest

2020-05-04 Thread Peter Otten
Unknown wrote: > Hello > > doctest of the sample function funct() doesn't works > because flag used by funct() is the one defined in > first line "flag = True" and not the one in the > doctest code ">>> flag = False". > > Any work around known ? You can import the module where funct() is define

Problem with doctest

2020-05-04 Thread ast
Hello doctest of the sample function funct() doesn't works because flag used by funct() is the one defined in first line "flag = True" and not the one in the doctest code ">>> flag = False". Any work around known ? flag = True # <- funct() always use this one def funct(): """

Re: What is the problem with my code?

2020-04-26 Thread Chris Angelico
On Mon, Apr 27, 2020 at 4:26 PM wrote: > > def is_positive_int(int): > x = int[0] > if int == "": > return Flase > elif int != "": > print(True) > if int[0] < 1: > return false > else: > print(True) > for x in int: > if x > 0 and x < 10:

What is the problem with my code?

2020-04-26 Thread yoavmelnik5
def is_positive_int(int): x = int[0] if int == "": return Flase elif int != "": print(True) if int[0] < 1: return false else: print(True) for x in int: if x > 0 and x < 10: print(True) x = x + 1 else: return Fal

Re: problem with python 3.8.1

2020-01-20 Thread DL Neil via Python-list
On 20/01/20 7:35 PM, coolguy 12336 wrote: hi I can not install the py launcher and I really need it for something I used repair and tried it again but it still didn't work.Do you know how to fix my issue and if you do please email me back as soon as possible thank you. Hi, are you a student -

problem with python 3.8.1

2020-01-20 Thread coolguy 12336
hi I can not install the py launcher and I really need it for something I used repair and tried it again but it still didn't work.Do you know how to fix my issue and if you do please email me back as soon as possible thank you. -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem with pip

2020-01-13 Thread Terry Reedy
On 1/13/2020 12:00 AM, Helal Uddin wrote: When I first installed python, I didn’t have Pip. In Command Prompt, run > python -m ensurepip But when I installed python a few days ago, it’s showing this problem. What problem? -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/p

Problem with pip

2020-01-13 Thread Helal Uddin
When I first installed python, I didn’t have Pip. But when I installed python a few days ago, it’s showing this problem. Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: problem with curring in python

2019-10-22 Thread Terry Reedy
On 10/22/2019 6:15 AM, Antoon Pardon wrote: On 22/10/19 12:02, Terry Reedy wrote: On 10/22/2019 4:58 AM, Antoon Pardon wrote: Using python 3.5 I have been experimenting with curried functions. A bit like in Haskell. So I can write the following function: def sum4(a, b, c, d): return a +

Re: problem with curring in python

2019-10-22 Thread Peter Otten
Antoon Pardon wrote: > On 22/10/19 12:02, Terry Reedy wrote: >> On 10/22/2019 4:58 AM, Antoon Pardon wrote: >>> Using python 3.5 >>> >>> I have been experimenting with curried functions. A bit like in Haskell. >>> So I can write the following function: >>> >>> def sum4(a, b, c, d): >>> return a +

Re: problem with curring in python

2019-10-22 Thread Antoon Pardon
On 22/10/19 12:02, Terry Reedy wrote: > On 10/22/2019 4:58 AM, Antoon Pardon wrote: >> Using python 3.5 >> >> I have been experimenting with curried functions. A bit like in Haskell. >> So I can write the following function: >> >> def sum4(a, b, c, d): >> return a + b + c + d >> >> summing = c

Re: problem with curring in python

2019-10-22 Thread Terry Reedy
On 10/22/2019 4:58 AM, Antoon Pardon wrote: Using python 3.5 I have been experimenting with curried functions. A bit like in Haskell. So I can write the following function: def sum4(a, b, c, d): return a + b + c + d summing = curry(sum4) print summing(1)(2)(3)(4) # this prints 10. The p

problem with curring in python

2019-10-22 Thread Antoon Pardon
Using python 3.5 I have been experimenting with curried functions. A bit like in Haskell. So I can write the following function: def sum4(a, b, c, d): return a + b + c + d summing = curry(sum4) print summing(1)(2)(3)(4) # this prints 10. The problem is I need the signature of the original

Re: Installation problem with python 3.7 in windows 7 ultimate p.c(32 bit) showing unspecified error 0x80072ee7...

2019-05-22 Thread eryk sun
On 5/22/19, Sirso Bhatto wrote: > >I am Shirsendu. I encountered a problem while installing python 3.7 > in my windows 7 ultimate p.c(32 bit) . It is showing an unspecified error > of 0x80072ee7 when i am trying to initialize it in my pc. Please help me. A status code with only the high b

Installation problem with python 3.7 in windows 7 ultimate p.c(32 bit) showing unspecified error 0x80072ee7...

2019-05-22 Thread Sirso Bhatto
Hi.. I am Shirsendu. I encountered a problem while installing python 3.7 in my windows 7 ultimate p.c(32 bit) . It is showing an unspecified error of 0x80072ee7 when i am trying to initialize it in my pc. Please help me. -- https://mail.python.org/mailman/listinfo/python-list

Re: Help? How do i solve this problem with Python List Concept

2019-05-14 Thread Peter J. Holzer
On 2019-05-11 22:02:39 +0100, Ben Bacarisse wrote: > Donald Tripdarlinq writes: > > In the traditional Yoruba tribal Set-Up in Nigeria,West Africa the > > tradition of inheritance is very important. Now, The relative position > > of a child in the family counts when the issue of inheritance is > >

Re: Help? How do i solve this problem with Python List Concept

2019-05-11 Thread Gregory Ewing
Chris Angelico wrote: Given that we're dealing with a Nigerian inheritance, your Python program will probably need to start with "import smtplib", and the list in question will be the addresses of the people to send your 419 to Obviously it's a Nigerian homework scam. "Dearest Sir,I am the

Re: Help? How do i solve this problem with Python List Concept

2019-05-11 Thread Chris Angelico
On Sun, May 12, 2019 at 10:33 AM Donald Tripdarlinq wrote: > > In the traditional Yoruba tribal Set-Up in Nigeria,West Africa the tradition > of inheritance is very important. Now, The relative position of a child in > the family counts when the issue of inheritance is considered. > > Question:

Re: Help? How do i solve this problem with Python List Concept

2019-05-11 Thread Ben Bacarisse
Donald Tripdarlinq writes: > In the traditional Yoruba tribal Set-Up in Nigeria,West Africa the > tradition of inheritance is very important. Now, The relative position > of a child in the family counts when the issue of inheritance is > considered. > > Question: Now a farmer with 10 children die

  1   2   3   4   5   6   7   8   9   10   >