(→Ruby) |
(→Python) |
||
| 39번째 줄: | 39번째 줄: | ||
==Python== | ==Python== | ||
[[category: Python]] | [[category: Python]] | ||
{{참고|파이썬 pprint()}} | |||
<source lang='Python'> | <source lang='Python'> | ||
from pprint import pprint | from pprint import pprint | ||
2018년 9월 8일 (토) 15:01 판
- var_dump
- pprint
1 Perl
Perl
Copy
use Data::Dumper;
my $foo = {"ID"=>102, "Name"=>"YONEZAWA Akinori", "Address"=>"Naha, Okinawa"};
print Dumper($foo);
#$VAR1 = {
# 'Name' => 'YONEZAWA Akinori',
# 'ID' => 102,
# 'Address' => 'Naha, Okinawa'
# };
2 PHP
PHP
Copy
$dict = array(
"ID" => 102,
"Name" => "YONEZAWA Akinori",
"Address"=> "Naha, Okinawa"
);
var_dump($dict);
# array(3) {
# ["ID"]=>
# int(102)
# ["Name"]=>
# string(16) "YONEZAWA Akinori"
# ["Address"]=>
# string(13) "Naha, Okinawa"
# }
3 Python
Python
Copy
from pprint import pprint
dict = { }
dict['ID'] = 102
dict['Name'] = 'YONEZAWA Akinori'
dict['Address'] = 'Naha, Okinawa'
pprint( dict )
# {'Address': 'Naha, Okinawa', 'ID': 102, 'Name': 'YONEZAWA Akinori'}
4 Ruby
- 다른 뜻에 대해서는 루비 p 문서를 참조하십시오.
Ruby
Copy
a = [ "a", "b", "c" ]
p ("hello")
# "hello"
p 1
# 1
p nil
# nil
p [1,2,3]
# [1, 2, 3]
options = { font_size: 10, font_family: "Arial" }
p options
# {:font_size=>10, :font_family=>"Arial"}