@@ -217,8 +217,17 @@ $ cd /path/to/myProject
217
217
$ vien call main.py
218
218
```
219
219
220
- The optional ` -p ` parameter allows you to specify the project directory
221
- ** relative** to the parent directory of the ** file** being run.
220
+ In fact, all arguments following the ` call ` command are passed directly to the
221
+ python executable.
222
+
223
+ ``` bash
224
+ # passing arguments [-B, -OO] to Python and [arg1, arg2] to main.py
225
+ $ vien call -B -OO main.py arg1 arg2
226
+ ```
227
+
228
+ The optional ` -p ` parameter can be specified before the ` call ` word. It allows
229
+ you to set the project directory ** relative** to the parent directory of the **
230
+ file** being run.
222
231
223
232
``` bash
224
233
$ cd any/where # working dir is irrelevant
@@ -318,6 +327,37 @@ in `/x/y/z/aaa_venv`.
318
327
319
328
The ` _venv ` suffix tells the utility that this directory can be safely removed.
320
329
330
+ # Shebang
331
+
332
+ On POSIX systems, you can make a ` .py ` file executable, with ` vien ` executing it
333
+ inside a virtual environment.
334
+
335
+ Insert the shebang line to the top of the file you want to run. The value of the
336
+ shebang depends on the location of the file relative to the project directory.
337
+
338
+ File | Shebang line
339
+ --------------------------------|--------------------------------
340
+ ` myProject/runme.py ` | ` #!/usr/bin/env vien -p . call `
341
+ ` myProject/pkg/runme.py ` | ` #!/usr/bin/env vien -p .. call `
342
+ ` myProject/pkg/subpkg/runme.py ` | ` #!/usr/bin/env vien -p ../.. call `
343
+
344
+ After inserting the shebang, make the file executable:
345
+
346
+ ``` bash
347
+ $ chmod +x runme.py
348
+ ```
349
+
350
+ Now you can run the ` runme.py ` directly from command line. This will use the
351
+ virtual environment associated with the ` myProject ` . The working directory can
352
+ be anything.
353
+
354
+ ``` bash
355
+ # runs the runme.py in virtual environment for myProject
356
+
357
+ $ cd anywhere/somewhere
358
+ $ /abc/myProject/pkg/main.py
359
+ ```
360
+
321
361
# Shell prompt
322
362
323
363
By default the ` vien shell ` adds a prefix to
@@ -352,35 +392,4 @@ personalized:prompt> PS1=$PS1 vien shell
352
392
```
353
393
354
394
To avoid doing this each time, ` export ` your ` PS1 ` to make it available for
355
- subprocesses.
356
-
357
- # Shebang
358
-
359
- On POSIX systems, you can make a ` .py ` file executable, with ` vien ` executing it
360
- inside a virtual environment.
361
-
362
- Insert the shebang line to the top of the file you want to run. The value of the
363
- shebang depends on the location of the file relative to the project directory.
364
-
365
- File | Shebang line
366
- --------------------------------|--------------------------------
367
- ` myProject/runme.py ` | ` #!/usr/bin/env vien -p . call `
368
- ` myProject/pkg/runme.py ` | ` #!/usr/bin/env vien -p .. call `
369
- ` myProject/pkg/subpkg/runme.py ` | ` #!/usr/bin/env vien -p ../.. call `
370
-
371
- After inserting the shebang, make the file executable:
372
-
373
- ``` bash
374
- $ chmod +x runme.py
375
- ```
376
-
377
- Now you can run the ` runme.py ` directly from command line. This will use the
378
- virtual environment associated with the ` myProject ` . The working directory can
379
- be anything.
380
-
381
- ``` bash
382
- # runs the runme.py in virtual environment for myProject
383
-
384
- $ cd anywhere/somewhere
385
- $ /abc/myProject/pkg/main.py
386
- ```
395
+ subprocesses.
0 commit comments