5,746 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Tom_45

I am trying to extract three values from the td tags in an html downloaded file. <tr align="right"><td>236</td><td>Roy</td><td>Allyson</td> <tr align="right"><td>237</td><td>Marvin</td><td>Pamela</td> <tr align="right"><td>238</td><td>Micah</td><td>Kristine</td> <tr align="right"><td>239</td><td>Collin</td><td>Raquel</td> I am using the pattern match = re.findall(r'<td.?>([\d+])([.?])*<\/td>', file) The file is created with a read() statement. The output should look like (236, "Roy", "Allyson") (237, …

Member Avatar for Tom_45
1
81
Member Avatar for Tom_45

I am trying to extract three values from the td tags in an html downloaded file. <tr align="right"><td>236</td><td>Roy</td><td>Allyson</td> <tr align="right"><td>237</td><td>Marvin</td><td>Pamela</td> <tr align="right"><td>238</td><td>Micah</td><td>Kristine</td> <tr align="right"><td>239</td><td>Collin</td><td>Raquel</td> I am using the pattern match = re.findall(r'<td.*?>([\d+])([.*?])*<\/td>', file) The file is created with a read() statement. The output should look like (236, "Roy", "Allyson") (237, …

Member Avatar for Tom_45
1
85
Member Avatar for cored0mp

I'll admit that I have an opinion about this. Is the point of professional coding to write creative software or to write software that adheres closely to standards?

Member Avatar for cored0mp
0
92
Member Avatar for cored0mp

Hey Gang! OK today I am having trouble with my transaction processing application implemented in python/MySQL. Here is some "working" testing code. import psycopg2 from psycopg2 import Error import binascii from binascii import unhexlify import mysql.connector as mysql sql='''CREATE PROCEDURE testprocedure(OUT tacos INT) BEGIN show tables; SET tacos := 1 …

Member Avatar for Dani
1
26
Member Avatar for cored0mp

How do I create a table in postgres that's associated with a specific database? Obviously from the command line one can do Create table tablename (); But how do I make sure that the table is associated with the correct database? CREATE table dbname.tablename(); is giving me the error: ERROR: …

Member Avatar for Dani
1
123
Member Avatar for dseto200

How do I modify this program player has 5 chances to ask a letter is in the word. Computer responds yes and no. Original Exercise - Computer picks a random word from a list and player guesses the word. Computer tells the player how many letters are in the word. …

Member Avatar for Reverend Jim
0
3K
Member Avatar for Brian_37

Hello, I have run into an issue where my output for shipping charge needs to be Real Use local named constants not global Also the package weight needs to be times the rate PER pound, is what I have correct? rate1= 1.1 rate2= 2.2 rate3= 3.7 rate4= 3.8 def main(): …

Member Avatar for SendGroupSMS
0
2K
Member Avatar for olong tea

This questions contains probability and I dont know how to work with it in Java import numpy import random def cup_game(): cashprice = [0.5, 1.0 , 2.0 , 5.0] n_turn = numpy.random.randint(5,11) n_mult = numpy.random.randint(3,6) cups = list(range(0,15)) x = numpy.random.choice(cashprice, 15, p=[0.3, 0.4, 0.2, 0.1]) x = list(x) turn …

Member Avatar for JamesCherrill
0
90
Member Avatar for olong tea

Hi, I am new to Java but familiar with python, I need to convert my code from python to Java can anyone help me? Much appreciated! import random suits = ['C', 'S', 'H', 'D'] val = list(range(1,14)) class Card: def __init__(self, suits, val): self.suit = suits self.value = val def …

Member Avatar for JamesCherrill
0
185
Member Avatar for Shianne_1

I need help with this problem! I can't get all three to display. Write a program that prompts a user to enter their hourly pay and rate. Understanding that "time and a half" applies to hours in excess of forty, calculate and print the user's regular pay, overtime pay, and …

Member Avatar for Reverend Jim
0
322
Member Avatar for moroccanplaya

hi im using tkinter and have a scroll bar that works with my text widget but its so small i dont know why ?? [CODE] scroll = tkinter.Scrollbar(content,borderwidth=50) Text = tkinter.Text(content,wrap=CHAR, width=50, height=20) scroll.config(command=Text.yview) Text.config(yscrollcommand=scroll.set) Text.grid(row=2, column=1,columnspan=1, rowspan=3, sticky=(N)) scroll.grid(row=2,column=3) [/CODE]

Member Avatar for TECH COFEE
0
2K
Member Avatar for Ethan_145

I'm making a game in Python, where two armies battle each other. The soldiers both spray arrows at each other. But for **each** soldier, there is a 1 in 15,000 chance every frame them firing. One thing I noticed was the FPS dropped from 60 to less than 3. Both …

Member Avatar for toneewa
0
255
Member Avatar for isendre

Hi everyone, I'm having trouble creating a program. This program needs to create a square board of size n, where a user inputs an integer value 2 - 9. For example, a board with size n=4 would look like: 1 . . . 2 . . . 3 . . …

Member Avatar for cossy254
1
6K
Member Avatar for Scagli3tti

Hi, yesterday I threw together a little jumble solver that takes any anagram as an input and returns any real words that can be found using all of the letters of that anagram. Here is the code, it works fine when it comes to determining the answer, but I have …

Member Avatar for michellepermsm
0
1K
Member Avatar for gdtraveller

I'm developing a calendar application The top level window is a frame containing a panel that displays the calendar grid and a panel that contains a "Close" button. I'm unable to obtain the size of the calendar grid panel. When I add code to get the panel size, the result …

Member Avatar for Reverend Jim
0
487
Member Avatar for shak187

hi there i have some python coding which i need to convert to java can ne1 help me please email me back if you can help then i will show you the coding much appriciated

Member Avatar for eliasarximan
2
153K
Member Avatar for gdtraveller

Hi everyone, I've been researching various python libraries to extract data from pdf files. Currently, I'm exploring PyMuPDF After installing it, I try to run a basic script to get the number of pages in the pdf file. However, the following runtime error occurs. File "/usr/local/apps/PyMuPDF-1.18.17/fitz/fitz.py", line 1281 def is_rectangular(self) …

Member Avatar for Reverend Jim
0
82
Member Avatar for mouigher

I'm not very good at Python as you can tell from my earlier posts. I'm trying to write a payroll program that gets the input from the user of how many hours worked and the hourly rate and calculates the total wages for the week. It also has to figure …

Member Avatar for Minasa
0
3K
Member Avatar for usdblades

I just started learning Python Last Night and I am curious of how to put a pause at the end. I did the Famous Hello World Program and when saved and Executed it seems like it runs and closes before I can even read the text. I tried raw_input("Press ENTER …

Member Avatar for Theofanis
0
2K
Member Avatar for soibac

Hi all, I have 2 form and a main.py in the project: ffrend.py and fmain.py main.py: from PyQt4 import QtCore, QtGui from fmain import * if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() app.exec_() fmain.py (there is a button to execute …

Member Avatar for RespectedCow
0
9K
Member Avatar for Urbandude23

I am trying to run my game in Python, with Pygame. However, I am presented with a black screen, but my game shows up for a fraction of a second after I exit the Shell. What's wrong with my code, I think it's an issue with my timer. # Import …

Member Avatar for Prragya
0
5K
Member Avatar for razstec

Im new to python , trying to update my self from the time of ASP Classic. In that time i use to have a page for vars that i included in my main page. I like that method because i can keep all my vars organized. I tried to do …

Member Avatar for Husoski
0
100
Member Avatar for Xioto

So, I’m trying to capture and store wave height data and cache it in a file based on the fetch timestamp in local time. I have hit an error with the last section. Here is the error - d = sorted(data['hours'], key=lambda i: i['time']) TypeError: list indices must be integers …

Member Avatar for Husoski
0
1K
Member Avatar for joe82

Hello everyone, I am writting a code where result is not coming correct because I am not able to join 2 lines to make a single line. Please help me e.g my input file is: AATTCCGGTTT CCTTAACCCCC I want my code to first join them together as AATTCCGGTTTCCTTAACCCCC and then …

Member Avatar for vishakha_3
0
22K
Member Avatar for Gabriela_4

Hello! So I have this homework that i have no idea how to continue. this is an exemple of input,but i have to do it for a general one: **7 pencils car ball candy tshirt bike video_game Mike Andrew Inna** and the output must be like this: **Mike: pencils candy …

Member Avatar for rproffitt
0
165
Member Avatar for Rabana_1

def Count_Total_Words(str1): total = 1 for i in range(len(str1)): if(str1[i] == ' ' or str1 == '\n' or str1 == '\t'): total = total + 1 return total string = input("Please Enter your Own String : ") leng = Count_Total_Words(string) print("Total Number of Words in this String = ", leng)

Member Avatar for rproffitt
0
114
Member Avatar for ultimatebuster

Is it possible to store a certain function as a variable? If not, is it okay to make a class, and define a function. Store the class as the variable and invoke that function?

Member Avatar for tomas_petricek
1
31K
Member Avatar for Shift_

I got bored of revision last night, and decided to have another go at python! So to refresh my memory and have a bit of a practice I wrote a quick phone-book program. I'd be grateful if y'all could give me some tips and ways to improve on it/make it …

Member Avatar for TAJUL ISLAM_1
0
10K
Member Avatar for Peter.W

I run Python 3.x on a Windows 10 laptop and I have a daily routine that involves opening three Python scripts in succession, and running them all concurrently, each one in its own, separate instance of Idle. I have been wondering whether I could automate the entire process. I imagine …

Member Avatar for Peter.W
0
292
Member Avatar for Helder_3

i have start to convert by hand a python script to php its an example how to mine in python but i want implement a kind of same in my php project **That its what i did until now** $MAX_NONCE = 100000000000; $prefix_zeros = need convertion; //execute sql statement and …

Member Avatar for wwwalker
0
364

The End.