简单代码的奇怪问题 [英] Curious issue with simple code

查看:75
本文介绍了简单代码的奇怪问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一些简单的代码 - 有效......有点代码:

Hi,

I have some simple code - which works...kind of..here''s the code:

展开 | 选择 | Wrap | 行号

推荐答案

codefire写道:
codefire wrote:




我有一些简单的代码 - 有效......有点代码:

Hi,

I have some simple code - which works...kind of..here''s the code:

展开 | 选择 | Wrap | 行号


codefire写道:
codefire wrote:

如上所述,它们都按预期工作。但是,在标记的行上,如果我使用f代替fp,那么该条件将返回false!当然,

isfile(f)应该返回true,即使我只是给出了一个文件名,而不是完整路径的

As above it all works as expected. However, on the marked line, if I
use f instead of fp then that condition returns false! Surely,
isfile(f) should return true, even if I just give a filename, rather
than the full path?



尝试打印两个f和fp,看看你能分辨两个文件名之间的区别

......


< / F>

try printing both "f" and "fp", and see if you can tell the difference
between the two filenames...

</F>


codefire写道:
codefire wrote:

如上所述,它们都按预期工作。但是,在标记的行上,如果我使用f代替fp,那么该条件将返回false!当然,

isfile(f)应该返回true,即使我只是给出了一个文件名,而不是完整路径的

As above it all works as expected. However, on the marked line, if I
use f instead of fp then that condition returns false! Surely,
isfile(f) should return true, even if I just give a filename, rather
than the full path?



嗨Tony,


实际上该文件与工作目录不同

目录,所以你需要给它找到它的路径。如果你从'c:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ >

问候,

乔丹

Hi Tony,

Actually the file is in a different directory from the working
directory, so you need to give it the path where to find it. If you
started the script from ''c:\intent\docn'' (i.e., start_dir), then just
using f would work.

Regards,
Jordan


这篇关于简单代码的奇怪问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆