我不明白为什么我下面的子进程命令(python2.7)不能工作。有什么想法吗?谢谢。
In [35]: import subprocess
In [36]: subprocess.call("for f in $(find _test/ -name *.c -print); do echo hello; done ".split(),shell=True)
f: -c: line 0: syntax error near unexpected token `newline'
f: -c: line 0: `for'
Out[36]: 2
有人能帮我找出如何按顺序打印随机创建的列表旁边的元素吗?这些数字是书名,随机数字是书价,我需要在你选择要买的书之后,把这些价格放在书名旁边。
这是我的代码:
import random
print("Books for sale")
m = 25
price_list = []
for s in range(3, m + 1):
price_list.append(s)
i = 0
books = 1
n = 10
book_list = []
while i < n:
prices = random.sample(price_list, 1)
我的数据库托管在共享主机中。我在Management Studio Express中远程连接数据库。每当我尝试连接到sqlserver实例时,它都会显示该服务器实例中托管的所有数据库。总是从400个其他用户的数据库中找出你的数据库是很烦人的。
有没有办法将数据库列表过滤到我获得或拥有权限的数据库中?我不想看到我没有权限或者我不拥有的数据库。
请记住,我的数据库托管在共享主机中,作为一个用户,我拥有有限的特权。