2

我遇到了几行与此类似的代码,但我不确定应该如何破解它:

blueprint = Blueprint(self.blueprint_map[str(self.ui.blueprint_combo.currentText())], runs=self.ui.runs_spin.text(), me=self.ui.me_spin.text(), pe=self.ui.pe_skill_combo.currentIndex())

提前致谢

4

5 回答 5

14
blueprint = Blueprint(
    self.blueprint_map[str(self.ui.blueprint_combo.currentText())],
    runs=self.ui.runs_spin.text(), 
    me=self.ui.me_spin.text(),
    pe=self.ui.pe_skill_combo.currentIndex(),
)
于 2010-02-15T14:53:39.147 回答
5

这个怎么样

blueprint_item = self.blueprint_map[str(self.ui.blueprint_combo.currentText())]
blueprint = Blueprint(blueprint_item,
                      runs=self.ui.runs_spin.text(),
                      me=self.ui.me_spin.text(),
                      pe=self.ui.pe_skill_combo.currentIndex())
于 2010-02-15T14:53:54.357 回答
4

我会这样做:

blueprint = Blueprint(
              self.blueprint_map[str(self.ui.blueprint_combo.currentText())],
              runs=self.ui.runs_spin.text(),
              me=self.ui.me_spin.text(),
              pe=self.ui.pe_skill_combo.currentIndex())
于 2010-02-15T14:53:50.263 回答
0

括号内的任何地方都应该工作,例如:

blueprint = Blueprint(self.blueprint_map[str(self.ui.blueprint_combo.currentText())],
        runs=self.ui.runs_spin.text(), me=self.ui.me_spin.text(),
        pe=self.ui.pe_skill_combo.currentIndex())
于 2010-02-15T14:53:04.313 回答
0
blueprint = Blueprint(self.blueprint_map[str(self.ui.blueprint_combo.currentText())], 
                      runs=self.ui.runs_spin.text(), me=self.ui.me_spin.text(),
                      pe=self.ui.pe_skill_combo.currentIndex())
于 2010-02-15T14:53:50.253 回答