Ross Boylan wrote:
>> No [easy] way to go from bytecodes back to AST, but I see no reason
>> why you can't create a new code object with your filename and line
>> numbers and then create a new function using your modified code
>> object.
> Could you elaborate? I don't understand what you are su
Duncan Booth wrote
> Ross Boylan wrote:
>
> > As an extension or alternate, could there be a decorator like
> > @source_line(lineno, filename)
> > for classes and methods that could do the conversion on the fly? I
> > don'
Ross Boylan wrote:
> As an extension or alternate, could there be a decorator like
> @source_line(lineno, filename)
> for classes and methods that could do the conversion on the fly? I
> don't know if there's a way to go from the function (or class) object
> the decorator receives to the AST.
>
The ast module shows that elements of the syntax tree have line and
column numbers. Would it be sensible to attempt to revise them to
achieve effects like the #line directive in C?
Context: Using noweb, a literate programming tool, which from a source
file foo.nw produces foo.py. The lines in th
Dne 8.11.2011 23:36, MrSmile napsal(a):
Thank you all, that was it that I was searching for you.
Except that most likely it wasn't the right answer. Take a look at
http://docs.python.org/library/argparse.html (or optparse, if you are on
Python < 2.7).
Best,
Matěj
--
http://mail.python.org/
Thank you all, that was it that I was searching for you.
Tamer
Am 08.11.2011 23:32, schrieb Cameron Simpson:
> On 08Nov2011 23:19, MrSmile wrote:
> | I am looking for a way to get the command line in the script.
> |
> | Let us say I am in the folder "/tmp" okay!
> |
> | now from /tmp I execut
On 08Nov2011 23:19, MrSmile wrote:
| I am looking for a way to get the command line in the script.
|
| Let us say I am in the folder "/tmp" okay!
|
| now from /tmp I execute in the console this:
| python /home/tamer/MyApp/MyScript.py
|
| in the app itself, I want to grep the path and the script
On Tue, Nov 8, 2011 at 2:19 PM, MrSmile wrote:
> Hi people!
> I am looking for a way to get the command line in the script.
>
> Let us say I am in the folder "/tmp" okay!
>
> now from /tmp I execute in the console this:
> python /home/tamer/MyApp/MyScript.py
>
> in the app itself, I want to grep t
On 8-11-2011 23:19, MrSmile wrote:
Hi people!
I am looking for a way to get the command line in the script.
Let us say I am in the folder "/tmp" okay!
now from /tmp I execute in the console this:
python /home/tamer/MyApp/MyScript.py
in the app itself, I want to grep the path and the scriptname
Hi people!
I am looking for a way to get the command line in the script.
Let us say I am in the folder "/tmp" okay!
now from /tmp I execute in the console this:
python /home/tamer/MyApp/MyScript.py
in the app itself, I want to grep the path and the scriptname itself,
like: /home/tamer/MyApp is b
10 matches
Mail list logo