Skip to main content
added 98 characters in body
Source Link
Alex Hall
  • 36.2k
  • 5
  • 63
  • 98

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

The \n is there to prevent a syntax error in the case that a.py does not end in a newline.

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

The \n is there to prevent a syntax error in the case that a.py does not end in a newline.

Rollback to Revision 1
Source Link
Alex Hall
  • 36.2k
  • 5
  • 63
  • 98

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo 'print'\nprint(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo 'print(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

deleted 2 characters in body
Source Link
Nico Schlömer
  • 59.6k
  • 35
  • 216
  • 290

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint'print(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

Here's a simple crude solution:

$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo 'print(a)') 
6.28

There are various ways this might not work, but the constraints of your situation are not clear.

Source Link
Alex Hall
  • 36.2k
  • 5
  • 63
  • 98
Loading