Bash ::每行显示一个输出项

时间:2016-03-29 03:38:44

标签: python bash command-line

我在终端运行此python script.py,输出urls

数组
rem_results = artist.search(name='rem')
rem = rem_results[0]
rem_blogs = rem.blogs
print 'Blogs about rem:', [blog.get('url') for blog in rem_blogs]

如何使用bash命令输出每行一项

1 个答案:

答案 0 :(得分:1)

要将它保存在Python的上下文中,你不需要bash来做你正在做的事情,只需要你正在迭代的任何东西,并在新行上使用join,这样你的数据集合中的每个值都将被分开通过字符串中的新行:

Create or replace PROCEDURE IdentifyLockedAccounts(p_recordset OUT SYS_REFCURSOR) AS
BEGIN
OPEN p_recordset FOR SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS = 'LOCKED' OR ACCOUNT_STATUS = 'LOCKED(TIMED)';
END IdentifyLockedAccounts;
/