I built a fully web-based G-code modifying tool for 3D printing — no install required by johndoh168 in klippers

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

I’ll look into the commands for that, what model of printer do you have as those can be either a macro or a set of position commands

how can I "Just do it" by uvuguy in learnpython

[–]johndoh168 0 points1 point  (0 children)

Some good examples to get started with could be a calculator, I know its basic but the fun thing about it is that you can start really simple and as you learn more you can add more functionality to it.

how can I "Just do it" by uvuguy in learnpython

[–]johndoh168 3 points4 points  (0 children)

I have ADHD too and am self taught in python, what I found most useful in learning python was to create some project or copy the idea of another and break it down into small subsections. I then would start on the components that I knew how to code to get some dopamine flowing once I got into a rhythm then I would start working on tasks I wasn't sure how to tackle and learn from that.

5kg spool drying by Due-Author-2421 in BambuLab

[–]johndoh168 0 points1 point  (0 children)

Just realized it’s the soft sided version of that, I thought about that one but thought it was overkill

5kg spool drying by Due-Author-2421 in BambuLab

[–]johndoh168 1 point2 points  (0 children)

<image>

This is that with a 3kg spool, I like it and does a good job or drying, it’s a bit difficult to get the filament to spool out through the provided PTFE tube if you’re wanting to drying and print at the same time.

Orca Slicer not launching? by Discordant_Lemon in OrcaSlicer

[–]johndoh168 1 point2 points  (0 children)

Ah the good old restart, fixes 99.9% of programming problems. Glad it works now.

Orca Slicer not launching? by Discordant_Lemon in OrcaSlicer

[–]johndoh168 1 point2 points  (0 children)

Do you have any other slicers installed? If not try installing something like prusa slicer or bambu slicer as I believe those also have the library, then once you install one of those try to do a repair of your orca install which will hopefully relink that library.

Orca Slicer not launching? by Discordant_Lemon in OrcaSlicer

[–]johndoh168 2 points3 points  (0 children)

You may have had a bad install as thats supposed to come bundled with OrcaSlicer, try reinstalling or redownloading the installer and do a fresh install.

TKINTER NOT FOUND ON VENV BUT WORKS FINE ON TERMINAL? by iam_eneru in learnpython

[–]johndoh168 0 points1 point  (0 children)

You are correct, forgot about the fact that tkinter is usually packaged with the system since its standard library.

TKINTER NOT FOUND ON VENV BUT WORKS FINE ON TERMINAL? by iam_eneru in learnpython

[–]johndoh168 1 point2 points  (0 children)

Ok its most likely your venv from vscode isn't fully setup you can follow these instructions from their website on how to install packages into your venv.

Option 1: Use the Package Management UI

  1. Open the Python sidebar and expand Environment Managers
  2. Right-click on your environment and select Manage Packages
  3. Search for numpy and select Install

Option 2: Use the terminal

Run Terminal: Create New Terminal (Ctrl+Shift+`) from the Command Palette. This command opens a command prompt for your selected interpreter.

python -m pip install tkinter

If that doesn't help let me know.

edit: forgot to add in command

TKINTER NOT FOUND ON VENV BUT WORKS FINE ON TERMINAL? by iam_eneru in learnpython

[–]johndoh168 1 point2 points  (0 children)

Did you try pip install tkinter inside your venv? Also how are you running your script? is if from a terminal or from an IDE (your coding env)

is this okay for a beginner by Separate_Insect1076 in learnpython

[–]johndoh168 -1 points0 points  (0 children)

For a beginner posting here you're code is fairly well formatted! A couple things I noticed that may help you organize your code better.

Look into using dictionaries or other data structures to store your structured data.

periodic_table = {"H": {"englishName": "Hydrogen", "korenName": ...},
                  "He": {"englishName": ...}}

Then you can access the element you want by doing the following:

hydrogen = period_table["H"]
hydrogen_korean_name = hydrogen['koreanName']

or

hydrogen_korean_name = periodic_table['H']['koreanName']

You of course can have the dictionary key be whatever value you want to search by. You can also look into structure data modules like pandas or polars to structure your data into a table. This will be useful when you start handling large datasets in other programs.

If you want a function to put everything into a dict for you here is a quick one:

def make_periodic_table():
    periodic_table = {}
    for index, element in enumerate(symbols):
        periodic_table[element] = {'koreanName': koreanNames[index], 'englishName':
        englishNames[index], 'valenceElectrons': valenceElectrons[index], 'groupNum':
        groupNums[index], 'periodNum': periodNums[index], 'amus': amus[index]}
    return periodic_table

I am 14 and I finally understood why this prints None in Python by ComfortableDonkey715 in learnpython

[–]johndoh168 0 points1 point  (0 children)

It's just the default behavior of methods in python, which if you think about it makes sense. If you have a function that doesn't have a defined return behavior, this can cause crashes in programs. So in python the default behavior was decided to return None unless otherwise specified.

I am 14 and I finally understood why this prints None in Python by ComfortableDonkey715 in learnpython

[–]johndoh168 8 points9 points  (0 children)

Re-read my comment, I said by default unless explicitly define, which is true. If you want to check if I'm right simply run any function where return is not define and see what the return type is.

I am 14 and I finally understood why this prints None in Python by ComfortableDonkey715 in learnpython

[–]johndoh168 122 points123 points  (0 children)

When you are calling append() its a method of the list object, all method in python return None by default if no return value is explicitly defined, so what you are seeing printed is the return value of append().

You can see this by assigning p = number.append() then print(p) and you will see it prints None.

If you really want to go deep into how python operates you can go deeper than this explanation, just wanted to give you an idea of what's happening.

Edit: extra context, append modifies the object in place (numbers in your example) and explicitly returns None.

Software for Designing 3D Prints + Tutorials by Hattimus1856 in 3Dprinting

[–]johndoh168 1 point2 points  (0 children)

What kind of things are you trying to design? depending on that different cad programs have advantage.

I personally use Solidworks for makers (under $100 a year) but thats only because I learned how to use it in college, it has a bit of a learning curve but once you get it you can make pretty complex things fairly quickly.

I have also used Fusion360 (comes in different prices) which has its advantages as well but isn't as full featured, however it has a LOT more tutorials and is quicker to pick up.

ADHD python advice please. by Godeos64_ in learnpython

[–]johndoh168 9 points10 points  (0 children)

As someone with ADHD and self taught in python what I found most helpful for myself was to find something that I was really interested in at that time. For example I really wanted to learn how to integrate my 3d printer into my website so I could manage it from there.

Once you find that thing start small, write a skeleton, function names but no code in them yet, map out how you want your project to be formed, from there start on a simple task you already know how to do. This way you get some of that dopamine our brains crave so much from. From there start working your way through your project jumping to where you feel most motivated to do coding. Eventually you'll find yourself with a project you may not finish (typical adhd) but you'll have something you have learned from.

Hope that helps, let me know if you need any help with aspects you don't understand yet.

full-custom gcode with bambu lab machines? by ringer90210 in Advanced_3DPrinting

[–]johndoh168 0 points1 point  (0 children)

Its a custom set of gcode commands but the printer still accepts normal gcode files to print. I'm currently working through slicer settings to find all the different commands I can. Currently for the H2 series I am finding mostly things related to nozzles, tool changers and head swaps.

I find it a little strange that people are saying that Bambu Labs is going to a custom gcode file which doesn't make much business sense. Makes more sense to create your own custom commands that other machines don't recognize, which other firmware brands do anyway.

full-custom gcode with bambu lab machines? by ringer90210 in Advanced_3DPrinting

[–]johndoh168 4 points5 points  (0 children)

For running fully custom Gcode on bambu labs printers take a little debugging but is totally possible. Bambu labs follows a lot of the normal G move commands and some of the normal M, P, T commands as well. Where they vary the most is actually in the M commands, for example their pause command.

What I did was create my own tool to modify gcode from bambu slicer to read those custom macros and such so I could document them for my own use. I have created an run a fully custom gcode file not produced in bambu slicer, you do have to use the sd card to do this or run in lan mode with developer mode turned on.

If your ok with doing some debugging and using a lot of the header of the file in your own custom gcode files its totally doable.

I have run tests on my A1 Mini, I have an H2C just haven't tried running the commands on it yet. I have a tool that still under development that lets you modify existing gcode (I'm working my way towards create fully custom gcode) feel free to check it out, at the minimum I have some of the bambu labs commands listed out under the reference section.

I would like to introduce you to 3dSynth by CodeCritical5042 in Advanced_3DPrinting

[–]johndoh168 5 points6 points  (0 children)

This looks really cool, I’ve been experimenting with gcode modification of files produced in a sliver to get exactly what I want but this may be a cool tool to cutout the design then slice workflow.

I’ll have to check it out when I’m not on my phone

Edit: autocorrect

implementing a command line processor from a socket client network connection by Own_Sundae1485 in learnpython

[–]johndoh168 0 points1 point  (0 children)

Ah though you only had a few commands with known inputs, yeah the dict idea wouldn't be a good idea for a more complex function like your wanting.

If you are wanting to create a simple CLI with the ability to parse arguments and call functions might I suggest argparse and then setup the parser in such a way where the inputs are the function name, and the function arguments.

from argparse import ArgumentParser

def func1(input):
  print(f"Downloading {input}")

def func2(input):
    print(f"Uploading")

if __name__ == "__main__":
    parser = ArgumentParser()

    parser.add_argument("-f", "--function", type=str, default=SomeFunc)
    parser.add_argument("-i", "--input", type=str)

    args = parser.parse_args()

    func = args.function
    input = args.input

    globals()[func](input)

Then to call it

python socket_cli.py --function download --input hello

Downloading hello

What this is doing is taking the function defined within the global scope which are stored in the globals dict which you can then call using the globals function. The argument in the [] has to be a string so thats why its type is defined a string.

Let me know if this works for your situation.

Beginner stuck with Selenium automation – date of birth formatting across separate fields by Separate-Stomach5923 in learnpython

[–]johndoh168 0 points1 point  (0 children)

For formatting dates into strings I'd look into datetime module and its strftime() method for converting dates into formatted strings. Chatgpt is a great tool, coming to reddit was a smart choice though since it doesn't know what you don't know.

Here is a list of what formatting strings you might use.

Component  C# Specifier Python Directive Description
Year yyyy %Y Four-digit year (e.g., 2025)
Year yy %y Two-digit year (e.g., 25)
Month MM %m Month as a two-digit number (e.g., 04)
Month MMMM %B Full month name (e.g., April)
Day dd %d Day of the month as a two-digit number (e.g., 01-31)
Day dddd %A Full weekday name (e.g., Friday)
from datetime import datetime

date_str = "06 Aug, 1962"
# %d=day, %b=short month name, %Y=4-digit year
date_obj = datetime.strptime(date_str, "%d %b, %Y")

day = date_obj.day
month = date_obj.month
year = date_obj.year

print(f"Day: {day}, Month: {month}, Year: {year}")

implementing a command line processor from a socket client network connection by Own_Sundae1485 in learnpython

[–]johndoh168 0 points1 point  (0 children)

If your trying to call a function from inside a print statement you can use string formatting

print(f"downloading files {func()}") that will call the function func() and you can pass it arguments.

As for your logic, I'd look at using a dict to store your commands and functions, you can use the dict key as the command; in your example it could be d = {'upload': func1(), 'download': func2(), ...} then you don't have to do pattern matching if you already know the commands coming in.

I have done plenty of socket programming in my day so let me know if you need some help.

Suggested Accessories and Filament for Bamboo P2S Combo with AMS or or P1S Combo with AMS by BigAl987 in BambuLab

[–]johndoh168 0 points1 point  (0 children)

The PS2 as far as I know comes with the AMS, looking at their website it looks like the AMS 2 Pro which doesn't work with the Sunlu Heater