首页 \ 问答 \ Python没有打印所有的sys.argv(Python not printing all the sys.argv)

Python没有打印所有的sys.argv(Python not printing all the sys.argv)

我从sys.argv [1]得到一个超出范围错误的列表,我尝试用这段代码制作一个简单的脚本。

import sys
print sys.argv

我在cmd上得到这个:

C:\...\...\...\py>back.py exampleargv
['C:\\...\\...\\...\\py\\back.py']

我不知道为什么我没有得到下一个arg。


I'm getting a list out of range error from sys.argv[1] and I tried making a simple script with this code.

import sys
print sys.argv

I get this on cmd:

C:\...\...\...\py>back.py exampleargv
['C:\\...\\...\\...\\py\\back.py']

I don't know why I don't get the next arg.


原文:
更新时间:2022-07-14 10:07

最满意答案

有两个版本的MVC Futures与MVC 2 RTM并列。 一个版本面向.NET 3.5; 另一个目标是.NET 4.(.NET 4版本不是.NET 3.5版本的超集;如果您需要全部功能,则必须在应用程序中包含它们。)从http:// aspnet下载.codeplex.com / releases / view / 41742

一个非详尽的功能列表(.NET 3.5+):

  • 诊断页面 ,可帮助诊断运行时和程序集加载错误(请参阅文档 )。

  • 一种新的, 更强大的模型绑定和验证系统 。 上面的链接提供了详细的文档和教程。

  • 改进了对构建RESTful服务的支持(请参阅Microsoft.Web.Mvc.Resources命名空间)。

  • 强类型的ActionLink <T>()

  • 一大堆其他的过滤器和帮手 ,比如Html.Serialize()(参见博客文章 ),Html.Script()等等。

  • 一大堆其他价值提供者 ,比如JsonValueProviderFactory。

  • 能够关闭单个控制器的会话状态以增加站点中的并行性(请参阅文档 )。

面向ASP.NET 4的MVC Futures版本还包括:

  • 具有部分输出缓存的能力,例如,将RenderAction()的结果与页面的其余部分分开缓存。

  • DynamicViewPage允许您在ViewPage中使用真实的动态对象,功能比默认的ViewPage <dynamic>更全面。

  • 能够使用DataAnnotations 4属性

  • 远程验证IClientValidatable (验证属性提供其自身客户端验证信息的能力),以及自定义非DataAnnotations属性为ModelMetadata信息做出贡献的能力。


There are two versions of MVC Futures that sit alongside MVC 2 RTM. One version targets .NET 3.5; the other targets .NET 4. (The .NET 4 version is not a superset of the .NET 3.5 version; you must include both of them in your application if you want the entire range of functionality.) Download from http://aspnet.codeplex.com/releases/view/41742.

A non-exhaustive feature list (.NET 3.5+):

  • A diagnostics page which can help diagnose runtime and assembly loading errors (see documentation).

  • A new, more powerful model binding and validation system. Detailed documentation and a tutorial are available at the above link.

  • Improved support for building RESTful services (see the Microsoft.Web.Mvc.Resources namespace).

  • Strongly-typed ActionLink<T>().

  • A slew of other filters and helpers, such as Html.Serialize() (see blog post), Html.Script(), etc.

  • A slew of other value providers, such as JsonValueProviderFactory.

  • The ability to turn off Session State for individual controllers to increase parallelism in your site (see documentation).

The version of MVC Futures that targets ASP.NET 4 additionally includes:

  • The ability to have partial output caching, e.g. caching the result of a RenderAction() separately from the rest of the page.

  • DynamicViewPage allows you to use real dynamic objects in your ViewPage, somewhat more full-featured than the default ViewPage<dynamic>.

  • The ability to use DataAnnotations 4 attributes.

  • Remote validation, IClientValidatable (the ability of a validation attribute to supply its own client validation info), and the ability for custom non-DataAnnotations attributes to contribute to ModelMetadata information.

相关问答

更多
  • 您可以将MVC 2项目定位到.NET 3.5 SP1或更高版本。 但是,使用.NET 4.0会授予您一些功能,例如,您可以编写<%: someString %>而不是<%= Html.Encode(someString) %> 。 You can target your MVC 2 project to .NET 3.5 SP1 or superior. However using .NET 4.0 grants you some functionality, for example you can wri ...
  • 通常使用按钮,您将使用JavaScript来调用该操作或将其包装在一个表单中(或两者兼而有之)。 <% Html.BeginForm( "action", "controller", new { id = Model.ID } ) { %> <% } %>