There is some good info here on how to 'touch' a file from within python:

        http://stackoverflow.com/questions/1158076/implement-touch-using-python


Sidebar, there is a really good utility on the Mac called "Dash":

        https://itunes.apple.com/us/app/dash-docs-snippets/id458034879?mt=12

And some info here on how you can enable lookups from BBEdit:

        
http://bbedit-hints.tumblr.com/post/23037132326/using-bbedit-with-dash-app-for-code-lookup

It is pay-for but I use it a lot to look up functions/methods when I am coding, 
and the python documentation is pretty good.

F.

On Apr 28, 2013, at 8:49 PM, LuKreme <[email protected]> wrote:

> 
> On 28 Apr 2013, at 17:13 , François Schiettecatte <[email protected]> 
> wrote:
> 
>> sys.stdin is an iterator not a list so addressing an element in the way you 
>> are doing it won't work, you would need to wrap sys.stdin in a list() to 
>> cause it to read all the lines, and then address the element, for example
> 
> I knew I was going to hate python, and I do. My script was failing because 
> there were spaces indenting a line instead of a tab.
> 
> I finally, after much struggling, ended up with this:
> 
> #!/usr/bin/python
> 
> import sys
> import datetime
> import re
> 
> for line in sys.stdin:
>       line=line.strip()
>       myDate, myPath = line.split(' ',1)
>       myDate = str(datetime.date.fromordinal(int(myDate)))
>       myDate = re.sub('[^\d]','',myDate)
>       print 'touch -ct {}0001 {}'.format(myDate,myPath) 
> 
> Thank you all for your help.
> 
> Now, one other thing, if I wanted to execute the touch command (I don't, in 
> this case), could I do that within the python via some sort of exec() 
> function?
> 
> 
> -- 
> "@Drhorrible is not following you" Whew! that's a relief, I was sure
> some super villain was following me. Hope it's not Dick Cheney.
> 
> -- 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, 
> please email "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to