質問編集履歴

2

行ったことを追記しました。

2018/12/28 02:14

投稿

yukifujiwara
yukifujiwara

スコア11

test CHANGED
File without changes
test CHANGED
@@ -4,29 +4,13 @@
4
4
 
5
5
  利用しているPC:windows 10 pro
6
6
 
7
- anaconda3をウエブからダウンロードしました。
7
+ anaconda3をウエブからダウンロード
8
8
 
9
9
  pythonのバージョン:3.7.0
10
10
 
11
11
 
12
12
 
13
- **python searchtweetsパッケージ** [GitHub](https://github.com/twitterdev/search-tweets-python)を参考にしているのですが、上手くいきません。
13
+ **python searchtweetsパッケージ** [GitHub]のサイトを参考にしているのですが、上手くいきません。
14
-
15
-
16
-
17
- 質問は、
18
-
19
- 0. YAMLファイルはどこに保存すればよいか
20
-
21
- 0. コードはコマンドプロンプトに打つのか
22
-
23
- 0. 出力したファイルはどこにあるのか
24
-
25
-
26
-
27
-  以上の3つです。
28
-
29
- 慣れておらず、的外れな質問ばかりかもしれませんが、よろしくお願いします。
30
14
 
31
15
 
32
16
 
@@ -42,7 +26,7 @@
42
26
 
43
27
  ()の中は私のconsumer keyなどを入力しています。
44
28
 
45
- 保存場所がわからず、Anaconda3ファイルの中に入れています。
29
+ Anaconda3ファイルの中に保存しています。
46
30
 
47
31
  ```
48
32
 
@@ -58,14 +42,26 @@
58
42
 
59
43
  ```
60
44
 
61
-
62
-
63
-
64
-
65
45
  以下をコマンドプロンプトに入力しました。
66
46
 
67
47
  ```
68
48
 
49
+ python search_tweets.py --max-results 100 --results-per-call 100 --filter-rule "iPhone lang:ja since:2018-12-01 until:2018-12-02" ---filename-prefix test_search --print-stream
50
+
51
+ ```
52
+
53
+ すると"can't open file 'search_tweets.py': [Errno 2] No such file or directory"と表示されます。
54
+
55
+ ![イメージ説明](c4821874c0b45852c1ea8f3606e104b5.png)
56
+
57
+
58
+
59
+ ---
60
+
61
+ 以下をコマンドプロンプトに入力しました。
62
+
63
+ ```
64
+
69
65
  search_tweets.py --max-results 100 --results-per-call 100 --filter-rule "iPhone lang:ja since:2018-12-01 until:2018-12-02" ---filename-prefix test_search --print-stream
70
66
 
71
67
  ```
@@ -74,7 +70,7 @@
74
70
 
75
71
  すると以下の画面が開きます。(長いです)
76
72
 
77
- 開く画面は、左上に「Python 2.7.8: search_tweews.py - C:\Users\SOCIAL002\Anaconda3\Scripts\search_tweets.py」と表示されている白い画面です。(python Shellというものでしょうか、、、)
73
+ 開く画面は、左上に「Python 2.7.8: search_tweews.py - C:\Users\SOCIAL002\Anaconda3\Scripts\search_tweets.py」と表示されている白い画面です。(python Shell)
78
74
 
79
75
  ```
80
76
 
@@ -208,150 +204,20 @@
208
204
 
209
205
 
210
206
 
211
- argparser.add_argument("--count-bucket",
207
+ .
212
-
208
+
213
- dest="count_bucket",
209
+ .
214
-
210
+
215
- default=None,
211
+ .(文字制限を超えるため中略)
216
-
217
- help=("""Bucket size for counts API. Options:,
212
+
218
-
219
- day, hour, minute (default is 'day')."""))
213
+
220
-
221
-
222
-
223
- argparser.add_argument("--start-datetime",
214
+
224
-
225
- dest="from_date",
226
-
227
- default=None,
228
-
229
- help="""Start of datetime window, format
230
-
231
- 'YYYY-mm-DDTHH:MM' (default: -30 days)""")
232
-
233
-
234
-
235
- argparser.add_argument("--end-datetime",
236
-
237
- dest="to_date",
238
-
239
- default=None,
240
-
241
- help="""End of datetime window, format
242
-
243
- 'YYYY-mm-DDTHH:MM' (default: most recent
244
-
245
- date)""")
246
-
247
-
248
-
249
- argparser.add_argument("--filter-rule",
250
-
251
- dest="pt_rule",
252
-
253
- default=None,
254
-
255
- help="PowerTrack filter rule (See: http://support.gnip.com/customer/portal/articles/901152-powertrack-operators)")
256
-
257
-
258
-
259
- argparser.add_argument("--results-per-call",
260
-
261
- dest="results_per_call",
262
-
263
- help="Number of results to return per call "
264
-
265
- "(default 100; max 500) - corresponds to "
266
-
267
- "'maxResults' in the API")
268
-
269
-
270
-
271
- argparser.add_argument("--max-results", dest="max_results",
272
-
273
- type=int,
274
-
275
- help="Maximum number of Tweets or Counts to return for this session")
276
-
277
-
278
-
279
- argparser.add_argument("--max-pages",
215
+ argparser.add_argument("--debug",
280
-
216
+
281
- dest="max_pages",
217
+ dest="debug",
282
-
283
- type=int,
284
-
285
- default=None,
286
-
287
- help="Maximum number of pages/API calls to "
288
-
289
- "use for this session.")
290
-
291
-
292
-
293
- argparser.add_argument("--results-per-file", dest="results_per_file",
294
-
295
- default=None,
296
-
297
- type=int,
298
-
299
- help="Maximum tweets to save per file.")
300
-
301
-
302
-
303
- argparser.add_argument("--filename-prefix",
304
-
305
- dest="filename_prefix",
306
-
307
- default=None,
308
-
309
- help="prefix for the filename where tweet "
310
-
311
- " json data will be stored.")
312
-
313
-
314
-
315
- argparser.add_argument("--no-print-stream",
316
-
317
- dest="print_stream",
318
-
319
- action="store_false",
320
-
321
- help="disable print streaming")
322
-
323
-
324
-
325
- argparser.add_argument("--print-stream",
326
-
327
- dest="print_stream",
328
218
 
329
219
  action="store_true",
330
220
 
331
- default=True,
332
-
333
- help="Print tweet stream to stdout")
334
-
335
-
336
-
337
- argparser.add_argument("--extra-headers",
338
-
339
- dest="extra_headers",
340
-
341
- type=str,
342
-
343
- default=None,
344
-
345
- help="JSON-formatted str representing a dict of additional request headers")
346
-
347
-
348
-
349
- argparser.add_argument("--debug",
350
-
351
- dest="debug",
352
-
353
- action="store_true",
354
-
355
221
  default=False,
356
222
 
357
223
  help="print all info and warning messages")

1

基本的な情報(pythonのバージョンなど)の追加/困っていることをさらに詳細に書きました。

2018/12/28 02:14

投稿

yukifujiwara
yukifujiwara

スコア11

test CHANGED
File without changes
test CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
 
4
4
 
5
+ 利用しているPC:windows 10 pro
6
+
7
+ anaconda3をウエブからダウンロードしました。
8
+
9
+ pythonのバージョン:3.7.0
10
+
11
+
12
+
5
13
  **python searchtweetsパッケージ** [GitHub](https://github.com/twitterdev/search-tweets-python)を参考にしているのですが、上手くいきません。
6
14
 
7
15
 
@@ -66,6 +74,8 @@
66
74
 
67
75
  すると以下の画面が開きます。(長いです)
68
76
 
77
+ 開く画面は、左上に「Python 2.7.8: search_tweews.py - C:\Users\SOCIAL002\Anaconda3\Scripts\search_tweets.py」と表示されている白い画面です。(python Shellというものでしょうか、、、)
78
+
69
79
  ```
70
80
 
71
81
  #!c:\users\social002\anaconda3\python.exe