15,190 Topics

Member Avatar for
Member Avatar for r3bol

I made a scraper for a web site, but I'm having problems runninf my code... #!/usr/bin/env python from bs4 import BeautifulSoup import urllib2 import re # Get the links... html = urllib2.urlopen('http://www.blah.fi/asdf.html').read() links = re.findall(r'''<a\s+.*?href=['"](.*?)['"].*?(?:</a|/)>''', html, re.I) links_range = links[6:len(links)] # Scrape and append the output... f = open("test.html", "a") …

Member Avatar for happygeek
0
6K
Member Avatar for davy_yg

Hello, This is my first time using Python. I only know the basic syntax of python but I never actually run the code itself. Therefore, I am trying to figure out how to install Python web server on localhost ? I have this installer - GoogleCloudSDKInstaller When trying to install …

Member Avatar for techbeamers
0
687
Member Avatar for lancelot_1

import requests.packages.urllib3 requests.packages.urllib3.disable_warnings() from flask import Flask from flask import request import requests from requests_toolbelt import MultipartEncoder import requests app = Flask(__name__) import requests import json from datetime import datetime botEmail = "" # botun email adresi accessToken = "" # Botun access tokeni host = "https://api.ciscospark.com/v1/" # CISCO Spark …

Member Avatar for rproffitt
0
327
Member Avatar for Carl_5

I am trying to take a user input from an entry input and display it back to the user in a simpl text widget. I have implementing a label but apparently that's a bad idea for what I desire. Ultimatley, I'd like my gui to look like this: User: Hey …

0
171
Member Avatar for Jack_44

I'm trying to compare 2 different CSV files, mark those differences respectively, then produce it as an output. However, my code seems to be only reading the last part of the lines from sample1.csv and sample2.csv as you can see below: Sample1.csv Planet,Account,Name,Station,City Earth,1234,Pete,Nebula,Phoenix Earth,1234,Pete,Nebula,Phoenix Earth,1234,Pete,Nebula,Phoenix Sample2.csv Planet,Account,Name,Station,City Earth,1234,Pete,Nebula,Wakanda Earth,1234,Pete,Nebula,Montgomery …

Member Avatar for Ramij
0
1K
Member Avatar for ALosh99

How can I calculate the average weight in python for two columns (x,y) data file, between 8<r< 9. in python I have tried this put it dose not work with my np.average(X,Y, weights=[8,9]) I have calculated the average weight which is 12.14, now I am trying to use this weight …

Member Avatar for vaishali_2
0
315
Member Avatar for ALosh99

I have two array data files. I want to add weight function to these two array which I ploted see attached file. what I am trying to do now is use the weight function below, for two data set and select the points between 8<r <9 in each data then …

Member Avatar for ALosh99
0
143
Member Avatar for Joe_40

Just wondering how you would add user input from within the program into a drop down bar for future use.

Member Avatar for rproffitt
0
172
Member Avatar for davy_yg

Hello all, I am quite impress knowing that Python has been the most popular programming language in July 2018. Check this statistic: https://pypl.github.io/PYPL.html It looks like there is a changing in trends - in 2015 PHP is rank no 2 and now rank 4. While Python rank 3 moves up …

Member Avatar for rproffitt
1
465
Member Avatar for Leonardo_6

Could anyone please review my code https://github.com/LeoUpperThrower4/GeneticAlgorithm

Member Avatar for rproffitt
0
246
Member Avatar for Jatin_4

I am facing issue while appending fieldlist through append_entry in flask-wtf. I am able to add one row of fields from fieldlist but after adding first row, i am not able to add second row. No errors are shown. In first attempt a new row is added of field list …

0
183
Member Avatar for Syafiqur

Suppose I have a text file : > As a manager, he told FIFA TV he communicates his messages in a measured way. “I’m not one of the lads,” Southgate explained. How do I change the sentence inside the quote (") into indirect sentence? What method/algorithm do I need to …

Member Avatar for rproffitt
0
595
Member Avatar for deadmarshal

Hi, I've written this code which i send below. now i have a listview, and when i click each item in my listview, i want it's related word to be fetched from db and shown in my textview. now it fetches all the data :(. look at the picture, for …

Member Avatar for rproffitt
0
522
Member Avatar for gerald_9

Hi everyone I have this code that I am using from a book, it seems that it does not run correctly, I am new to tkinter and trying to understand how its lay out is supposed to work, is this code up-to-date with using pycharm? I have tried pycharm and …

0
250
Member Avatar for Otto_1

New to Python. Background from TRS basic thru several versions of basic and ending with Qbasic, some Perl and now trying Python. I get the following error and have no idea what is causing it. There would be 11 catagories and some catagories could have multiple entries for the period. …

Member Avatar for ryantroop
0
1K
Member Avatar for Asima_2

hi so im trying to do a code that will ask the user for 3 values,determine if those values make a triangle,find the angles if it does make a triangle ane draw the triangle if the values make one.im having trouble drawing the trangle.this is the code i have so …

Member Avatar for ddanbe
0
444
Member Avatar for Amaina

I have been cracking my head on this mater in the past couple of days. I am faced with a situaton where i need to write a MySQL equivalent of PHP code to loop through sql select results. The Php code looks like this $query = "SELECT pubid, author FROM …

Member Avatar for flashx4u
0
19K
Member Avatar for ALosh99

I want to shift my plot to the right by fixed value , I have npy file contain 7 columns, I plot the histogram for the column number 7 as below: plt.figure() plt.hist(x[7],bins=800,color='y',histtype='step',linewidth=2,stacked=True) plt.show() I am trying to shift my plot to the right with fix value but I could …

Member Avatar for ALosh99
0
1K
Member Avatar for Gustavo_7

I would like to retrieve a filtered data from a text file and send to excel. I have these lines in a text.txt file: I am Fred username is fred from USA cd I am Robert username is bob from USA cd I am John username is john from China …

Member Avatar for rproffitt
0
521
Member Avatar for Sergi_1

I am looking for an API that will be easy to use, also allows me view reports of sended SMS, that also has documentation and examples to how manage it.

Member Avatar for Tran_10
0
301
Member Avatar for Jack_9

Hello fellow python lovers of daniweb.com. This isn't as much a question as much as the fact that I want to see how different people would go about using python to inject an SQl database. I made a script were you can access the ip and run a command. NOTE:Obviously …

Member Avatar for phoenix079
0
8K
Member Avatar for Abdullahi_2

I have writen my codings, all that is remain for me is to convert to software. Please how do I convert it...

Member Avatar for JimmyD94
0
470
Member Avatar for shibunath

Fellow Python developers, Python has a sorted() or sort() function to implement ascending or descending order programs,but supposing if i want to develop a ascending order program that takes user input and ascends or descends them,how should I go about? For Example: Lets Say i want to convert this C …

Member Avatar for Zak_2
0
6K
Member Avatar for usman_14

Hey guyss, here are a big champs of programming I have seen in this web, I am stucking in this assignment of mine, from where should I start I am totally stucked, is anyone here who can help me for this programme........ Define a function drawCircle. This function should expect …

Member Avatar for Gribouillis
0
1K
Member Avatar for lllllIllIlllI

Hi i have been spending the last few days deciding on an IDE that would let me program in Java, C++ and python and notepad++ looked pretty good. The only issue is i cant work out how to make the program run once i have made it. I looked in …

Member Avatar for Kuldeep_8
1
3K
Member Avatar for Mystrious

The purpose of this question is to calculate the three cubic roots of a complex number. A complex number is of the form a + ib where i is √−1. Attach the full qustion

Member Avatar for ddanbe
0
229
Member Avatar for Elizabeth_13

I am having trouble getting my button to work. What I am trying to do is when the button is pressed, it should call the function clickGame() The window is opening after I press the button but I get an error message: self.tk = master.tk AttributeError: 'Point' object has no …

Member Avatar for Gribouillis
0
771
Member Avatar for Mamatha_1

Hi All, I am a newbie programmer in python and I am trying to read multiple csv files from a folder, replace the delimeter for all the csv files and then output these files into a new folder with replaced delimiter. So far I am stuck at the beginning. Please …

Member Avatar for rproffitt
0
613
Member Avatar for Amani_2

I am having trouble coding an animation for a pendulum simulation. I can never seem to get any of the code right. I tried using pygame, but it didn't work even after I installed it into my computer! I just need to know where to start! Help please!!!

Member Avatar for rproffitt
0
225
Member Avatar for suhayb

i want to make simple cafe management system in Tkinter the buttons are automatically generating from a database so how i can get the names of the buttons and their price from a database and also want so insert this into a receipt(textbox) thanks def showbreakfast(): data1 = readbreakfast() for …

0
318

The End.