python从元组中获取两个整数参数

时间:2016-02-06 00:01:00

标签: python tuples

这只是问题的一部分。它有错误,在运行它时缺少1个必需的位置参数'mm'。 我知道问题是它像time_to_minutes((h,mm)一样运行,) 我该怎么做才能让它像time_to_minutes(h,mm)一样运行?

private Rectangle m_normalBounds;

@Override
public void setExtendedState(int state)
{
   if (getExtendedState() == 0)
      m_bounds = getBounds();        // Capture the normal bounds since the state is changing

   super.setExtendedState(state);
}

private Rectangle getNormalBounds()  // Always returns the normal bounds
{
   Rectangle bounds;

   if (getExtendedState() == 0)
      return(getBounds());

   return(m_normalBounds);
}

1 个答案:

答案 0 :(得分:6)

使用星号(*)运算符unpack元组:

first = time_to_minutes(*extract_time(a))
相关问题