r/pythonhelp • • Apr 19 '21

How can I stop this 'turtle' from appearing, or at the very least hide it? (context in a comment)

4 Upvotes

r/pythonhelp • • Apr 18 '21

Hello, I'm very new to python and I'm following a YouTube video on making simple code. Can someone explain to me why I'm getting a syntax error here seemingly on the print statement?

Post image
4 Upvotes

r/pythonhelp • • Apr 16 '21

HOMEWORK Python Password Generator Program

4 Upvotes

Hello everyone! I am currently creating a randomly generated password program for a school project. I am wanting to make it so that if you answer the question “What should the length of the password be?” with something besides an integer, it will display and error message and then ask you the question again. Does anyone have any tips on how I can start to set this up? Thank you!

I have the link to my GitHub which has the code right here: https://github.com/snowiestdaisy56/Python---Password-Generator/blob/657c3ca6fafd6316071e9425c615c955e0f16cc7/main.py

This is my first time ever using GitHub so hopefully I did it correct!


r/pythonhelp • • Mar 22 '21

So guys, I wrote a script that should print out all CDS sequences from my file but the problem is that I'm only getting the first CDS sequence printed out multiple times and nothing more.. what can be the problem? 🤔

Post image
4 Upvotes

r/pythonhelp • • Feb 11 '21

Which type of plot do I need?

4 Upvotes

Hi all, I'm looking at plotting data with matplotlib. The data I need to plot has a value (magnitude) and time data point so it's well suited to a scatter plot. I want a line to join the points up, however only changes are recorded. That means you cannot interpolate a line between the points. The line in-between points must therefore stay at the same y axis value as the previous point but progress in time until the next point. So how would I go about plotting this? Hope that makes sense.


r/pythonhelp • • Jan 05 '21

SOLVED So I’m a beginner and I have no idea why, but every time I run the program no matter what I input weather it’s L or K, it always prints “you weigh so and so pounds. It never prints the other statement, I can’t seem to find what’s wrong with my code. Any help would be much appreciated, thank you!

Post image
4 Upvotes

r/pythonhelp • • Dec 08 '20

Can i please get some help, the problem is i’m getting unnecessary zeros in the third column of the output

Thumbnail
gallery
4 Upvotes

r/pythonhelp • • Dec 07 '20

How do i put a gif ontop of a gif?

4 Upvotes

Im currently trying to put a gif ontop of a gif and then save it. I've tried this.

@client.command()
async def salt(ctx, member: discord.Member):
    response = requests.get(member.avatar_url)
    img = Image.open(BytesIO(response.content))
    
    framess = []
    framess.append(img)
    
    # Save into a GIF file that loops forever
    framess[0].save('png_to_gif.gif', format='GIF',
                append_images=framess[1:],
                save_all=True,
                duration=100, loop=0)
    
    new_Igf = Image.open('png_to_gif.gif')

    animated_gif = Image.open("salty.gif")
    frames = []
    for frame in ImageSequence.Iterator(new_Igf):
        frame = frame.copy()
        frame.paste(animated_gif)
        frames.append(frame)
        frames[0].save("iamge.gif", format='GIF',
                append_images=framess[1:],
                save_all=True,
                duration=100, loop=0)

What this does is get an image from a url convert it into a gif format. Open a gif locally an trying to apply it to the converted gif.

Instead of what im expecting i get a weird non animated file.

image link> https://cdn.discordapp.com/attachments/738572311107469354/785428570205716491/iamge.gif

Please help. Using discord.py and Pillow.


r/pythonhelp • • Nov 25 '20

Are certifications really that important?

4 Upvotes

So I've been surfing the web and such and I came across this website for python certifications. It was a website called python institute and I was wondering if 1. Is this credible and something that might actually help me stand out? 2. Is it important to get certified?


r/pythonhelp • • Nov 21 '20

Help

4 Upvotes

Im trying to understand how to take specific traits of a website and then input them into my own html file.

However, I cant seem to get specific traits to make the output say the desired weather, time and all that stuff.

Were using import urlibb.request

and the website that we are taking from is https://weather.gc.ca/city/pages/on-107_metric_e.html

Any help would appreciated but please don't solve it for me , I wanna figure it out myself.


r/pythonhelp • • Nov 11 '20

INACTIVE Hey guys, could someone help me with that? I'm trying to launch my program but it keeps on telling me there's an error whatever I do, I'm kind of blocked.

Post image
4 Upvotes

r/pythonhelp • • Nov 05 '20

I want to automate some stuff on my pc, but i just cant make this code work (im a beginner so im pretty noob)

4 Upvotes

I want to automate some software boot ups on my pc, but i just cant make this code work

This is my code:

import subprocess

subprocess.call(r"C:\Users\Robbin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Steam\Steam.exe")

This is my error:

C:\Users\Robbin\Desktop\pycharm\projects\venv\Scripts\python.exe C:/Users/Robbin/Desktop/pycharm/projects/app.py
Traceback (most recent call last):
  File "C:\Users\Robbin\Desktop\pycharm\projects\app.py", line 3, in <module>
    subprocess.call(r"C:\Users\Robbin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Steam\Steam.exe")
  File "C:\Users\Robbin\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\Robbin\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\Robbin\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vinden

Process finished with exit code 1

How can i fix this?


r/pythonhelp • • Oct 18 '20

hw challenge question(pls help)

4 Upvotes

Create a text document called names.txt that contains a list of 20 names, each on its own line. Write a program that reads the names from names.txt and then generates a file called shuffle.txt that contains the names listed in random order. (Do not use the .shuffle() build in list method)


r/pythonhelp • • Oct 16 '20

Help

4 Upvotes

If someone chose the number 3, how would I make a code that chooses all the positive integers from 1 to n (3), and displays the sum of the numbers? So for example 3, 1+2+3=6(sum)


r/pythonhelp • • Sep 24 '20

can anyone help me explain what this python code mean?

Post image
4 Upvotes

r/pythonhelp • • Jul 22 '20

hey can someone help me with my code? i keep on getting a key Error regarding Username

Post image
4 Upvotes

r/pythonhelp • • Jul 19 '20

Why is my syntax wrong where the cursor is? ImI'm trying to make a simple rock paper scissors game.

Post image
4 Upvotes

r/pythonhelp • • Jul 04 '20

I need help! The program works but the text “None” shows up under the numbers. I have narrowed the problem down to the print(“ “, card_print()). The card_print looks like the cause of the issue.

Post image
4 Upvotes

r/pythonhelp • • Jun 16 '20

Hi guys I'm a beginner in python, and would like help writing the following program

4 Upvotes

Write a Python program that prompts the user to enter a sentence of at least 5 words. Include a test to ensure that the user has entered at least 5 words. Store the individual words as separate items in a list. Print the sentence in reverse order - word by word. The words must print in one line (not beneath each other).


r/pythonhelp • • Jun 12 '20

How can I open a python file with python code?

4 Upvotes

Title. can I use the os module? can the open() function help? I just can't figure it out.


r/pythonhelp • • Dec 23 '19

I need help with writing input into a txt file.

4 Upvotes

I have I = open(“f.txt”, “w”) I.readable I.readline I.close


r/pythonhelp • • 3d ago

python breaks for some reason when I rename a project

3 Upvotes

Hi, python newbie here, and I have a very weird problem which is that whenever I rename a project, python refuses to run it because of "cannot run program "/Users//PycharmProjects/WelcomeScreen/.venv/bin/python" (in directory "/Users//PycharmProjects/Blackjack_but_working"): Exec failed, error: 2 (No such file or directory)"

(i censored my name for privacy reasons but otherwise that is the error)

plz help


r/pythonhelp • • 29d ago

My UI/UX looks very smudged and jagged

3 Upvotes

So I am working on creating my own personal AI and my UI/UX looks very smudged, it is supposed to look like the UI/UX for an sci-fi generation ship. ASUS AI V1

import tkinter as tk
import math

# ==========================
# ASUS_v1
# ==========================

root = tk.Tk()

root.title("ASUS_v1")
root.geometry("1000x700")
root.configure(bg="black")

canvas = tk.Canvas(
    root,
    width=1000,
    height=700,
    bg="black",
    highlightthickness=0
)

canvas.pack(fill="both", expand=True)

angle = 0


def draw():
    global angle

    cyan = "#00FFFF"

    canvas.delete("all")

    # ==========================
    # TITLE
    # ==========================

    canvas.create_text(
        500,
        50,
        text="ASUS ONLINE",
        fill=cyan,
        font=("Consolas", 24, "bold")
    )

    cx = 500
    cy = 400

    # ==========================
    # OUTER RING
    # ==========================

    canvas.create_oval(
        250,
        150,
        750,
        650,
        outline=cyan,
        width=3
    )

    # Rotating markers

    for i in range(12):

        a = math.radians(
            angle + i * 30
        )

        x1 = cx + math.cos(a) * 220
        y1 = cy + math.sin(a) * 220

        x2 = cx + math.cos(a) * 250
        y2 = cy + math.sin(a) * 250

        canvas.create_line(
            x1,
            y1,
            x2,
            y2,
            fill=cyan,
            width=2
        )

    # ==========================
    # INNER RING
    # ==========================

    canvas.create_oval(
        325,
        225,
        675,
        575,
        outline=cyan,
        width=2
    )

    # ==========================
    # CENTER CORE
    # ==========================

    canvas.create_oval(
        450,
        350,
        550,
        450,
        fill=cyan,
        outline=cyan
    )

    canvas.create_text(
        500,
        400,
        text="ASUS",
        fill="black",
        font=("Consolas", 10, "bold")
    )

    # ==========================
    # SYSTEM PANEL
    # ==========================

    canvas.create_rectangle(
        20,
        120,
        180,
        360,
        outline=cyan,
        width=2
    )

    canvas.create_text(
        100,
        150,
        text="SYSTEM",
        fill=cyan,
        font=("Consolas", 12, "bold")
    )

    # ==========================
    # PROJECTS PANEL
    # ==========================

    canvas.create_rectangle(
        820,
        120,
        980,
        360,
        outline=cyan,
        width=2
    )

    canvas.create_text(
        900,
        150,
        text="PROJECTS",
        fill=cyan,
        font=("Consolas", 12, "bold")
    )

    # ==========================
    # ANIMATION SPEED
    # ==========================

    angle += 0.5

    root.after(25, draw)


draw()
root.mainloop()

ASUS_v1 memory.json:

{
    "user_title": "Sir",
    "voice_enabled": true,
    "hardware_thresholds": {
        "cpu_percent": 85.0,
        "ram_percent": 90.0
    },
    "protocols": {
        "house party": {
            "description": "Launch primary workstation suite",
            "paths": [
                "C:\\Windows\\System32\\calc.exe",
                "C:\\Windows\\notepad.exe"
            ]
        }
    },
    "dynamic_rules": {
        "run diagnostic": "audit_logs",
        "system status": "check_telemetry"
    }
}

r/pythonhelp • • 29d ago

Question in coding Text RPG

3 Upvotes

I am a hs student in a Computer Science course and I’m working on a personal project where I’m creating a Text RPG similar to those AI generated & run apps but without any AI and I’m currently stuck. I’ve worked out the randomised character creation (Name, Class, Strength, Dexterity, Wisdom, Intelligence, Charisma, Constitution, HP, AC, Initiative, Special Attribute/Spell, Power Level, & Catchphrase).
Now I’m working out how to code the actual Game part. I’m making a sort of encounter table (1-100) that randomises the number of encounters (10-50) and all encounters (Monster/Creature, Loot, Town, NPC/Quest, Environmental Events, & Rare Encounters) in addition to a randomized boss at the end of the game (1-20), but I don’t know how to code that many randomized inputs without mixing up my variables.