Re: checking whether a string is text or binary
On Tuesday, October 28, 2014 5:30:31 PM UTC-5, Dan Stromberg wrote: > On Tue, Oct 28, 2014 at 3:21 PM, Rick Dooling wrote: > > I tried to convert the code using 2to3 and it broke. > > > > The error I get when using Python 3 is on this line: > > > > _null_trans = string.maketrans("", "") > > > > and the error reads > > > > AttributeError: 'module' object has no attribute 'maketrans' > > > > Any help? I barely understand the whole unicode business, but any guidance > > in updating the code would be much appreciated. > > Top hit on "python3 maketrans" in Google: > > http://stackoverflow.com/questions/3031045/how-come-string-maketrans-does-not-work-in-python-3-1 THANK YOU I read that twice before without being able to figure what I needed to change, but third time is a charm. Rick -- https://mail.python.org/mailman/listinfo/python-list
Re: Any other screenwriters?
Thank you, Chris. I was trying to avoid the xcode since I know didley about that too, but I'll download it and see if I can get it to run. THANKS AGAIN Rick On Friday, March 8, 2013 3:51:44 PM UTC-6, Chris Angelico wrote: > On Sat, Mar 9, 2013 at 8:07 AM, Rick Dooling wrote: > > > To that end, I would like to take this Ruby script (which works pretty > > well, but throws errors in Mac OS X; some Ruby ones and some Prince ones) > > and convert it to Python so I can fix it myself, because I don't know Ruby > > at all, and would rather work in Python. > > > > > > https://github.com/olivertaylor/Textplay > > > > Hmm. You're looking at a fairly detailed markup language, and a > > potentially buggy third-party implementation of it. Are you able to go > > from the https://github.com/nyousefi/Fountain code instead? Given that > > you don't know Ruby at all, you'd be no worse off there, and it seems > > to be the "reference implementation". > > > > Porting either version to Python is going to be a big job, > > unfortunately. However, given that the reference implementation seems > > to have been written for a Mac, you have a reasonable chance of being > > able to execute the code, run the tests, and play with it, while you > > develop your own version. That's a *huge* help in porting - you can > > implement piece by piece, comparing in detail both the code and the > > output of each subsection. > > > > Alternatively, can you get the xcode version to run directly? (I'm not > > a Mac person and have no idea whether this is at all possible.) Can > > you call on it, in some way, and thus write just a wrapper around the > > outside? Might be a smaller job. > > > > Ultimately, you're working with a markup format. That means it's all > > text in, fiddle fiddle, text out... a workflow that Python's pretty > > good at handling. But you may be letting yourself in for a fairly big > > job :) > > > > ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Any other screenwriters?
On Friday, March 8, 2013 9:41:57 PM UTC-6, Rick Johnson wrote: > First impression of Fountain: TOTAL CRAP! Noted. But it seems to be the syntax the screenwriters and their programmers have settled on for now. It's all working pretty well. Just no Python or command-line implementations yet. I didn't post seeking help to make a new markdown system for screenwriters. That would surely be out of my league. > Well, $250 dollars is not a lot of money you know, especially if you are > using the software for professionally. Sorry if I was unclear. Sure. I have several programs like this and yes we use them once production starts, but it's nice to be able to work in your text editor for as long as possible. Faster. More versatility. So everybody is looking for a fast way to make PDFs in screenplay format from simple markdown text. > Ruby and Python are very similar. Have you made any attempts to translate > (any portions of) the code yet? No, but I may. Especially if those regexes in the Ruby script will work in Python. I'll try. Thanks, Rick -- http://mail.python.org/mailman/listinfo/python-list
Re: Any other screenwriters?
Thanks all! I have the ruby script working pretty well and may indeed just tamper with that and perhaps learn a little ruby along the way. The goal is a command-line converter, hence Trelby would be nice as a converter of last resort, but I would never use it as an editor. The whole point is to stay in Vim as long as possible. Writers are just like programmers. We write, we run it (and then read the PDF) and then we debug (edit). It's this cycle that is so nice in, say, LaTeX or markdown where you can turn the file you are working on into a PDF, read a few paragraphs, edit, turn it into a new PDF, repeat forever. Thanks for all of the good advice. Rick -- http://mail.python.org/mailman/listinfo/python-list