小编mic*_*ace的帖子

自定义排序python

我有一个问题:这是由ElementTree库组成的列表列表.

   [['word1', <Element tag at b719a4cc>], ['word2', <Element tag at b719a6cc>], ['word3', <Element tag at b719a78c>], ['word4', <Element tag at b719a82c>]]
Run Code Online (Sandbox Code Playgroud)

word1..4可能包含unicode字符,即(â,ü,ç).

我想按自定义字母对这个列表列表进行排序.

我知道如何通过自定义字母排序从这里 排序python中的单词

我也知道如何从这里按键排序http://wiki.python.org/moin/HowTo/Sorting

问题是我找不到如何应用这两种方法来对我的"列表列表"进行排序的方法.

python sorting

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

Three.js - 无法在 Mapbox GL JS 自定义 WebGL 层上渲染立方体

我正在尝试使用此示例渲染多维数据集:添加 3D 模型

示例在three.js 上工作到117 版本。由于 118 版本示例不起作用:多维数据集在页面刷新后立即消失。我研究了变更日志,最明显的变化是,自从 v118 Three.js 使用 WebGL2 作为默认渲染引擎。所以我更改了代码以使用 WebGL1,但立方体仍然消失。

  this.renderer = new THREE.WebGL1Renderer({
  canvas: map.getCanvas(),
  context: gl,
  antialias: true
});
Run Code Online (Sandbox Code Playgroud)

这是重现问题的代码笔。(重新加载页面以查看立方体片刻)

javascript three.js mapbox-gl-js

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

如何在JavaScript中调用原型之外的函数?

如何调用setTile范围之外的函数TopDownGame?我试过TopDownGame.Lesson31.setTile(x,y),但它不起作用.

var TopDownGame = TopDownGame || {};

TopDownGame.Lesson31 = function() {};

TopDownGame.Lesson31.prototype = {
    setTile: function(x, y) {
        console.log(tile);
    }
};
Run Code Online (Sandbox Code Playgroud)

javascript prototype

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

标签 统计

javascript ×2

mapbox-gl-js ×1

prototype ×1

python ×1

sorting ×1

three.js ×1