Re: System Beep?

2019-03-09 Thread Karsten Hilbert
On Sat, Mar 09, 2019 at 11:55:03AM +1300, DL Neil wrote:

> You've piqued my interest. I haven't worked with sound using Python, but a
> future project, presently graphics/video, could easily expand...
> 
> I don't think it is an OpSys fault, per-se. Someone with some Python-audio,
> indeed Linux-audio (in my case) experience may well blow-apart my theory,
> but here goes (E&OE):
> 
> Python print()s to files. Normally the shell and a running program will
> print() to the screen. This can be piped or re-directed to a disk-file (for
> example). Thus, many such implementations have no bell to ring!

Well, "back in the days", there was a known difference
between "playing music" and beeping the system speaker.

The latter was a built-in real speaker which could be beeped
by various arcane and magic incantations, one of which was
sending the BEL control character to the terminal. Many, but
not all, terminals still support that one way or another.

But it's got nothing to do with access to any DSPs.

However, under the hood, the "system speaker" will nowadays
be faked any number of ways: flashing the terminal, piezo
buzzer, sending stuff to DSPs below the beloved
beep-the-speaker interface.

So, first of all, one needs to decide: do I want to *play*
sound, very likely from a file, or do I "simply" want to make
the system "beep" one way or another.

Or, in fact, do I want to grab user attention - for which
there is additional ways in today's toolkits, say


https://wxpython.org/Phoenix/docs/html/wx.TopLevelWindow.html#wx.TopLevelWindow.RequestUserAttention

Karsten
-- 
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: System Beep?

2019-03-09 Thread Chris Angelico
On Sat, Mar 9, 2019 at 10:33 PM Karsten Hilbert  wrote:
>
> On Sat, Mar 09, 2019 at 11:55:03AM +1300, DL Neil wrote:
>
> > You've piqued my interest. I haven't worked with sound using Python, but a
> > future project, presently graphics/video, could easily expand...
> >
> > I don't think it is an OpSys fault, per-se. Someone with some Python-audio,
> > indeed Linux-audio (in my case) experience may well blow-apart my theory,
> > but here goes (E&OE):
> >
> > Python print()s to files. Normally the shell and a running program will
> > print() to the screen. This can be piped or re-directed to a disk-file (for
> > example). Thus, many such implementations have no bell to ring!
>
> Well, "back in the days", there was a known difference
> between "playing music" and beeping the system speaker.

Speak for yourself! I played music on the system speaker

Okay, it was one-bit music, but still! If you don't have a sound card,
PC Speaker Music is all you have!

I probably still know all the frequencies for musical notes - 262Hz
for middle C, 277 for C#, 294 for D... ahh, old memories.

:)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: System Beep?

2019-03-09 Thread eryk sun
On 3/9/19, Dennis Lee Bieber  wrote:
>
> ... produces a sound on my system... But has to be run from a Windows
> console (command line -- either "DOS" or PowerShell).

Say "CMD" if that's what you mean. DOS was an OS (albeit a simple
one). The CMD shell is not an OS and was never a DOS program. (It was
written for OS/2.) Also, python.exe doesn't have to be "run from a
console", by which I think you mean it has to be run from a shell
that's attached to a console. Like any console application, python.exe
allocates its own console if it doesn't inherit one. cmd.exe and
powershell.exe are exactly the same in this regard.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: System Beep?

2019-03-09 Thread Luuk

On 9-3-2019 07:27, Steve wrote:

Mischief almost managed.
They both work when using IDLE but the second one leaves an empty window to
be closed.
I do like the second one.  Is there a follow up command to close that
window?

Steve


see below





Footnote:
I am simply a thing that thinks.
Rene Descartes

-Original Message-
From: Python-list  On
Behalf Of Terry Reedy
Sent: Saturday, March 9, 2019 12:53 AM
To: python-list@python.org
Subject: Re: System Beep?

On 3/8/2019 1:13 PM, Steve wrote:

How can I cause a system beep using code?


  >>> import winsound as ws
  >>> ws.Beep(500, 1000)

and

  >>> from tkinter import Tk
  >>> root = Tk()
  >>> root.bell()

work for me.  The bell is not exactly a bell, but different from a monotone
beep.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list




root.destroy()

see: 
https://stackoverflow.com/questions/110923/how-do-i-close-a-tkinter-window


--
Luuk
--
https://mail.python.org/mailman/listinfo/python-list


Python resources recommendations

2019-03-09 Thread Arup Rakshit
Hello Python,

This is my first time in this mailing list. I am a Ruby/JS developer by day. I 
have decided to learn Python now this year. Being an experienced developer as I 
said above which resources I should pick to learn Python in and out? Currently 
I am reading this https://docs.python.org/3/tutorial/index.html 
 . What next you would recommend 
me after this? I would like to learn Flask once I feel good with Python core.


Thanks,

Arup Rakshit
a...@zeit.io



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python resources recommendations

2019-03-09 Thread DL Neil

Hello Arup,

On 10/03/19 3:01 AM, Arup Rakshit wrote:

Hello Python,
This is my first time in this mailing list. I am a Ruby/JS developer by day. I have 
decided to learn Python now this year. Being an experienced developer as I said above 
which resources I should pick to learn Python in and out? Currently I am reading this 
https://docs.python.org/3/tutorial/index.html 
 . What next you would recommend 
me after this? I would like to learn Flask once I feel good with Python core.



There is such a wealth of resources to learn Python that this question 
is somewhat difficult to answer.


Firstly, there is another mailing list 'here', called Python-Tutor.

Secondly, it depends upon your starting-point and your preferred mode of 
learning.


Apparently you are a programmer, so you don't need to be told the 
difference between integers and reals/floating-point numbers, and thus 
'My first programming book using Python' would be ineffectual.


There are Python courses on all of the major learning platforms, eg edX, 
Coursera, Lynda/LinkedIn, etc. Most of which one may access for $free or 
pay for a certificate (pending tests, assignments, etc). I've recently 
audited a "Py3" course out of U.Mich which features an interesting 
on-line course-book and coding environment (if you head this way, I'll 
be interested to hear feedback!) The same also offer "Dr Chuck's" 
'Python for Everyone' courseware (videos alongside his "Python for 
Informatics" book).


There are many, many books - if you ask for specific recommendations you 
will be inundated! The book I used (many years ago, 'Chun') was Python2. 
I recommend that you start with Python3 and not look back! Several 
'books' are available for download/CC-license. If you have access to a 
library, they're likely to have something, otherwise your favorite 
search engine...


All the best!
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python resources recommendations

2019-03-09 Thread Alex Kaye
DL,

Good advice.
U of M is well done and interesting.

One wonders what Arup plans to use Python for.

I am dabbling and am relearning from DOS and machine language on AppleII.

A K.



Virus-free.
www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Mar 9, 2019 at 2:09 PM DL Neil 
wrote:

> Hello Arup,
>
> On 10/03/19 3:01 AM, Arup Rakshit wrote:
> > Hello Python,
> > This is my first time in this mailing list. I am a Ruby/JS developer by
> day. I have decided to learn Python now this year. Being an experienced
> developer as I said above which resources I should pick to learn Python in
> and out? Currently I am reading this
> https://docs.python.org/3/tutorial/index.html <
> https://docs.python.org/3/tutorial/index.html> . What next you would
> recommend me after this? I would like to learn Flask once I feel good with
> Python core.
>
>
> There is such a wealth of resources to learn Python that this question
> is somewhat difficult to answer.
>
> Firstly, there is another mailing list 'here', called Python-Tutor.
>
> Secondly, it depends upon your starting-point and your preferred mode of
> learning.
>
> Apparently you are a programmer, so you don't need to be told the
> difference between integers and reals/floating-point numbers, and thus
> 'My first programming book using Python' would be ineffectual.
>
> There are Python courses on all of the major learning platforms, eg edX,
> Coursera, Lynda/LinkedIn, etc. Most of which one may access for $free or
> pay for a certificate (pending tests, assignments, etc). I've recently
> audited a "Py3" course out of U.Mich which features an interesting
> on-line course-book and coding environment (if you head this way, I'll
> be interested to hear feedback!) The same also offer "Dr Chuck's"
> 'Python for Everyone' courseware (videos alongside his "Python for
> Informatics" book).
>
> There are many, many books - if you ask for specific recommendations you
> will be inundated! The book I used (many years ago, 'Chun') was Python2.
> I recommend that you start with Python3 and not look back! Several
> 'books' are available for download/CC-license. If you have access to a
> library, they're likely to have something, otherwise your favorite
> search engine...
>
> All the best!
> --
> Regards =dn
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python resources recommendations

2019-03-09 Thread DL Neil

AK,


On 10/03/19 12:41 PM, Alex Kaye wrote:

DL,
Good advice.
U of M is well done and interesting.


Actually, I criticised them - but was looking at matters such as 
"delivery" and from a cognitive psychology perspective - on behalf of, 
but quite different to, the needs of 'the average' trainee!


From a programming/Pythonic view-point, I sadly noted Java-influence 
creeping-in: weak use of Python terminology, pythonic coding approaches, 
and similar. Probably won't hurt the average beginner, but not the best 
training approach.


At the moment, there are a number of unhappy people who purchased the 
entire specialisation (five courses), but currently stalled because the 
last course will not be produced and ready for use until early next 
month. Slightly naughty, but courseware needs to be carefully 
constructed and that (as per program design) is both time-consuming and 
something it pays not to rush!


On the plus-side, the material covers the ground, and does-so quite 
quickly. I haven't seen any feedback from 'beginners' to be sure of 
pace. There are a number of interesting worked-examples, which can be a 
point-of-boredom in training/'toy examples' (I played with Python's 
"turtle", simply because I'd never touched that sort of thing before).


So, to the OP, please put my bias(es) aside, take AK's positive 
experience, and try it for yourself...
(you can always start-out $free, and once satisfied, return later to 
fulfil the requirements and achieve certification!)




One wonders what Arup plans to use Python for.


That's a very good point, which I didn't cover, earlier. Whereas 
previously one started with books that might be called 'Python for raw 
beginners' or some-such, these days there are plenty of more specialised 
books, eg 'Learn Python for Data Science', etc.




I am dabbling and am relearning from DOS and machine language on AppleII.


Which is another somewhat specialised area: MicroPython, Python for 
Raspberry Pi, and similar for other smaller/older machines, SBCs, etc! 
We now risk confusing the OP...


I remember those words - back in the days when my hair had color (and 
not from out of a bottle either). Using the power of Linux, every day I 
see much of the 'old' from DOS, CP/M, PDP minis; in our ever-green 
terminal interface. However, despite much of my hardware being 'old' (by 
other people's standards) I have no wish to go back as far as the Apple 
][ - floppy disks, poor-quality display screens, etc. IMHO, there's too 
much to learn, attempting to keep-up with 'the modern stuff', the 
opening of new vistas... However, I can imagine the appeal of 'history'. 
Have fun!


--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python resources recommendations

2019-03-09 Thread Andrew Z
I would think that your experience with other languages would guide you on
the route of learning another tool..

On Sat, Mar 9, 2019, 13:01 Arup Rakshit  wrote:

> Hello Python,
>
> This is my first time in this mailing list. I am a Ruby/JS developer by
> day. I have decided to learn Python now this year. Being an experienced
> developer as I said above which resources I should pick to learn Python in
> and out? Currently I am reading this
> https://docs.python.org/3/tutorial/index.html <
> https://docs.python.org/3/tutorial/index.html> . What next you would
> recommend me after this? I would like to learn Flask once I feel good with
> Python core.
>
>
> Thanks,
>
> Arup Rakshit
> a...@zeit.io
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list