У меня есть как Agda 2.4.2.5, так и 2.5.2.2 на моем компьютере, как мне удалить 2.4? Или, по крайней мере, сказать, что мой компьютер использует 2,5?

Да, если вы используете Skype4Py.

Я создал простой скрипт callto.py на основе примеров / callfriend.py из Skype4Py. В качестве аргумента требуется номер телефона или имя друга из списка skype.

Skype спросит вас, хотите ли вы предоставить API для Skype4Py.

Код следует:

#!python
# ---------------------------------------------------------------------------------------------
#  Python / Skype4Py example that takes a skypename or number from the commandline
# and calls it.
#

import sys
import Skype4Py

# This variable will get its actual value in OnCall handler
CallStatus = 0

# Here we define a set of call statuses that indicate a call has been either aborted or finished
CallIsFinished = set ([Skype4Py.clsFailed, Skype4Py.clsFinished, Skype4Py.clsMissed, Skype4Py.clsRefused, Skype4Py.clsBusy, Skype4Py.clsCancelled]);

def AttachmentStatusText(status):
   return skype.Convert.AttachmentStatusToText(status)

def CallStatusText(status):
    return skype.Convert.CallStatusToText(status)

# This handler is fired when status of Call object has changed
def OnCall(call, status):
    global CallStatus
    CallStatus = status
    print 'Call status: ' + CallStatusText(status)

# This handler is fired when Skype attatchment status changes
def OnAttach(status): 
    print 'API attachment status: ' + AttachmentStatusText(status)
    if status == Skype4Py.apiAttachAvailable:
        skype.Attach()

# Let's see if we were started with a command line parameter..
try:
    CmdLine = sys.argv[1]
except:
    print 'Missing command line parameter'
    sys.exit()

# Creating Skype object and assigning event handlers..
skype = Skype4Py.Skype()
skype.OnAttachmentStatus = OnAttach
skype.OnCallStatus = OnCall

# Starting Skype if it's not running already..
if not skype.Client.IsRunning:
    print 'Starting Skype..'
    skype.Client.Start()

# Attatching to Skype..
print 'Connecting to Skype..'
skype.Attach()

# Make the call
print 'Calling ' + CmdLine + '..'
skype.PlaceCall(CmdLine)

# Loop until CallStatus gets one of "call terminated" values in OnCall handler
while not CallStatus in CallIsFinished:
    pass
0
задан 14 April 2017 в 03:13

0 ответов

Другие вопросы по тегам:

Похожие вопросы: