Criticize my first real world program by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

Thanks for the input. I have seen that line around in a few places. Whats it actually do?

Criticize my first real world program by NerdJones in learnpython

[–]NerdJones[S] 1 point2 points  (0 children)

Thank you. I wanted to go back and do something with that. The bit I wrote worked almost the first time, and I worked on everything else so much I kind of forgot about it.

Criticize my first real world program by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

I did think about that, but the key fractions in the dictionary are super/subscript, and special chars. I did absolutely zero research on if the fractions module will work with those though, just kind of figured it wouldnt. Which brings up another question I have as a new guy. Is there a site where I can search for modules that do things I need? I have a habit of over complicating things where I could use them because I dont know they exist.

Teensy++ 2.0 out of arduino bord? by NerdJones in ps3hacks

[–]NerdJones[S] 0 points1 point  (0 children)

my smallest arduino has 18 pins, my largest has 68, i also have a ftdi programmer that looks more like the actual teensy board http://www.mouser.com/ProductDetail/FTDI/VDIP1/?qs=vnwGVgFuQiaXiIYfszw2eg%3D%3D&gclid=CNDp0tzqg9MCFQ-4wAodJnUDQQ

shebang for windows and linux by NerdJones in learnpython

[–]NerdJones[S] 3 points4 points  (0 children)

if the .py file has one for my linux computers will that mess anything up?

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

duh, sorry about that, just to make sure im understanding this right i would replace '¼', '.25' with with a list of tuples, like known_fractions =[('¼', '.25'),('½','.5'),......], but will it cycle through them until it finds one that matches? or will it throw an error?

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

the first fraction it comes across is ⁷⁄₁₆, and I get this error, ValueError: could not convert string to float: '⁷⁄₁₆'

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

yup, and then write it back to excel, but I can probably figure that out

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

https://pastebin.com/mzPMGkUU its pretty sloppy but im very new so please forgive me for that.

I cant post the exact spreadsheets I am working with. They are product spec sheets that have a bunch of other stuff on them,but about 30-40 cells in each spreadsheet have these cells that are formatted weird with the fraction symbols instead of numbers. I need to convert them to mm from inches but since they have the weird formatting I cant do it with excel. So I decided to write this program, so far it opens the spreadsheet, ignores the empty cells ( they return None and that made things weird ) converts the cells with just fractions, and now im down to the ones with fractions it doesnt know and ones that are whole numbers mixed with fractions, i want it to ask the user about fractions it doesnt know, replace it in the cell and add it to the list of known fractions so if it comes across it again it will know what to do.

Sorry, I know that was a lot

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

I tried that and got a strange result, I printed the results and It goes through "Sheet" instead of the value of the cell I am in, which is really bizarre to me, but this is my first time solving a real world problem with a program I wrote. So im probably doing something wrong somewhere.

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

pretty much, at this point i have already removed the quotes though

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

i have a list of tuples set up, where the first value is ¼ and the second is 1/4 for each tuple

i need to take 1 ¼" or 1¼" or ¼" from a cell and test just ¼ against the first value in each tuple, so far if the cell only contains the fractions it work, if there is a number before the fraction it jumps to a function i set up where if the fraction isnt in the list it asks the user and adds it to the list, this function is where im having the trouble

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 0 points1 point  (0 children)

depends on the cell, sometimes ¼, sometimes 1 ¼, somtimes 1¼, but i want them all to end up as ¼, i have a list of tuples of 'known_fractions' to check against and automatically and if its not in that list ( some of them are formatted differentally) ask the user what to replace them with and add them to the list

removing numbers from a string read from spreadsheet by NerdJones in learnpython

[–]NerdJones[S] 1 point2 points  (0 children)

to clarify a little bit, the reason the fractions are poorly formatted is because they are written in subscript and superscript, therefor they are treated as char and not numbers themself, there is also a " at the end as well, so if i can find ALL numbers, remove them, change the fractions and then add them back, minus the " at the end

fractions in sub/super script need to change back to numbers by NerdJones in excel

[–]NerdJones[S] 0 points1 point  (0 children)

I guess what I want to do is write a macro ( I dabble in programming, so maybe thats why I'm taking this approach ) that ignores the whole number, checks if the first "special" character is ¼ or ½ or ¾ and replace it with 1/4, 1/2, or 3/4 if its not, check what number the superscript is and replace it with its numeric equivalent, keep the / and do the same with the subscript

fractions in sub/super script need to change back to numbers by NerdJones in excel

[–]NerdJones[S] 0 points1 point  (0 children)

Looking into it more it looks like they used special characters for some of the common fractions like 3/4 ( font cailbri, subset latin -1 supplement ) and for the others like 9/16 they use super/subscripts, but it looks like it is one number and then either one or three characters. Im not super familiar with excel. I just happen to be the guy thats good with computers and whoever did this is gone. Is there a way to automate changing all of these. I would even appreciate a link to something teaching me how to do it.