15,190 Topics

Member Avatar for
Member Avatar for lewashby

builtins.UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 14: invalid continuation byte I'm getting the following error that pops up not in my script but in the codecs.py file. I've used code exactly like this in another program and it worked just fine. Any ideas? Script below. #/usr/bin/env python3 …

Member Avatar for snippsat
0
819
Member Avatar for kartikdani

i am using cartridge-mezzanine for site but now it not saved order when i goes in complete.html it shows a "page not found error" because it can't access in order object in shop/views.py in def complete(request, template="shop/complete.html"): try: order = Order.objects.from_request(request) except Order.DoesNotExist: raise Http404 items = order.items.all() how i …

0
147
Member Avatar for kxjakkk

I'm trying to make a calculator of a sort in python that works on a local web server. I have the localhost all set up and all. import cgi data = cgi.FieldStorage() product_description = data.getvalue('product_description') list_price = data.getvalue('list_price') discount_percent = data.getvalue('discount_percent') total = data.getvalue('total') def total_price(): data.getvalue('total') - discount return …

Member Avatar for snippsat
0
479
Member Avatar for vegaseat

This program takes a text string and creates a list of words. Any attached punctuation marks are removed and the words are converted to lower case for sorting. Now you can generate a dictionary of the words and their frequencies. The result is displayed using a sorted list of dictionary …

Member Avatar for snippsat
2
1K
Member Avatar for vegaseat

The Fibonacci series of numbers was used by Leonardo of Pisa, a.k.a. Fibonacci (around the year 1200), to describe the growth of a rabbit population. The series has been noted to appear in biological settings, such as the branching patterns of leaves in grasses and flowers. We take a look …

Member Avatar for Stefan_3
1
2K
Member Avatar for vegaseat

Because of their demand only nature, generators are ideal for finding the combinations of larger sequences. This code applies a Python generator to find the combinations of the sequence. Since permutations are a special case of combinations for all the items in a sequence, I have expanded the result to …

Member Avatar for Stefan_3
1
434
Member Avatar for MartinIT2type

Hello, I'm pretty new to Python, and I've been making simple projects to practice in. The issue I've run into though is I'm creating a GUI (Using Tkinter with Python 2.6) to take a text input and bring out "Name". What I want to do though is keep that "Name" …

Member Avatar for jules1234567
0
8K
Member Avatar for Chrome 142

Hi, I am trying to make my "Save All" button to save whatever is selected from the option menu or dropdown to that particular file. So if I have "animation" selected from the option menu it saves to the animation file 'ji.txt','r+'. Or if I have "compositing" selected from the …

Member Avatar for Chrome 142
-1
403
Member Avatar for b6huss

Hi, I am extremely new to python, and I am completely stuck regarding filtering the contents of a list. I have a list of the first thirty elements, and i have been told to identify any beginning with the letter 's' and any that are four letters long. I have …

Member Avatar for snippsat
0
400
Member Avatar for krystosan

Does anyone have idea how to fetch a file split into defined number of ranges using the requests module instead of urllib2 ?

Member Avatar for snippsat
0
124
Member Avatar for awahqn

Hi, I have a code in perl that does some mail things and I would like to translate it to perl can someone help me please? I dont know perl so i want it in python so i can edit it. here is the code: #!/usr/bin/perl -w # USAGE : …

Member Avatar for TrustyTony
0
214
Member Avatar for kxjakkk

I'm trying to modify this code: class Tree: def __init__(self, cargo, left=None, right=None): self.cargo = cargo self.left = left self.right = right def __str__(self): return str(self.cargo) def print_tree_inorder(tree): if tree is None: return print_tree_inorder(tree.left) print(tree.cargo, end=" ") print_tree_inorder(tree.right) So that it adds parentheses around every operator and pair of operands. …

Member Avatar for kxjakkk
0
471
Member Avatar for caltech

Hi, I've had a rather ambitious project on my mind for as long as I've been at my job (almost a year) -- to pretty much rewrite their central application, which is a listing database/"portal", around and upon which their entire IT infrastructure and web and computing tasks and operations …

Member Avatar for il_doc
0
306
Member Avatar for yuimikazuki

print "Let's practice everything." print 'You'd need to know 'bout escapes with \\ that do \n newlines and \t tabs.' poem = """ \tThe lovely world with logic so firmly planted cannot discern \n the needs of love nor comprehend passion from intuition and requires an explanation \n\t\twhere there is …

Member Avatar for HiHe
0
160
Member Avatar for lewashby

(Linux) I just installed eyed3 for python using apt-get, everything installed fine but when I tried to import eyed3 I got a trackback error, no such module. Do I need to do something special to let python know where the module is at or do I need to move the …

Member Avatar for Gribouillis
0
1K
Member Avatar for henry.moore.319247

this is my first attempt on python and i would really love some help heres my code class Customers(object): def __init__(self, Surname = None, FirstName = None, Address = None, Town = None, Postcode = None, PhoneNumber = None, Date = None, Email = None): self.Surname = Surname self.FirstName = …

Member Avatar for TrustyTony
0
316
Member Avatar for Jack_9

I'm still kinda uncertain about python. But if you can, How would you go about making a instant messaging webapp? This isn't for any homework or paid jobs, just curious for my website.

Member Avatar for Hiroshe
-1
104
Member Avatar for abaddon2031

Im working on a project where i have to get the number of printers that are allocated to a certain job and need to split the file name up so that i can read the type and the number of printers and if its a half bed or not. The …

Member Avatar for snippsat
0
266
Member Avatar for yuimikazuki

from sys import argv from os.path import exists script, from_file, to_file = argv print "Copying from %s to %s" % (from_file, to_file) # we could do these two on one line too, how? in_file = open(from_file) indata = in_file.read() print "The input file is %d bytes long" % len(indata) print …

Member Avatar for David W
0
221
Member Avatar for analys

Hi, I'm new to python. I'm creating python script that will copy file from different destination to another destination. It will copy as well the access for different user. I'm trying to output any results to the logfile but it didn't seem to output it. Here's my code. Hope anyone …

Member Avatar for analys
0
418
Member Avatar for analys

Hi, I want to develop Python script for server automation (server backup) that able to copy the files with user access permission as well. I want to do it with Python but I'm not sure how to start on the active directory scripting with Python. Can somebody help me?

0
189
Member Avatar for Jack_9

I honestly think that the python programming language will take over other languages such as c# and maybe even c++. Why do I say this? Because a python interpreter can easily be embedded in the game. I have also written an engine to make python as fast as C++ (true …

Member Avatar for iamthwee
0
410
Member Avatar for kxjakkk

I'm trying to write a boolean function that takes two Mytime objects, t1 and t2 as arguments, and returns True if the object falls inbetween the two times. This is a question from the How to Think Like a Computer Scientist book, and I need help. What I've gotten so …

Member Avatar for David W
0
449
Member Avatar for Jack_9

In my opinion, python is a fantastic language, but is it possible to develop an operating system with python, BUT one thing that I do know is that if you were going to develop something with python it would probably have to be the gui. Because python dosen't even really …

Member Avatar for mike_2000_17
0
262
Member Avatar for kxjakkk

I wanted to format this string but I don't know how I can do the formatting part at all. class MyTime: def __init__(self, hrs=0, mins=0, secs=0): self.hours = hrs self.minutes = mins self.seconds = secs if self.seconds >= 60: self.minutes += self.seconds // 60 self.seconds = self.seconds % 60 if …

Member Avatar for sepp2k
0
263
Member Avatar for kxjakkk

This is my code: class MyTime: def __init__(self, hrs=0, mins=0, secs=0): self.hours = hrs self.minutes = mins self.seconds = secs if self.seconds >= 60: self.minutes += self.seconds // 60 self.seconds = self.seconds % 60 if self.minutes >= 60: self.hours += self.minutes // 60 self.minutes = self.minutes % 60 if self.hours …

Member Avatar for kxjakkk
0
284
Member Avatar for tanuja vykuntpu

i want to create online discussion forum using python but i dont know what type of tools to use,i want to maintain database and builtin board myself without interference of third parties,please anyone help me

Member Avatar for tanuja vykuntpu
0
117
Member Avatar for abaddon2031

I am working on a code that searches a folder gets a specific part of the file name and adds 1 to a file counter. There are some files in tehre that have a special character that indicates that is is only half. I ahve got it to count the …

Member Avatar for flebber
0
200
Member Avatar for flebber

I am having an error file object when opening and reading a text file(csv). I must be misusing the with so that when I call the function race table its getting a file object and not a readline. How can I get the with to correctly hand over the file? …

Member Avatar for flebber
0
151
Member Avatar for EnergeticJet

Hello there DANIWEB! Now I know that there are already many different discussions asking for python ideas for beginners, but I thought maybe this could be a discussion for all different abilities. For example, if I wanted to reply with a Beginner idea, I would type: **BEGINNER** And the same …

Member Avatar for DragonMastur
0
378

The End.