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. T

    Python I need an understanding in this scenario

    Hi All, I want someone to tell me what goes on in the following scenario, I don't need the code I just want to understand what goes where i.e., array ,Boolean etc. Here is the scenario. Friends of Seaview Pier is an organisation devoted to the restoration and upkeep of a pier in the town. A...
  2. N

    Python I am making a Snake game using turtle and have a "raise terminator turtle.terminator" error.

    I would like it to run rather than terminate itself: #//Snake #Import random for spawns, turle for graphics, time for pauses, and urllib for downloading icon import random import turtle import time import urllib.request #//Downloading... print("Downloading necessary files...") #//Icon download...
  3. M

    Python Python code to read in data file, write it to a file, order columns in ascending order

    Specific Prompt Read in the included data file and write it to a file named sorted_data.txt with the same data, but order the columns in ascending alphabetical order. The data comes from a .txt file and is randomly generated data going up to 1000 How would I approach writing this code...
  4. davecleghan

    Meme Thread

    Hello I am new here and looking forward to interact with the community. Currently I am learning Python. So I have a meme for the community. Try posting more such memes. Credits: Data Scientists Love For Python
  5. SilentHealer584

    Python How can i use this to translate entire words at a time?

    I got some code here(can anyone help solve this problem?): while True: n = raw_input("Ltr:") if n.strip() == 'a': print("01100001") repeat='while True' if n.strip() == 'b': print("01100010") repeat='while True' #it goes on for every letter of the...
  6. Sarge

    Parametrizing routes in flask by multiple submit buttons

    I am trying to make a website which has solutions of a book (5 chapters). Firstly, I want to open chapters.html with route /chapters which displays five submit buttons and chapter no. as their values. <form action="/{{ chapter }}" method="POST"> <input type="submit" value="Chapter 1">...
  7. Mettatone

    Python My basic python script is not responding, please help.

    import pyautogui import tkinter import sys from tkinter import * def delete(): while True: pyautogui.click() pyautogui.press('up') pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') for x in range(3)...
  8. A

    Python How to pass additional information with PyQt5's: QTableWidget::cellDoubleClicked(int row, int column)

    I understand that the cellDoubleClicked method passes the row and the column to a specified function, but how can I send additional information as function arguments? For example the list the table was filled with. if I have the following fuction (with functools.partial imported): def...
  9. S

    HTML & CSS how to split page on static and scroll-able parts?

    I want to split web page onto two parts. Static (top one) and scroll-able (bottom one). The problem is that solution I have creates a scroll-able box with fixed width and height. But I've seen an example of a page where bottom and right sections are limited by size of the browser screen and have...
  10. Wolfmann Games

    Python How to continue sound in Pygame?

    I have a sound that I wish to play. My code; [...] if var_camera_flip == 1: if var_camera != 4: pygame.mixer.Channel(2).play(pygame.mixer.Sound(r'audio\camera\camera motor.mp3'), -1) else: pygame.mixer.Channel(2).stop()...
  11. U

    Python Is i possible for iter_lines to show all lines?

    This is only giving me one line back, I want all lines back. Is there a way to have iter_lines show all lines? Thanks. #import modules import requests import json import re #retrieve lichess games for a specific user def get_lichess_games(username): api_session = requests.Session()...
  12. V

    Python Help!

    How do I make this script ignore certain words when renaming files? Please help! --- import pandas as pd import os from pathlib import Path as path df = pd.read_excel("KODAIX.xlsx") df = df.set_index('code') folder = path(r'C:\Users\X\PycharmProjects\pythonProject3\MOZAIKX') for file...
  13. S

    Python Issues with lists in Python

    my_list = [1, 2] for v in range(2): my_list.insert(-1, my_list[v]) print(my_list) The result of this is [1, 1, 1, 2], but I can't honestly comprehend why? Why isn't there a 0 then a 1? why isn't it after the 2 considering it is -1 for the placement in the list? myList = [] for i...
  14. Qubik

    Python Please, help. I need generate dictionary list

    I have 2 lists. For example list_1 = ["a", "b", "c", "d"] list_2 = ["A", "B", "C", "D"] It should turn out: total_list = [{"lower": "a", "upper":"A"}, {"lower": "b", "upper":"B"}, {"lower": "c", "upper":"C"}, {"lower": "d", "upper":"C"}]. I tried like this list_data_dict = [{"lower": a_lower...
  15. SilentHealer584

    HTML & CSS How can i change body bgcolor by sliding slider ?

    Am I able to also change colour by sliding the same slider I use to change image size ? <body> <center> <p><-- low temp.</p><div class="slidecontainer"> <input type="range" min="15" max="25" value="15" class="slider" id="Slider"> </div><p>high temp. --></p>...
  16. skifli

    Python Expected type 'Sized', got 'int' instead

    Hi. I'm coding a hangman game in Python & I've been getting an error that I can't figure out how to get rid off. Basically, after I take the user's letter, I create a counter that goes from 0 to the length of the word. However, since Python uses the number 0 first, instead of 1, I have to do the...
  17. D

    Python how is this done?

    Implement a function called walker(x) that, given a list x of N numbers [x(0), x(1), x(2),..., x(N-1)], outputs a "walk list" y = [y(0), y(1),..., y(N)], defined recursively as: y(0) = 0, y(n) = y(n-1) + x(n-1), if 0 < n <= N
  18. C

    Python/Django or Headless WP/JS

    Hi, Code Forum. We're a medium-sized agency & we're starting to use different programming languages to get better page speeds. We have had many people tell us that Python & Django is the way to go. We have had others say that using Headless WordPress with a JS Language like, next.js would be...
  19. beginner07

    Python Python multi-dimensional arrays,matrix?

    The problem is that,to write a function which generate a random matrix (bigger than 2x2). And calculate all the 2x2 part determinant of the original matrix.Then generate a new matrix with that values. For example: generated matrix [4, 4, 8, 1 2, 6, 4, 7 1, 6, 6, 10] calculated matrix [16...
  20. Q

    Python Practice Coding Interview Questions

    Hey Everyone! I have started a YouTube channel for answering coding interview questions. Do let me know if you want step by step explanation for any specific Python related coding problem. My first episode gives a brief explanation for one of the questions I faced during an interview. My aim...
Back
Top Bottom