val scores=Map("Alice"->10,"Bob"->3,"Cindy"->8) // 获取所有的key val nameList=scores.map(_._1) // map 函数返回List println(nameList.getClass) 遍历list中的元素 nameList.foreach((x:String)=>print(x+" ")) 输出 :Alice Bob Ci
<script type="text/javascript"> getJson('age'); function getJson(key){ var jsonObj={"name":"傅红雪","age":"24","profession":"刺客"}; //1.使用eval方法 var eValue=eval('jsonObj.'+key); alert
1, 使用文件 #vim /etc/motd "1 hello world" 2 ...... yes 3 no you are a shadiao 4 hahh maye you are right ddddddddddddddddddddddddddddddddddd ccccccccccccc vvv 2,python脚本 [root@localhost python]# vim 7.py f=open("/etc/motd") alllines = [lin
public void ReadVideoTime(String path) { long sum = 0; long num = 0; File source = new File(path[i]); Encoder encoder = new Encoder(); File[] file = source.listFiles(); for (File file2 : file) { try { MultimediaInfo m = encoder.getInfo(file2); long l