Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
(uiserver):xxxxxxxx:~ > python Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print ("hello world") hello world >>> print "hello world" hello world >>> print "hello world" hello world >>> print """hello world""" hello world >>>
to z pythona na serwerze
a to u mnie z kompa:
[przemo@arch ~]$ python Python 3.3.1 (default, Apr 6 2013, 19:11:39) [GCC 4.8.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print "hello world" File "<stdin>", line 1 print "hello world" ^ SyntaxError: invalid syntax >>> print hello world File "<stdin>", line 1 print hello world ^ SyntaxError: invalid syntax >>> print hello world
co jest nie tak u mnie????
wersja python2 dziala wporzadku.
Ostatnio edytowany przez pink (2013-05-01 10:45:16)
Offline
U mnie:
python Python 2.7.3 (default, Apr 2 2013, 08:03:17) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print ("hello world") hello world >>> print "hello world" hello world >>> print "hello world" hello world >>> print """hello world""" File "<stdin>", line 1 print """hello world""" ^ IndentationError: unexpected indent >>> print "hello world" hello world >>> print hello world File "<stdin>", line 1 print hello world ^ IndentationError: unexpected indent >>> print hello world File "<stdin>", line 1 print hello world ^ SyntaxError: invalid syntax >>>
Widocznie te typy już tak mają.
Spróbowałem u mnie printy z obu twoich przykładów.
Mimo tego python działa ok.
Ostatnio edytowany przez Jacekalex (2013-05-01 10:53:16)
Offline
python3 sie tak dziwnie zachowuje, a instaluje sie z chromium jako zalerznosc przynajmniej w archu.
nic to, dodalem alias w .bashrc co by sie nie denerwowac.
Offline
Nie dziwnie, a zamierzenie ;-)
http://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function
Offline