15,185 Topics
| |
Well I done it! Got bored after the holidays and bought a Raspberry Pi credit card sized computer ($35), the least expensive LED TV and a Logitech wireless Keyboard/Mouse combo. The way I ordered the kit it cost almost twice as much, but it came with a good 2.5A powersupply, … | |
Hello. I'm trying to create a web crawler. I've read about web crawler's duty and about how it works and what he does. But just need more information. Could you please tell me what does a web crawler can do? What kind of duty i can define for my web … | |
One way to find the shortest distance between a series of surface (x, y) points is to let Python module itertools find the non-repeating combinations of point pairs. Now you can apply the Pythagoras' theorem to find all the distances and the minimum distance. | |
Hello, me again :) With this code: >>> from BeautifulSoup import BeautifulSoup >>> import urllib2 >>> url = urllib2.urlopen('http://www.python.org').read() >>> soup = BeautifulSoup(url) >>> links = soup('a') >>> print links A list of links printed into the terminal. I want to send the list into a text file, i tried … | |
hi, i have created a drug dispensing client to be used by a pharmacy shop as a project. i need to add a function that can tell whether a drug has expired in the database. Csv was used. any idea how i should go about it. Thanks | |
I am try to make a program that alows the user to input their username and password to recive a set of options. Right now the options are to look at a file or quit. In order to complete it I need to know how to turn of the visability … | |
Given a unicode string or file, what is the best way to find a short unicode string that is **not** a substring of the first one ? I want a working algorithm that avoids transforming the first string into a list of characters. My first idea is to choose a … | |
Well this is my basic code for my RPG, can I have help improving it? import cmd import json from rpg_data import * class RPG(cmd.Cmd): def do_n(self, line): try: Me.location = Me.location.exits["north"] except: print("You can't go north") def do_s(self, line): try: Me.location = Me.location.exits["south"] except: print("You can't go south") def … | |
Hi again. I want to create a robot or spider or crawler with python urllib. Still couldn't find any good tutorial. Any suggestion?! | |
Hi friends. With `datetime.datetime.now()` or `datetime.datetime.today()` i can get the current date (English calendar) for my program but what about if i want to get the current date (from Persian calendar) for my program; then what should i do? As my pc os date is set to English calendar so … | |
Hello. I want to learn python urllib. I have installed it and now looking for a good tutorial, any suggestion? | |
Hi friends! import urllib url = 'http://www.python.org' text = urllib.urlopen(url).read() I have typed the code above on the terminal and in the next line with `print text` an html file printed there. I want to send it to a text file, how can i do that? | |
I want to exchange line 18 text with line 23 lable text, but here line 18 doesn't work in my code? Any idea?! from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label def timer(): delta = datetime.datetime(2015, 3, 21, 2, 15, 11) - datetime.datetime.now() days = delta.days … | |
Is there a specific way to code a database authentification for users of a program? | |
` #Author : Bikash Guragai #versione : 1.0 #email : bikashguragai@gmail.com or bikashguragai@programmer.net import random print ("Hello and welcome") Name = input("What is your name: ") print ("Nice to meet you",Name) ok = input("Click enter to move on") play = input("Lets play a game") b = input("Think of any Any … | |
This is a PyEditor I made because I couldn't get a IDLE working on windows 95. | |
Is it posible to have an optional veriable in a funtion? Such as this: >>>def Say(msg, (optional)): >>> print msg >>> print optional >>> >>>Say('hi', 'option') hi option >>>Say('not') not If so How? | |
import sys slayer=int(input("enter your guess for SLAYERS:")) count_letters=len(str(slayer)) if count_letters!=6: print('Your guess is incorrect: SLAYER must be a 6-digit number. ') else: new_slayer=3*slayer i=1 while(i<=1000): a=[] a=str((slayer//i)%10) i=i*10 layers=a[1]*100000+a[2]*10000+a[3]*1000+a[4]*100+a[5]*10+a[0]*1 if new_slayer==layers: print('Your guess is correct: ') print('SLAYER+SLAYER+SLAYER=',new_slayer) print('LAYERS=',layers) else: print('Your guess is incorrect: ') print('SLAYER+SLAYER+SLAYER=',new_slayer) print('LAYERS=',layers) I want to store … | |
I want to send an email using python. The contents of the message is from a sql querry placed inside a ttk treeview widget. so how do i select and send the selected items? the code below prints (I001) inside the email. # Specifying the from and to addresses self.fromaddr … | |
Hello. I have copied these 2 files of code from a website. main.py: from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.clock import Clock from kivy.properties import StringProperty import datetime class Counter_Timer(BoxLayout): def update(self, dt): delta = datetime.datetime(2015, 9, 13, 3, 5) - datetime.datetime.now() self.days … | |
I have a Tkinter GUI that is composed of two widgets, the first is a widget class with an entry field and a button and the second is a scrollable text widget class. I have combined these two widget classes to make a single GUI. Each of these widget classes … | |
Hi, I am looking for a little example of making a window visible or invisible. I have a main window with 2 buttons (option1 and option2). If i press option one i open a new window with something else but i want that keep stored in a variable that i … | |
Hello friends. I want to create a countdown program for the new year that is comming. I know i can use this code for example, for short certain time: from threading import Timer def sayhi(): print "hello everybody!" t = Timer(10, sayhi) t.start() But the new year begins in 29 … | |
I have code that when executed will give me a long list output, which is fine, but how can I get it to print without the parenthesis and commas? example: answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') but I'd like it to print like this: 7Q5H9438L I … | |
Ok, so while practicing python, plotting and quadratic equations - I found this weird behaviour in plotting. The function 'func' defines one of the solution to a quadratic equation. The solution being *0.5(x+1 - sqrt((x+1)^2 - 4x))* And so I tried plotting this value against different x values. I get … | |
import pygal data = [ ["Python", 30.3], ["Java", 22.2], ["C++", 13], ["Ruby", 10.6], ["Javascript", 5.2], ["C#", 5], ["C", 4.1], ["PHP", 3.3], ["Perl", 1.6], ["Go", 1.5], ["Haskell", 1.2], ["Scala", 1], ["Objective-C", 0.4], ["Clojure", 0.2], ["Bash", 0.1], ["Lua", 0.04], ["TCL", 0.03] ] # Make a Pygal chart pie_chart = pygal.Pie() # add … | |
I have code that when executed will give me a long list output, which is fine, but how can I get it to print without the parenthesis and commas? example: answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') but I'd like it to print like this: 7 Q … | |
The code: print [c[i] for c in ['as','df'] for i in range(len(c))] outputs: ['a','s','d','f'] while, print [c[0] for c in ['as','df']] outputs: ['a','d'] - The first letter of each word. shouldn't the output be ['a','d','s','f'] - Why is this different? | |
A simple code example on how to play wave sound files with the Python module PyGame. | |
Hey guys I have a program download link here... (link deleted) This program is used to purchase a pair of sneaker on adidas.com. I am a rookie in coding and have no idea what to do with it. I know it is a python file and you are supposed to … |
The End.