python

  1. 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...
  2. 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">...
  3. 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)...
  4. 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...
  5. 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...
  6. 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()...
  7. 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()...
  8. 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...
  9. 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...
  10. 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...
  11. 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>...
  12. 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...
  13. 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
  14. 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...
  15. 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...
  16. 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...
  17. Sago

    Python discord.py (discord bot)

    Hello, I wanted to make a public discord bot when I started discord. I have the bot setup in my server, but I want to expand. I created another python file for the public bot, because I wanted there to be commands for my server. I want to save all the data for one server put it on a JSON file...
  18. C

    Python TradingView - Private Indicator Subscription Management, Patreon/Python Integration

    Hi there first time post, Wondering if it is possible to use python to code a membership management on tradingview? My company sells monthly subscriptions to indicators and we use Patreon to manage our monthly subscriptions. Its very easy to integrate discord to patreon which is what we do so...
  19. F

    Python Python HTTP Post to Apache

    Hello I have a super simple python script requesting to HTTP post to one of my web pages with PHP script. import requests url = 'https://domain.com/page.php' myobj = {'test': '1'} x = requests.post(url, data = myobj) print(x.text) Here is the code on the server side: <?php...
  20. YumaDazai

    Python How to start programing a Pet sim? Just a stupid project for friends to pass time.

    So I want to program a pet sim with breeding features for me and my friends to mess around with, But I am not sure how to start out. I have some Youtube videos saved, but they only cover one part of what I need or the other, and I am confusing myself. If anyone could help me out with this that...
Top Bottom