15,185 Topics

Member Avatar for
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
431
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
470
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
305
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
314
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
220
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
417
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
186
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
408
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
261
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
261
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
283
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
199
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
150
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
376
Member Avatar for mark103

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 …

Member Avatar for DragonMastur
0
459
Member Avatar for moone009

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 …

Member Avatar for moone009
0
7K
Member Avatar for Vikram_2

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 …

Member Avatar for Gribouillis
0
2K
Member Avatar for krystosan

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 …

Member Avatar for woooee
0
329
Member Avatar for kxjakkk

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 …

Member Avatar for Hiroshe
0
612

The End.