15,175 Topics

Member Avatar for
Member Avatar for Hugo Edson

I wrote this line of code: database = {"host":host, "user":user, "password":password, "db":db, "charser":charset, "cursorclass":cursorclass} and i'm receiving this: {'host': '35.234.92.142', 'user': "b'freedbtech_'", 'password': "b''", 'db': "b'freedbtech_cursopython'", 'charset': 'utf8mb4', 'cursorclass': "<class 'pymysql.cursors.'>} i need to remove those "b's" and " ' " in the strings, but i don't know how to …

Member Avatar for rproffitt
0
105
Member Avatar for Liam_12

Am at an intermediate level in python and tkinter, and have been trying to figure out how to get the code below into some kind of workable form I can understand. What I want to do is, like, if I typed something into the bottom frame, then I'd like to …

Member Avatar for Husoski
0
172
Member Avatar for zattat

import threading,time,sys try: import requests except: print("Please install requests module!") sys.exit() path=input("File (example: file.m3u) => ") out=path+"_out.txt" try: with open(path, 'r') as file_in: lines = file_in.read().splitlines() except: print("File error or not found!") file_out=open(out, "w") #print(str(lines)) all = len(lines) print(all) worked=0 print("Scanning {} lists... Worked will write in {}".format(all,out)) time.sleep(5) def …

Member Avatar for rproffitt
0
50
Member Avatar for zattat

import threading,time,sys try: import requests except: print("Please install requests module!") sys.exit() path=input("File (example: file.m3u) => ") out=path+"_out.txt" try: with open(path, 'r') as file_in: lines = file_in.read().splitlines() except: print("File error or not found!") file_out=open(out, "w") #print(str(lines)) all = len(lines) print(all) worked=0 print("Scanning {} lists... Worked will write in {}".format(all,out)) time.sleep(5) def …

Member Avatar for Reverend Jim
0
134
Member Avatar for Jean_19

for(#iterations) solve non linear solution get new flux klinkages solve LD and Lq solve new Id and Iq if (abs(Id_new - Id_old) < 0.01) break else put in the new Id_new and Iq_new

Member Avatar for rproffitt
0
117
Member Avatar for TimTheCoder

I have an array in python that has letters as strings and a comma as a string also. I have managed to find code that finds all the letters that come before that comma letter, there are other comma letters and i would like to iterate to list every letter …

Member Avatar for Husoski
0
57
Member Avatar for The_real_Aadi

Hey fellow Daniweebs, I would like to present a code to you, which seems to be not working for some reason , kindly help me name = input("Enter your name: ") age = input("Enter your age: ") if type(name) != str or type(age) != int: print("PLEASE ENTER VALID CREDNTIALS", end …

Member Avatar for Reverend Jim
0
31
Member Avatar for Tonittoh

each quarter the marketing manager of a retail store divides the customers into two groups based on their purchase behavior in the previous quarter. The classes are denoted by L and H. The manager wishes to determine to which group of customers he should sent a catalog. The cost of …

Member Avatar for Dani
0
47
Member Avatar for awk18

Lines=["1x+1y+0","1x-1y+0","1x+0y-3","0x+1y-0.5"] So, How do we extract coefficients of each equation in the list?

Member Avatar for rproffitt
0
12
Member Avatar for Deepak_71

I have my resoruces stored in mysql DB: eg : > |IPaddress | Status| |10.x.x.x| yes| |10.1.x.x| yes| I am trying to get the available resource and after that will update DB with status No. > query = ("SELECT IPaddress from TABLE where status='yes'") cursor = mydb.cursor() cursor.execute(query) result=cursor.fetchall() query1 …

Member Avatar for Dani
0
45
Member Avatar for Yumensh

The code: using Discord; using Discord.Commands; using Discord.WebSocket; using NadekoBot.Common.Attributes; using NadekoBot.Core.Services; using NadekoBot.Extensions; using NadekoBot.Modules.CustomReactions.Services; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace NadekoBot.Modules.CustomReactions { public class CustomReactions : NadekoTopLevelModule<CustomReactionsService> { private readonly IBotCredentials _creds; private readonly DbService _db; private readonly DiscordSocketClient _client; public CustomReactions(IBotCredentials creds, DbService db, DiscordSocketClient client) …

Member Avatar for rproffitt
0
75
Member Avatar for Simiyu
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 Satyajeet_1
Member Avatar for Prajkta_2

Create a code using python of random walk where food is placed in spots on the grid. Whenever a Walker runs into the food it eats it and reproduces

Member Avatar for rproffitt
0
150
Member Avatar for aliabd

Hi guys how are you please why When I run this code it does not work but when I change the ( tn.write(b"config t \n") tn.write(b"router ospf 10 \n") to the show command it works fine ?? **************************************************************************************************************** import sys import telnetlib import getpass host=["192.168.1.164","192.168.1.169"] devno=len(host) user='ali' Password='cisco' for i …

Member Avatar for aliabd
0
53
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
168
Member Avatar for Aleks_Retr0

Hello Guys! I'm new in python and started creating this code without any experience and of course I can't know a lot about coding and I will do a lot of stupid mistakes, and this case is not exception as well. I tried to assign option menu to my list, …

0
320
Member Avatar for JNSS
Member Avatar for Rahul_53
0
64
Member Avatar for Charlie_13

Python program that will 1)Define a single point for the red/green dot near the supposedly enemy territory; 2)Define a subset A of your DEM raster image towards the friendly territory; 3)Calculate the line of sight for each pair (of observation pixel to target pixel); 4)Sum the total number of green …

Member Avatar for rproffitt
0
51
Member Avatar for ferrerjulie
Member Avatar for Pratiksha_5
Member Avatar for euubisse12

i am completly stuck with some problems in programming, talking exactly aboutt linked list and some others can anyone help me?

Member Avatar for Naheedmir
0
114
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
130
Member Avatar for youssef_8
Member Avatar for anwaralrikbi5
Member Avatar for Amuthini

for personality prediction from text by using unsupervised learning method or without training data can we able to use any other method for better accuracy nearly 75%

Member Avatar for rproffitt
0
25
Member Avatar for KINYUA_1

I have a string in python and i desire to find the index of the first occurrence of the letter `l` in it. Here is the code am using mystring="abcdloplu" ##how do i get the index of the first occurrence of l in the string

Member Avatar for rproffitt
0
18
Member Avatar for markusd5454

Below is a program that asks the user to input a username and password. Once logged off the user is asked to re-enter their username and password. Is the program correct where it checks if the username and password input before is correctly input again?. Any help would be welcome …

Member Avatar for Reverend Jim
0
86K
Member Avatar for aditya_#2

i am a newbie , and i have to give a program from dictionary in python in which we have multiple users . a simple username and password login program . plz explain it too .

Member Avatar for Reverend Jim
0
22

The End.