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!

python

  1. cegbuji14

    HTML Problem loading local Json file

    Hi, im currently using Python's Flask to create a dashboard and on one route I'd like to render an html template that turns a local json file into a table. When using getJSON for some reason the localhost/server cannot find the file no matter how I've defined the path so the table always only...
  2. T

    Python How can I write a program in Python that presses "a" and "d"?

    Hi there, I've been trying for a long time today to write a program in python which presses the "a" key for 20 seconds, then pauses for 2 seconds and then presses the "d" key for 20 seconds and this should repeat infinitily. But I couldn't do that. If someone could help me, that would be very...
  3. Freeto_India

    Python Read xls and xlsx file to write it in csv file using python

    Hi All, I have 2 -> .XLS files (with header), 1 -> .XLSX file and 1 -> .XLSX file (password protected) I have to read these files optimally and create respective .CSV files - What would be the best optimized approach? - What are the necessary libraries required? Can one library solve this...
  4. esqhol

    My python learning app

    Hello, I recently published an app that I built for google play, I would like to reviews from you about the app and suggestions for improvements. The app is made for python learning, practice, and competing against online players. App name: Sigma- code wars Link...
  5. T

    Python I want to implement a bootstrap method to get the 95% confidence intervals for a cumulative rate

    Hello, I basically have worked out a cumulative rate and have it as a pandas column, see attached below: The confidence bounds I want are for the column CumSum which was calculated from taking all individual rates (Rind ) so Cumsum[0] is the sum of all Rind from Rind[0] to Rind[1663] and...
  6. N

    Lua explaining the structure of two functions in Lua

    Hi everyone, I am trying to integrate a code which is a variational auto encoder model (where the prior of the VAE is a mixture of Gaussians) from Lua (torch) to pytorch as part of my model and I have a hard time to fully understand the Lua script (I didn't find a tutorial of the language)...
  7. 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...
  8. 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...
  9. 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...
  10. 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
  11. 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...
  12. 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">...
  13. 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)...
  14. 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...
  15. 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...
  16. 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()...
  17. 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()...
  18. 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...
  19. 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...
  20. 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...
Back
Top Bottom