程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

How to make beeps in Python for windows ECS

編輯:Python

windows For ECS python How to make a beep ? Let's look at ordinary computers first , It's simple ,2 sentence python Get it done

Install first python2.7 x64

Then notice that line by line

pip install playsound

python -m pip install --upgrade pip

pip install playsound

Then notice that line by line

cmd Command line , Note that cmd Command line

python

import winsound

winsound.Beep(800,800)

winsound.Beep(800,800)

winsound.Beep(800,800)

winsound.Beep(800,800)

exit()

But on ECs , Because the ECS does not have a sound device , It can't be done winsound.Beep.

The alternative is to prepare for a beep wav file , Check before remote “ Play... On this computer ”, Then, in the case of remote connection to the server, use python The code plays this wav( Pay attention to the cloud server's windows audio Service open , Then you can do it remotely again )

http://windows-1251783334.cos.ap-shanghai.myqcloud.com/beep.wav

http://windows-1251783334.cos.ap-shanghai.myqcloud.com/test.mp3

for example python The environment is ready , perform pip install playsound

then cmd open python enter , Enter the corresponding play wav or mp3 File code

Note that line by line execution

cmd Command line , Note that cmd Command line

python

from playsound import playsound

playsound("C:\\tmp\\beep.wav")

playsound("C:\\tmp\\test.mp3")

playsound("C:\\tmp\\beep.wav")

exit()

It is worth mentioning that , The cloud desktop can be used like a normal computer winsound.Beep Realize buzzer .

citrix Cloud desktop technology of is especially awesome , Ordinary cloud servers without computer equipment can be packaged almost the same as real computers , This use citrix The product implemented in the cloud is called cloud desktop , The cloud desktop of Tencent cloud has not been made public , Currently in the internal test , The time of public sale is unknown . Open the device manager of the cloud desktop server , You will find that there are many more devices than ordinary cloud servers .

Tianyi cloud desktop does not limit the user level , Individual users can also use , Tencent cloud must have enterprise real name certification

Bought several Tencent cloud desktop machines , Batch bind to 1 I don't even support , unreasonable

The cloud desktop of Tianyi cloud can directly access the external network , They directly match it SNAT 了 , The cloud desktop of Tencent cloud needs to be equipped by itself SNAT To get to the Internet

I tried it myself , Cloud desktops are no different from real computers , I was the first 2021 year 3 In June, I met with the product manager of cloud desktop in an exchange , It was still in the development stage , After seeing the effect , Know that this thing may catch fire in the future .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved