質問するログイン新規登録

質問編集履歴

4

修正

2021/08/17 00:54

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  ```
24
24
  # shareフォルダ内のPDFファイル検索(半角スペース等がパスに使われていない前提)
25
- cmd = "where Z:\documents:*.pdf"
25
+ cmd = r"where Z:\documents:*.pdf"
26
26
  ```
27
27
 
28
28
  ただ、ネットワークドライブを割り当てないで実現できればそうしたいです。

3

修正

2021/08/17 00:54

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ```
4
4
  # shareフォルダ内のPDFファイル検索(半角スペース等がパスに使われていない前提)
5
- cmd = "where \192.168.0.100\share\documents:*.pdf"
5
+ cmd = r"where \192.168.0.100\share\documents:*.pdf"
6
6
  outs, errs = mypopen(cmd, True, 5)
7
7
  print(outs)
8
8
  ```

2

修正

2021/08/17 00:53

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -3,8 +3,11 @@
3
3
  ```
4
4
  # shareフォルダ内のPDFファイル検索(半角スペース等がパスに使われていない前提)
5
5
  cmd = "where \192.168.0.100\share\documents:*.pdf"
6
+ outs, errs = mypopen(cmd, True, 5)
7
+ print(outs)
6
8
  ```
7
9
 
10
+ (mypopen関数: [Python3 subprocess.Popenのタイムアウト時のstdout, stderrについて](subprocessのコーディングはhttps://teratail.com/questions/352043))
8
11
 
9
12
 
10
13
  Pythonでsubprocessを使って検索しようとしたのですが、標準出力に期待するファイル名が入っておらず、
@@ -20,12 +23,8 @@
20
23
  ```
21
24
  # shareフォルダ内のPDFファイル検索(半角スペース等がパスに使われていない前提)
22
25
  cmd = "where Z:\documents:*.pdf"
23
- outs, errs = mypopen(cmd, True, 5)
24
- print(outs)
25
26
  ```
26
27
 
27
- (mypopen関数: [Python3 subprocess.Popenのタイムアウト時のstdout, stderrについて](subprocessのコーディングはhttps://teratail.com/questions/352043))
28
-
29
28
  ただ、ネットワークドライブを割り当てないで実現できればそうしたいです。
30
29
  なにか方法ありますか?
31
30
 

1

修正

2021/08/17 00:09

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- Windwosで、サーバにあるファイルを検索、ダウンロードしたいです。
1
+ Windowsで、サーバにあるファイルを検索、ダウンロードしたいです。
2
2
 
3
3
  ```
4
4
  # shareフォルダ内のPDFファイル検索(半角スペース等がパスに使われていない前提)