Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. menator01

    Happy New Years!

    Happy New year
  2. menator01

    Merry Christmas and Happy Holidays from Code Forum

    Merry Christmas to all.
  3. menator01

    PHP How do you fix image not found in database error

    Can you show the code?
  4. menator01

    Python Range / empty list issue??

    This line is where the error is. random_suit = randrange(0, len(available_cards)) There is no range between 0 and 0.
  5. menator01

    Python Range / empty list issue??

    I'm not sure if this is what you want but, If the pull is from an empty list, this will reset the deck. Added a try block in the while loop while True: try: generate_random_card() except ValueError: full_deck = {} for i in range(len(suits))...
  6. menator01

    Can anyone review this?

    I think the code works fine. Here is one of my early attempts using functions and match case. # Do the imports from random import choice import os # Set some global variables player_score = 0 computer_score = 0 ties = 0 def clear(): ''' Function to clear the screen clutter '''...
  7. menator01

    Python Is there a command that runs a line of code again?

    It loops. Having an input statement in the loop pauses it until enter is pressed. A quick example with comments. # Set counter variable counter = 0 # Infinte loop while True: # Print counter print(counter) # Input n = input('Press enter/return to count - press q enter to...
  8. menator01

    Python Is there a command that runs a line of code again?

    Here is another way. Using the match case statement and menu options # Create a dict for our menu menu = { 1: 'ban', 2: 'kick', 3: 'view ban', 4: 'view kicked', 5: 'exit' } # Create the list for banned and kicked users banned = [] kicked = [] # Get username and password...
  9. menator01

    Python Is there a command that runs a line of code again?

    You can use a while loop. https://www.w3schools.com/python/python_while_loops.asp
  10. menator01

    Python unindent does not match any outer indentation level problem

    I don't get any errors. Note: You should not name a list using a python builtin. I rewrote your code a little. from string import ascii_letters as letters, digits from random import sample, shuffle from time import sleep import sys characters = list(letters + digits) shuffle(characters)...
  11. menator01

    Python unindent does not match any outer indentation level problem

    Yes, please post relevant code and the error you are getting.
  12. menator01

    Python Flask function isnt working

    I've tinkered with it a little more. Here is what I have. The send message doesn't handle any messages. It just goes to a confirm page then redirects back to the main page. Right side displays according to user level. Structure main folder -- static ----css ------base.css --templates...
  13. menator01

    Python Python Web Programming Flask website cookies issue

    You can use flask-sessions I done example your other post about flask https://codeforum.org/threads/flask-function-isnt-working.6989/#post-26141
  14. menator01

    Python Flask function isnt working

    Are you trying to do something like this. I've not worked with alchemy or flask-sessions before. from flask import Flask, render_template, url_for, session, request, redirect from flask_session import Session from sqlalchemy import (create_engine, Column, Integer, String...
  15. menator01

    Python Flask function isnt working

    Here is a example of a flask login system. Gives a couple of examples as well using a database. https://pythonspot.com/login-authentication-with-flask/
  16. menator01

    Python Python Guessing Game Program with Error - Assistance Needed

    Here is a way to add a little error checking. from random import randint random_number = randint(1,101) tries = 0 while guess:= input('Enter a number between 1 - 100\n >> '): if guess.isdigit(): tries += 1 guess = int(guess) if guess > random_number...
  17. menator01

    Python PyQt5 - Python 3.12 Music Player - Part 5

    In the final part of the tutorial we will add some dynamic text and images to our app In our imports add from PyQt5.QtGui import QPixmap Add the class class Data: def __init__(self): pass def data(self, player): info = {} info['artist'] =...
  18. menator01

    Python PyQt5 - Python 3.12 Music Player - Part 4

    In this tutorial we will be adding functionality to our buttons. Buttons: Get Audio - Used to get our music file Clear List - Clear the playlist Play/Pause - Will play or pause our music player Prev - Go back to previous track Next - Go to nest track Stop - Stop the music player Exit - Exit the...
  19. menator01

    Pyqt6 Tutorial

    I started a python and pyqt6 tutorial on making a music player but, I have ran into a snag. PyQt6 has had an overhaul and I'm not able to get it to play any music files among a couple other library issues. Seems PyQt6 doesn't support openssl3 yet. So I'm going to rename the title to PyQt5 Music...
  20. menator01

    Python PyQt5 - Python 3.12 Music Player - Part 3

    In this part we will be using some more classes from the PyQt5 modules QHBoxLayout QVBoxLayout QListWidget QDial QPushButton Our current script should look something like this now # Do the imports import sys from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QGridLayout...
Back
Top Bottom