Return

2021-12-07 Thread vani arul
Hey There, Can someone help to understand how a python function can return value with using return in the code? It is not not about explicit or implicit function call. Thanks Vani -- https://mail.python.org/mailman/listinfo/python-list

For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

2021-12-07 Thread Mohsen Owzar
Hi all, I have a problem with "pyinstaller". When I compile a single Python file, an EXE file is created in the "dist" directory, with which I can start the program and the GUI appears after a few seconds. But when I try to compile my project with "pyinstaller Relais_LastDauerTester.py" and ge

Urllib.request vs. Requests.get

2021-12-07 Thread Julius Hamilton
Hey, I am currently working on a simple program which scrapes text from webpages via a URL, then segments it (with Spacy). I’m trying to refine my program to use just the right tools for the job, for each of the steps. Requests.get works great, but I’ve seen people use urllib.request.urlopen() i

Odd locale error that has disappeared on reboot.

2021-12-07 Thread Chris Green
I have a very short Python program that runs on one of my Raspberry Pis to collect temperatures from a 1-wire sensor and write them to a database:- #!/usr/bin/python3 # # # read temperature from 1-wire sensor and store in database with date and time # import sqlite3 im

HTML extraction

2021-12-07 Thread Julius Hamilton
Hey, Could anyone please comment on the purest way simply to strip HTML tags from the internal text they surround? I know Beautiful Soup is a convenient tool, but I’m interested to know what the most minimal way to do it would be. People say you usually don’t use Regex for a second order languag

Re: HTML extraction

2021-12-07 Thread Chris Angelico
On Wed, Dec 8, 2021 at 4:55 AM Julius Hamilton wrote: > > Hey, > > Could anyone please comment on the purest way simply to strip HTML tags > from the internal text they surround? > > I know Beautiful Soup is a convenient tool, but I’m interested to know what > the most minimal way to do it would b

Re: Urllib.request vs. Requests.get

2021-12-07 Thread Chris Angelico
On Wed, Dec 8, 2021 at 4:51 AM Julius Hamilton wrote: > > Hey, > > I am currently working on a simple program which scrapes text from webpages > via a URL, then segments it (with Spacy). > > I’m trying to refine my program to use just the right tools for the job, > for each of the steps. > > Reque

Re: Urllib.request vs. Requests.get

2021-12-07 Thread Paul Bryan
Cloudflare, for whatever reason, appears to be rejecting the `User- Agent` header that urllib is providing:`Python-urllib/3.9`. Using a different `User-Agent` seems to get around the issue: import urllib.request req = urllib.request.Request( url="https://juno.sh/direct-connection-to-jupyter-s

Re: For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

2021-12-07 Thread Chris Angelico
On Wed, Dec 8, 2021 at 4:49 AM Mohsen Owzar wrote: > *** > GPIOContrl.py > *** > class GPIOControl: > def my_print(self, args): > if print_allowed == 1: > print(args) > >

Re: Return

2021-12-07 Thread Roland Mueller via Python-list
Hello ti 7. jouluk. 2021 klo 19.47 vani arul (arulvan...@gmail.com) kirjoitti: > Hey There, > Can someone help to understand how a python function can return value with > using return in the code? > It is not not about explicit or implicit function call. > > Not sure whether I understood your que

Re: HTML extraction

2021-12-07 Thread Roland Mueller via Python-list
Hello, ti 7. jouluk. 2021 klo 20.08 Chris Angelico (ros...@gmail.com) kirjoitti: > On Wed, Dec 8, 2021 at 4:55 AM Julius Hamilton > wrote: > > > > Hey, > > > > Could anyone please comment on the purest way simply to strip HTML tags > > from the internal text they surround? > > > > I know Beautif

Re: HTML extraction

2021-12-07 Thread Chris Angelico
On Wed, Dec 8, 2021 at 7:55 AM Roland Mueller wrote: > > Hello, > > ti 7. jouluk. 2021 klo 20.08 Chris Angelico (ros...@gmail.com) kirjoitti: >> >> On Wed, Dec 8, 2021 at 4:55 AM Julius Hamilton >> wrote: >> > >> > Hey, >> > >> > Could anyone please comment on the purest way simply to strip HTML

Re: Return

2021-12-07 Thread dn via Python-list
On 08/12/2021 09.45, Roland Mueller via Python-list wrote: > Hello > > ti 7. jouluk. 2021 klo 19.47 vani arul (arulvan...@gmail.com) kirjoitti: > >> Hey There, >> Can someone help to understand how a python function can return value with >> using return in the code? >> It is not not about explici

Re: Return

2021-12-07 Thread Chris Angelico
On Wed, Dec 8, 2021 at 9:04 AM dn via Python-list wrote: > > plus Python, unlike some other languages, allows us to return multiple > values, either as a collection or as an implied-tuple: > > def function_list(): > a_list = [ i for i in range( 9 ) ] > return a_list > > def function_multip

Re: Return

2021-12-07 Thread dn via Python-list
On 08/12/2021 11.07, Chris Angelico wrote: > On Wed, Dec 8, 2021 at 9:04 AM dn via Python-list > wrote: >> >> plus Python, unlike some other languages, allows us to return multiple >> values, either as a collection or as an implied-tuple: >> >> def function_list(): >> a_list = [ i for i in ran