Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2012-06-29 01:13:29 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2012-06-29 01:13:29 (GMT)
commit712bcbc52c4d71788e4a7dd5722635ea58e6a3df (patch)
treedd571ea42e4631406333ea3945f1875595353810
parentd3cf83c7a1da540f332ca627bf112edb2ba5614f (diff)
Modifique Convert.py para que funcionara sin interfas grafica
-rw-r--r--Convert.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Convert.py b/Convert.py
index bbff36f..02b26cb 100644
--- a/Convert.py
+++ b/Convert.py
@@ -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()