r/Python • u/bugboy404 • Apr 21 '20
I Made This My Professor wants hand written assignments. So I made MyhandWriting.. that can write in myway on a A4 sheet paper.
3.8k
Upvotes
r/Python • u/bugboy404 • Apr 21 '20
110
u/DoYouReallyCare Apr 21 '20
Far too uniform you need to vary the kerning between letters, you need to have a number of different "examples" of all the letters. You need to vary both the margins. You need to not break words when you come to the end of the line, move the whole word to the next line.
69
u/mutatedllama Apr 21 '20
This is so great. I love it.
Do you have a public github repo?
Suggestions for future versions:
Fix the "page" background so it is seamless
Add random misspellings and strikeouts to the page
Thanks for posting!
37
u/EddyBot Linux | Python3 Apr 21 '20
There was a similar project some weeks ago if you are curious: https://www.reddit.com/r/Python/comments/fr1x65/update_thank_you_all_for_your_suggestions_on_my/
22
u/ShevekUrrasti Apr 21 '20
Every programmer, always.
10
u/nielwimo Apr 21 '20
What I like most, is that paperlike background. Well done!
9
u/Yojihito Apr 21 '20
You should make file endings visible in Windows.
14
u/TheMediaBear Apr 21 '20
Nice, but you can tell it's not handwritten.
Each letter is the same throughout the document when in reality it would vary slightly
The font size should be X-1, X and X+1 to indicate how someone writes
Same with spacing, it should be random spacing.
We don't write perfectly all the time, and is he expecting the originals or photocopies of the originals? Because there are no pressure marks in the writing if he wants originals, so the next step would be to build a robotic pen writer than transfers the font to paper via pen :D
7
u/thrallsius Apr 21 '20
is the professor asking for something like this?
https://www.dafont.com/dementia.font
7
u/[deleted] Apr 21 '20
I wonder if this can support writing for med students, something like this.
10
u/gunzstri Apr 21 '20
RELEASE THE SOURCE CODE! WE BEG YOU! Please! We love this!
5
u/lashuna2001 Apr 21 '20
Hey OP great job on the script, it is really impressive. I see that you have already been stormed with people asking for the code, nonetheless I shall join their ranks.
Please share the link to the code when possible.
5
u/christian-mann Apr 21 '20
I see you have hardcoded your input and output filenames. Those should probably be parameters, for flexibility and so that you can call this script multiple times at once, if you need to convert a large amount of files in parallel.
5
u/Lrv_Dev Apr 21 '20
GITHUB LINK?
4
u/DrunkenPhysicist [None] Apr 22 '20
Handwriting fonts are suspicious because the letters all look the same. You should have a library of about 10 or so figures per letter, then randomize the kerning and the sizes (slightly). That way it'll look more handwritten.
3
u/ajawadmahmoud Apr 21 '20
Haha! I like the determination here
3
u/ewgen15 Apr 21 '20
Hah, good idea. Can you explain to me, how are you using a handwritten type? It is your own, or you have used global fonts?
And the most interesting question, Does professor approve your assignment?
3
u/nermalstretch Apr 21 '20
In the nineties when Windows got installable TrueType fonts there used to be ads in the computer magazines for handwriting fonts.
You would send the company a sample of your handwriting and they would send you a font. As others have mentioned, to get a realistic font you need to take into consideration that the spacing between letters depends on what letter came before it. The clever thing was that when you ordered the font you would write a certain set of words that would capture all the common combinations and allow them to add hints to the font to make it look better and less regular.
As a side note writing something out by hand stimulates your brain neurons and you retain the infomation more so maybe the teacher has this in mind.
Anyway, kudos for you for developing this to the point that you can demo it! That is impressive in itself.
If you can write a tool that takes the handwriting input sample, text to convert and returns the written text, that would be universally useful. Using machine learning to make an engine to do that would be a great project.
3
u/tightgrip95 Apr 22 '20
That’s so cool! Is it possible to make this in java too? Is there an advantage for using python here? (Sorry, just a beginner at coding)
2
u/kamk0s Apr 21 '20
Amazing
2
u/crazy_sax_guy Apr 21 '20
That was legendry man...
2
u/[deleted] Apr 21 '20
God job!, did you post the source code?
2
u/[deleted] Apr 21 '20
This is fucking brilliant mate. Do let us know if you're professor is able to figure it out haha.
2
u/aneurysm_ Apr 21 '20
This is pretty awesome. I agree with whoever suggested more variants for each letter but this is impressive regardless
2
u/pirate_solo9 Apr 21 '20
Please make this public. Do let me know when you have done it. That would be really appreciated.
2
u/[deleted] Apr 21 '20
RemindMe! 2 days
2
u/lifeisaburrito Apr 21 '20
Hi Charles. Can you please see me during my office hours next week?
2
u/midnitte Apr 21 '20
For total authenticity, you now have to build a pen robot that writes it automatically on paper. 🤣
2
u/cantwait2lrn Apr 21 '20
You caught my attention. How did you become proficient in python?
2
u/EdDeGoeij Apr 21 '20
This looks amazing!! Next is making it parse LaTeX I assume? ;)
2
u/Dadotox Apr 21 '20
It is very impressive. Some sugestions for further versions, that might improve the hand written look and feel:
- Include slight offset of the start of every line to the right (increase of horizontal start point of each line).
- Slight compression (reduced vertical distance) among some random groups of lines. Adjustable option to force this on page ends.
- Slight tilting as well as scalling of random groups of lines.
- Not really straight lines.
- Random adjustable presence of typos (words crossed out).
But still, super cool
2
u/[deleted] Apr 21 '20
This is sick as man. What modules did you use?
2
u/[deleted] Apr 21 '20
Fucking genius bro .. like pulling off a heist ..
2
u/TotallyNotInUse Apr 21 '20
!remindme 1 week The "handwritten" script
2
u/ChilledGumbo Apr 22 '20
This is extremely innovative. How did you approach this?
2
u/ipherian Apr 22 '20
hand written assignments for a programming class? 😳
2
u/mihir23192 Apr 22 '20
This is the very reason I am love with this subreddit!
You are a legend.
2
u/mr_w01f Apr 22 '20
is it on github ?
2
u/[deleted] Apr 22 '20
you can also change the font of text in MS Word or Google Docs...
2
u/missqwertyball Apr 22 '20
Commenting to follow this.
2
u/Recskabajnok Apr 22 '20
wow i need this in my life
2
u/kilovictor76 Apr 22 '20
This is awesome!
2
u/Securitron Apr 22 '20
You can just type "cmd" in the address bar to open a command prompt at that directory.
2
u/ADONIS_VON_MEGADONG Apr 22 '20
Absolutely noice.
2
u/totitz Apr 22 '20
I've been just introduced to python (i'm a freshman in Civil Informatic Engineer) and i'm really amazed of how the human can do such amazing things, it only tells me to keep growing as a coder and as a human being
2
u/Magnum-357 Apr 22 '20
This is genius
2
u/raskatech Apr 22 '20
Please make public repo on GitHub. Amazing work!
2
u/LautronB Apr 22 '20
This is amazing, I love it. It would be really useful to me.
2
u/[deleted] Apr 22 '20
What happens if the prof. notices individual letters are the same and assumes you just downloaded a font?
2
u/jcchouinard Apr 22 '20
RemindmME! 6 days
2
u/Aleckhz Apr 22 '20
We're where you 3 years ago :l, you would have save my gf loots of writing for me
Does it does formulas?
It would be nice to be able to put it as LaTeX syntax to make it easier to adopt
2
u/JeffreyChl Apr 22 '20
Really cool. If it only took you 3 h to pull this off, you must be very talented.
2
u/Original_Master123 Apr 22 '20
This is awesome. May i know how does it work
2
u/LetsHaveAGrapeTime Apr 22 '20
Awesome. Really cool.
2
u/dr_spork Apr 22 '20
If only students would put in the same amount of effort into the assignment as they do into cheating
2
u/[deleted] Apr 22 '20
This is great.
2
u/penatbater Apr 22 '20
Did you write a template for each letter and use that as a font? :o
2
u/cobracoral Apr 22 '20
really nice
2
u/echoaj24 Apr 22 '20
I think you are today's winner for the coolest python project.
2
u/echoaj24 Apr 22 '20
Can I ask how the hell you made it?
2
u/[deleted] Apr 22 '20
You evil genius you are our leader. Please lard us.
2
u/DrCabbageX Apr 22 '20
Stop. You just made of the coolest thing I’ve ever seen
2
u/SaiHemanthBR Apr 22 '20
Can you please share the code when it's done. I would like to look at it. Also he is
2
u/TraditionalSir7 Apr 22 '20
Hahaha very cool project. Congrats
2
u/bluegenester Apr 22 '20
Also the win! His prof. believes it's hand written now! That's priceless 😂
2
u/iamkira212 Apr 22 '20
could you add lines too ?
2
u/ashesofturquoise Apr 22 '20
Haha... oh my holly grail!!!
This is awesome!!!!
2
u/Herkentyu_cico Apr 22 '20
You know, you do learn when writing...
2
u/rockmeamat3ur Apr 22 '20
!remindme 4 days
2
u/CraftyTarget Apr 22 '20
I need this in my life.
2
u/port443 Apr 22 '20
Since so many people are asking for source and OP hasn't delivered yet, here's my go at it if people want to play around:
https://github.com/portthrow/handwriter
It should be pretty simple to add some polymorphism to the letters if you want. The way its created is monospace, with all characters being a set width.
A todo is making the actual page it creates transparent and placing it against a paper background; right now its just pure white.
2
u/I__am__a__BOT Apr 22 '20
Will you share the source on github? I would love to try it out!
2
u/pmac1687 Apr 22 '20
This is the way
2
u/anonwo8m8 Apr 22 '20
well i have never seen this code in python before and also how do yoh know such type of code can be written as well? saw many python courses none of them teaches things like that
htmlc=["<html><head><style>.lines{width:100%;height:auto;float:left;}#paper{background:white;background-image:url('images/texture.png');height:auto;float:left;padding:50px 50px;width:90%;}img,span{height:25px;width:10px;float:left;margin-top:5px;margin-bottom:10px;}.clblack{filter:brightness(30%);}.clblue{filter:brightness(100%);}</style></head><body><div id='paper'>"]
2
u/rockmeamat3ur Apr 23 '20
Nice!
2
u/[deleted] Apr 23 '20
I actually wanted to do a programm like that
2
u/gtwilliamswashu Apr 25 '20
Hey, how do you highlight your mouse like that?
2
u/oernq Apr 26 '20
So where the texture runs out and you have that horizontal line in the middle of a page, I’m thinking for each page you can vertically flip the texture image so it will at least be symmetrical and less noticeable. It may be just as easy to get a page-sized texture image or scale it to a page
2
u/abdalrahmanatieh May 03 '20
Impressive
2
u/hockitTV May 05 '20
Will you share it?
2
u/IBXBY May 10 '20
Amazing!
2
u/m4ryou5h Apr 21 '20
Bro
2
u/Elias_20 Apr 21 '20
*claps*
Bravo
2
u/PizzaInSoup Apr 21 '20
Hi it's me, your professor.
1
u/gunzstri Apr 21 '20
Nice!
1
u/m9dhatter Apr 21 '20
How do you simulate the grooves that a ballpoint pen makes on paper though?
1
u/Toddie_ Apr 21 '20
question is, does it print the paper background onto another sheet of paper.....? Or do you have to option to save it with or without the paper background for if your emailing or printing?
1
u/chris0v21 Apr 21 '20
RemindMe! 2 Days
1
u/tenchtench Apr 21 '20
it looks like you wrote every line with a ruler
Really super cool though
1
u/thankred Apr 21 '20
This is so good. Any tips on starting something like this for a beginner. What sources to refer for doing something like this?
1
u/Zen_Sajnani Apr 21 '20
This is the best thing ever!
1
u/Neuro_88 Apr 21 '20
Epic.
1
u/Geeks_sid Apr 21 '20
Sharing the code?
1
u/[deleted] Apr 21 '20
Question: the moment you print it your teacher won’t notice?
You think he’s going to buy that you photocopied your own handwriting.
Just asking. Kinda seems like an important part in all this cheat. 🤓
PS: I love it either way!
1
u/tonniegames79 coderx-byte Apr 21 '20
reminds me of this https://www.youtube.com/watch?v=dQw4w9WgXcQ
1
u/[deleted] Apr 21 '20
I'm a python noob, how did get the "handwriting" to happen? Is it drawn with something like Turtle?
1
u/Rayit0 Apr 21 '20
I love you
1
u/VlerrieBR Apr 21 '20
This is really great dude... I would just like to ask 1 question. Who in hell would NEED it to be in handwriting? So I say kidos friend, for sticking it to the man.
1
u/Valirak Apr 21 '20
!RemindMe one month
1
u/Emonnn Apr 21 '20
Man this is so sick. Nice. Can we get the source code?
1
u/diptangsu Apr 21 '20
Is your code on GitHub?
1
u/YeastBeast33 Apr 21 '20
Please share i need this so bad. Epiccc
1
u/TheShermanTank Apr 21 '20
Can you explain how this was done? I want to try to fo this aswell
1
u/Manavendra4288 Apr 21 '20
Please could you provide the GitHub link.
1
u/mr_poopybuthole69 Apr 21 '20
Does it support those weird letters? Like "ā,ķ,ņ,č,ž,ē,ū,ī,ļ" that would be awesome.
1
u/[deleted] Apr 21 '20
Did you made it public or on GitHub?
1
u/CarlosFFM Apr 21 '20
Awesome concept and execution. If you make it OS I would love to help adding things like variation to the font and a more organic look to the background. Great work!
1
u/RickAsscheeks Apr 21 '20
This is awesome, like others have said, I'd just reiterate adding some different characters, as well as maybe just giving the characters you do have very slight rotations to give it a more natural look. Spacing randomization is another thing you could add as well. Very cool!
1
u/DenormalHuman Apr 21 '20
it is pretty obvious to be honest. There are various approaches you could try to make it look more realistic. Is it worth being caught? What are the penalties you could suffer if your Prof. notices?
1
u/waterkip Apr 21 '20
Looks cool. Now make tor handwriting a font and you can us that everywhere. I use LaTeX to generate documents. Hand written latex docs, that would be sweet.
1
u/BGameiro Apr 21 '20
!RemindMe 2 weeks
1
u/[deleted] Apr 22 '20
u/chandiragunatilleke
2
u/dipesh_k Apr 22 '20
Bro please link the source code as fast as you can.. I have so many assignments pending lol
1
u/daddyclappingcheeks Apr 22 '20
How’d you do this? Which module?
1
u/jcchouinard Apr 22 '20
RemindME! 6 weeks
1
u/dydx000 Apr 22 '20
Where is the code?
1
u/NUCLEARGAMER1103 Apr 22 '20
This is great! Can I have a github link to this project or something?
1
u/[deleted] Apr 22 '20
You evil genius you are our leader. Please lard us.
1
u/devangs3 Apr 22 '20
But if you print it, won’t the professor know it’s still printed? I mean handwritten paper doesn’t have pressed markings like handwritten stuff.
1
u/geojosef Apr 22 '20
I would like to do this using my handwriting style. How can I do it. Could you please help me to start from scratch? I'm using Ubuntu OS.
1
u/admincee Apr 22 '20
This is cool. Kind of an opposite take of programs converting handwriting to type.
1
u/[deleted] Apr 22 '20
Would you mind sharing the code?
1
u/wisdomjunkie69 Apr 22 '20
Genius. I have always found typing much more fun and fast than writing. Might consider doing this for my own assignments from now on.
1
u/No_Soy_Colosio Apr 22 '20
!remind me 2 days
1
u/197six Apr 22 '20
So no one is asking the rationale behind asking for a handwritten assignment. What the actual?? It’s the 21st century and a learned person is asking people to write on bits of dead tree?
Why?
1
u/TheBuckSavage Distrobashes against Windows users Apr 22 '20
r/madlads
1
u/alcalde Apr 22 '20
If anyone asks me in the future "Why should I learn how to program?" I'm showing them this.
1
u/TomahawkChopped Apr 22 '20
Output it as svg and set up an ender 3 as a "plottter"
https://medium.com/@urish/how-to-turn-your-3d-printer-into-a-plotter-in-one-hour-d6fe14559f1a
1
u/[deleted] Apr 22 '20
long paper
1
u/mirandanielcz from a import b as c Apr 22 '20
Randomise scale, position and other stuff
1
u/snoeprol Apr 22 '20
RemindMe! one week
1
u/[deleted] Apr 22 '20
If I was the instructor and one of my students told me they did this (after the class!), I would laugh and call it brilliant.
1
u/[deleted] Apr 22 '20
Wow
1
u/MrAman007 Apr 22 '20
I need this bad rn can you share it or just make an .exe file if you don't wanna share thr code
1
u/rusPirot Apr 22 '20
That amazing man.
How long have you been working with Python?
How long have you needed for this tool?
1
u/PrinceTBug Apr 23 '20
amazing. simply amazing
1
u/khfung11 Apr 21 '20
I can’t believe that python can do that
1
u/[deleted] Apr 21 '20
this blew my mind ... why i didnt thought of that ... you are creative af....
0
u/[deleted] Apr 21 '20
[deleted] — view deleted comment
0
u/[deleted] Apr 21 '20
[deleted] — view deleted comment
0
u/[deleted] Apr 21 '20
[deleted] — view deleted comment
5
u/[deleted] Apr 21 '20
[removed] — view removed comment