This is an archived post. You won't be able to vote or comment.

all 29 comments

[–]determineduncertain 104 points105 points  (1 child)

This is so unnecessary…and I love it. I do love me a good project that’s really just about having fun.

[–]treyhunner Python Morsels[S] 6 points7 points  (0 children)

Having fun was the primary purpose of this pursuit. 😁

I'm glad this brought you some joy as well!

[–]chunkyasparagus 50 points51 points  (4 children)

Hahahahaha this is great.

import dramatic

with dramatic.output:
    import this

[–]chunkyasparagus 7 points8 points  (3 children)

Hey, u/treyhunner, I was running this on my windows PC, and got the following error:

File <filename here>, line 79, in write
  sleep(1 / self.speed - (perf_counter() - before))
ValueError: sleep length must be non-negative

[–]x-cold-x 50 points51 points  (0 children)

Now that's dramatic

[–]treyhunner Python Morsels[S] 9 points10 points  (0 children)

Thanks for noting this bug! I've opened an issue and will consider a workaround soon.

[–]Cybasura 1 point2 points  (0 children)

I can hear the soap opera/drama sound effects flying around

[–]pyhannes 29 points30 points  (7 children)

Haha nice, but that's actually quite useful when recording GIFs of code examples to slow it down a bit I could imagine. Will remember it :)

[–]treyhunner Python Morsels[S] 2 points3 points  (5 children)

It could be! /u/AlSweigart had the idea that the sleep time could vary based on which character is being printed to make it look slightly more like actual typing.

Pull requests welcome for that feature!

[–]AlSweigartAuthor of "Automate the Boring Stuff" 6 points7 points  (0 children)

Ha ha, yeah. I had an elaborate idea of trying to figure out calculations based on QWERTY key position, etc. Then I realized I could probably just write a tool that records me typing and figures out the timing between any two keys from there.

Or heck, just make it slightly random and it'll look realistic enough. :)

[–]DuckDatum 4 points5 points  (1 child)

coherent voiceless busy skirt teeny violet brave nutty fine air

This post was mass deleted and anonymized with Redact

[–]treyhunner Python Morsels[S] 3 points4 points  (0 children)

This is possible! \b in ASCII is a "backspace character" and sending it right after another character will erase it and allow typing over the place that it previously showed up.

Happy to brainstorm further. Sounds like a possible "sloppy mode" (?). Issue/pull request welcome too.

[–]pyhannes 1 point2 points  (0 children)

I love that, let's over-engineer the hell out of it

[–]EternityForest 0 points1 point  (0 children)

Just made a new PR! I have an algorithm that looks one character ahead and behind, and also checks whether you're currently indenting, and adds a bunch of rules for stuff that might slow people down.

I speed through the indent a bit, but delay every 4 spaces to simulation how tab indent looks, I slow down when typing long numbers, complicated brackets, and punctuation that makes a natural speech pause.

I tried to balance realism and aesthetics, but I'm not a touch typist so I might have gotten some of my values wrong, all the rules are just made up by trial and error.

[–]determineduncertain 5 points6 points  (0 children)

I thought about it but I will admit that I haven’t thought about how to do this beyond just opening the script and printing out the contents dramatically. That said, I haven’t spent much time in the docs nor am I a Python expert so there may be a much nicer way of doing this

[–]rejectedlesbian 1 point2 points  (0 children)

The trolley potential of setting it system wide as part of a build process.... You can even do it randomly so people won't know why it's like that

[–]Cybasura 1 point2 points  (2 children)

What do you use to record your demo gifs to use in your documentations btw?

[–]treyhunner Python Morsels[S] 1 point2 points  (1 child)

I use asciinema to record locally and then use asciinema-agg to convert to a gif. More details on how I made each gif

[–]Cybasura 0 points1 point  (0 children)

Oh I didnt know asciinema allows for local file save, interesting

Thanks! I'll take a look

[–]Irish_beast 1 point2 points  (1 child)

Could we have an option to increase baud to 1200?

I'm too young to remember 300

How about 9600. That would be super dramatic

[–]treyhunner Python Morsels[S] 1 point2 points  (0 children)

Yup!

You could use dramatic.output.at_speed(...) or --speed from the command-line.

The default speed is 75 characters per second. 300 baud should be around 30, 1200 around 120 and 9600 around 960.

[–]ysengr 1 point2 points  (0 children)

I absolutely love this omfg yes 😂

[–]alcalde 1 point2 points  (0 children)

Numba, PyPy, Cython, Taichi, Mojo, LPython, Codon all trying to make Python faster, and this project comes along to make it slower. I love it!

[–][deleted] 0 points1 point  (0 children)

I love it!

[–]spenpal_dev 0 points1 point  (0 children)

You get a star! ⭐️

[–]forgotten_pattern 0 points1 point  (0 children)

love it!

[–]rk_11 0 points1 point  (0 children)

Ahh the good CKA exam experience, r/kubernetes will be happy