首页 \ 问答 \ IndexError:列表赋值索引在python中超出范围(IndexError: list assignment index out of range in python)

IndexError:列表赋值索引在python中超出范围(IndexError: list assignment index out of range in python)

IndexError:列表赋值索引在python中超出范围我做错了什么。 我是新手

actual_ans_dict = []
for data in prsnobj.result:
    actual_ans_dict[data[0]] = data[1]
    print actual_ans_dict

IndexError: list assignment index out of range in python What am i doing wrong. I am an newbie

actual_ans_dict = []
for data in prsnobj.result:
    actual_ans_dict[data[0]] = data[1]
    print actual_ans_dict

原文:
更新时间:2022-05-30 09:05

最满意答案

你绝对可以做到。 但是,这可能不可取。 离子只是提供了一堆指令供您使用。 您可以将其与Cordova / Phonegap等软件一起使用,以将其打包以用于移动版本。 否则,你可以把项目的web部分(即所有的html / js / css / assets)和web服务器指向他们,然后presto - 你可以通过浏览器访问你的离子页面。

然而...

出于几个原因你可能不想这样做。

  1. Ionic未写入目标桌面页面
  2. Ionic并没有真正为桌面版提供任何东西,A.在Angular中还不存在。或者某人没有正确编写桌面解决方案

我的建议是使用简单的Angular或其他框架,如React / Vue。

回答你的问题的最后一部分:Angular是Ionic为其提供绑定(以及一些资源,如图标)的框架。 这些绑定恰好针对移动设备进行了优化/瞄准。

希望能有所帮助。


You can definitely do it. However, it's probably not advisable. Ionic just provides a bunch of directives for you to use. You can use that in conjunction with something like Cordova/Phonegap to package that up for a mobile release. Otherwise, you could just take the web parts of the project (i.e. all your html/js/css/assets) and point a web server to them and presto - you can access your ionic page with a browser.

However...

You probably don't want to do this for a few reasons.

  1. Ionic wasn't written to target desktop pages
  2. Ionic doesn't really provide anything for desktop pages that A. doesn't already exist in Angular or B. someone hasn't properly written for desktop solutions

My suggestion here is to just use plain Angular or another framework such as React/Vue.

To answer the last part of your question: Angular is the framework that Ionic provides bindings (and some assets such as icons) for. Those bindings happen to be optimised/targetted towards mobile devices.

Hopefully that helps out a bit.

相关问答

更多
  • 在低层次上,Web应用程序和Web服务有点相同。 它们都通过http(s)进行操作。 SOAP只是一个明确定义的XML版本。 REST只是HTTP。 如果你愿意,你可以使Web应用程序看起来像Web服务,反之亦然。 主要区别在于基于您使用的平台的内部开发选项。 例如,如果您使用的是Visual Studio,那么添加WCF服务应用程序将为您提供默认情况下针对WCF的项目。 但选择任何其他应用程序类型不会阻止您添加Web服务。 由于以下原因,使用SOAP通常比普通的xml更好: 你的用户会期待它,并且很可能知 ...
  • 网站: 网站项目即将编制。 你最终会有更多的DLL文件,这可能是一个痛苦。 当一个目录中的页面或控件需要在另一个目录中引用页面和控件时,也会出现问题,因为另一个目录可能尚未编译成代码。 另一个问题可以在发布。 如果不知道Visual Studio不断重复使用相同的名称,那么它会为页面生成的DLL文件提供新的名称。 这可能导致包含相同类名的DLL文件的几个关闭副本,这将产生大量的错误。 该网站项目是与Visual Studio 2005一起推出的,但已经证明不是非常受欢迎。 Web应用程序: Web应用程序项 ...
  • 请参阅此处的示例代码: 使用WiX将新虚拟目录安装到默认网站 。 改写它:如果你将元素放在元素中,那么网站由MSI管理并在卸载时被删除。 如果没有,那么网站元素是占位符,卸载不会触及它。 See the example code here: Install a New Virtual Directory to Default Web Site with WiX. Rephrasing it: if you put your elem ...
  • Web应用程序通常是通过网络/ Internet向您提供接口的应用程序。 因此,Web应用程序可以驻留在网站上。 在Visual Studio的上下文中,这是微软对Web应用程序和网站项目之间差异的解释: 链接 http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5 A web application is generally an application where the interface is delivere ...
  • 我已经解决了我的问题。 事实证明,问题与IIS及其配置或类似的东西无关,而是VS2010发布Web应用程序的方式的副产品。 因此,正如我们大多数人所做的那样,我们并没有真正调试Cassini下的应用程序 - 相反,我们使用指向我们不断变化的源代码的IIS。 好吧,使用发布功能的默认设置,VS2010所做的是编译应用程序(和依赖项)并将相应的文件复制到项目根位置内名为“obj”的特殊子目录下的文件夹中。 其将要尝试部署的Web应用程序的“副本”中包含要部署的web.config文件。 此配置文件包含应用于应用 ...
  • 罗纳德请看看这里,也许它可能对你有所帮助。 http://msdn.microsoft.com/en-us/library/dd394698(VS.100).aspx Ronald please take a look here,maybe it might help you. http://msdn.microsoft.com/en-us/library/dd394698(VS.100).aspx
  • @Controller通常用于MVC控制器系统,这允许您从控制器内将模型返回到视图。 @RestController通常用于REST风格的Web服务,并且通常会输出XML或JSON,您可以使用库或POJO的ToString()方法从POJOs解组。 在所有情况下(除非你使用Spring Boot),你通常仍然会使用web.xml。 我更喜欢使用注释方法(@Controller和/或@RestController),因为它意味着更少地处理XML文件。 我不想使用你提到的第三种方法,因为它对我来说不那么灵活,也 ...
  • 但是如何让root网站成为一个应用程序呢? 根网站已经是一个应用程序。 所以基本上当你有一个网站时,这个网站被映射到硬盘上的一个物理位置,你应该在那里部署你的代码。 然后,如果网站与bar.com:80绑定,您的应用程序将直接在http://bar.com访问。 but how to do you make the root website an application? The root website is already an application. So basically when you ha ...
  • 你绝对可以做到。 但是,这可能不可取。 离子只是提供了一堆指令供您使用。 您可以将其与Cordova / Phonegap等软件一起使用,以将其打包以用于移动版本。 否则,你可以把项目的web部分(即所有的html / js / css / assets)和web服务器指向他们,然后presto - 你可以通过浏览器访问你的离子页面。 然而... 出于几个原因你可能不想这样做。 Ionic未写入目标桌面页面 Ionic并没有真正为桌面版提供任何东西,A.在Angular中还不存在。或者某人没有正确编写桌面解 ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)