Re: Video file to subtitles file

2020-08-29 Thread Muskan Sanghai
On Sunday, August 30, 2020 at 11:46:15 AM UTC+5:30, Chris Angelico wrote: > On Sun, Aug 30, 2020 at 4:11 PM Muskan Sanghai wrote: > > > > On Sunday, August 30, 2020 at 10:57:00 AM UTC+5:30, Christian Gollwitzer > > wrote: > > > Am 29.08.20 um 13:51 schrieb Muskan Sanghai: > > > > I want to ex

Re: Video file to subtitles file

2020-08-29 Thread Chris Angelico
On Sun, Aug 30, 2020 at 4:11 PM Muskan Sanghai wrote: > > On Sunday, August 30, 2020 at 10:57:00 AM UTC+5:30, Christian Gollwitzer > wrote: > > Am 29.08.20 um 13:51 schrieb Muskan Sanghai: > > > I want to extract subtitles from a MPEG video (which does not have any > > > previous subtitles) > >

Re: Video file to subtitles file

2020-08-29 Thread Muskan Sanghai
On Sunday, August 30, 2020 at 10:57:00 AM UTC+5:30, Christian Gollwitzer wrote: > Am 29.08.20 um 13:51 schrieb Muskan Sanghai: > > I want to extract subtitles from a MPEG video (which does not have any > > previous subtitles) > I'm still not sure I get it. "Extract" subtitles, when they are NOT >

Re: Threading plus multiprocessing plus cv2 error

2020-08-29 Thread Chris Angelico
On Sun, Aug 30, 2020 at 4:01 PM Stephane Tougard via Python-list wrote: > > On 2020-08-29, Dennis Lee Bieber wrote: > > Under Linux, multiprocessing creates processes using fork(). That > > means > > that, for some fraction of time, you have TWO processes sharing the same > > thread and al

Re: Threading plus multiprocessing plus cv2 error

2020-08-29 Thread Stephane Tougard via Python-list
On 2020-08-29, Dennis Lee Bieber wrote: > Under Linux, multiprocessing creates processes using fork(). That means > that, for some fraction of time, you have TWO processes sharing the same > thread and all that entails (if it doesn't overlay the forked process with > a new executable, they a

Re: Video file to subtitles file

2020-08-29 Thread Christian Gollwitzer
Am 29.08.20 um 13:51 schrieb Muskan Sanghai: I want to extract subtitles from a MPEG video (which does not have any previous subtitles) I'm still not sure I get it. "Extract" subtitles, when they are NOT there? Can it be, by any chance, that you are talking about speech recognition? I.e., yo

Re: Silly question, where is read() documented?

2020-08-29 Thread Terry Reedy
On 8/29/2020 12:18 PM, Chris Green wrote: Well it sounds a silly question but I can't find the documentation for read(). It's not a built-in function and it's not documented with (for example) the file type object sys.stdin. sys.stdin is of no particular type, but must at least have a .read me

Re: Silly question, where is read() documented?

2020-08-29 Thread Cameron Simpson
Also: https://docs.python.org/3/library/io.html#io.TextIOBase.read https://docs.python.org/3/library/io.html#io.BufferedIOBase.read Found by going to: https://docs.python.org/3/ https://docs.python.org/3/genindex.html https://docs.python.org/3/genindex-R.html and finding the

Re: Where read() is documented

2020-08-29 Thread Joe Pfeiffer
Chris Green writes: > Stefan Ram wrote: >> Chris Green writes:I can't find the documentation for >> >read(). It's not a built-in function and it's not documented with >> >(for example) the file type object sys.stdin. >> >> |read() (asyncio.StreamReader method), 894 >> |read() (chunk.Chunk

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Cameron Simpson
On 29Aug2020 16:50, Chris Green wrote: >However the problem appears to be that internally in Python 3 mailbox >class there is an assumption that it's being given 'ascii'. Here's >the error (and I'm doing no processing of the message at all):- > >Traceback (most recent call last): > File

Aw: Re: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Karsten Hilbert
> Just appending a message as a raw file to a mailbox, doesn't properly > add it as a new message. You need to add a From: line to the front, and > then go through the message and alter any line that begins as "From:" > (and possibly any line that begins with something like ">From:" or > ">>From:"

Re: Aw: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Richard Damon
On 8/29/20 3:31 PM, Karsten Hilbert wrote: >> However the problem appears to be that internally in Python 3 mailbox >> class there is an assumption that it's being given 'ascii'. > Do you really _need_ the mailbox class ? From what you've > written so far my understanding was that you receive data

Aw: Re: Video file to subtitles file

2020-08-29 Thread Karsten Hilbert
> I want to extract subtitles from a MPEG video (which does not have any > previous subtitles) and then add them to the same video . I am not sure I parse the above: You want to *extract* subtitles from a video which *does not have* subtitles ? I have a feeling you will need to rephrase your obj

Aw: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Karsten Hilbert
> However the problem appears to be that internally in Python 3 mailbox > class there is an assumption that it's being given 'ascii'. Do you really _need_ the mailbox class ? From what you've written so far my understanding was that you receive data (bytes) and want to append that to a file (which

Re: Where read() is documented

2020-08-29 Thread MRAB
On 2020-08-29 17:48, Chris Green wrote: Stefan Ram wrote: Chris Green writes:I can't find the documentation for >read(). It's not a built-in function and it's not documented with >(for example) the file type object sys.stdin. |read() (asyncio.StreamReader method), 894 |read() (chunk.Chun

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Richard Damon
On 8/29/20 11:50 AM, Chris Green wrote: > Chris Green wrote: >> Dennis Lee Bieber wrote: >>> On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed >>> the >>> following: >>> >>> >>> Maybe I shouldn't but Python 2 has been managing to do so for several years without any issues. I

Finally fixed my Python 2 to Python 3 e-mail problem

2020-08-29 Thread Chris Green
I've started a new thread because this relates to two or three threads I started here over the past few days. First, thank you everyone for all the help and suggestions. I've finally fixed the problem, it was due to sys.stdin.read() returning a string object in Python 3 as opposed to bytes in Py

Re: Where read() is documented

2020-08-29 Thread Chris Green
Stefan Ram wrote: > Chris Green writes:I can't find the documentation for > >read(). It's not a built-in function and it's not documented with > >(for example) the file type object sys.stdin. > > |read() (asyncio.StreamReader method), 894 > |read() (chunk.Chunk method), 1385 > |read() (code

Re: FW: pip not recognized

2020-08-29 Thread Mats Wichmann
On 8/27/20 2:18 PM, gpostle500 wrote: > > Sent from my Verizon, Samsung Galaxy smartphone > Original message From: geoff postle > Date: 8/27/20 12:08 PM (GMT-08:00) To: python-list@python.org Subject: pip > not recognized Hey just downloaded the 3.8.5 and when I search for pi

Re: Can't use interpreter

2020-08-29 Thread Mats Wichmann
On 8/28/20 5:02 AM, Joshua Sharma wrote: > I have downloaded python 3.7.6, but I can't seem to use it in PyCharm. I > have subscribed. > See the PyCharm instructions for setting an interpreter, which can be default, and per-project. Unless there was more to this question that you didn't ask...

Re: Silly question, where is read() documented?

2020-08-29 Thread Ian Hobson
https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects (It is in the top result returned by Google, searching for Python read documentation) On 29/08/2020 17:18, Chris Green wrote: Well it sounds a silly question but I can't find the documentation for read(). It's not a

Silly question, where is read() documented?

2020-08-29 Thread Chris Green
Well it sounds a silly question but I can't find the documentation for read(). It's not a built-in function and it's not documented with (for example) the file type object sys.stdin. So where is it documented? :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Chris Green
Chris Green wrote: > Dennis Lee Bieber wrote: > > On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed > > the > > following: > > > > > > > > >Maybe I shouldn't but Python 2 has been managing to do so for several > > >years without any issues. I know I *could* put the exceptions in a >

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Chris Green
Dennis Lee Bieber wrote: > On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed the > following: > > > > >Maybe I shouldn't but Python 2 has been managing to do so for several > >years without any issues. I know I *could* put the exceptions in a > >bucket somewhere and deal with them sep

Can't use interpreter

2020-08-29 Thread Joshua Sharma
I have downloaded python 3.7.6, but I can't seem to use it in PyCharm. I have subscribed. -- https://mail.python.org/mailman/listinfo/python-list

Proposal: Ignore all empty entries within $PYTHONPATH

2020-08-29 Thread David A. Wheeler
All: I propose that all empty entries with $PYTHONPATH be ignored. This would eliminate some accidents that can lead to security problems. I thought it'd be easiest to explain by drafting a PEP, so please see this first draft below. Thanks! Comments welcome. --- David A. Wheeler

FW: pip not recognized

2020-08-29 Thread gpostle500
Sent from my Verizon, Samsung Galaxy smartphone Original message From: geoff postle Date: 8/27/20 12:08 PM (GMT-08:00) To: python-list@python.org Subject: pip not recognized Hey just downloaded the 3.8.5 and when I search for pip in cmd it doesn’t show up and says not recogn

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Grant Edwards
On 2020-08-28, Chris Green wrote: > Maybe I shouldn't but Python 2 has been managing to do so for several > years without any issues. I know I *could* put the exceptions in a > bucket somewhere and deal with them separately but I'd really rather > not. Then just leave it as bytes and do whateve

Threading plus multiprocessing plus cv2 error

2020-08-29 Thread John O'Hagan
Dear list Thanks to this list, I haven't needed to ask a question for a very long time, but this one has me stumped. Here's the minimal 3.8 code, on Debian testing: - from multiprocessing import Process from threading import Thread from time import sleep import cv2 def show(im, title, locat

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Grant Edwards
On 2020-08-27, Chris Green wrote: > bbb = [b'aaa', b'bbb', b'ccc'] > sss = [] > for i in range(0, 2): > sss.append(str(bbb[i]) > > but that does seem a bit clumsy. Is there a better way? sss = [str(s) for s in bbb] -- Grant -- https://mail.python.org/mailman/listinfo/pyth

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Grant Edwards
On 2020-08-27, Marco Sulla wrote: > Are you sure you want `str()`? > str(b'aaa') > "b'aaa'" > > Probably you want: > > map(lambda x: x.decode(), bbb) If you're an old Scheme or Lisp programmer. :) This is probably the more usual way to spell it: sss = [x.decode() for x in bbb] -- ht

Re: Video file to subtitles file

2020-08-29 Thread Chris Angelico
On Sat, Aug 29, 2020 at 11:15 PM Barry Scott wrote: > > On 29 Aug 2020, at 12:51, Muskan Sanghai wrote: > > On Friday, August 28, 2020 at 10:59:29 PM UTC+5:30, Chris Angelico wrote: > >> Not familiar with Openshot, but it's worth looking into. > >> Alternatively, I'd definitely recommend ffmpeg f

Re: Video file to subtitles file

2020-08-29 Thread Muskan Sanghai
On Saturday, August 29, 2020 at 6:44:34 PM UTC+5:30, Barry Scott wrote: > > On 29 Aug 2020, at 12:51, Muskan Sanghai wrote: > > > > On Friday, August 28, 2020 at 10:59:29 PM UTC+5:30, Chris Angelico wrote: > >> On Sat, Aug 29, 2020 at 3:24 AM Barry >> > wrote: > >>>

Re: Video file to subtitles file

2020-08-29 Thread Barry Scott
> On 29 Aug 2020, at 12:51, Muskan Sanghai wrote: > > On Friday, August 28, 2020 at 10:59:29 PM UTC+5:30, Chris Angelico wrote: >> On Sat, Aug 29, 2020 at 3:24 AM Barry > > wrote: >>> >>> >>> On 28 Aug 2020, at 17:37, Muskan Sanghai wrote: On Frid

Re: Video file to subtitles file

2020-08-29 Thread Muskan Sanghai
On Friday, August 28, 2020 at 10:59:29 PM UTC+5:30, Chris Angelico wrote: > On Sat, Aug 29, 2020 at 3:24 AM Barry wrote: > > > > > > > > > On 28 Aug 2020, at 17:37, Muskan Sanghai wrote: > > > > > > On Friday, August 28, 2020 at 12:27:25 AM UTC+5:30, Barry Scott wrote: > > On 27 Aug 20

Re: Video file to subtitles file

2020-08-29 Thread Muskan Sanghai
On Friday, August 28, 2020 at 10:52:57 PM UTC+5:30, Barry wrote: > > On 28 Aug 2020, at 17:37, Muskan Sanghai wrote: > > > > On Friday, August 28, 2020 at 12:27:25 AM UTC+5:30, Barry Scott wrote: > On 27 Aug 2020, at 18:00, Muskan Sanghai wrote: > >>> > >>> I would be really thankful if

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-29 Thread Samuel Marks
Putting Liskov substitution principal to one side, I had a suggestion to follow PEP3102, and do `def train(self, *, epochs):`… It's a rather simple suggestion that I just might take aboard. In response to Dieter: My purpose for using a base class is so that the highest level interface—say a CLI,

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-29 Thread Dieter Maurer
Samuel Marks wrote at 2020-8-29 19:14 +1000: >So there is no way to get a AOT error when the two functions aren't >implemented, if the two functions have different required arguments on >implementors? > >To paint this picture for why I need this, say the first is: > >class Base(ABC): >@abstract

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-29 Thread Samuel Marks
So there is no way to get a AOT error when the two functions aren't implemented, if the two functions have different required arguments on implementors? To paint this picture for why I need this, say the first is: class Base(ABC): @abstractclass def train(self, epochs): asset epoc

Re: Error in lambda function..!

2020-08-29 Thread Rob Cliffe via Python-list
On 29/08/2020 08:58, Shivlal Sharma wrote: from functools import* nums = [1, 2, 3, 4, 5, 6, 7, 8, 9] add = reduce(lambda a : a + 1, nums) print(add) error: - TypeError Traceback (most recent call last) in () 1 from functools import* 2 nums = [1, 2

Re: Error in lambda function..!

2020-08-29 Thread Peter Otten
Shivlal Sharma wrote: > from functools import* > nums = [1, 2, 3, 4, 5, 6, 7, 8, 9] > add = reduce(lambda a : a + 1, nums) > print(add) > > error: - > TypeError Traceback (most recent call > last) in () > 1 from functools import* > 2 nums = [1, 2, 3, 4

Error in lambda function..!

2020-08-29 Thread Shivlal Sharma
from functools import* nums = [1, 2, 3, 4, 5, 6, 7, 8, 9] add = reduce(lambda a : a + 1, nums) print(add) error: - TypeError Traceback (most recent call last) in () 1 from functools import* 2 nums = [1, 2, 3, 4, 5, 6, 7, 8, 9] > 3 add = reduce(lambd

Re: Didn't understand the output of the following Python 3 code with reduce function?

2020-08-29 Thread Shivlal Sharma
On Saturday, 29 August 2020 at 02:47:56 UTC+5:30, Ben Bacarisse wrote: Thanks you all, I was really confused in this code. > Shivlal Sharma writes: > > > I have seen this code on one of competative programming site but I > > didn't get it, Why output is 9? > > > > from functools import * > >