15,181 Topics
| |
Disclaimer: I am not looking for a full answer to this lab, only hints. I know people get frustrated when others ask to do their homework for them. ;P Hey guys - first post here, although I have used this website many times to assist me with my Programming classes. … | |
Hi All How can I select some random names from a list, so that in next time, those previously selected names become omitted from the list? for example, say we have 100 names in test.txt file, and we want to select 3 names randomly. then by recalling the selection function, … | |
Just fooling around I came across an issue updating a digital-clock like label. This: [CODE]self.now=time.strftime('%a. %b %d %Y %H:%M:%S',time.localtime()) self.clock=ttk.Label(self,text=self.now) self.clock.pack() while True: self.now=time.strftime('%a. %b %d %Y %H:%M:%S',time.localtime()) self.clock['text']=self.now[/CODE] simply freezes the program, I've managed to get it to update on certain events like the user hitting a button but … | |
Dear seniors, I am a newbie in wxPython and I have to write a code that can immediately start playing a video after I load the file. I have been going through a lot of forums tried to implement 10 - 20 codes, but the wx.media is not playing the … | |
Sometimes, you just want to run a system command from python and capture its output. Currently, the standard way to do this is to call the subprocess.Popen with convenient arguments and use the communicate method. After writing such code a few times, I wrote this little Command class to ease … | |
i've got an assignment to write a program that simulates a game of snaps in python but don't know how to get started, your help would be appreciated! Here is the question: Write a program to allow the simulation of a game of Snap. Assume two humans will play, but … | |
Maybe this is a bit too broad a question and too much code for this forum, but I'll give it a shot... OS: Win7x64 6.1.7601 py: 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] wx: 2.8-msw-unicode My question is more of a general nature than in regards … | |
[CODE]class InspectionGroup(models.Model): group = models.CharField(max_length=50) class InspectionItem(models.Model): group = models.ForeignKey(InspectionGroup) item = models.CharField(max_length=50) class InspectionQuestion(models.Model): item = models.ForeignKey(InspectionItem) question = models.CharField(max_length=200) question_pass = models.BooleanField() class InspectionResult(models.Model): question = models.ForeignKey(InspectionQuestion) vehicle = models.ForeignKey(Vehicle) result = models.BooleanField() submitted_by = models.ForeignKey(User, editable=False) date_time_submitted = models.DateTimeField(default=datetime.today, editable=False)[/CODE] From the above structure, I'd like to … | |
Hi! My aim is to create a grid in which cols, rows, range, and step are given by the user BUT they have to be placed in the grid in a random way. Then, I have to save that grid in a txt file. I wrote the following using some … | |
Hi, What's the best and easiest way to make a table and print it on a printer? 1. I tried QTextEdit + QTextTable but it's a lot of work to move/set a cursor for each cell first and then add text to each cell 2. I also tried a QTableWidget … | |
i am trying to implement ceaser's cipher in the generic sense by rotating the digits by integer n.i am trying to find out the pairs of these from a file containing words. this what i've done so far, [CODE] from string import * d = dict() l = [] for … | |
Hi all. I'm trying to capture video from a webcam and then display the feed in a wxPython GUI. I originally borrowed code from the OpenCV wiki ([url]http://opencv.willowgarage.com/wiki/wxpython[/url]), and since the code was for OpenCV 1.x I tried to adapt it for version 2.1. Here's my attempt to far: [CODE]import … | |
Hi, I am learning Python, and I was just wondering whether Python can achieve everything PHP can. I don't know PHP, but I know it's a server side scripting language, and it is often embedded in HTML pages. Can Python be used in the same manner, i.e. embedded in HTML … | |
I'll preface this by saying that I'm fairly new to Python (after having 2-3 years of C++ under my belt), but for some reason I can't figure out the reasoning behind global variables and when/how I should be using them. For instance, there is a project for school that we've … | |
I need to create a code that will extract the dob from a array of string, like this [iCODE]finddob(["name:bob grade:a dob:1980","dob:1976 name:kate grade:c"])[/iCODE] [CODE]def finddob(listofstrings): recordnum = 0 while(recordnum < len(listofstrings)): yearstart = listofstrings[recordnum].find("dob:") + 4 yearend = listofstrings[recordnum].find(yearend) year = int(listofstrings[yearstart, yearend]) if(year > 1990): print("Is over 21") else: … | |
Hi, I have just recently started using python and I couldn't figure out two problems regarding finding the first three occurrences of spaces using while loops. I have trouble understanding the concept of while loops. How would i write a program that reports the first three occurrences of a space, … | |
Early versions of Python used a hybrid of samplesort (a variant of quicksort with large sample size) and binary insertion sort as the built-in sorting algorithm. This proved to be somewhat unstable, and was replaced in version 2.3 with an adaptive mergesort algorithm. I am comparing several rudimentary sorting routines, … | |
After MANY hours searching online documentation, i still cannot find some simple examples of using the subprocess module to execute commands in the windows console and read back in the output from said command(everything is for unix). So for example, if i wanted to do something like use 7z.exe to … | |
[B]Hello, I am a new CSC 111 student. I have this problem where I am supposed to create "interactive forms", but I'm having trouble figuring out how to do the height, the "time" portion of the form, and it doesn't seem to cooperate interactively. I have the problem and my … | |
HI, Here is my code which I am trying to run: import array a = [] for i in range(0,10): a.append(i+2) class A: def __init__(self,a): self.var1=a[0] self.var2=a[1] class B: def __init__(self, a): self.g1 = a[2] self.arr = [] cl1 = [] var = A(a) for j in range (0,10): cl1.append(var) … | |
I'm trying to learn Python and I tried making just a little "Secret" protected by a password. I also tried to make it so if you typed "help" it would give you a hint. Well I made it so when you type anything that's not the password it would say … | |
Does anybody know a good working Python 3.x wrapper for OAUTH2? I'm having issues with the backwards incompatability with simplegeo-python-oauth2.:'( | |
[B][I][I][U]Introduction:-[/U][/I][/I][/B] [COLOR="Red"] Hi guyz today I am going to writing a tutorial on dictionaries in Python....As per as getting comments from my readers I'll try to make this tutorial Short....[/COLOR] [B][I][U] Layout:-[/U][/I][/B] [COLOR="Green"] 1.What are dictionaries? 2.Why dictionaries? 3.How to declare/make dictionaries in Python? 4.What all you can do with … | |
Hello, I am having trouble with a python 3.2.2 problem. Here is the problem, followed by the answer I have right now (I've put the example in green for clarification): Write a program that declares a different series of lists (lists should not have the same number of words), and … | |
Hi how do I get a £ to print in python 2.4.1. if I type print "£" in the terminal it works fine if I try to to that from a script it comes up with a Deprecationwarning no encoding selected and prints (don't know how to get the character … | |
Ive been looking at the sys.path.append('/../') command in order to import a python module to a given folder. The thing is doesnt python modules have to be installed from wither source or by the given package manager i.e rpm ?? Many Thanks, | |
Dear Members, I am quite new to python and I have to implement the bank account code. At this point I just want to Ask is whether I am moving in correct direction or not. I am not looking for any code but needs suggestion. So far for bank account … | |
Early this morning, and I haven't a clue how this slipped by me, I learned about the Android SDK and Python for Android, I did a little research, it's very intriguing. Has anybody worked with this at all? Do most built in libraries and modules work for it? How do … | |
"You should present students with a menu where they can repeatedly choose to practice addition, subtraction, multiplication, and division problems or to exit the program." | |
The need for efficient storing of IP numbers came up in discussion thread. With help of this conversion to/from the 32 bit numbers that IP numbers (the old ones) represent I could push the time of finding unique IP numbers from 10 million random numbers down to under two minutes … |
The End.