小编jac*_*cob的帖子

如何让UISlider具有离散间隔?例如间隔 5000

如何在 swift 中的 ui 滑块上舍入或设置 5000 的间隔?

@IBAction func incomeSliderChanged(sender: UISlider) {
    var incomeValue = Double(sender.value)
    currentIncomeLabel.text = ("$\(incomeValue) /yr")
}
Run Code Online (Sandbox Code Playgroud)

uislider ios swift

1
推荐指数
1
解决办法
1973
查看次数

AWS DynamoDB Python连接错误

无法在AWS Dynamodb上运行示例代码.

我正在尝试运行他们在那里的网站上提供的AWS示例python代码.这是我的python文件:

    from __future__ import print_function # Python 2/3 compatibility
    import boto3

   dynamodb = boto3.resource('dynamodb', region_name='us-west-2', endpoint_url="http://localhost:8000")


   table = dynamodb.create_table(
       TableName='Movies',
       KeySchema=[
           {
               'AttributeName': 'year',
               'KeyType': 'HASH'  #Partition key
           },
           {
               'AttributeName': 'title',
               'KeyType': 'RANGE'  #Sort key
           }
       ],
       AttributeDefinitions=[
           {
               'AttributeName': 'year',
               'AttributeType': 'N'
           },
           {
               'AttributeName': 'title',
               'AttributeType': 'S'
           },

       ],
       ProvisionedThroughput={
           'ReadCapacityUnits': 10,
           'WriteCapacityUnits': 10
       }
   )

   print("Table status:", table.table_status)
Run Code Online (Sandbox Code Playgroud)

然后我在终端运行python文件,我收到以下错误:

File "MoviesCreateTable.py", line 32, in <module>
    'WriteCapacityUnits': 10
File "/home/name/.local/lib/python2.7/site-packages/boto3/resources/factory.py", line 520, in do_action
    response …
Run Code Online (Sandbox Code Playgroud)

python ubuntu amazon-web-services python-2.7 amazon-dynamodb

1
推荐指数
1
解决办法
2458
查看次数