diff options
author | Cristhofer Travieso <cristhofert97@gmail.com> | 2012-06-29 01:13:29 (GMT) |
---|---|---|
committer | Cristhofer Travieso <cristhofert97@gmail.com> | 2012-06-29 01:13:29 (GMT) |
commit | 712bcbc52c4d71788e4a7dd5722635ea58e6a3df (patch) | |
tree | dd571ea42e4631406333ea3945f1875595353810 | |
parent | d3cf83c7a1da540f332ca627bf112edb2ba5614f (diff) |
Modifique Convert.py para que funcionara sin interfas grafica
-rw-r--r-- | Convert.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -18,10 +18,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +import sys class convert(): def __init__(self, number, uni1, uni2, type_u): - super(convert, self).__init__() + + self.dic = {} self.long = {} self.vol = {} @@ -43,6 +45,11 @@ class convert(): elif type_u == "time": self.dic = self.time - self.a = number * self.dic[uni1] + self.unidad = number * self.dic[uni1] + + return self.unidad * self.dic[uni2] + +def main(): + print convert(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]) - return self.a * self.dic[uni2] +main() |