Python-不在for循环中处理str-结果为白色

Python-不在for循环中处理str-结果为白色,python,Python,我在处理python循环中的一个参数时遇到了问题 def Find_文件(*参数): 对于args中的项目: 对于p,在os.walk(os.path.abspath(item))中的文件: 打印(文件) 结果是它是白色的。 向下代码完成: print(directorys) type(directorys) 0 \\\\xxx.xxx.xx.xx\\z$\\Directory-LOG 1 \\\\xxx.xxx.xx.xx\\x$\\Directory-LOG 2 \

我在处理python循环中的一个参数时遇到了问题

def Find_文件(*参数): 对于args中的项目: 对于p,在os.walk(os.path.abspath(item))中的文件: 打印(文件)

结果是它是白色的。 向下代码完成:

print(directorys)
type(directorys)

0       \\\\xxx.xxx.xx.xx\\z$\\Directory-LOG
1    \\\\xxx.xxx.xx.xx\\x$\\Directory-LOG
2    \\\\xxx.xxx.xx.xx\\y$\\Directory-LOG
Name: IPDIRETORIO, dtype: object

pandas.core.series.Series
# #

“结果是白色的”

#

但是,如果我在项目conform down中设置参数,则过程将成功:

Find_files('\\\\xxx.xxx.xx.xx\\z$\\Directory-LOG')
我不理解什么问题


你能帮我吗?

描述了这个问题

我的密码错了。有额外的反斜杠

the exit should be:
"\\xxx.xxx.xx.xx\z$\Directory-LOG"

Instead of:

"\\\\xxx.xxx.xx.xx\\z$\\Directory-LOG"

您是否在问为什么从列表中传递值时什么也不返回,而直接作为字符串传递?我相信列表中存储的值是“0\\\\xxx.xxx.xx.xx\\z$\\Directory LOG”。您应该拆分它,只获取目录的完整路径-在传递它之前删除零和空格。在调用函数:print(directorys[0])\\\\192.168.30.37\\m$\\CL01-INST01-BKP-LOG中删除零
type(directorys[0])
str
Find_files('\\\\xxx.xxx.xx.xx\\z$\\Directory-LOG')
the exit should be:
"\\xxx.xxx.xx.xx\z$\Directory-LOG"

Instead of:

"\\\\xxx.xxx.xx.xx\\z$\\Directory-LOG"