Posts
 
Reputation
Joined
Last Seen
Ranked #758
Strength to Increase Rep
+4
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
9
Posts with Upvotes
9
Upvoting Members
6
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
4 Commented Posts
0 Endorsements
Ranked #864
~50.0K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Robbert

Hi Any one know how I can get the following function to return a value - thanks. [CODE]import threading import time def stringFunction(value): str = "This is string no. " + value return str thread1 = threading.Thread(stringFunction("one")) thread1.join() thread1.start() while threading.activeCount()>1: time.sleep(1) print thread1 [/CODE] Currently returns "<Thread(Thread, stopped)>" Not …

Member Avatar for sekmani
2
29K
Member Avatar for mahela007

Is it possible to keep writing the output of a program on the same line instead of moving to a new line every time? The output should be written over the preceding output. An example would be a kind of counter... say a number that counts from 1 to 10 …

Member Avatar for Lucaci Andrew
0
11K
Member Avatar for Roiti

Hello I am kind of a new programmer in python and I tryed to do a port scanner. I have a problem here but I can gigure it out' when I try to compile it it just gets stuck :S Here is the code [CODE] import socket as sk import …

Member Avatar for The_Kernel
0
241
Member Avatar for kjock002

[CODE]# PURPOSE: to calculate the sum of the first (n) odd counting numbers # # INPUT(S): the number (n) which will be the last number added to the sum # # OUTPUT(S): the sum of the first (n) counting numbers # # EXAMPLES: input: 23 ; output: 144 # input: …

Member Avatar for The_Kernel
0
3K
Member Avatar for Tech B

I've been working on facial recognition and have obtained a dll that can recognize faces in an image, and gives cordinates aswell. It came with an example program written in C++ and I'm trying to port it to python. Here is the C++ code [CODE] #include "windows.h" #include "loadbmp.h" // …

Member Avatar for Tech B
0
453
Member Avatar for eva yang

Hi, I don't know the difference between class variables and instance variables. Can anybody give me an example? Thank you so much:)

Member Avatar for eva yang
0
138
Member Avatar for doctorjo5

I know that this is an easy one but it is hard for me to figure out. I need to make a program that can: * Open the file and read through all of the lines in the file. (got this) * If a line starts with "Subject:", skip the …

Member Avatar for woooee
0
159
Member Avatar for herrschteiner

Good day, I am attempting to write a Python script that has a given hexadecimal value, and a given list of strings. The script randomly samples the list and pulls out 3, 4-string lists. The strings are joined, converted to integers, converted to hexadecimal values, added together and the sum …

Member Avatar for herrschteiner
0
218
Member Avatar for tziny

Hello, Do you know what is the regular expression for characters that are enclosed in quotes? E.g "python" "12345" Thanks

Member Avatar for The_Kernel
0
102
Member Avatar for sammakko

hi, my problem I can't solve: each of my two lists consists of an ID and runID. The output I need are those elements who are not in list2 and the max Value of runID of each ID. e.g. list1 = [('1101', '2'), ('1101', '3'), ('1101', '4'), ('4472', '2'), ('4472', …

Member Avatar for sammakko
0
86
Member Avatar for Hawkeye Python

Incomplete dice game function, dunno why does'nt works... If you're not using windows, change the dir. "C:/" [CODE] def bet(Bet): try: f = open('C:/money.txt') print f money = f.readline() f.close() print ('You have', money, 'Dollars. Wanna play dice(y/n)?') v = raw_input() if v == 'y': # here i'm printing those …

Member Avatar for The_Kernel
0
170
Member Avatar for msaenz

I have a dicationary [code=python] x={'symbol':LTV,'user':derek,'where':home,'time':night} [/code] Obviously when u print it the dictionary doesnt keep the order you put them in. how do i have a dictionary that has it the way i input them? I looked online, but not sure to you cmp, lambda, etc? Thanks for the …

Member Avatar for vegaseat
0
162
Member Avatar for baskar007

i am new to PyGtk. i don't know how to get realtime update on gtk. such as downloadmanagers show's every time the speed changes. here is my. in this code the "f='/home/tree.txt'" is a log file .this file regularly updated by another thread. i want to add the file contents …

Member Avatar for The_Kernel
0
691
Member Avatar for bol0gna

My file directory is full of filenames with "male" and "female" being part of them. I want to loop through the directory and distinguish between the two. [CODE] import os maleDataSets = 0 femaleDataSets = 0 females = [] males = [] filePath = "Dataset/parameter feature vectors" for file in …

Member Avatar for vegaseat
0
194
Member Avatar for tlj333

I read the guidelines on posting homework questions and I think this one is within the rules. A little background, currently taking my first computer program class, its an online class (big mistake), it's very hard to get feedback or assistance. I have been ripping my hair out trying to …

Member Avatar for tlj333
0
188
Member Avatar for simpatar

Here is my program: [I]#avg2.py # A simple program to average two exam scores # Illustrates use of multiple input def main(): print('This is a program to average two exam scores') score1, score2 = float(input('Enter two scores separated by a comma: ')) average = (score1 + score2) / 2.0 print('The …

Member Avatar for The_Kernel
0
161
Member Avatar for jmark13

So the Goal is: given a Nested list that contains 3 elements in each element in the nest, i.e. L1=[[1,2,3],[4,5,6],[7,8,9],[10,11,12]] how can I take a flat list, i.e. L2=[1,2,3,4,11] where if the elements within the nested list, i.e. L1[0], L1[1], etc. intersect with any single element in L2, the element …

Member Avatar for lukerobi
0
190
Member Avatar for willygstyle

Hello all. I been messing around with this port scanner for a while now and can't wrap my head around the speed issue. I tried to create a few threads to help speed it up, but I'm pretty sure I havn't made any progress. Could someone explain why the speed …

Member Avatar for willygstyle
0
150
Member Avatar for mahela007

Hi.. I would like to know how to create a variable while the program is being executed. Here's what should happen. The program asks for an input from the user and then creates a variable who's name is the value of the input and then assign's a value to it. …

Member Avatar for The_Kernel
0
254
Member Avatar for SoulMazer

Hi, I am writing a script that aims to help a person keep a list of characters while reading a book. In doing this, I am writing to a file and checking it constantly, except I ran into a problem. Say I executed a code block such as the following: …

Member Avatar for SoulMazer
0
1K
Member Avatar for joe82

hello everyone, my file has many long lines witth 12 ccolumns like: gnl|dbS|13484118 gi|62750812 100 16 .......around 12 columns gnl|dbS|13484888 gi|62750812 95 20 ....... gnl|dbS|22484118 gi|62750812 92 20 .......... I want to grab the lines where values of column 3 lies between 90 - 99.9 in the file and store …

Member Avatar for joe82
0
116
Member Avatar for johndoe444

Hi, I have this code: list = ['12 angry men', 'Rash &# xf4;mon'] [CODE]def func(list): ... for e in list: ... e = re.sub(' ?&# x([0-9a-f]*);',r'\x\1',e) ... print type(e) ... e = unicode(e,'iso-8859-1') ... print type(e) ... print e[/CODE] I get this output: [CODE] 12 angry men Rash\xf4mon[/CODE] whereas I …

Member Avatar for The_Kernel
0
164
Member Avatar for hughesadam_87

Hey guys, A while ago, with your help, I was able to create a code which scans a data file for names, and when a new name is found, it appends it to a list. For each entry is the list, the code then opens a new file for each …

Member Avatar for jlm699
0
1K
Member Avatar for akindo

Hi all. I am new to Python and have a problem regarding data structures. In my application I will be having several messages and my own type of IDs (Lamport clocks) to go with these messages. I will need to frequently ask for specific messages based on the ID. Hence …

Member Avatar for akindo
0
135
Member Avatar for brashli

I am taking a text file and trying to do calculations with it where the line in the file looks like this: 'Corn For Grain', 'Irrigated', '1970', 'Colorado', 'Chaffee', '8', '10', '15', '11199199', '1', '', '100 acres', '75 bushel', '7500 bushel', '', '' It has commas because it came from …

Member Avatar for The_Kernel
0
135
Member Avatar for dinilkarun

Hi All, I have the following string: "AND Category 07|Spec 01|ABC 01 AND Category 07|Spec 02|XYZ 02 AND Category 07|Spec 03|PQR 03 " It is stored in a string variable. I want to remove only the "ABC 01", "XYZ 02", "PQR 03", etc from the original string. The new string …

Member Avatar for dinilkarun
0
147
Member Avatar for hughesadam_87

Hey guys, I'm new to python so if this is a silly question, pardon me. I have the following basic assignment: Take a user-specified range of lines from some data file, call it input, and write them to an output data file. What I want to do is have the …

Member Avatar for The_Kernel
0
133