15,181 Topics
| |
Hello, I have a huge file with the following kind of lines: A,B,C 1,2,3 D,E 4,5 What is efficient way to split and get the following output using python? A 1 B 1 C 1 A 2 B 2 C 2 A 3 B 3 C 3 D 4 D … | |
| Im getting errors with this, please advice me on what to do: [CODE]def displayHappy(): numLimit = input("Enter a positive integer: ") countHappy = 0 countUnhappy = 0 liHappy = [] for num in range(1, numLimit + 1): inNum = num while inNum != 1 and inNum != 4: inNum = … |
Hello all, I am currently teaching myself Python 3 and came across a project at work that would be ideal for this. The department in which I work is an IT support desk with a number of us taking calls and providing support to end-users. There is a field in … | |
Hi there I am translating PERL code into python and i am new on both language.I have one question if we have hash key reference in PERL like this way $a->{b} how we can traslate it into PYTHON? and if we have this code $a->{$b} , how we translate it … | |
I have an excel spreadsheet that has 2 used columns. Using Python I have to read the data in those to columns. So far I have a code that lists the item in column A and B on Python GUI. Once that is done I have to write code so … | |
I posted a snippet about using a microcontroller as a mouse, and it works great, but it moves the mouse as a stepper motion. How would I go about making it velocity driven? Like when I tilt the accelerometer further, the faster the mouse moves. I've seen it on youtube, … | |
Many new computers come with Windows7(64bit) OS. You will be tempted to install something like Python 3.1.1 64bit version. However, many packages like PyQT and PyGame don't offer 64bit versions yet and will not work! | |
I'm having troubles understanding global variables in python. I am trying to keep track of when a function gets called and once it does I want it to be unavailable to the user. However for some reason its not working :\ [CODE] psycStat = False def main(): form = cgi.FieldStorage() … | |
Does anybody know of any libraries or scripts or even code snippets that can generate HTML code from a diff or comparison of the contents of two files? I know of the HtmlDiff class in difflib, but the format it outputs is not the one I want (it puts both … | |
I am new to python . The QList widget contain the list of files in a directory ...I want to select the name of the file and store it in a variablle.....How can i do that?... | |
[CODE]x = self.spinbox37.value() * 40 y = self.spinbox38.value() * 40 printer = str(self.comboBox4.currentText()) print_cmd = 'echo "IN;PU" x "," y | lpr -P %s %s' self.LCDNumber18.display(x) self.LCDNumber19.display(y) #print_cmd = 'echo "IN;PU2100,11300;" | lpr -P %s %s' os.system(print_cmd % (printer, ""))[/CODE] In the above line I'm trying to use the x … | |
I m trying to sending the data over TCP/IP by segmenting it into different sizes ....with 10KB and 100KB the data is tranferring perfectly but when I segment it to 500KB ..it transfer sometime perfectly and sometime it failed by giving error socket.error: [Errno 104] Connection reset by peer | |
Hi there, I am using elementtree to read xml, if xml file contains "-" i am getting error. Is it possible to read without any error? Plz give me code to read xml, if u have. Thanks -Shyami | |
Hi, I have jest started learning Python. I would like to get some help on writing a script that would delete a data of lines only key from array which looks like this : [CODE]['192.168.255.1 00:01:02','[COLOR="Red"]172.14.0.1 00:0f:01','172.14.0.1 01:ff:dd:34'[/COLOR] ,192.168.255.3 00:dd:01:ff[/CODE] [B] I want delet red data only [/B] | |
[CODE]# File: Manager.py from Tkinter import * class Manager: def choose(self,master): tasksf=Frame(master) tasksf.grid(row=1,column=0,padx=3,pady=3) Label(tasksf, text="Task ID:").grid(row=0,column=0,padx=3,pady=3) Label(tasksf, text="Description:").grid(row=1,column=0,padx=3,pady=3) Label(tasksf, text="Start Date:").grid(row=2,column=0,padx=3,pady=3) Label(tasksf, text="Deadline:").grid(row=3,column=0,padx=3,pady=3) self.tid=Entry(tasksf) self.tdesc=Entry(tasksf,width=25) self.tstart=Entry(tasksf) self.tdead=Entry(tasksf) self.tid.grid(row=0,column=1,padx=15,pady=5,sticky=W) self.tdesc.grid(row=1,column=1,padx=15,pady=5,sticky=W) self.tstart.grid(row=2,column=1,padx=15,pady=5,sticky=W) self.tdead.grid(row=3,column=1,padx=15,pady=5,sticky=W) def asdfg(self,master): print "dsgsfd ",v def __init__(self,master): master.title("Manager") menuf=Frame(master) v = IntVar() Radiobutton(menuf, text="Tasks", variable=v,indicatoron=0, value=11,command=self.choose(master)).grid(row=0,column=0,padx=5,pady=5,ipadx=5,ipady=5) Radiobutton(menuf, text="Meeting", variable=v,indicatoron=0, … | |
I was wondering is there a good IDE for python /wxpython/pygame? I was wanting something that would do all 3 very good, for when I do finally jump to a GUI... I was messing around a little with pygame, and I noticed it dose not like the python IDLE... | |
Does anyone have a code example for using the mouse wheel with the Tkinter GUI toolkit handy? | |
I have a series of rules that I want to be able to execute without having to manually edit the code. I'd like to give my rule conditions at the beginning and have the program run it. This way, I can test every single rule combination in a for loop … | |
| How do you make a function repeat itself using a while statement. Here's the function: [CODE] # the function accepts any positive integer parameter and returns the sum of # the squares of its digits. def zap(intNum): total = 0 while intNum != 0: last = intNum % 10 total … |
I used [URL="http://www.parallax.com/Store/Education/KitsandBoards/tabid/182/CategoryID/67/List/0/SortField/0/Level/a/ProductID/313/Default.aspx"]Parallax's Basic Stamp Homework Board[/URL] and an [URL="http://www.radioshack.com/product/index.jsp?productId=2909788"]accelerometer[/URL] to use as a mouse. It works better than I thought it would. [URL="http://sourceforge.net/projects/pyserial/"]PySerial[/URL] is used to grab the debugged values from the stamp. The circuit is compiled of two push buttons, 2 LEDs to tell when a button is … | |
I am new to programming in Python and I am just wondering if I could have some help. I am trying to write a program which creates diary entries for events and I am currently trying to convert the raw_input from the user into a date (yyyy/mm/dd) and time (24hr … | |
Hello. First of all i'm compete newbie in the python. And second i was wondering for some time what does the value 'i" do in python or is it a value at all? I'm sorry if i'm pre-posting a question that have been answered already. This is the example : … | |
can anyone tell me what i did wrong with the decryption part of this code? ive been looking at it for some time now (while working on other related stuff), and i cant seem to find the problem with it. its getting really retarded, on my part [B]and this is … | |
hey guys i was wondering if anyone knew of any tutorials on how to get Python to read and open a XML text file? any help would be much appreciated as i cant seem to find anythign!!! kitty | |
Hi, I have installed Python2.6 and wxPython. I wish to use wxPython together with Matplotlib to generate times series graphs. I am unable to install Matplotlib it always throws the following error "Python 2.6 required, but not found in registry". Please help me | |
Hi Is there a way to hide the python source code from being copied or hacked? I am planning to write and distribute some python code to my team, but I would prefer not to reveal the code. Is it possible in Linux? In windows I wud probably create an … | |
Is there a way to grab values from a basic stamp with python? I just bought a Accelerometer and want to read the values with python. | |
Hi, I try to convert a tuple into binary number but I keep getting the error like"ord() expected string of length 1 but tuple found" Can anyone help me in this? | |
Oh do I need some serious help! lol. I'm working on a phone book in python. For some reason when I select the option, enter....say....the last name, even though it's on the file that my program is reading it tells me that it's not there. Can somebody please look at … |
The End.