Re: How can I format an integer ?
Re: How can I format an integer ?
- Subject: Re: How can I format an integer ?
- From: Skeeve <email@hidden>
- Date: Fri, 07 Nov 2008 08:39:28 +0100
André Berg schrieb:
I have also found that you can use normal Python syntax in HERE strings
once you figure out the backslash-salad that is.
You don't need to. Once I also found that for perl but soon learned that
ther is a better way and I guess the same is true for python.
In shell you can type:
perl -e 'script here'
I guess in python it's
python -c 'script here'
The solution when you want to do that with AS is:
do shell script "python -c " & (quoted form of "script here")
With this you only have to take care of backslashing quotes and
backslashes. I think that's an easy task. At least you don't have to
take care for a proper "HERE" - end string, can use linebrakes and
indents for formatting purposes and you get the advantage that the
python/perl script still can read STDIN for processing (small example
with too much code):
do shell script "echo " & myNumber " | perl -e " & (quoted form "
use strict;
use warnings;
while (<>) {
tr/,./.,/;
print;
}
")
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden