15,175 Topics

Member Avatar for
Member Avatar for RMWChaos

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 …

0
198
Member Avatar for ste_a47

[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 …

Member Avatar for ste_a47
0
188
Member Avatar for henky2011

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 …

Member Avatar for TrustyTony
0
588
Member Avatar for linuxoidoz

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 …

Member Avatar for britanicus
0
1K
Member Avatar for jagan605

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 …

Member Avatar for TrustyTony
0
194
Member Avatar for convoluted

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 …

Member Avatar for lassytouton
0
2K
Member Avatar for Cupidvogel

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 …

Member Avatar for Cupidvogel
0
209
Member Avatar for paraclete

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 …

Member Avatar for paraclete
0
219
Member Avatar for pythonhelp11

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: …

Member Avatar for woooee
0
423
Member Avatar for d3fined

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, …

Member Avatar for TrustyTony
0
178
Member Avatar for vegaseat

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, …

Member Avatar for Skrell
1
4K
Member Avatar for Skrell

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 …

Member Avatar for Skrell
0
105
Member Avatar for computerchip

[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 …

Member Avatar for TrustyTony
0
186
Member Avatar for puruharsh

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) …

Member Avatar for Stefano Mtangoo
0
181
Member Avatar for aj9393

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 …

Member Avatar for JoshuaBurleson
0
117
Member Avatar for JoshuaBurleson

Does anybody know a good working Python 3.x wrapper for OAUTH2? I'm having issues with the backwards incompatability with simplegeo-python-oauth2.:'(

Member Avatar for TrustyTony
0
134
Member Avatar for lionaneesh

[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 …

Member Avatar for colstonewall
0
410
Member Avatar for computerchip

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 …

Member Avatar for computerchip
0
437
Member Avatar for ali13

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 …

Member Avatar for snippsat
0
436
Member Avatar for felix001

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,

Member Avatar for hughesadam_87
0
88
Member Avatar for jainpratik2

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 …

Member Avatar for jainpratik2
0
176
Member Avatar for JoshuaBurleson

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 …

Member Avatar for JoshuaBurleson
0
358
Member Avatar for crazygamer49

"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."

Member Avatar for TrustyTony
0
89
Member Avatar for TrustyTony

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 …

Member Avatar for mrkbbk
0
814
Member Avatar for ttback

For the past 2 days, no matter which Sharepoint web service I access via Python's suds lib, the remote service always returns 403 Forbidden. I'm using Python Suds 0.4 and Python NTLM 1.0. Suds 0.4 has built-in support for accessing Python NTLM. I followed the documentation from Suds's website on …

0
63
Member Avatar for ttback

For the past 2 days, no matter which Sharepoint web service I access via Python's suds lib, the remote service always returns 403 Forbidden. I'm using Python Suds 0.4 and Python NTLM 1.0. Suds 0.4 has built-in support for accessing Python NTLM. I followed the documentation from Suds's website on …

0
120
Member Avatar for The_Tiger
Member Avatar for ttback

For the past 2 days, no matter which Sharepoint web service I access via Python's suds lib, the remote service always returns 403 Forbidden. I'm using Python Suds 0.4 and Python NTLM 1.0. Suds 0.4 has built-in support for accessing Python NTLM. I followed the documentation from Suds's website on …

0
101
Member Avatar for layr

Hi, i need a simple python code which would trigger a command if there is an internet connection; if there isn't, sleep for some time and check again until there is. I found few examples, but they're all rather difficult to grasp and being new to python, I can't get …

Member Avatar for TrustyTony
0
3K
Member Avatar for NewbieXcellence

Hello everybody! I'm trying to produce a timestamp (system time) in windows (Python 2.7) with resolution equal to or better than microseconds. Calling time.time() repeatedly in a loop it appears it only updates in approximately 0.01 second increments. Using datetime.datetime.today() seems to show similar results. Anybody have a possible way …

Member Avatar for NewbieXcellence
0
488

The End.