@ru_python

Страница 1797 из 9768
Johnnie
18.11.2016
21:46:56
weekday()*

b0g3r
18.11.2016
21:46:57
dayofweek и iso dayofweek

Трусов
18.11.2016
21:46:59
datetime.weekday()

сенкс

Google
b0g3r
18.11.2016
21:47:03
Да

Igor
18.11.2016
21:47:05
switch{ case понедельник: return 1;

и т.д.

b0g3r
18.11.2016
21:47:18
Johnnie
18.11.2016
21:47:27
> switch > Python O_O

b0g3r
18.11.2016
21:47:29
У нас тут вроде конфа по питону)

Igor
18.11.2016
21:48:07
ооо ну попробуйте отступами выделить, вдруг покатит

я кстати табы юзаю, а не пробелы

b0g3r
18.11.2016
21:48:57
ууууу

Johnnie
18.11.2016
21:49:31
Language: python3 Source: from datetime import datetime print(datetime.now().weekday()) Result: 4 Stats: Absolute running time: 0.14 sec, cpu time: 0.02 sec, memory peak: 5 Mb, absolute service time: 0,14 sec

прикольная штука)

Igor
18.11.2016
21:50:54
Language: python2 Source: print 'hello world' Result: hello world Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec

Language: python2 Source: import requests print requests.get('http://httpbin.org/ip').text Errors: File "source_file.py", line 1 import requests print requests.get('http://httpbin.org/ip').text ^ SyntaxError: invalid syntax Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec

Google
Igor
18.11.2016
21:52:17
эээ

Υπερβορεία
18.11.2016
21:52:58
Не хочет что-то он работать

import this не выводит

b0g3r
18.11.2016
21:55:33
выводит

Result: The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! Stats: Absolute running time: 0.14 sec, cpu time: 0.02 sec, memory peak: 5 Mb, absolute service time: 0,14 sec Tip: Wrap your code in triple backticks to display it in monospace.

Υπερβορεία
18.11.2016
21:59:21
выводит
Но не инлайн

b0g3r
18.11.2016
21:59:50
и инлайн

Υπερβορεία
18.11.2016
22:00:19
Language: python3 Source: import this Result: The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! Stats: Absolute running time: 0.14 sec, cpu time: 0.02 sec, memory peak: 5 Mb, absolute service time: 0,14 sec

О, теперь выводит

Глюк видимо был

b0g3r
18.11.2016
22:02:06
Errors: The directory '/var/www/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/var/www/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Exception: Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 266, in run delete=build_delete) as build_dir: File "/usr/local/lib/python3.4/dist-packages/pip/utils/build.py", line 22, in __init__ name = os.path.realpath(tempfile.mkdtemp(prefix="pip-build-")) File "/usr/lib/python3.4/tempfile.py", line 426, in mkdtemp dir = gettempdir() File "/usr/lib/python3.4/tempfile.py", line 370, in gettempdir tempdir = _get_default_tempdir() File "/usr/lib/python3.4/tempfile.py", line 312, in _get_default_tempdir dirlist) FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] Stats: Absolute running time: 0.34 sec, cpu time: 0.27 sec, memory peak: 23 Mb, absolute service time: 0,34 sec Tip: Mistake? Edit your message, I'll adjust my response.

очень нравится фича с редактированием сообщения и то что он это подхватывает)

Igor
18.11.2016
22:03:11
Error: 413

b0g3r
18.11.2016
22:05:14
/python3 import os os.system('df -h')

Result: Filesystem Size Used Avail Use% Mounted on /dev/ploop11587p1 250G 14G 226G 6% / none 8.0G 4.0K 8.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 1.7G 68K 1.6G 1% /run none 5.0M 0 5.0M 0% /run/lock none 8.0G 4.0K 8.0G 1% /run/shm none 100M 0 100M 0% /run/user Stats: Absolute running time: 0.14 sec, cpu time: 0.02 sec, memory peak: 5 Mb, absolute service time: 0,14 sec Tip: Wrap your code in triple backticks to display it in monospace.

Igor
18.11.2016
22:07:28
Result: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin libuuid:x:100:101::/var/lib/libuuid: syslog:x:101:104::/home/syslog:/bin/false messagebus:x:103:107::/var/run/dbus:/bin/false bind:x:104:111::/var/cache/bind:/bin/false postfix:x:105:113::/var/spool/postfix:/bin/false dovecot:x:106:115:Dovecot mail server,,,:/usr/lib/dovecot:/bin/false dovenull:x:107:116:Dovecot login user,,,:/nonexistent:/bin/false landscape:x:108:117::/var/lib/landscape:/bin/false sshd:x:109:65534::/var/run/sshd:/usr/sbin/nologin mysql:x:102:106:MySQL Server,,,:/nonexistent:/bin/false fetchmail:x:110:65534::/var/lib/fetchmail:/bin/false ren:x:1000:1000::/home/ren: colord:x:111:120:colord colour management daemon,,,:/var/lib/colord:/bin/false Stats: Absolute running time: 0.13 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,13 sec Tip: Wrap your code in triple backticks to display it in monospace.

Result: uid=33(www-data) gid=33(www-data) groups=33(www-data) Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec Tip: Wrap your code in triple backticks to display it in monospace.

Johnnie
18.11.2016
22:08:25
Traceback (most recent call last): File "python", line 2, in <module> requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb8295d1a58>: Failed to establish a new connection: [Errno -2] Name or service not known',))

repl.it выдал)

думал минут 5 минимум

Google
b0g3r
18.11.2016
22:12:15
теперь у меня хотелка

создать чат

добавить туда этого бота и моего

и мой пусть пытается сделать брутфорс рут-пароля

Igor
18.11.2016
22:13:05
lvps92-51-147-212.dedicated.hosteurope.de

Johnnie
18.11.2016
22:14:29
b0g3r
18.11.2016
22:14:41
ну сначала его сделать)

чтоб он ему писал что-нибудь вроде /...@rextester_bot

или какой там синтаксис

Johnnie
18.11.2016
22:15:26
Language: python3 Source: import os os.system('ping 127.0.0.1 -c 3') Result: PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.029 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.034 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.025 ms --- 127.0.0.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1999ms rtt min/avg/max/mdev = 0.025/0.029/0.034/0.005 ms Stats: Absolute running time: 2.14 sec, cpu time: 0.02 sec, memory peak: 5 Mb, absolute service time: 2,15 sec

во внешку не пускает(

но в теории мне кажется это тоже хуево

b0g3r
18.11.2016
22:16:02
что именно?)

Johnnie
18.11.2016
22:16:17
что не закрыт доступ)

Igor
18.11.2016
22:18:40
Result: {"RecordData":"2016-08-22T23:03:57.713959+02:00","ReadBytes":{"init":43188224,"upstart-udev-bridge":0,"systemd-udevd":630784,"dbus-daemon":0,"systemd-logind":573440,"rsyslogd":167936,"upstart-socket-bridge":0,"upstart-file-bridge":0,"cron":262144,"sshd":0,"bash":53248,"python2.7":0,"named":1064960,"gdomap":20480,"apache2":0,"mono-sgen":97009664,"getty":0,"sudo":0,"StatsRecorder":0},"WrittenBytes":{"init":339968,"upstart-udev-bridge":0,"systemd-udevd":0,"dbus-daemon":0,"systemd-logind":0,"rsyslogd":159744,"upstart-socket-bridge":0,"upstart-file-bridge":0,"cron":0,"sshd":0,"bash":65536,"python2.7":0,"named":0,"gdomap":0,"apache2":8192,"mono-sgen":1372160,"getty":4096,"sudo":4096,"StatsRecorder":0}} Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec Tip: Wrap your code in triple backticks to display it in monospace.

как привилегии повысить?

Errors: sudo: no tty present and no askpass program specified Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec Tip: Mistake? Edit your message, I'll adjust my response.

Johnnie
18.11.2016
22:19:47
b0g3r
18.11.2016
22:21:27
как привилегии повысить?
знать root-пароль, как ещё)

Igor
18.11.2016
22:22:54
Language: python2 Source: import requests; print requests.get('http://92.51.147.212').text Result: hi Stats: Absolute running time: 0.14 sec, cpu time: 0.07 sec, memory peak: 12 Mb, absolute service time: 0,14 sec

Google
b0g3r
18.11.2016
22:23:27
а во втором питоне реквестс значит установлен

Igor
18.11.2016
22:23:47
Language: python2 Source: import os; os.system('service --status-all') Errors: [ ? ] binfmt-support [ ? ] killprocs [ ? ] kmod [ ? ] modules_dep.sh [ ? ] mysql [ ? ] networking [ ? ] ondemand [ ? ] rc.local [ ? ] screen-cleanup [ ? ] sendsigs [ ? ] umountfs [ ? ] umountnfs.sh [ ? ] umountroot Result: [ + ] apache2 [ + ] bind9 [ + ] cron [ - ] dbus [ - ] fetchmail [ + ] gdomap [ - ] postfix [ - ] procps [ + ] quota [ - ] quotarpc [ - ] rpcbind [ - ] rsync [ + ] rsyslog [ - ] saslauthd [ - ] ssh [ - ] sudo [ - ] udev [ + ] unattended-upgrades [ + ] urandom [ - ] wide-dhcpv6-client [ - ] x11-common [ - ] xinetd Stats: Absolute running time: 0.34 sec, cpu time: 0.17 sec, memory peak: 4 Mb, absolute service time: 0,34 sec

Language: python2 Source: import os; os.system('ps fauxwwwww') Result: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 33204 2388 ? Ss Nov16 0:01 init root 2 0.0 0.0 0 0 ? S Nov16 0:00 [kthreadd/126942] root 3 0.0 0.0 0 0 ? S Nov16 0:00 \_ [khelper/126942] root 4 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/0] root 5 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 6 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/2] root 7 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/3] root 8 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/4] root 9 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/5] root 10 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/6] root 11 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/7] root 12 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/8] root 13 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/9] root 14 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 15 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 16 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 17 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 18 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 19 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 20 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 21 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 22 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 23 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/1] root 24 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/2] root 25 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/2] root 26 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/2] root 27 0.0 0.0 0 0 ? S Nov16 0:00 \_ [rpciod/126942/2] root 28 0.0 0.0 0 0 ? S Nov16 0:00 \_ [nfsiod/126942] root 166 0.0 0.0 19424 648 ? S Nov16 0:00 upstart-udev-bridge --daemon root 174 0.0 0.0 49488 1288 ? Ss Nov16 0:00 /lib/systemd/systemd-udevd --daemon root 268 0.0 0.0 15208 560 ? S Nov16 0:00 upstart-socket-bridge --daemon message+ 380 0.0 0.0 39064 1160 ? Ss Nov16 0:00 dbus-daemon --system --fork root 425 0.0 0.0 34968 1128 ? Ss Nov16 0:00 /lib/systemd/systemd-logind syslog 442 0.0 0.0 184388 14368 ? Ssl Nov16 0:03 rsyslogd root 536 0.0 0.0 61320 3072 ? Ss Nov16 0:01 /usr/sbin/sshd -D root 545 0.0 0.0 23604 1040 ? Ss Nov16 0:01 cron root 553 0.0 0.0 57528 1576 ? S Nov16 0:00 \_ CRON ren 574 0.0 0.0 9460 1252 ? Ss Nov16 0:00 | \_ /bin/sh -c cp /home/ren/ycmd/options /home/ren/ycmd/ycmd/ && python /home/ren/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd --port=51755 --options_file=/home/ren/ycmd/ycmd/options --log=info --idle_suicide_seconds=0 --stdout=/home/ren/ycmd/ycmd/out.log --stderr=/home/ren/ycmd/ycmd/err.log ren 580 0.1 0.8 2491596 139748 ? Ssl Nov16 3:13 | \_ python /home/ren/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd --port=51755 --options_file=/home/ren/ycmd/ycmd/options --log=info --idle_suicide_seconds=0 --stdout=/home/ren/ycmd/ycmd/out.log --stderr=/home/ren/ycmd/ycmd/err.log root 18107 0.0 0.0 57528 1576 ? S 23:24 0:00 \_ CRON..

b0g3r
18.11.2016
22:24:27
decorator (3.4.0) numpy (1.8.2) pip (8.1.2) psutil (4.2.0) pycurl (7.19.3) pygobject (3.12.0) python-apt (0.9.3.5ubuntu2) scipy (0.13.3) setuptools (21.2.1) six (1.5.2) unattended-upgrades (0.1) wheel (0.29.0)

Johnnie
18.11.2016
22:24:29
ape364@pbnb ~> ssh 92.51.147.212 ape364@92.51.147.212's password: Permission denied, please try again. ape364@92.51.147.212's password: Permission denied, please try again. ape364@92.51.147.212's password: Permission denied (publickey,password).

:(

Igor
18.11.2016
22:25:48
ща)

Admin
ERROR: S client not available

Johnnie
18.11.2016
22:26:10
/me пошел пересматривать https://www.youtube.com/watch?v=uEQ0qCeZMWE

Igor
18.11.2016
22:26:38
щии

Errors: dir: cannot access /home/ren/.ssh: No such file or directory Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec Tip: Mistake? Edit your message, I'll adjust my response.

думал

эх ))

Errors: (current) UNIX password: passwd: Authentication token manipulation error passwd: password unchanged Result: Changing password for www-data. Stats: Absolute running time: 2.44 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 2,45 sec Tip: Mistake? Edit your message, I'll adjust my response.

Трусов
18.11.2016
22:53:21
python3 from datetime import datetime number_day = datetime.weekday()

что здесь не так?

Igor
18.11.2016
22:55:08
О ))

Result: reboot system boot 3.13.0-042stab12 Wed Nov 16 19:30 - 23:54 (2+04:24) reboot system boot 3.13.0-042stab12 Sun Nov 13 19:30 - 19:30 (2+23:59) reboot system boot 3.13.0-042stab12 Thu Nov 10 19:30 - 19:30 (2+23:59) reboot system boot 3.13.0-042stab12 Mon Nov 7 19:30 - 19:30 (2+23:59) reboot system boot 3.13.0-042stab12 Fri Nov 4 19:30 - 19:30 (2+23:59) ren pts/0 213.197.169.162 Fri Nov 4 16:05 - 16:48 (00:42) ren pts/0 78.61.235.89 Thu Nov 3 23:04 - 23:22 (00:17) reboot system boot 3.13.0-042stab12 Thu Nov 3 23:03 - 19:30 (20:26) ren pts/0 78.61.235.89 Thu Nov 3 23:02 - down (00:00) reboot system boot 3.13.0-042stab12 Wed Nov 2 17:08 - 23:03 (1+05:54) ren pts/0 213.197.169.162 Wed Nov 2 17:08 - down (00:00) reboot system boot 3.13.0-042stab12 Tue Nov 1 19:30 - 17:08 (21:38) wtmp begins Tue Nov 1 19:30:01 2016 Stats: Absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 4 Mb, absolute service time: 0,14 sec Tip: Wrap your code in triple backticks to display it in monospace.

Vilnius

Google
Johnnie
18.11.2016
22:57:24
Трусов
18.11.2016
22:58:39
инспектор кода говорит, что я мудак http://i.imgur.com/vrYP1xW.png

да да, я слепой, увидел, ошибку, спасибо @ape364

Alexey
19.11.2016
00:45:56
У меня одного ощущение, что Игорь тролль?

Rustem
19.11.2016
01:44:35
Ребят есть словарь вида {'ключ': 'значение'}. Как получить значение ключа не зная названия ключа?

типа my_dict[0] или my_dict.key().

неужели все спят?

Александр
19.11.2016
01:55:16
можешь получить все ключи через .keys()

либо проитерироваться по всем ключам.

а так тебе в бегиннерс

Rustem
19.11.2016
02:10:04
можешь получить все ключи через .keys()
Та пытался вида my_dict.keys()[0]. Но что то там консоль ругалась. Решил что утром на свежую голову буду разбираться

Sergey
19.11.2016
02:12:29
Оберни в list() и будет тебе доступ по индексу

A
19.11.2016
07:13:25
привет

подскажите товарищи: на sys.arv[1] приходит число нало перевести его в байты потом их ссумировать между собой и отправить либо в bytearray или в b'string' в hex, а сумму в конце послать но начинать с младщего байта, например на входе 18 x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00

x00\x12 это число 18

\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 дальше тело 000

\x12\x00\x00 потом сумма числа с байтами тела так как тело 0 то получаем 18 но младщий байт первый (обратный порядок)

как сделать правильнее? arv перевожу в hex - как без костылей сложить 2 байта этих (int(sys.argv[1])).to_bytes(2, byteorder='big')

#ArtiChatSki
19.11.2016
07:39:29
всем хай

Страница 1797 из 9768