- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 44
- Posts with Upvotes
- 36
- Upvoting Members
- 22
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re: I am building a crawler+parser in Python. It has to be run for, like 20 hours. How can I modify the code such that the code execution pauses (before next urllib2.urlopen) when the internet is disconnected, and AUTOMATICALLY resumes with the same variable values, when the internet connection is back … | |
Re: Alright i am totaly new to python and could really use some help. I need a program that will run and starting at "2:00" count down all the way to "0:00". The left side being minutes and the right side being seconds. so 120 seconds total. I have no idea … | |
Re: The idea of this thread is to help the beginning Python programmer with hints and helpful code. Please feel free to contribute! If you have any questions start your own thread! The creators of Python are very active, improving the language all the time. Here is a little of the … | |
Re: I am trying to change the first character of each word in a list to upper case using Python 2.7. I am able to change the entire list to lower case, but I am not getting what I want - i.e the first character of each word to be upper … | |
Re: I want to use Python to make something similar to the fc command found in MS-DOS and Windows. How would I handle opening 2+ files and reading them a byte at a time for comparing? | |
Re: I am a total newbie to programming. I was hoping to learn how to write a program that prints out a string representation of a random card from a deck of playing cards. The programs should use either “A”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “J”, “Q”, … | |
Re: Hello, So I have been trying to produce an algorithm for unsymmetric matrices which finds the smallest magnitude eigen value. I have found this: ![cfafcf24b5563ebb8aad4395c3c90ff0](/attachments/large/2/cfafcf24b5563ebb8aad4395c3c90ff0.png "cfafcf24b5563ebb8aad4395c3c90ff0") ![cfafcf24b5563ebb8aad4395c3c90ff0](/attachments/small/2/cfafcf24b5563ebb8aad4395c3c90ff0.png) However, I still don't know how to implement it in python. Can someone help out or provide psudocode/code ? | |
Re: import random guessesTaken = 0 my_name = input("Hello, What is your name? ") difficulty = input("Well, "+ my_name + ". What dificulty would you like ? easy medium or hard? " if difficulty == easy number = random.randint (1,20) print ("Okay, " + my_name + ". I am thinking of … | |
Re: a1 = 1 a2 = 2 a3 = 3 ....... a10000 = 10000 So, I want to create a function that will autoassign names to numbers. In the the code above, for x in range (desired range): a(quantity of x) = x how do i get my code to call … | |
Re: Hi I have simple python script that open a TCP socket,connect to the SMTP servert and issue a VRFY command. When I run the script I got error,I wonder How can I fix error? #!/usr/bin/python import socket import sys if len(sys.argv) != 2: print "Usage: vrfy.py <username>" sys.exit(0) # Create … | |
Re: “Guess the number” game One of the simplest two-player games is “Guess the number”. The first player thinks of a secret number in some known range while the second player attempts to guess the number. After each guess, the first player answers either “Higher”, “Lower” or “Correct!” depending on whether … | |
Re: I am having difficulty with a program in my CS class right now and I am wondering if you guys could help. Basically, I need to find the length/width (should be equal) of the 4 corners(I'll call this variable 'x') of a piece of cardboard, to cut them out to … | |
Re: import xlrd import re workbook=xlrd.open_workbook('planningSpreadSheet_20140120T124023_20140203-20140209.xls') sh=workbook.sheet_by_index(0) palabras=str(sh) for col in range(sh.ncols): for i in range(sh.nrows): caca=sh.row_values(i) print(caca) Hi , i try to do a seeker, read an xls file ,and find a word,(input()),and show all the content of the row | |
Re: Hello there? I am extremely new to python, and am trying to attend the lectures about hashing. Please cd you ceck the following code and error, and just tell me how to make it work. Please I am not that advanced user of python. I am very basic. def create(smallest, … | |
Re: Ok, i've gotten pretty far on a code but keep getting an error. I know it's something simple but i just can't put my finger on it please help. import os import pickle class Student(object): def _init_(self): self._students = {} def addStudent(self, name): self._students[name] = [0, 0, 0] def editStuData(self): … | |
Re: Hi All, I am trying to scrape a piece of HTML similar to the below where I want beautiful soup to return something like: List Price, £28,410 Body Style, Open Car etc etc. I thought if I did this: soup = BeautifulSoup(html_doc) tag = soup.find_all('tr') tag_td = tag[0].find('td') tag_b = … | |
Re: Programming Python 3rd Edition by Mark Lutz has example code (below) where a variable seems to be assigned with options ("or") but what the criteria for selecting the options is not clear. The explanation is almost non-existent but I think this is to do with feeding in a variable number … | |
Re: Hello, i'm currently trying to write some code to find the integral of exp(-x*x). I have been given code for one trapezium rule (trap0) which is imperfect, and a second set of code for a new trapezium rule (trap1), which uses the old code and some new conditions to 'perfect' … | |
| |
Re: I have a long list of data structured in the following way Date , Time, Temperature, Moisture, Accumulated precipitation 1/01/2011, 00:00, 23, 50, 2, 1/01/2011, 00:15, 22, 45, 1, 1/01/2011, 00:30, 20, 39, 0, 1/01/2011, 01:00, 25, 34, 0, 1/01/2011, 01:15, 23, 50, 0, . . . . 1/01/2011, 23:45, … | |
Re: Implement function ion() that takes a string as input and returns True if the entered string ends in 'ion' and false otherwise. ion('congratulation') True ion('marathon') False How can I start this off and Finish it? | |
Re: I am looking for help in how to implement function avg() that takes as input a list that contains lists of numbers. Each number list represents the grades a particular student received for a course. List for a class of four students. ([95,92,86,87],[66,54,],[89,72,100],[33,0,0]) the function avg should print one per … | |
| Re: I am using Debian Linux and Python 2.7 with PIL. I want to capture an image from a webcam and store it in a file. What are the ways in which this can be done? Also,I want to covert the captured image for modification using Scipy. What is the procedure.for … |
Re: i am a beginner in python and still got a whole lot to learn.i have this exercise that seem too difficult to crack. check it out and see if you can help. here is a simple data set1=["01","34","29","16"] set2=["45","88","19","17"] set3=["56","21","57","20"] set4=["29","42","89","08"] set5=["19","45","56","20"] set6=["85","56","33","78"] using the data above, write this program … | |
Re: A GPA, or Grade point Average, is calculated by summing the grade points earned in a student’s courses and then dividing by the total units. The grade points for an individual course are calculated by multiplying the units for that course by the appropriate factor depending upon the grade received: … | |
Re: Just a little fun with Python's named tuple, behaves like a class but is much leaner. | |
Re: Here is a plan for a (relatively) random numeric dictionary I've put together. I'm hoping that people can help me refine the plan so that I can start incremental coding: #! usr/bin/env python # creates a random dictionary from random import randint # user inputs maximum length of dictionary # … | |
Re: I saw this code on stack overflow def writeProfile(profileName, profileData): """ pickle user profile data """ os.chdir(PROFILE_DIR) fileName = profileName + ".dat" f = open(fileName, "wb") pickle.dump(profileData, f) f.close() os.chdir("..") It is for saving progress under the pickle module. I don't see a way to save variables. How would I … | |
Re: A simple test of a numeric string. | |
Re: Hi to all I'm newbie in the python and this is my first program in it. I have created a board that it LEDs can on/off like the checkbox. and a Timeline that has 20 Frames for controlling the animation (Frames are like the RadioButton). Can you help me : … |