我想在Python中过滤一个字符串,只获取逗号,和数字[0-9].
import re
x="$HGHG54646JHGJH,54546654"
m=re.sub("[^0-9]","",x)
print(m)
Run Code Online (Sandbox Code Playgroud)
结果是:
5464654546654
Run Code Online (Sandbox Code Playgroud)
代替:
54646,54546654
Run Code Online (Sandbox Code Playgroud) 我添加了.dll:AxWMPLib和使用方法,get_Ctlcontrols()但它显示如下错误:
AxWMPLib.AxWindowsMediaPlayer.Ctlcontrols.get':无法显式调用运算符或访问器
这是我的代码使用get_Ctlcontrols()方法:
this.Media.get_Ctlcontrols().stop();
Run Code Online (Sandbox Code Playgroud)
我不知道为什么会出现这个错误.任何人都可以解释我以及如何解决这个问题?
我想根据它们的索引模3来置换列表的元素,例如列表:
[0,1,2,3,4,5,6,7,8]
Run Code Online (Sandbox Code Playgroud)
应重新订购:
[0,3,6,1,4,7,2,5,8]
Run Code Online (Sandbox Code Playgroud)
一般来说:
[A0, A1, A2, A3, A4, A5, A6, A7, A8]
Run Code Online (Sandbox Code Playgroud)
应成为:
[A0, A3, A6, A1, A4, A7, A2, A5, A8]
Run Code Online (Sandbox Code Playgroud)
我试过使用以下代码:
def arr_sort(arr, algo):
arrtmp = arr
arrlen = len(arr)
if algo == 1:
return arr
if algo == 2:
count = 0
while count < (arrlen - 1):
for index, val in enumerate(arr):
if index % 3 == 0:
arrtmp[count] = val
count += 1
for index, val in enumerate(arr):
if index % 3 == …Run Code Online (Sandbox Code Playgroud) 我想使用九个补丁图像为我的应用程序制作一个启动画面,它在纵向和横向方向看起来应该是相同的(正方形).
我的代码很简单:
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.splashscreen);
// more code here...
}
Run Code Online (Sandbox Code Playgroud)
我的资源文件是:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<bitmap android:src="@drawable/launch_image" />
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
在Draw 9-patch实用程序中,九个补丁图像看起来很好:

但结果是图像被拉伸:

怎么了?九个补丁图像可以这样使用吗?
d = int(input("Please Enter any Number: "))
a = 0
def product_of_digits(Number):
d= str(Number)
for integer in d:
s = 0
k = []
while s < (len(d)):
print (int(d[s])*int(d[s+1])*int(d[s+2])*int(d[s+3])*int(d[s+4]))
s += 1
print (product_of_digits(a))
Run Code Online (Sandbox Code Playgroud)