[TxMt] Linefeeds in commands & snippets

Mike Mellor alaskamike at gmail.com
Sat May 13 01:51:52 UTC 2006


On May 12, 2006, at 2:01 AM, textmate-request at lists.macromates.com  
wrote:

> To: TextMate users <textmate at lists.macromates.com>
> Subject: Re: [TxMt] Linefeeds in commands & snippets
> Reply-To: TextMate users <textmate at lists.macromates.com>
>
>
> This is a Python issue. Python writes a newline to the end of all  
> print statements, which is where this is coming from. You could write:
>
> 	print newtask,
>
> which would not write a newline, but would add a space. In order to  
> write -just- the text, this would work:
>
> #!/usr/bin/python
> import os,sys
>
> def texter():
> 	oldtask = os.environ['TM_CURRENT_LINE']
> 	# oldtask = "Alligator"
> 	newtask = "DONE "
> 	for i in range (len(oldtask)):
> 		if i > 4:
> 			newtask = newtask + oldtask[i]
> 	sys.stdout.write(newtask)
> 	
> texter()
>
>
> Lindsay

Lindsay -

Thanks for the help, I thought it was something I was doing wrong in  
TextMate.

Mike


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060512/ab3288b3/attachment.html>


More information about the textmate mailing list