4,305 Posted Topics

Member Avatar for Warrens80

Taco Bell is part of Yum! Brands, Inc. I have some of their stock and it has done well. Yes, I do go to Taco Bell to spend some of the dividents, always liked their stuff.

Member Avatar for mike_2000_17
0
468
Member Avatar for sinnebril
Member Avatar for krystosan

Something like this might give you a hint: http://www.daniweb.com/software-development/python/code/467824/a-simple-image-slide-show-pyside

Member Avatar for krystosan
0
268
Member Avatar for Stefano Mtangoo

[QUOTE=paulthom12345;768727]Well i know this may be obvious, but Tkinter is all ready to be used in python 3. So anybody who uses that GUI toolkit will still be able to use it in python 30.[/QUOTE]Tkinter ships with the Python30, it better work! Also Tkinter uses its own language called TCL, …

Member Avatar for vegaseat
0
985
Member Avatar for Xantipius

Your brain needs "sugar" to function, that limits the number of people that can avoid it. Spicy food can kill cancer is an "old wives' tale" at best. Has been around for many years without any proof.

Member Avatar for jwenting
0
366
Member Avatar for stevewilliams02

Here is a hint ... ''' toplevel101.py ''' from functools import partial from Tkinter import * def show_pic(img): # create child window top = Toplevel() Label(top, image=img).pack() # create the root window app = Tk() #Apply GUI title app.title("Horoscope") #Size of window. app.geometry("500x3000") # pick images you have in the …

Member Avatar for sneekula
0
192
Member Avatar for vegaseat
Member Avatar for robert99x

A test ... print(True or True) # True print(True or False) # True print(False or True) # True print(False or False) # False print('-'*12) # exclusive or ^ print(True ^ True) # False print(True ^ False) # True print(False ^ True) # True print(False ^ False) # False print('-'*12) print(True …

Member Avatar for robert99x
0
293
Member Avatar for Pioggia254

The line `guess = int(input("Your Guess? "))` in essence appears 3 times, see if you can use it just once.

Member Avatar for vegaseat
0
173
Member Avatar for vinodvinu

No computer language is easy to learn unless you put some effort and thought into it. Looks like Visual Basic might be a fine language system for you.

Member Avatar for vegaseat
0
445
Member Avatar for Dearden

When I grew up you got either breast milk or cow milk. Epensive baby formula was not available.

Member Avatar for Ancient Dragon
0
844
Member Avatar for bryann
Member Avatar for HiHe

I would never take a computer/tablet on our bus system here. I would be robbed in a hurry!

Member Avatar for pixelsoul
2
181
Member Avatar for Remy the cook

A few test prints should help ... ''' nltk_tokenize102.py use module nltk to find the frequency distribution of nouns in a given text downloaded and installed: nltk-2.0.4.win32.exe from: https://pypi.python.org/pypi/nltk tested with Python27 ''' import nltk import pprint text = "This ball is blue, small and extraordinary. Like no other ball." …

Member Avatar for Remy the cook
0
1K
Member Avatar for v.r.t

Unless it's for the exercise, I prefer a while loop over a recursive function and avoid a possible stack overflow.

Member Avatar for vegaseat
0
158
Member Avatar for Remy the cook

Try this ... ''' nltk_sentences101.py downloaded and installed: nltk-2.0.4.win32.exe from: https://pypi.python.org/pypi/nltk tested with Python27 ''' import nltk import pprint text="""First patented in 1876 by Alexander Graham Bell and further developed by many others, the telephone was the first device in history that enabled people to talk directly with each other …

Member Avatar for vegaseat
0
272
Member Avatar for CodingCabbage

The most common library used to be the Python Image Library (PIL), which is now Pillow as mentioned by Jukka O For info see ... http://pillow.readthedocs.org/en/latest/

Member Avatar for vegaseat
0
266
Member Avatar for nitin1

Get to know the project, see what others have done and show that you can do better.

Member Avatar for theguitarist
0
254
Member Avatar for kur3k
Member Avatar for <M/>
Member Avatar for nitin1
Member Avatar for Ancient Dragon
Member Avatar for glao

Rewrite your code a little ... count = 0 phrase = "hello, world" for iteration in range(5): index = 0 while index < len(phrase): count += 1 print "index: " + str(index) index += 1 print "Iteration " + str(iteration) + "; count is: " + str(count)

Member Avatar for glao
0
269
Member Avatar for Jacklittle01

Hint ... # this test string will have 65 characters s = 'q' * 65 length = len(s) if length <= 64: encrypted = encrypt(s) else: print("string exceeds 64 characters")

Member Avatar for vegaseat
0
175
Member Avatar for krystosan

Also see ... http://www.daniweb.com/software-development/python/code/465991/high-resolution-time-measurement-python

Member Avatar for germ
0
275
Member Avatar for LucyLogic

One of the many ways to do this ... import random def is_even(number): # Determines if the number is odd or even. if (number % 2) == 0: status = True else: status = False # Returns status as True or False return status even = 0 odd = 0 …

Member Avatar for vegaseat
0
508
Member Avatar for CodingCabbage

Here is another example ... ''' sqlite3_employ101.py experimenting with a Python sqlite3 database of employees ''' import sqlite3 # for temporary testing you can use memory only conn = sqlite3.connect(":memory:") cur = conn.cursor() # query language in upper case is optional eye candy cur.execute('''CREATE TABLE employees( number INTEGER PRIMARY KEY …

Member Avatar for vegaseat
0
614
Member Avatar for krystosan
Member Avatar for aboubakarsalim.khamis
Member Avatar for CodingCabbage
0
208
Member Avatar for antonio.neal.39

Change your code to this ... from urllib.request import urlopen u = urlopen('http://www.ctabustracker.com/bustime/map/getBusesForRoute.jsp?route=22') info = u.read() print(type(info)) # just a test --> <class 'bytes'> f = open('rt22.xml', 'wb') f.write(info) f.close() # convert info to string before printing print(info.decode()) # test Notice that info is not a string object.

Member Avatar for HiHe
0
222
Member Avatar for eric_arambula

Hint ... rate = 0.2 monthly_rate = rate/12 min_payment = 10 total = 0 for month in range(12): total += min_payment + min_payment*monthly_rate print("Month {:2d} total = {:.2f}".format(month+1, total)) # test ''' result ... Month 1 total = 10.17 Month 2 total = 20.33 Month 3 total = 30.50 Month …

Member Avatar for phoenix.enero
0
302
Member Avatar for laura301019

This might help too ... # words you want to ignore later text = '''\ a the on up down ''' fname = "ignorelist.txt" # write the file out with open(fname, "w") as fout: fout.write(text) # read the file back in and convert into a list with open(fname, "r") as …

Member Avatar for vegaseat
0
195
Member Avatar for danielPROGRGAMS

You could use a dictionary like ... d = { 'kw1' : [def1, def2, def3, ix], 'kw2' : [def1, def2, def3, ix], 'kw2' : [def1, def2, def3, ix], ... } Where keys kw1, kw2, ... are the keywords and values are a list of definitions for each keyword, and the …

Member Avatar for TrustyTony
0
472
Member Avatar for rajeeeesh
Member Avatar for vegaseat
0
147
Member Avatar for tinku.cater
Member Avatar for a8med
Member Avatar for vegaseat
0
232
Member Avatar for rabowling

This will work ... `pause = lambda: time.sleep(3)` Then call with ... `pause()` Also convert a very long text line into multiline text this way ... print """\ You will be given multiple choices throughout this adventure. How you choose determines how you end. Please answer questions in all lowercase …

Member Avatar for vegaseat
0
496
Member Avatar for booicu

Another hint ... is_even = lambda x: x % 2 == 0 is_odd = lambda x: x & 1 == 1 # test print(is_even(3)) # False print(is_even(8)) # True print(is_odd(12)) # False print(is_odd(7)) # True

Member Avatar for vegaseat
0
3K
Member Avatar for cdwin
Member Avatar for vegaseat

This example calculates timed x, y points of a projectile motion that can be used for plotting or other calculations.

Member Avatar for ddanbe
3
6K
Member Avatar for glez_b

If the csv file contains the time data, then you might be better off to split date and time in the csv file.

Member Avatar for vegaseat
0
9K
Member Avatar for tinku.cater

Hint ... # using module bisect to determine grades import bisect # both sequences have to be sorted or be in order # A is 85 or higher, B is 75 to 84 etc. grades = "FEDCBA" breakpoints = [30, 44, 66, 75, 85] def grade(total): return grades[bisect.bisect(breakpoints, total)] print …

Member Avatar for vegaseat
0
335
Member Avatar for james.lu.75491856
Member Avatar for Vinolia

Hint ... grains_sum = 0 grains = 1 for square in range(1, 64+1): print(square, grains) # test grains *= 2 grains_sum += grains print(grains_sum) # test

Member Avatar for vegaseat
0
416
Member Avatar for Badgeking
Member Avatar for BlackPhoenix

Ah, just in time for halloween. A web crawler visits a given URL and retrieves any URLs from the hyperlinks on that page. It visits these URLs and collects more URLs and so on. Kind of spooky. What you do with these URLs is up to you. You can collect …

Member Avatar for vegaseat
0
235
Member Avatar for Vusumuzi

You could put the more repetitive tasks into a function. Something like this ... import random def get_guess(direction=""): return int(raw_input("Please guess a {} number: ".format(direction))) number = random.randrange(100)+1 print("Guess a number from 1 to 100 game ...\n") tries = 1 attempts = int(raw_input("Please enter the number of attempts you want: …

Member Avatar for fonzali
0
244
Member Avatar for ant1vanden

You can sort by two criteria this way ... import operator as op # a test dictionary with name:[age,weight] pairs mydict = { 'Zack' : [35, 210], 'Adam' : [24, 175], 'John' : [35, 150], 'Tony' : [35, 244] } # convert to list of (name, age, weight) tuples mylist …

Member Avatar for vegaseat
0
171
Member Avatar for vegaseat

A Python sort with a helper function to allow for mixed order sort like age descending and weight ascending.

3
495
Member Avatar for bradley1234

Hint ... import itertools as it # create non-repeating pairs print(list(it.combinations('ABCD', 2))) ''' result ... [('A', 'B'), ('A', 'C'), ('A', 'D'), ('B', 'C'), ('B', 'D'), ('C', 'D')] ''' Note: Instead of 'ABCD' use a sequence of (x, y) coordinate points.

Member Avatar for vegaseat
0
188

The End.