15,175 Topics

Member Avatar for
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
32K
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 1427_Sharupya

help me asp..... In this assignment you have to write functions (in python) that applies various preprocessing techniques which are popular in Natural Language Processing (NLP). For this purpose, you are supplied with a Text Dataset (“corona_data\test_small.tsv”) and you have to process that dataset using the following techniques: 1. Tokenization …

Member Avatar for Reverend Jim
0
120
Member Avatar for THEDJ300

Hello all I am new to Python and I am taking a programming class but I can't seem to figure out what I am doing wrong to get the programming correct. I have the following but it isn't working correctly. print ("Change Calclator") quarter = .25 dime = .10 nickel …

Member Avatar for Reverend Jim
0
119
Member Avatar for myspaceissecret

I am trying to add two two `functions` in one input tag. BUT failed many times. **What i am trying to do ?** There are two functions in different `input` tags in my HTML template. One for `add tag` by `,` . AND second for `autocomplete`. I am trying to …

0
39
Member Avatar for yorekaa819
Member Avatar for rproffitt
0
496
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
319
Member Avatar for @jassmine97

hello, i barely know how to use python and i need to write a cubic spline interpolation code in python for my programming assignment . I have C++ code but i know nothing about c++ so can someone help me to convert that code to python code? this is a …

Member Avatar for rproffitt
0
197
Member Avatar for asutosh_1

def findMaximumPath(mat): rows = cols = len(mat) count_list = [] for i in range(rows): summ = 0 mat_index = [rows-1, cols-1] curr_index = [0, i] summ = mat[curr_index[0]][curr_index[1]] while curr_index[0] != rows-1 and curr_index[1] != cols-1: if mat[curr_index[0]][curr_index[1]+1] > mat[curr_index[0]+1][curr_index[1]]: curr_index[1] = curr_index[1] + 1 else: curr_index[0] = curr_index[0] + …

Member Avatar for JamesCherrill
0
26
Member Avatar for shiv.manoj23

I have a very little approach with coding in C# in asp.net please help converting this python code into c#. # Python example - Fourier transform using numpy.fft method import numpy as np import matplotlib.pyplot as plotter # How many time points are needed i,e., Sampling Frequency samplingFrequency = 100; …

Member Avatar for rproffitt
0
197
Member Avatar for vegaseat

For those who are afraid of lycanthropes and full moons, here is a way to figure out the phase of the moon.

Member Avatar for Sichen
2
6K
Member Avatar for pippy729

I am building a python vending machine program where you input price and get change due. Ive got the price working fine and the change for the most part, but Im trying to figure out how to give exact change. Im using dollars, quarters, dimes, nickels and pennies. I am …

Member Avatar for rproffitt
0
135
Member Avatar for Ding_1

Dear friends: I need to develop a numerical computation software with a GUI interface like the attachment. I have tried tkinter package, but it seems that it can not resolve this mission. Could you please give me some suggestions about which package should i use to obtain this goal. Regards …

Member Avatar for Reverend Jim
0
49
Member Avatar for rex_2

I'm trying to convert a Java code into Python. I could adapt most of the code, however, it is difficult to me to link all the functions. The java code is used in Weka. I would like a stand-alone python code. The algorithm in the code is presented in this …

Member Avatar for Reverend Jim
0
244
Member Avatar for maaru1903

Is there a standard algorithm that can output the difference time (in seconds) and use it to print the minutes, hours, numbers? I would appreciate it if you show this algorithm in Flowgorithm app.

Member Avatar for rproffitt
0
57
Member Avatar for caboh59237

Hi i want to know we can perform features etraction on ham10000 and segementation also train model with cnn

Member Avatar for rproffitt
0
32
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
388
Member Avatar for wandie

I used to this code for a splash screen but doesn't run. Please could someone assist. Or help with a link I can check Tkinter splash screens. [code] from Tkinter import * try: from PIL import Image, ImageTk except ImportError: import Image, ImageTk class SplashScreen(Toplevel): def __init__(self, master, image=None, timeout=1000): …

Member Avatar for Roja_3
0
664
Member Avatar for bruce.hagen

I have a Py file that consists of 100+ frames, aprox 80+ radio buttons and 65 textboxes. I have attached shortened exert from main file. Textbox 1 takes on a value when a radio button is pressed. When button "Show Values is pressed it inserts the accumulated of all textboxes …

0
185
Member Avatar for Luka_1

I have never learn python and i need to write one small program in it. I have C++ code so can someone convert that code to python code ? code: #include <stdio.h> int N; struct { int y, x1, x2; } platforme[100]; int spusti(double x, int y) { int rez …

Member Avatar for Adina_2
0
72K
Member Avatar for david_adp

I'm new to c# and would like to convert this code from Python. Any help or orientation would be great. Thanks D. api_url_base = 'https://oneapi.zemanta.com/o/token/' api_token = b64encode(b"2JreK10kPxO3P0wHPkqjfDSw8yKdHzSSyIQNavWH:JLYcjOjoP9LzTO6AI7N0FprW7Uuy8pZVFxk6eRIfDgTSHNaZGAHOMbickdzvtv41PXVpJZ9O2y5DHPpJs4rTchpv9MIursLi4S1Om4qINLanazpygR3Zr8rKTHdsZm8B").decode("ascii") headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Basic {0}'.format(api_token)} payload = {'grant_type': 'client_credentials'} api_url = '{0}'.format(api_url_base) r = requests.post(api_url, headers=headers, data=payload) ret = json.loads(r.content) …

Member Avatar for rproffitt
0
50
Member Avatar for guidely

Hi, I try to convert the c code into python it actually complie but no result came out Code in C #include <stdio.h> # include <math.h> double const pi=3.1415926535897932384626433; double const twopi=2.0*pi; double const halfpi=pi/2.0; float cos_32(float x) { int quad; x=fmod(x,twopi); if (x<0) { x=-x; } quad=int(x/halfpi); switch (quad) …

Member Avatar for Sukant_1
0
18K
Member Avatar for Ridhima_1
Member Avatar for manasrathore43

Hi, I have created a two player board game url deleted - rule 2.7 Thes problem is that AI is easily beatable. I used heuristics to find best move for the AI. The rules of game are as follows 1) 9 by 9 grid is divided into 9 grids of …

Member Avatar for rproffitt
1
68
Member Avatar for adam291086

I have a file that contains a class, its called test.py. How can i call on that class within another file called xml.py?

Member Avatar for chethan_2
0
14K
Member Avatar for Nether_1

Hi everybody, I'm doing some programming in Flask, and as part of the program I'm doing a basic system of logging in, but that's not where my problem resides. During my programming, the page that is supposed to verify a login absolutely refuses to go past a specific line of …

Member Avatar for Reverend Jim
0
75
Member Avatar for Tima_2

Hey, Im working on the UNO game in python and am almost done with the rest of the code but I am not able to print the UNO logo as of yet. Please help. I need to submit my work tomorrow.

Member Avatar for rproffitt
0
36
Member Avatar for mangle200

i have a set of code for a gui that runs using a dictionary but i cant get the code to exit once the user presses the last button named end import sys import tkinter as tk from functools import partial class Situation(tk.Frame): def __init__(self, master=None, story='', buttons=[], **kwargs): tk.Frame.__init__(self, …

Member Avatar for rproffitt
0
167
Member Avatar for kingmu

If you run the following code (on Windows 7, Python 2.6.5), you should see a light border around a black square and some text below it. How do I get rid of that border? Thanks! [code=python] from Tkinter import * class App: def __init__(self, master): #background frame self.bgFrame = Frame(master, …

Member Avatar for Madnokof
0
11K
Member Avatar for Rusyaidi

Hi, how do we write value into text file in wxpython. As in python, file_out = open("filename", "wb") is used (as far as I know). Im trying to write the value from textctrl using: self.val = self.textctrl.GetValue() So, as for the next step to write the value into text file, …

Member Avatar for rproffitt
0
29

The End.