Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

python

  1. User8574

    Python Pygame: screen.fill and screen.blit not working, please help!

    # Modules import pygame, sys # Init / Clock pygame.init() clock = pygame.time.Clock() # Display Setup screen_width = 1920 screen_height = 1080 screen = pygame.display.set_mode((screen_width,screen_height)) pygame.display.set_caption("Coin Collector") # Objects coin =...
  2. User8574

    Python I make a global variable and then it says it isn't defined, wtf? (Python / Pygame)

    def ball_animation(): global player_score player_score = 0 player_score_surf = font.render(str(player_score), False, (10,10,10)) Apparently player score is not defined. Please help! I tried taking it out of the function above it and it still doesn't work.
  3. User8574

    Python 'Function needs at least three arguments' Pygame screen.blit error

    screen.blit(player_score_surf, (200,200)) I get an error that screen.blit requires three arguments. I tried adding centre as the third as the point of which is at 200,200, but that still doesn't work. How do I fix it?
  4. Hilton D

    Python The longest palindrome sequence

    A palinadrome is a nonempty string that reads the same forward and backward across some alphabet. Palindromes include all strings of length one, civic, racecar, and aibohphobia (fear of palindromes). Provide an efficient approach for determining the longest palindrome that is a subsequence of...
  5. skifli

    Python Encapsulation in Python

    I recently learned about encapsulation in Python, and how you could specify private variables in classes that can't be accessed outside of the class (by prefacing the variable with '__'). However, this actually only mangles the name of the variable to...
  6. P

    Python Flask and Jinja syntax. How to get a name to show on another page?

    I am trying to make a web app using Flask, but I am having trouble with the Jinja syntax. I am following CS50. I want to take the student's name and dorm from index.html and display it on success.html. However, I am unable to do this. All that displays is "You have successfully registered...
  7. Veronica

    JavaScript Want more resource

    We can use binary search to find the target element in an array. First, we need to sort the array in ascending order. Then, we can use binary search to find the target element in the sorted array. The time complexity of this approach is O(nlogn), where n is the number of elements in the Array...
  8. K

    Python How to send data frame to another neural net in flask route

    So, I have flask app with py-cicflowmeter. Purpose - detection of network attacks. According to my idea, two neural networks are used. The first is a fast binary LSTM classifier, and the second is a slow multiclass KNN. Both networks are pretrained and have 23 inputs each, with the same input...
  9. VLSkill

    Python Which is a better method to start learning Python?

  10. Linh Lee

    Python SyntaxError: invalid syntax (help)

    Trying to search/delete for specific user with one letter name, "a", and always changing domains. Some addresses from this spam: [email protected] [email protected] [email protected] Need help please, fixing invalid syntax error. CODE: from imap_tools import MailBox, A with...
  11. P

    Python Expression expected ; Statement expected

    So hey guys I am totally new to coding and I tried to make a programm that would show me my recipe for my pancakes etc. if I type a certain number from 1 to 3 in there. But it came with a couple problems I dont know how to solve since this is my first time. the first is at print(for) and the...
  12. Linh Lee

    Python imap_ssl.search one letter name

    resp_code, mails = imap_ssl.search(None, '(FROM "a")') I want to search emails from a specific one letter named user, "a". Example: <[email protected]> <[email protected]> Problem is, search results cause all users with an "a" as part of their name to be returned. Example: [email protected]...
  13. User8574

    Python I'm not sure what this means and if pygame has been installed successfully.

    (Visual Studio) I installed the newest version of pygame but I'm not sure if it was installed properly. Anyone know? Thanks a lot.
  14. Linh Lee

    Python Yahoo imaplib errors

    Want to search folder "SPAM", for specific_user@any domain, and delete found mail. Code below ... import imaplib box = imaplib.IMAP4_SSL('imap.mail.yahoo.com', 993) box.login("[email protected]","xxxxxxxxxx") box.select('SPAM') typ, data = box.search(None, 'from','name@*.*') for num in...
  15. Linh Lee

    Python Imaplib [search, move, delete] Yahoo Mail

    Any python experts willing to share there knowledge, please?! Want to: 1. Search ALL folders including SPAM, for "specific_user@ANY (wildcard) domain" 2. Move those emails to folder called DUMP 3. Delete contents of DUMP Unfortunately I can't figure out how to do what I need above in Yahoo...
  16. shivambhatele

    Python Which Python Framework is more Flexible in Large Projects?

    Hello All, I am new in python programming and got the opportunity to work on a large project which is based on finance domain. I want to know which python framework is more flexible between Flask and Django in a large project. I have asked this quey on Quora and according to this source, Django...
  17. amirgh21593

    Python Solving Supply Chain Logistics Problem with Ant Colony Optimization

    Hi! I'm currently working on my university project. the link to the article which I'm referencing is Accelerating supply chains with Ant Colony Optimization across a range of hardware solutions and its dataset is available Supply Chain Logistics Problem Dataset. I would appreciate it if there is...
  18. P

    Python Best way to rerun this snippet of code:

    New to python3 working on a fantasy character generator, tyring to find the best way to rerun the snippet of code if the wrong letters are entered in input. Thanks for any help you can give me. #Code to exit or reginirate script quittogen = input("""\nDo you want to quit or generate another...
  19. voldyy

    Python Digit into number

    Hi, how can i change this code to work for two-digit numbers or three-digit number? For now only work for single digit numbers, tried to change algorthm but didnt work. def to_number(digits): result=digits[0] for el in digits[1:]: result=result*10 result=result + el...
  20. stevan

    Python Python compiling error (Python Beginner)

    I'm trying to get data from my temperature and humidity sensor and write the data to a JSON file every minute. I started learning Python two days ago, so I have no idea why these errors occur (the output is in the attachment): The Code: import time import board import adafruit_dht import...
Back
Top Bottom