Re: count consecutive elements

2021-09-27 Thread Bischoop
I'd wish to have this challenge posted on my blog but because I suck in IT english, could you guys help me with decribing the task of what the code supposed to do? -- Thanks -- https://mail.python.org/mailman/listinfo/python-list

Python for Android

2021-07-19 Thread Bischoop
Will Python delevopment apps for Android OS getting easier? So far best option is Kivy which is not liked by many developers, another option is PyQT5, which finally gets some support but there still are some buts.. Tkinter, some tried but it's still a NO for Android support. --

Re: If you have Python Cookbook, 3rd ed.

2021-05-21 Thread Bischoop
On 2021-05-19, Terry Reedy wrote: > can you verify that the Algorithm chapter (near end in 2nd ed.) does > *NOT* have an introduction by Tim Peters? > (Info needed to verify timeit doc correction > https://github.com/python/cpython/pull/21744) Preface .. xi 1.Data Structure adn

Re: do ya still use python?

2021-04-21 Thread Bischoop
On 2021-04-19, Unbreakable Disease wrote: >> do ya still use python? That's why we're all here. > almost no useful posts here for almost a year. is python dying? It's not a Python thing, it's Usenet that's not used as much today as decade ago. There's a lot of places in a Internet to talk

Yield after the return in Python function.

2021-04-05 Thread Bischoop
The return suspends the function execution so how is it that in below example I got output: def doit(): return 0 yield 0 print(doit()) -- https://mail.python.org/mailman/listinfo/python-list

Re: Button placement

2021-03-09 Thread Bischoop
On 2021-03-09, Terry Reedy wrote: > > Say more clearly what you want/expect and what you are getting and why > you are unhappy. > It solved Terry, I wanted center the button on top, had only 3 columns (0,1,2) and was unaware that I could use "columnspan=3" as it ends on 2, I was using

Re: Button placement

2021-03-09 Thread Bischoop
On 2021-03-09, Richard Damon wrote: > > One thing to remember is that span is sort of like range, range(3) is > [0, 1, 2] > Right, ends on 2. Thanks again, that ended mine frustration lol. -- Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Button placement

2021-03-09 Thread Bischoop
On 2021-03-09, Peter Otten <__pete...@web.de> wrote: > On 09/03/2021 03:08, Bischoop wrote: >> >> I try for a while place the top button in a a middle of column=0 with >> span to column2 below so the button being centered to those, > > I'm not sure what you mean,

Button placement

2021-03-08 Thread Bischoop
I try for a while place the top button in a a middle of column=0 with span to column2 below so the button being centered to those, tried with canvas as well but with no success. Is someone with Tkinter experience able to advice what I could do? from tkinter import * from tkinter import ttk

Re: Tkinter new window contentent when button is clicked.

2021-02-28 Thread Bischoop
On 2021-02-25, MRAB wrote: >> > The trick is to put the "pages" on top of each other and then show the > appropriate one, something like this: > import tkinter as tk > > def on_next_page(): > # Brings page 2 to the top. > frame_2.tkraise() > > def on_previous_page(): > # Brings

Re: Tkinter new window contentent when button is clicked.

2021-02-24 Thread Bischoop
On 2021-02-24, Bischoop wrote: > Just came to solution, I learnt that the combobox can be bind and call function when combobox value changes. -- Thanks -- https://mail.python.org/mailman/listinfo/python-list

Tkinter new window contentent when button is clicked.

2021-02-24 Thread Bischoop
I'm learning Tkinter now and have upgraded few programs I've made in CLI in the past. What is bothering me now is what I should look at when I want new content in a window when button is 'Next' is clicked. In some programs we're clicking button next and new content appears in same window. I've

Re: Deleting Python 3.8.5

2021-02-22 Thread Bischoop
On 2021-02-22, Vinicius Costa Marques wrote: > Hello there Python team, I’m having this problem were I installed >Python 3.9.2 and then went to unistall 3.8.5 but here is the problem >the version 3.8.5 dosen’t get deleted properly. >The uninstall program says that everything worked but the files

Problem when scraping the 100 Movie titles.

2021-02-18 Thread Bischoop
I'm learning Scraping actually and would like to scrape the movie titles from https://www.empireonline.com/movies/features/best-movies-2 . In the course I was learning I was supposed to do it with bs4: titles = soup.find_all(name = 'h3', class_ = 'title') but after after a while I guess the

Response for PING in ircbot.

2021-01-30 Thread Bischoop
Got problem with responding for Ping, tried so many ways to response and always end up with time out or other error. This time: ERROR :(Ping timeout: 264 seconds) Traceback (most recent call last): s.send(bytes('PONG ' + data.split()[1], 'UTF-8')) BrokenPipeError: [Errno 32] Broken pipe

Re: imalib cant get From: adresses

2021-01-27 Thread Bischoop
On 2021-01-27, Bischoop wrote: Solved using IMAP4.uid. -- https://mail.python.org/mailman/listinfo/python-list

imalib cant get From: adresses

2021-01-27 Thread Bischoop
I don't have much experience with imaplib and for a few days can't manage to get properly, I followed also some tutorial but also met few problems. What I want is to get email addresses from emails I do have in gmail inbox. The code below gets them but then pops an error. When I change the part

Re: count consecutive elements

2021-01-19 Thread Bischoop
On 2021-01-19, Peter Otten <__pete...@web.de> wrote: > On 19/01/2021 04:45, Bischoop wrote: > >> I sat to it again and solved it. > > Congratulations! > > > lil = tuple(set(s)) # list of characters in s > > > > li=[0,0,0,0,0,0] # list for counted

Re: count consecutive elements

2021-01-18 Thread Bischoop
On 2021-01-14, Stefan Ram wrote: > > If you want to know why, maybe you should insert print > statements to see the values of critical variables and > expression, especially in loops. > > Then compare the printed values with your expectations. > > Also, decompose into meaningful

Re: binascii.b2a vs ord()

2021-01-15 Thread Bischoop
On 2021-01-10, Chris Angelico wrote: > > Hope that helps! > Yep, now it seems more understandable what is going on. Thanks for you time. -- Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: count consecutive elements

2021-01-15 Thread Bischoop
On 2021-01-14, Tim Chase wrote: > > seems to only return one value so seems to get odd results if I > specify something like > > get_longest("aaabcccbbb") > > which at least here tells me that "c" is the longest run, even though > aaa, bbb, and ccc are all runs of length 3. The OP didn't

Re: count consecutive elements

2021-01-14 Thread Bischoop
On 2021-01-13, Bischoop wrote: I know what was wrong: > m = s.index(i) I forgot that m will return first index of i. So tried that way but still getting out of index although I that that I'm making sure not to get out of index. s = 'aabskaaabadh' c = 0 t = list(se

Re: count consecutive elements

2021-01-13 Thread Bischoop
On 2021-01-13, Bischoop wrote: > t = set(s) # set of characters in s I have this one changed to: t= list(set(s)) -- https://mail.python.org/mailman/listinfo/python-list

count consecutive elements

2021-01-13 Thread Bischoop
I want to to display a number or an alphabet which appears mostly consecutive in a given string or numbers or both Examples s= ' aabskaaabad' output: c # c appears 4 consecutive times 8bbakebaoa output: b #b appears 2 consecutive times I thought about set the string then and for each

Re: binascii.b2a vs ord()

2021-01-10 Thread Bischoop
On 2021-01-10, Chris Angelico wrote: > > Trace it through, step by step. You have a series of ASCII values, > represented in binary, and then you call int() on each of them. What > sort of numbers will you get? > I'm kinda lost here about what sort of numbers I get, its class 'int'. > Then look

Re: primitive password cracker

2021-01-10 Thread Bischoop
On 2021-01-08, Stefan Ram wrote: > Bischoop writes: >>What I want to learn is if I need get for example four combinations, so >>how to get in a loop first letter 'a',then another step'a' and again 'a' >>and 'a', to have '' later on'abaa' etc. > > I can only

binascii.b2a vs ord()

2021-01-09 Thread Bischoop
I wanted to learn about conversion string to Ascii. So I learn about binascii.b2a but because the output wasn't what I wanted got deeper and found out about ord(c) and actually that's what I'expected. So what's that binascii and why I cant convert ascii that I got from ord to string by using char,

Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Bischoop wrote: > On 2021-01-07, Chris Angelico wrote: >> >> True. Unfortunately, it doesn't work, so what you'd have is something >> that can be easily parameterized to not work on other numbers of >> characters too. :) >> > > My bad is I'm

Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, David Raymond wrote: > I think you might want to check out itertools.product() > https://docs.python.org/3.9/library/itertools.html#itertools.product Thanks David for contribution I find it very convenient but not knowing how to solve solution without itertools for: for a i :

Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Chris Angelico wrote: > > True. Unfortunately, it doesn't work, so what you'd have is something > that can be easily parameterized to not work on other numbers of > characters too. :) > My bad is I'm kinda maniac and have to know how to, I know best solution itertool but... I just

Re: Some problem in code execution in python

2021-01-07 Thread Bischoop
On 2021-01-07, Dario Dario wrote: > Sir, I am one of the user of your python program, that is after completion > of installation I got some statement like "you got code execution problem > ". I don't know how to rectify this problem.so please help me to rectify > this problem . > You send me the

Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Chris Angelico wrote: This could allow easy to change the number of characters in combination, just pass n argument to range where n is how many characters. -- https://mail.python.org/mailman/listinfo/python-list

Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Chris Angelico wrote: > > I'd recommend having just a string, rather than a list; it'll behave > identically for what you're doing, and it'll be a lot easier to see > when you have all the right letters. > Yes that's definitely better, I've done so. >> mineset= set() >> for a in

primitive password cracker

2021-01-07 Thread Bischoop
I was practising for educational purpose with simply password cracker. I know that I could use itertool but in my case when I'm learning I would miss facing problems and learning on them and indeed I've met one which is not giving me a peace. What I want to learn is if I need get for example

Re: A random word from one of two lists

2021-01-03 Thread Bischoop
On 2021-01-02, Stefan Ram wrote: > Bischoop writes: >>On 2021-01-02, Stefan Ram wrote: >>>Otherweise, I'd go this way without a dictionary. >>>import random >>>animal = ['koala', 'kangaroo'] >>>fruit = ['banana', 'apple'] >>>kinds = [an

Re: A random word from one of two lists

2021-01-02 Thread Bischoop
On 2021-01-02, Stefan Ram wrote: > > The following might /not/ be good programming style, > but addresses the idea to choose a "variable". > I kinda like the below one. > import random > animal = ['koala', 'kangaroo'] > fruit = ['banana', 'apple'] > kinds = ['animal','fruit'] > variable =

Re: A random word from one of two lists

2021-01-01 Thread Bischoop
On 2021-01-02, Python wrote: > > >>> from random import choice > >>> choice(words[choice(list(words.keys()))]) > 'apple' > >>> choice(words[choice(list(words.keys()))]) > 'kangaroo' > >>> choice(words[choice(list(words.keys()))]) > 'koala' > >>> choice(words[choice(list(words.keys()))]) > 'apple'

Re: A random word from one of two lists

2021-01-01 Thread Bischoop
On 2021-01-01, Cameron Simpson wrote: > > kinds = list(words.keys()) > Yes, solved it with that exeactly. -- thanks -- https://mail.python.org/mailman/listinfo/python-list

A random word from one of two lists

2021-01-01 Thread Bischoop
I have two lists *animal* and *fruit* and I try to get a random variable animal or fruit and then random word from that list. I thought that dictionary(*words*) could help me but no succes, the only way I've done partially what was with list *kinds* and by using two times random.choice. However

Re: Which method to check if string index is queal to character.

2020-12-30 Thread Bischoop
On 2020-12-29, jak wrote: > > you could try this way: > > # --- > from dns import resolver as dns > > emails=['john@fakeserver.bah', > 'john@gmail.com'] > > for ue in emails: > try: > mxl = dns.resolve(ue.split('@')[1], 'MX') > except: >

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Bischoop
On 2020-12-28, Michael Torrie wrote: > On 12/28/20 10:46 AM, Marco Sulla wrote: >> On Mon, 28 Dec 2020 at 17:37, Bischoop wrote: >>> >>> I'd like to check if there's "@" in a string and wondering if any method >>> is better/safer than others. I

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Bischoop
On 2020-12-28, Mats Wichmann wrote: > On 12/28/20 10:46 AM, Marco Sulla wrote: >> On Mon, 28 Dec 2020 at 17:37, Bischoop wrote: >>> >>> I'd like to check if there's "@" in a string and wondering if any method >>> is better/safer than others. I

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Bischoop
On 2020-12-28, Stefan Ram wrote: > > "@" in s > That's what I thought. >>I want check if string is a valid email address. > > I suggest to first try and define "valid email address" in English. > > A valid email address consists of an email prefix and an email domain, both in acceptable

Which method to check if string index is queal to character.

2020-12-28 Thread Bischoop
I'd like to check if there's "@" in a string and wondering if any method is better/safer than others. I was told on one occasion that I should use is than ==, so how would be on this example. s = 't...@mail.is' I want check if string is a valid email address. code ''' import time email =

Re: Review, suggestion etc?

2020-12-17 Thread Bischoop
On 2020-12-17, Bischoop wrote: > On 2020-12-17, Dennis Lee Bieber wrote: >>> >> >> The main concern is that you are using a RECURSIVE call. It is much >> better for such input checking to use an ITERATIVE (loop) scheme. >> >> def

Re: Review, suggestion etc?

2020-12-17 Thread Bischoop
On 2020-12-17, Dennis Lee Bieber wrote: >> > > The main concern is that you are using a RECURSIVE call. It is much > better for such input checking to use an ITERATIVE (loop) scheme. > > def marriage(): > #loop forever > while True: >

Re: Function returns old value

2020-12-17 Thread Bischoop
On 2020-12-17, Peter J. Holzer wrote: > > --EVF5PPMfhYS0aIcm > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On 2020-12-17 03:06:32 -, Bischoop wrote: >> pasting from my IDE to vim/slrn

Re: Function returns old value

2020-12-17 Thread Bischoop
On 2020-12-17, dn wrote: >> After expiry, any posts 'here' with links to 'there', will be useless. >> >> I do mind that however I thoght it better if paste a whole code to see >> and pasting from my IDE to vim/slrn was messing syntax, I'll do better >> next time. > > > Yes, it can be difficult

Re: Review, suggestion etc?

2020-12-17 Thread Bischoop
On 2020-12-17, Michał Jaworski wrote: > > Exactly. I would go even further and make it a reusable function. Eg. > > def prompt_choices(prompt, choices): > choices = set(c.lower() for c in choices) > while value := input(f"{prompt} {choices}:").lower() not in choices: > pass >

Re: Review, suggestion etc?

2020-12-17 Thread Bischoop
On 2020-12-17, Michael Torrie wrote: > On 12/17/20 9:10 AM, Bischoop wrote: >> Could you expand here, I rather don't know how I could do it different >> way apart from if maritals == 'Yes' or maritals == 'No' or is it what >> you meant? > > I think he's hinting at usin

Re: Messed up syntax in Vim when pasting python code to post to the groups.

2020-12-17 Thread Bischoop
On 2020-12-17, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > > I'm not a vim user, but it just came up to look into the paste and > nopaste commands. I've googled the matter and found pressing F2 toogles 'paste' mode and then after pasting F2 again to switch

Re: Messed up syntax in Vim when pasting python code to post to the groups.

2020-12-17 Thread Bischoop
On 2020-12-17, Bischoop wrote: > > I've being asked not to use external links for code sharing to the > groups but when I paste the code in to my vim editor I do use with slrn > client the code is just messed up. > How dear people people using vim solved this? Solved, partialy

Messed up syntax in Vim when pasting python code to post to the groups.

2020-12-17 Thread Bischoop
I've being asked not to use external links for code sharing to the groups but when I paste the code in to my vim editor I do use with slrn client the code is just messed up. How dear people people using vim solved this? -- https://mail.python.org/mailman/listinfo/python-list

Re: Review, suggestion etc?

2020-12-17 Thread Bischoop
On 2020-12-17, Michał Jaworski wrote: Thanks for feedback and useful tips. I couldn't use any OOP here because have not a clue about it, just going to go toward it. > I've made a quick look at the code and even executed it. It looks pretty > clear and is easy to understand, although it has

Re: Review, suggestion etc?

2020-12-16 Thread Bischoop
On 2020-12-17, Bischoop wrote: Accidently removed the paste, https://bpa.st/E3FQ -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-16 Thread Bischoop
On 2020-12-17, dn wrote: > Remember that posts to the list are archived, and thus may be searched. > People experiencing similar problems in-future will be able to 'mine' > the archives for help and advice. > > Using a/any pastebin is great for immediate sharing. Remember that in > this case

Re: Function returns old value

2020-12-16 Thread Bischoop
On 2020-12-12, Terry Reedy wrote: > > Don't post links to unknown sites. Reduce it to the minimum needed to > exhibit the questionable behavior and include inline with the question. > >> How this functions should look properly? > > I've solved the problem. BTW bpa.st/+python is well known for

Review, suggestion etc?

2020-12-16 Thread Bischoop
I've done my biggest project that allowed me to learn a lot. It's basically simply Database with basic options >> https://bpa.st/FU4A . What sucks here is basically the find_people() I'll have to work on it yet to make it more useful. . If anyone was bored and wished to point me some wrong way

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
On 2020-12-12, Tim Chase wrote: > > Hopefully this gives you the hints that you need to troubleshoot. > > -tkc > > > > Yes it explains a lot. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Unable to pass dict from json.

2020-12-12 Thread Bischoop
Here https://bpa.st/YBVA I've working code with dictionary only if used dict from the code (it's commented now) but when I load it I can print it from load function (line 14) but at all have not a clue how to pass the data so could use them. I've learnt a lot when making it but here I'm

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
Got it solved here: https://bpa.st/BFJA -- https://mail.python.org/mailman/listinfo/python-list

To check if number is in range(x,y)

2020-12-12 Thread Bischoop
I need to check if input number is 1-5. Whatever I try it's not working. Here are my aproaches to the problem: https://bpa.st/H62A What I'm doing wrong and how I should do it? -- Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
I've also convert the choice to int() but doesn't help. -- https://mail.python.org/mailman/listinfo/python-list

Re: To check if number is in range(x,y)

2020-12-12 Thread Bischoop
On 2020-12-12, Oscar wrote: > In article , > Bischoop wrote: >>I've also convert the choice to int() but doesn't help. > > Oh.. did not read this yet. How did you do this? In both places after > the input or during the comparison? If so, in which version? Only the >

Re: Letter replacer - suggestions?

2020-12-11 Thread Bischoop
On 2020-12-07, Grant Edwards wrote: > On 2020-12-07, MRAB wrote: > >> Avoid a 'bare' except unless you _really_ mean it, which is >> virtually never. Catch only those exceptions that you're going to >> handle. > > And sometimes "handling" is just printing some extra stuff and then > re-raising

Re: Function returns old value

2020-12-11 Thread Bischoop
On 2020-12-12, Joe Pfeiffer wrote: > Bischoop writes: > >> I've function asking question and comparing it, if is not matching 'yes' >> it does call itself to ask question again. The problem is that when >> function is called second time it returns old value or with addi

Re: Function returns old value

2020-12-11 Thread Bischoop
On 2020-12-12, dn wrote: > On 12/12/2020 14:25, Bischoop wrote: >> >> >> >> I've function asking question and comparing it, if is not matching 'yes' >> it does call itself to ask question again. The problem is that when >> function is called second time

Re: Letter replacer - suggestions?

2020-12-11 Thread Bischoop
On 2020-12-07, Marco Sulla wrote: > Not sure why you want to do this (it's schoolwork)? >Anyway, this is my version: > Thanks, seems nicer I think not to mention those exceptions. So far I'm just learning and doing everythin only for myself so do not think on others users but I know it's good

Re: Letter replacer - suggestions?

2020-12-11 Thread Bischoop
On 2020-12-07, MRAB wrote: > > word = input( f'input word you want to change letters in: ') Yes, I've learn already that should use only when want to use variables I just started using this new f' string method. > > There's no need for the f prefix. > > > print(f' Your word to change:

Function returns old value

2020-12-11 Thread Bischoop
I've function asking question and comparing it, if is not matching 'yes' it does call itself to ask question again. The problem is that when function is called second time it returns old value or with additional else statement it returns none. Code: https://bpa.st/KVGA How this functions

Letter replacer - suggestions?

2020-12-07 Thread Bischoop
I worked on my wee script that replaces a letters: https://bpa.st/OYBQ . I would like to have some suggestions about the code from more experienced programmers, the code does work and do its job but perhaps could work in a better way. Thanks --

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.

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

Any better way for this removal?

2020-11-07 Thread Bischoop
So I was training with slicing. Came to idea to remove text after second occurence of character, below is how I've figured it out, I know if it works it good but how you guys would made it in more pythonic way? text = "This is string, remove text after second comma, to be removed." k=

Re: strip() method makes me confused

2020-11-07 Thread Bischoop
On 2020-11-07, Alexander Neilson wrote: > Because the strip methods argument is the set of characters to remove from > either end. So it checks from the ends character by character until it finds > a character that isn’t in the set. Then it removes everything prior to that > (or after that at

Re: strip() method makes me confused

2020-11-07 Thread Bischoop
On 2020-11-07, Frank Millman wrote: > On 2020-11-07 1:28 PM, Frank Millman wrote: >> On 2020-11-07 1:03 PM, Bischoop wrote: >>> > [...] >>> >>> another example: >>> >>> text = "this is text, there should be not commas, but as you

strip() method makes me confused

2020-11-07 Thread Bischoop
According to documentation strip method removes heading and trailing characters. Why then: txt = ",rrttggs...,..s,bananas...s.rrr" x = txt.strip(",s.grt") print(x) output: banana another example: text = "this is text, there should be not commas, but as you see there are still" y =

Re: Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Bischoop
On 2020-11-06, Chris Angelico wrote: > On Fri, Nov 6, 2020 at 11:51 PM Bischoop wrote: >> >> On 2020-11-06, Chris Angelico wrote: >> >> > You're currently dumping out the raw bytes. Not very interesting, and >> > that's why it's not easy to read. I woul

Re: Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Bischoop
On 2020-11-06, Chris Angelico wrote: > You're currently dumping out the raw bytes. Not very interesting, and > that's why it's not easy to read. I would recommend (a) decoding the > bytes to text, and (b) splitting it on "\r\n", thus getting it > line-by-line. > > What you may want to consider,

Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Bischoop
I'm experimenting with irc bot. I've made it connecting, reading etc but everything is difficult to read. It's coming like one long string without breaking lines. How to mace it printing in new line after: \r\n or \n in data? -- b':weber.freenode.net 001 saaaki :Welcome to the freenode

Re: Find word by given characters

2020-11-03 Thread Bischoop
On 2020-11-03, duncan smith wrote: >> > from collections import Counter letters = 'att' letter_counts = Counter(letters) word = 'tolerate' wd_counts = Counter(word) for char, cnt in letter_counts.items(): > print (cnt == wd_counts[char]) > > > True >

Re: Find word by given characters

2020-11-03 Thread Bischoop
On 2020-11-03, Chris Angelico wrote: > > This seems strangely backwards for a Scrabble game. Normally you would > have a set of available tiles, and you have to form a word using only > those tiles, but it doesn't necessarily have to use them all. You seem > to have something where you must use

Re: Find word by given characters

2020-11-03 Thread Bischoop
On 2020-11-03, dn wrote: > > > The (full) specs are not clear. There's certainly room for > misunderstanding. I'd be happier if I could 'see' a full spec or > recognise a practical application, because then we'd be better able to > discuss facts. Meantime, we try to help with what we have been

Re: Find word by given characters

2020-11-02 Thread Bischoop
On 2020-11-02, dn wrote: > > > If you have a working Py2 version, once print-statements were changed > into functions, what errors were thrown-up? > > That was almost 15 if no more years ago when I was learning then had a long break beacause Life :-) Got married, working as Chef, now have some

Re: Find word by given characters

2020-11-02 Thread Bischoop
On 2020-11-01, duncan smith wrote: >> > > But this generates the letters counts for each word. They only need to > be generated once (outside the for loop). And using count requires > iterating over the letters / words for each x in letters (rather than > once). For a large enough collection of

Re: Find word by given characters

2020-11-01 Thread Bischoop
On 2020-11-01, Bischoop wrote: > I'm working on a script i which user inputs letters and then a printed > words containing those letters. The scripts works however I can't solve > one problem , it prints also words in which these letters occur more > than once. > ---

Find word by given characters

2020-10-31 Thread Bischoop
I'm working on a script i which user inputs letters and then a printed words containing those letters. The scripts works however I can't solve one problem , it prints also words in which these letters occur more than once. --- Fore example: Letters: at Output: auto, autobahn.

Re: Downloading Python

2020-08-01 Thread Bischoop
On 2020-07-31, Stefan Ram wrote: > > Don't download just IDLE in isolation. > > Instead download Python 3.8 from www.python.org/downloads > and properly install it following the installation > instructions for your operating system. > > This will then include IDLE. > > He's right. --

Re: python installation help

2020-07-10 Thread Bischoop
On 2020-07-10, Deepak Didmania <6073sum...@gmail.com> wrote: > please help me in installing python Well I don't think anybody here has a Wizard Glass Ball. You need to state what is your problem, what erro message you have during istallation. --

Re: [Beginner] Spliting input

2020-06-25 Thread Bischoop
On 2020-06-25, Andrew Bell wrote: > Without knowing the problem you're having, it's hard to answer. > This seems generally correct. > > Error track: Traceback (most recent call last): File "splitting.py", line 1, in numb1,numb2=input("enter 1st and 2nd no ").split() ValueError: not

[Beginner] Spliting input

2020-06-25 Thread Bischoop
I try to split input numbers, for example: 12 so I cant add them, I tried separated split(' ') but it's not working. Any ideas how to do this? * numb1,numb2=input("enter 1st and 2nd no ").split() Avg=(int(numb1) + int(numb2)) / 2 print(Avg) * -- Thanks --

Re: close() the file when opening "with"?

2020-06-14 Thread Bischoop
On 2020-06-14, Chris Angelico wrote: > On Sun, Jun 14, 2020 at 8:16 PM Bischoop wrote: >> >> >> So far I learnt "with" closes the file opened therefore "Generally" no >> need to close() file. I'm worry about this "Generally", then clos

close() the file when opening "with"?

2020-06-14 Thread Bischoop
So far I learnt "with" closes the file opened therefore "Generally" no need to close() file. I'm worry about this "Generally", then close() or not? -- https://mail.python.org/mailman/listinfo/python-list

change surface

2020-06-13 Thread Bischoop
I'm playing with pygame, https://bpa.st/6GOQ Not sure what is wrong here that object moves but draws another surface. -- https://mail.python.org/mailman/listinfo/python-list

Re: Phyton 32 or 64 bit?

2020-05-27 Thread Bischoop
On 2020-05-26, Alex Kaye wrote: > To all: > > The only stupid question is one that wasn't asked ! > > Alex > Well, visit FB and you'll change your mind. -- https://mail.python.org/mailman/listinfo/python-list

Re: Having trouble importing the python turtle on idle

2020-05-16 Thread Bischoop
On 2020-05-16, KINGHAMED io wrote: > On Sat, 16 May 2020 at 4:38 PM KINGHAMED io > wrote: > >> Hello my name is Hamed >> I have purchased python for kids. >> I have installed idle and Python launcher 3.8.3 with my 11 inch MacBook >> Air (Mac OS Sierra)version 10.12.6 >> I have followed all the

Re: Why Python has no equivalent of JDBC of Java?

2019-05-26 Thread Bischoop
On 2019-05-19, Marco Sulla wrote: >blablabla >blablablalbla >blablalblalbalblabla There's no perfect language mate, in some one is easier in other not, normal surprised you notice it so late. -- https://mail.python.org/mailman/listinfo/python-list

Re: Dictionary

2014-01-08 Thread Bischoop
Dennis Lee Bieber wrote: On Mon, 30 Dec 2013 18:38:20 +, Bischoop mar...@jakis.adres.em declaimed the following: I have a txt file with some words, and need simply program that will print me words containing provided letters. For example: Type the letters: (I type: g,m,o) open

Re: Dictionary

2014-01-08 Thread Bischoop
Walter Hurry wrote: On Mon, 30 Dec 2013 18:38:20 +, Bischoop wrote: I have a txt file with some words, and need simply program that will print me words containing provided letters. For example: Type the letters: (I type: g,m,o) open the dictionary.txt check words containing:g,m,o

Dictionary

2013-12-30 Thread Bischoop
I have a txt file with some words, and need simply program that will print me words containing provided letters. For example: Type the letters: (I type: g,m,o) open the dictionary.txt check words containing:g,m,o in dictionary.txt if there are words containing: [g, m, o ] print

  1   2   >