15,175 Topics
| |
Hi! :) As said in the title i try to get (as a string) the parent of a selected item, but i can't manage to do it. Of course i can easily retrieve the string of the selected item with GetItemText... But how do we retrieve its parent? Example: if … | |
[CODE]I have afile which has entries like BIG_CLUSTER106: cluster1150: CUB CUB CUB BIG_CLUSTER106: cluster1627: CUB Zona_pellucida BIG_CLUSTER106: cluster1632: CUB CUB CUB CUB CUB BIG_CLUSTER106: cluster1814: Kringle WSC CUB BIG_CLUSTER106: cluster2768: CUB CUB F5_F8_type_C F5_F8_type_C MAM DUF3481 BIG_CLUSTER106: cluster661: Astacin CUB CUB CUB CUB BIG_CLUSTER106: cluster687: CUB PDGF BIG_CLUSTER106: cluster701: CUB … | |
Hi, Below is the code I am compiling to a .dll & .lib but when I try to import the "Rand" module I get [B]ImportError: No module named Rand[/B], I renamed the .dll to .pyd then this error is removed but when I call the sub module Rand.myRand(10,30) it crashes … | |
[CODE]testingdays = testingData.getMeasurements() for day in testingdays: dayValues = [] dayValues[0].append(day.tempMean) dayValues[1].append(day.tempMax) dayValues[2].append(day.tempMin) dayValues[3].append(day.dewPoint) dayValues[4].append(day.humidMean) dayValues[5].append(day.humidMax) dayValues[6].append(day.humidMin) dayValues[7].append(day.pressure) dayValues[8].append(day.meanWindSpeed) dayValues[9].append(day.maxWindSpeed) dayValues[10].append(day.maxGustSpeed) dayValues[11].append(day.visibility) [/CODE] this is my code and when i try to run it i get the error message: "Traceback (most recent call last): File "main.py", line 166, in <module> … | |
I've just bought a reasonably capable quad core desktop and I want to start utilizing some of the advantages that multi core processing can offer. I have two simple counting functions, and I would like them to execute simultaneously. Does anyone know where I can start my research into the … | |
using pysnmp I am querying a variable which gives the IP address. I want to check that address. I do the following [CODE] ........... ............ ............. errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxx', 'yyy', 1), cmdgen.UdpTransportTarget((addr,161)), ((1,3,6,1,4,1,18489,1,2,2,2,9,30,0))) print"Error on GET for ccmSDIDULinkUtilEastRemoteIP -%s,%s%(errorIndication,errorStatus) print varBinds print varBinds[0][1] [/CODE] i get … | |
Hi, I was hoping someone could help out a python novice like me. I want to find in my data when there is three or more 1s in a row. This is a sample of what my input data would look like below. With the first number in each column … | |
hi all ...... import os os.system("ps") i want to kill two particular process i.e, log and snmp .....how to kill it , can anyone can plz help me:) thanks in advance | |
Hello! I am trying to create a tabbed program with Pyqt4. The idea is that I want to be able to add python scripts in a folder. Those scritps should be then be accessible from a main framework/program. Finally, when I run the python script I want the window to … | |
Not my code but I think free to share. This is intended as beginning point of learning classes or learning data structures. Read the document [url]http://mcsp.wartburg.edu/zelle/python/python-first.html[/url] As first exercise, this does not work instead of the while loop in test part: [CODE] for i in numbers: print i [/CODE] [QUOTE] … | |
Hi all. This is my first post and i am bit new to python. Pls dont mind if my question is dumb, kindly guide me I am writing a pexpect script (i am using linux Centos 5.5) to access my cisco router and want to record the output of "show … | |
hi all.. I need to issue a 'ping' to an ip address via my script and check whether it is up? can I issue it using os.system? can I capture the output and analyze to see if the host is up?? | |
This code changes anum but it should not?? What is going wrong? Many thanks >>> astr=['a','b','c','d'] >>> anum=[4,3,2,1] >>> anew=anum >>> for c,d in enumerate(anum): ... anew[c]=astr[c] ... print(anew,astr,anum) ... ['a', 3, 2, 1] ['a', 'b', 'c', 'd'] ['a', 3, 2, 1] ['a', 'b', 2, 1] ['a', 'b', 'c', 'd'] … | |
Hi I would like to create a daemon python process in windows which will spawn 8 processes out. Whenever, there is a job, it will be pushed to the queue and the job will be run. If the full 8 processes are been utilised, then the jobs will remain in … | |
Hi all, In my current project, I need to write python code extracting tons of pages grabbed from the web. By extraction, I mean strip all tags and comments and if possible, filter out small sections like navigation links. The only thing should be left is the length paragraph, if … | |
am working on creating a python script to find Installed programs in Uninstall folder in registry, the script works perfectly fine on 32 bit machines but errors out with a wmi error on 64 bit machines. Am not able to get hold of a wmi module for python on 64 … | |
This Python snippet shows you how to take typical beginner's example of prime number function and work on improving its speed. The decorator function for timing is ideal tool to follow your progress you make. The improvements are commented and you are encouraged to make further improvements. Python is fun! | |
hello, i want use wx.ScrolledWindow() in wx.Dialog() but i dont now how, i use two, three sizer's and nothing ... my code is to long, i search simple example! i must scroll this dialog -> [url]http://www.bankfotek.pl/image/915282.jpeg[/url] thanks | |
Hello all, suppose I have a string which i have retrieved using the regex like the following [CODE] string_feature = '<div class="BVRRLabel BVRRRatingNormalLabel">Customer Rating</div><div class="BVRRLabel BVRRRatingNormalLabel">Value for Price</div> <div class="BVRRLabel BVRRRatingNormalLabel">Picture Quality</div> <div class="BVRRLabel BVRRRatingNormalLabel">Ease of Use</div> <div class="BVRRLabel BVRRRatingNormalLabel">Features</div>' [/CODE] What will be the regular expression to get the … | |
continued from this thread! [url]http://www.daniweb.com/software-development/python/threads/353210[/url] i have a file which i am currently working on which will remove all pipes and replace them with a comma. that all works fine it the second bit i am currently stuck on.. i need to remove the first two CAPITAL letters from the … | |
please bare with me as im a returning newbie and have not really used re.expression much and still get very confused! my problem! i am currently working on a few database records which need appending. this is one of the files i need to resort the data base has now … | |
I'm trying to create two for statements,but only one of them runs >.< it's supposed to obfuscate username AND passwords.. Also is there any way to simplify it rather than have two for statements..? The only difference in the second for statement is "Username" and "username" changed to "Password" and … | |
Hi everyone I am using subprocess module. I called external script by using module subprocess. Now I want to use the output of the external program back in python script. Can anyone help me on this? any good tutorial? I tried doug hellmans ([url]http://blog.doughellmann.com[/url]) blog small example would be great. … | |
I'm writing a code to minimize a function and I'm having problems storing the new move. [CODE]import math import random #minimze the function: def f(x): return math.pow(x,2) + math.sin(10*x) x_list=[] energy_list=[] g=2 #starting position def move(): #Generate a random move random.uniform(-0.5,0.5) def energy(): h=g+move() #generate random move E = f(g)-f(h) … | |
Is it possible to read and write to a queue at the same time? for example, one thread is using put() and another thread get() on the same queue? When threading, I've added the task_done() but queue.join() seems to wait for all jobs to finish before the main thread continues. | |
Hi, I am new to python and am wondering is it possible to name a method after a variable. I know I can name a variable after another variable using [code=python] test = "temp" vars()[test] = 123 print temp [/code] this will print 123. so I was thinking something like … | |
Hi, myself and two of my friends are creating a game that imitates that of Whack-a-mole. I am trying to implement code so that when I click on the mole with the mouse, the image changes to a different image, eg. the image when just moving the mouse is a … | |
[CODE] class Player(object): def __init__(self): self.points = 0 def add_points(): plyr1.points += 1 plyr2.points += 1 plyr3.points += 1 if __name__ == '__main__': (plyr1, plyr2, plyr3 = (Player(), Player(), Player()) add_points()[/CODE] How could the 3 lines in add_points() be written better/shorter? | |
Hey All, am looking for a way to break an xml Tag line into tag and attributes. Say I have This line [code=xml] <event time="12:30" value="This is a Sample Value" type="event"> </event> [/code] I have this so far [code=python] # Open file to read f=open("myTest2.xml") #start reading File for line … |
The End.