15,185 Topics

Member Avatar for
Member Avatar for you2

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 …

Member Avatar for Gribouillis
0
98
Member Avatar for Dan08

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 …

Member Avatar for Dan08
0
588
Member Avatar for iamthwee

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 …

Member Avatar for miesnerd
0
1K
Member Avatar for southafrica1

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 …

Member Avatar for shibby
0
700
Member Avatar for pads_irl

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

Member Avatar for sneekula
0
61
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
380
Member Avatar for bsutcliffe

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 …

Member Avatar for Stefano Mtangoo
0
111
Member Avatar for taco1234

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 …

Member Avatar for Gribouillis
0
65
Member Avatar for LennieKuah

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 …

0
63
Member Avatar for foosion

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 …

Member Avatar for foosion
0
372
Member Avatar for miesnerd

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 …

Member Avatar for Mathhax0r
0
241
Member Avatar for foosion

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 …

Member Avatar for foosion
0
371
Member Avatar for blah32

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

Member Avatar for Gribouillis
0
123
Member Avatar for Mathhax0r

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 …

Member Avatar for woooee
0
112
Member Avatar for alex-VX

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 …

Member Avatar for woooee
0
85
Member Avatar for cohen

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

Member Avatar for leegeorg07
0
130
Member Avatar for nunos

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

Member Avatar for nunos
0
184
Member Avatar for Syllabus

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 …

Member Avatar for vegaseat
0
1K
Member Avatar for nunos

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 …

Member Avatar for nunos
0
83
Member Avatar for Zebibyte

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

Member Avatar for Gribouillis
0
127
Member Avatar for flipjoebanana

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 …

Member Avatar for zachabesh
0
115
Member Avatar for nunos

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

Member Avatar for nunos
0
409
Member Avatar for DustinS

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 …

Member Avatar for Gribouillis
0
108
Member Avatar for wasala

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 …

Member Avatar for wasala
0
147
Member Avatar for nunos

[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): """ …

Member Avatar for nunos
0
190
Member Avatar for kessenchu

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

Member Avatar for jlm699
0
519
Member Avatar for yuguang

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 …

Member Avatar for yuguang
0
115
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
128
Member Avatar for chrischavez

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 …

Member Avatar for woooee
0
197
Member Avatar for darangho

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 …

Member Avatar for bumsfeld
0
127

The End.