15,185 Topics
| |
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 … | |
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" … | |
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 … | |
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 … | |
Does anyone have idea how to fetch a file split into defined number of ranges using the requests module instead of urllib2 ? | |
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 : … | |
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. … | |
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 … | |
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 … | |
(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 … | |
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 = … | |
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. | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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? … | |
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 … | |
Hi all, I need some help regarding how to cancel the connection from my server using the urllib2 library. I want the database to stop writing the data away as soon as the connection has been cancelled. The `allchannels_timer` will be called when I hit the 'enter' button, which will … | |
First off this is my second day writing in Python. My manager switched us off SAS and moved us to Python and R which I actually am starting to like the flexibility. I have a few datasets that I work with on a regular basis that require a lot of … | |
Hello all, I have a Hindi Text file, from which i want to access the maximum repeated words and other similar operations. I went through many articles which help in accessing English text files. But i need to use the same operations on the Hindi text file, i am not … | |
Hi need help passing an argument through signal emitted from a function at module level, when the function is executed I want to emit a signal with an argument whose value i want to pass to the method that is connected to that signal in the class in that same … | |
I need to make an object called Accounts that can be used as a banking system. It requires 3 inputs, first name, last name, and initial deposit and 4 member functions: withdraw, deposit, fee and interest. The fee is $20 a month if the amount in the account is less … |
The End.