ben20 Posted June 29, 2013 Report Posted June 29, 2013 ma joc pe codecademy si am ajuns pe la date time etc, care stiti si am asta :from datetime import datetimenow = datetime.now()year = now.yearmonth = now.monthday = now.dayhour = now.hourminute = now.minutesecond = now.secondprint str(month) + "/" + str(day) + "/" + str(year)print str(hour) + ":" + str(minute) + ":" + str(second)Am instalat pe ubuntu python Idle 3.2 bag codu asta si nimic..oare ce sa fie ? vroiam sa ma mai joc cu el sa-mi afiseze in mai multe feluri. Quote
BGS Posted June 29, 2013 Report Posted June 29, 2013 Sintaxa pentru print a fost schimbata in Python3 Old: print "The answer is", 2*2New: print("The answer is", 2*2)Old: print x, # Trailing comma suppresses newlineNew: print(x, end=" ") # Appends a space instead of a newlineOld: print # Prints a newlineNew: print() # You must call the function!Old: print >>sys.stderr, "fatal error"New: print("fatal error", file=sys.stderr)Old: print (x, y) # prints repr((x, y))New: print((x, y)) # Not the same as print(x, y)!Pentru cele mai bune rezultare ar trebui sa downloadezi Python 2.7 ca sa nu ai probleme cand urmaresti tutorialele acelea.Daca ai oferi mai multe detalii cum ar fi , ce eroare primesti in IDLE ne-ar fi mult mai usor sa te indrumam. Quote
ben20 Posted June 29, 2013 Author Report Posted June 29, 2013 (edited) Pai nimic asta e..defapt problema Python 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] on linux2Type "copyright", "credits" or "license()" for more information.==== No Subprocess ====>>> from datetime import datetimenow = datetime.now()year = now.yearmonth = now.monthday = now.dayhour = now.hourminute = now.minutesecond = now.secondprint str(month) + "/" + str(day) + "/" + str(year)print str(hour) + ":" + str(minute) + ":" + str(second)>>> >>> >>> Am bagat 2.7 si la fel..Gata am rezolvat aparent trebuie save module. my bad Edited June 29, 2013 by ben20 Quote