15,185 Topics
| |
I need some help on how to draw graph at runtime in Python. I have logs running continuously which gives me CPU consumption value vs timestamp in a LOG file. (I'm able to parse these two values and create a dictionary entry for each timestamp vs CPU value.) Now I … | |
Hi everyone, I am doing a program with python on Windows Vista, and I've put a entry in my program, now what I need to do is only allow the user to write number, if the user tries to write anything apart from numbers and commas, appears a message box … | |
| As the title suggests how? I have successfully used pyExcelerator to convert an xls file to csv, 1) I downloaded the pyExcelerator file. 2) Extracted it and put the file under C:\Python25\Lib\site-packages 3) Then I ran the example script xls2csv.py example.xls > comma.csv but I would like to know how … |
Hey All I'm having trouble making executables with py2exe. I'm using Python 2.6 and I'm trying to make the simple 'Hello World!' program work as an executable. My setup script is as follows: [code=python]from distutils.core import setup import py2exe setup(console=['hello.py'])[/code] When I run the setup script in the command prompt … | |
Hi all, I was hoping to get some help with a problem I have. I have a function that is outputting this result: test = [[11,22,33,44,55,66]] which I have reason to believe is a nested array? eg. [[11,22],0] or something like this. My question, is it possible to manipulate 'test' … | |
Hello guys, Please help me with wxTreeCtrl events (I have never dealt with TreeCtrl before). I want to get simple basics how to catch events As example to clarify my question, I have tree of books and I want just the TextCtrl to display the chosen parent and Item, like … | |
I am writing an application in wxPython. It uses an XML file which populates a tree. When the application initialises it passes the XML file through xml.sax and stores all the data in a series of lists and dictionaries. One crucial element of the application is that a user can … | |
is there anyway to repeat a function every so often without using a while True: loop? im asking because in my GUI's they dont respond when proccessing large amounts of information. I want to display the information in real time without waiting for the while True loop to exit. Thanks … | |
Hi there, When I add a new row into the DataSet, the first time it works good but after the first time I added another row it's not working instead it generate this error message : "Update requires a valid Insertcommand when passed datarow collection with new rows" This is … | |
Does the documentation mean what it says? The 3.1 library reference says quopri.encodestring takes a string, but feeding it a string results in an error. [QUOTE]quopri.encodestring(s[, quotetabs]) Like encode(), except that it accepts a source string and returns the corresponding encoded string. [/QUOTE] However, feeding this a str results in … | |
Hey- I'm pretty new to python, and have a relatively simple task but I dont know the specifics about how to complete this task. I work in a research lab and part of the lab I'm not usually associated with uses a program that outputs data in a .txt file … | |
The following fails with an error message about not being able to encode the euro char. It works fine without the €. I have the feeling I'm missing something simple here, but can't figure it out. A fix would be appreciated. I'd like to use this in 2.5.4 and 3.1 … | |
Hello, I am not getting this sorting in python 3 with a key. If I don't use the key I get: [CODE] sorted_ent_list = entry_list.sort() TypeError: unorderable types: entry_T() < entry_T() [/CODE] If I do use a member function to return private variable from entry_T class, then it says [CODE] … | |
I just started learning Python last week, and I was having a few issues with doing a GUI app in Tk. My main problem is this: I have a list (each member of the list is a frame with a picture and some text in it) that populates itself by … | |
hello im new here on the forum.. so im using phyton 2.5.4 and i need help to finish this count loop [CODE=Python]while not inloged and not ended: sleep(1) print Time Time = Time - 1 if Time == 0: # os.system("shutdown -s") ended=True[/CODE] so now the count works good but … | |
I need help with a task: [QUOTE]For example, given the input: [CODE]doubloons[/CODE] your program should output: [CODE]Yarrrrrrr[/CODE] [/QUOTE] I don't know how to do the python script. I have never done Python before. Cohen | |
Hi I would like to know if there is any way to obtain a float result from a division between two integers other than using "from __future__ import division"? I am not looking for the .0 'trick'. Example 4/5.0 = 0.8. I want to be able to do 4/5 = … | |
Hi! I'am trying to make a program that dispalys a label with a image, but the rest of the program is "invisible", The problem I got is when I set the opacity, it affects the whole frame. This was ofcourse excepted, but I have not yet been able to make … | |
Hi. I am asking help for something that I have already done. However, I believe there is a much better way to do it. I am pretty novice to python and I don't know (yet xD) all of its capabilities and I am sure some of you will find this … | |
In an attempt to make my if statements cleaner, I figured out a simply way of making them quite a lot shorter. Instead of doing this: [code=python]elif talk_in == "quit" or talk_in == "q" or talk_in == "exit" or talk_in == "x":[/code] I can do this: [code=python]elif talk_in == ("quit" … | |
If I have a string, i.e.: s = "'Quote Example'\tby person\n" How can I display it to view the special characters untranslated, to see: "'Quote Example'\tby person\n" instead of: 'Quote Example' by person I need to know mostly for debugging purposes since the string is generated and doesn't follow a … | |
(a | b): For what I have read in other forum post, if a is true, python doesn't evaluate b an returns a. (a & b): What happens with logical and? If a is false, does python evaluates b or not? Thanks for your help. | |
The "exec" function seems to literally execute strings as code in a Python shell: >>> exec("a=2") >>> a 2 >>> However, when I tried this function from within a tkinter form, the variables were no longer accessible via their original names: a=1 #initialize the variable "a" exec(str(CodeTextBox.get())) # I entered … | |
Hi I am developing a spell checker for my language, and I came across solving an interesing problem. It would be great if you can suggest me an optimized solution for the problem described below: I have certain group of letters like these: Group #1: c,r,b Group #2: a,z,k Group … | |
[code=python] class ExcelDocument(): """ Some convenience methods for Excel documents accessed through COM. """ def __init__(self, visible=True): self.app = Dispatch("Excel.Application") self.app.Visible = visible self.sheet = 1 def new(self, filename=None): """ Create a new Excel workbook. If 'filename' specified, use the file as a template. """ self.app.Workbooks.Add(filename) def open(self, filename): """ … | |
I don't want to disturb you, but I don't understand how works the properties. I mean, using this simple code: #!/usr/bin/env python2.6 def cosas(self, width): return "cosas" class Rect(object): def __init__(self, width, height): self.width = width self.height = height self.area = 0 print "Adios" @property def _area(self): return self.width * … | |
My program doesn't make it pass these lines on one computer: [code] import re, os, glob, time os.chdir('/Software/xampp/htdocs/catalog/temp') file_list = glob.glob('Full-EP*.txt') file_dict = dict([(os.stat(a_file).st_mtime, a_file) for a_file in file_list]) date_list = list([key for key, value in file_dict.items()]) s = file_dict[max(date_list)] datePattern = re.compile(r'^Full-EP(\d{4})(\D{3})(\d{2})-(\d{2})(\d{2}).txt$') webdate = datePattern.search(s).groups() metadata = os.stat('WEB-Price-List.txt') dbdate … | |
I have read a little bit on XML and I will need it to get some information from already available XML files. I would like to learn it by making very small playlist. However I have encountered the two beasts. I don't know much of XML, especially with python. So … | |
hello im not very experienced with python so sorry for any bad code i am running ubuntu 8.10 and using pyserial i have made a script that reads the serial input from an arduino if you are not familier with an arduino here is there website [URL="http://www.arduino.cc/"]http://www.arduino.cc/[/URL] for some reason … | |
Hi, all Is there a way to get strings line by line from tk Text box? I know there is readline for files, but i don't see anything like that for tk Text box. Only thing i see is text.get(float(index1), float(index2)) but it seems unhelpful in my case, although it … |
The End.