Re: Asyncio -- delayed calculation

2016-11-28 Thread Zentrader
Take a look at Doug Hellmann's example using multiprocessing at https://pymotw.com/2/multiprocessing/basics.html You should be able to substitute the count down example directly into the first example. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread Zentrader
I don't know anything about asyncio, but multiprocessing would be my tool of choice. The first example should be enough for what you want to do at https://pymotw.com/2/multiprocessing/basics.html -- https://mail.python.org/mailman/listinfo/python-list

Re: for with decimal values?

2009-05-03 Thread Zentrader
There is no need for a function or a generator. A for() loop is a unique case of a while loop ## for i in range(-10.5, 10.5, 0.1): ctr = -10.5 while ctr 10.5: print ctr ctr += 0.1 -- http://mail.python.org/mailman/listinfo/python-list

Re: backup with python

2008-09-16 Thread Zentrader
Depends on what OS you are using. The easiest way would be to tar the files you want to backup into an empty directory and then have the python backup program call whatever DVD write program you have on your system with the appropriate commands and your backup directory. --

Re: (in memory) database

2008-09-02 Thread Zentrader
I don't understand why Cameron has a different version of Python which doesn't seem to have sqlite support enabled. Agreed, but won't the package manager tell him if python-sqlite is installed? That would be the next step since it appears that SQLite intself is already installed. Since Ubuntu

Re: (in memory) database

2008-09-01 Thread Zentrader
On Ubuntu you want to install something like python-sqlite (a search for python should turn up everything). There are 2 parts to this, SQLite and the python bindings to SQLite. So you seem to have SQLite installed but not the Python bindings. Also, on some systems you have to have python-sqlite

Re: conflict between multiple installs of python (linux)

2008-07-07 Thread Zentrader
On Jul 5, 11:09 am, david [EMAIL PROTECTED] wrote: You learn something new every day: On my ubuntu, update-manager is supposed to use the python2.5 installed on /usr/bin. Well, I had subsequently installed a whole bunch of stuff in /usr/local (/usr/local/bin/python and /usr/local/lib/

Re: list previous or following list elements

2008-06-28 Thread Zentrader
To be completely correct, you should allow for the possibility that the word found is the last word in the list for j, word in enumerate(words): if (word.startswith(b)) and (j+1 len(words)): print words[j+1] break -- http://mail.python.org/mailman/listinfo/python-list

Re: People still using Tkinter?

2008-05-10 Thread Zentrader
I like New Mexico Tech's site as well. Also, take a look at the PMW extension for additional widgets, and TkTable and/or TableListWrapper. http://infohost.nmt.edu/tcc/help/pubs/tkinter/ -- http://mail.python.org/mailman/listinfo/python-list

Re: List question

2008-03-22 Thread Zentrader
if ('one', 'two') are in f: ... are gives me an error in Python 2.5 with a from future import * statement included. What version and platform are you running. Also, the docs don't mention it. http://docs.python.org/ref/keywords.html -- http://mail.python.org/mailman/listinfo/python-list

Re: List question

2008-03-22 Thread Zentrader
On Mar 22, 10:07 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Mar 22, 4:38 pm, Zentrader [EMAIL PROTECTED] wrote: if ('one', 'two') are in f: ... are gives me an error in Python 2.5 with a from future import * statement included. What version and platform are you running. Also

Re: List question

2008-03-22 Thread Zentrader
No one meant to laugh at you. Your naivete was not obvious. FWIW, a sense of humor is a valuable possession in most Python-related conversations. Perhaps someone can explain how telling something like this to the OP, who thinks this statement will work if 'one' and 'two' in f: is funny and

Re: Floating point bug?

2008-02-15 Thread Zentrader
I disagree with this statement quoteBut that doesn't change the fact that it will expose the same rounding-errors as floats do - just for different numbers. /quote The example used has no rounding errors. For anything less that 28 significant digits it rounds to 1.0. With floats 1.0/3 yields

Re: Floating point bug?

2008-02-14 Thread Zentrader
That's a misconception. The decimal-module has a different base (10 instead of 2), and higher precision. But that doesn't change the fact that it will expose the same rounding-errors as floats do - just for different numbers. import decimal as d d = d.Decimal d(1) / d(3) * d(3)

Re: boolean decisions

2008-02-05 Thread Zentrader
and then choose the solution with the shortest number of terms or something Experience says that one should not assume that there is a one to one relationship, (the solution). Some event can trigger more than one combination of the 6 binary input variables. And experience says that the business

Re: Does anyone else use this little idiom?

2008-02-03 Thread Zentrader
Not to me. If I read for _ in ..., I wouldn't be quite sure what _ was. Is it some magic piece of syntax I've forgotten about? Or something new added to language while I wasn't paying attention (I still consider most stuff added since 1.5 to be new-fangled :-)). +1 to forgotten about +1 to

Re: How to convert markup text to plain text in python?

2008-02-02 Thread Zentrader
On Feb 1, 8:07 am, geoffbache [EMAIL PROTECTED] wrote: I have some marked up text and would like to convert it to plain text, If this is just a quick and dirty problem, you can also use one of the lynx/elinks/links2 browsers and dump the contents to a file. On Linux it would be lynx -dump

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Zentrader
On Feb 1, 6:27 am, Connolly [EMAIL PROTECTED] wrote: Hey, Right basically I've got to the end of my main section of my program an I've got it comparing the same dictionary to ensure that the values are the same (sounds stupid I know), yet what my line of code I am using to do this is failing

Re: error/warning color customization in interactive console?

2008-01-16 Thread Zentrader
On Jan 15, 5:44 pm, yhvh [EMAIL PROTECTED] wrote: Is it possible to output error messages in a different color? I'm using Terminal on Gnome. For the few times that I want to do this, this simple form works with xterm. for j in range(1,10): os.system(tput setaf +str(j)) print test for , j

Re: executing newgrp from python in current shell possible?

2008-01-09 Thread Zentrader
On Jan 9, 5:56 am, Svenn Are Bjerkem [EMAIL PROTECTED] wrote: I have been looking for a way to execute this command as a part of a script, but it seems that the changes are only valid in the context of the script and when the script exits, the current shell still have the original users group

Re: import zlib in 2.5 fails

2008-01-04 Thread Zentrader
On Jan 4, 2:19 am, stuntgoat [EMAIL PROTECTED] wrote: import zlib works in Python 2.4 (debian etch AMD64 - default python version for that distro) I built python 2.5 from source; zlib is not importable. 2.5 has been available for some time in the Debian repositories. Installing the .deb may

Re: at what complexity, a comparison fails ?

2007-12-31 Thread Zentrader
On Dec 31, 2:45 am, Stef Mientki [EMAIL PROTECTED] wrote: So what I need was something like: if A != A_prev : ... do something A_prev = A If A_prev is not declared prior to the if statement, you will get an error when you try to compare the non-existing variable to A.

Re: Building Python statically on linux

2007-12-27 Thread Zentrader
On Dec 27, 8:21 am, Christian Heimes [EMAIL PROTECTED] wrote: Micah Elliott wrote: I'm ./configure-ing with --disable-shared (because this must mean enable static, right?) I think you can just add -static to the gcc Flag line in the makefile. man gcc should also be helpful but that is a

Re: Happy Christmas Pythoneers

2007-12-26 Thread Zentrader
Bah, humbug And if you're not a Christian it would be Type Error bug. Anyway, happy New Years as well to all in the group. -- http://mail.python.org/mailman/listinfo/python-list

Re: where is uno?

2007-12-20 Thread Zentrader
It's installed by default with Python 2.5 on Ubuntu. Actually it is a link to /usr/share/pycentral/python-uno/site-packages/uno.py so first do a search for uno.py. If not found post back. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where best to put local modules?

2007-12-20 Thread Zentrader
Wherever it is physically located, I would suggest linking the dir to / usr/lib/python/site-python (on a Linux system). AFAIK the sole purpose of this dir is for the type of thing you are describing. On my system it also gets copied when Python is updated. What permissions you give the dir is

Re: How to generate pdf file from an html page??

2007-12-16 Thread Zentrader
I'm sure it can be done but there is no reason to reinvent the wheel unless it's for a programming exercise. You can use pdftohtml and run it from a Python program if you want. http://pdftohtml.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate pdf file from an html page??

2007-12-16 Thread Zentrader
Sorry, I read that backwards. I do it the opposite of you. Anyway a google for html to pdf python turns up a lot of hits. Again, no reason to reinvent the wheel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pascal code checker!

2007-12-13 Thread Zentrader
The OP was not talking about a Python program to check the Pascal program as I read it to make application in python that would send code (text) to pascal compiler...and it would return result and then application would show that result. So he/she/it would want subprocess to compile the

Re: looking for gui for python code

2007-12-13 Thread Zentrader
Whatever you use, it has to have a Python binding. Spectcl may or may not as you may be able to use it with the tkinter binding, but that is doubtful. Most GUI toolkits have an existing app to look for files in a directory, if that is what you are wanting to do. The following link is to the GUI

Re: Pascal code checker!

2007-12-12 Thread Zentrader
You can use subprocess to run the pascal program and capture the output/results. See here http://blog.doughellmann.com/2007/07/pymotw-subprocess.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Python deques linked lists?

2007-12-10 Thread Zentrader
Instead of linking records together via some key, I first try out a dictionary of lists. The list for each dictionary key would be the same as a list with a single, forward link. If you have relatively few records per key, it works well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-07 Thread Zentrader
If we use minutes from 2001, then 3566839 comes out as sometime in October, 2007 (6.78622 years). Close but no cigar. Is anyone familar enough with Excel to translate the formula or do we have to go a- googling? -- http://mail.python.org/mailman/listinfo/python-list

Re: What is python?????

2007-11-18 Thread Zentrader
Damn! I joined this group because I thought it was a pie-a-thon. All that practice has now gone to waste/waist. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE

2007-11-03 Thread Zentrader
This is a discussion on the Ubuntu forums-something like 51 pages worth. Even though you are using Gutsy, you want to take a look at KDevelop. It will install without problems even though it is KDE. A lot of people use Geany or Eclipse also. Anyway, you can page through as much of this thread

Re: Delete all not allowed characters..

2007-10-25 Thread Zentrader
allowed = [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Þ', u'þ', u'Ö', u'ö', u'Ü', u'ü', u'Ç', u'ç', u'Ý', u'ý', u'Ð', u'ð', 'A', 'C', 'B', 'E', 'D', 'G', 'F', 'I', 'H', 'K', 'J', 'M', 'L', 'O', 'N', 'Q', 'P', 'S', 'R', 'U', 'T', 'W', 'V', 'Y', 'X', 'Z', 'a', 'c',

Re: Delete all not allowed characters..

2007-10-25 Thread Zentrader
And my problem this function replace the character to but i want to for example: input: Exam%^^ple output: Exam ple I want to this output but in my code output Example I don't think anyone has addressed this yet. It would be if chr found_in_allowed_set: output_string += chr

Re: while statements

2007-10-16 Thread Zentrader
O while cal =0: #Prompt for calories cal = input(Please enter the number of calories in your food: ) if cal =0: print Error. The number of calories must be positive. #Prompt for fat fat = input(Please enter the number of fat grams in your food:

Re: Really basic problem

2007-10-08 Thread Zentrader
You can use Python's decimal class if floating point arithmetic is not exact enough import decimal status = decimal.Decimal( 0 ) for i in range(10): status += decimal.Decimal( 0.1 ) if status == decimal.Decimal( 0.1 ): print status elif status == decimal.Decimal( 0.2 ):

Re: question about for cycle

2007-09-29 Thread Zentrader
On Sep 29, 8:19 am, George Sakkis [EMAIL PROTECTED] wrote: On Sep 29, 10:34 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On 29 sep, 12:04, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: for i in generator_a: # the first for cycle for j in

Re: Creating Table using Tkinter

2007-09-27 Thread Zentrader
Two existing solutions are TableList + TableListWrapper (Google for it), and MultiListBox http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52266 In both cases you send the program the titles and data and the program takes care of all of the details. BTW, you can attach a scrollbar to any

Re: ValueError: too many values to unpack

2007-09-27 Thread Zentrader
On Sep 27, 9:46 am, Shawn Minisall [EMAIL PROTECTED] wrote: I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that

Re: Nested For and While Statements

2007-09-25 Thread Zentrader
Scope had to do with visibility and not with how memory was allocated. Scope means, can this line of code access that block of memory. Note that in list comprehension, [x for x in (1, 2, 3)], the for loop allocates memory the same way, but the scope changes so that x is visible outside the for

Re: Nested For and While Statements

2007-09-24 Thread Zentrader
Your for loops both use the same counting index. Since those variables are local to the for loop, theoretically it should work with both loops using the same variable. Although bad practice, I tested it on my machine and the following code does indeed work as expected, so it appears that the

Re: Nested For and While Statements

2007-09-24 Thread Zentrader
In addition, for is lower case, i.e not For. If this doesn't solve the problem then please post the actual error message. Next Line hits snag here? Where should this line be? is not specific enough. -- http://mail.python.org/mailman/listinfo/python-list

Re: find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread Zentrader
On Sep 22, 2:37 am, Konstantinos Pachopoulos [EMAIL PROTECTED] wrote: Hi, does any body now any such algorith? to find difference in days from MMDD to MMDD? Or just an algorithm, that converts MMDD to seconds since the epoch? Thanks For some reason, to-seconds-since-epoch is in

Re: Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Zentrader
sourcefile.find(stringID) returns the start location. You can use print to see this. You can then slice from start+len(stringID) and print it out. That should give you enough info to figure out how to find and extract to the end of the string tag as well. There are other ways to do this, but

Re: still get a defunct using a python script in the crontab

2007-09-19 Thread Zentrader
If I run the command /usr/sbin/program_prgchk everything works (no defunct process) But when I use it in the crontab I get a defunct process The crontabs file on my system is stored in /var/spool/cron/ crontabs/. It appears you are checking the wrong file. Try a crontab -e from the command

Re: subclass of integers

2007-09-14 Thread Zentrader
I would do something along the lines of the following, although it only tests for integers and not floats, so would return 'None' for a float. class Nint(int): def __add__(self, x, y): if isinstance(x, int) and isinstance(y, int): return x+y return None if

Re: subclass of integers

2007-09-14 Thread Zentrader
This would accept ints, floats, and decimal types. import decimal class Nint(int): def __add__(self, x, y): try: return x+y except: return None if __name__=='__main__': N=Nint() print N.__add__( 1, 2 ) print N.__add__( 1, None ) print

Re: Decimal formatting

2007-09-13 Thread Zentrader
The documentation is here http://docs.python.org/lib/typesseq-strings.html -- http://mail.python.org/mailman/listinfo/python-list

Re: File Parsing Question

2007-09-12 Thread Zentrader
Save the previous line in a variable if you want the previous line only. for line in inp: # Perform some operations with line if condition something: print prev_line print line break # I need to go back one line and use that line value -- prev_line = line

Re: File Parsing Question

2007-09-12 Thread Zentrader
I'm assuming you know that python has a file.seek(), but you have to know the number of bytes you want to move from the beginning of the file or from the current location. You could save the length of the previous record, and use file seek to backup and then move forward, but it is simpler to

Re: File Parsing Question

2007-09-12 Thread Zentrader
for line in inp.readlines(): If you are now using readlines() instead of readline(), then a) it is only used once to read all data into a container b) you can access each element/line by it's relative number data=open(filename, r).readlines() for eachline in data : (not readlines()) so try

Re: Car-ac-systems

2007-09-11 Thread Zentrader
snip What is it about please do not top-post that you have difficulty understanding? Or do MVPs feel that their time is so much more valuable than anyone else's that they are free to ignore the norms? Who made this the norm? In my travels through web-land, it appears to be the opposite. Don't

Re: How to insert in a string @ a index

2007-09-08 Thread Zentrader
Same solution as above, but if you just want Hello and to not include words containing Hello, i.e. Helloing or Unhello, then you want to include a leading and/or trailing space. lit= hello ## note added space t1=nothello world hello. hello \nwhy world hello start = t1.find(lit) t2 = t1[:start+1]

Re: How to determine the bool between the strings and ints?

2007-09-07 Thread Zentrader
On Sep 7, 11:30 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 07 Sep 2007 18:49:12 +0200, Jorgen Bodde wrote: As for why caring if they are bools or not, I write True and False to the properties, the internal mechanism works like this so I need to make that distinction.

Re: Using wild character

2007-09-06 Thread Zentrader
On Sep 6, 12:47 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 05 Sep 2007 22:54:55 -0700, TheFlyingDutchman wrote: To do a *string wildcard filter use the endswith() function instead of startswith() and to do a *string* type wildcard filter use the find() function -1.

Re: Finding specific date ranges

2007-09-06 Thread Zentrader
On Sep 6, 7:56 am, [EMAIL PROTECTED] wrote: December 31, 2006January 13, 2007 # doesn't earn January 14, 2007January 27, 2007 # does earn January 28, 2007February 10, 2007 # doesn't February 11, 2007 February 24, 2007 # does Am I over simplifying if I say that since

Re: Beginners Query - Simple counter problem

2007-09-06 Thread Zentrader
On Sep 6, 10:29 am, David Barr [EMAIL PROTECTED] wrote: yields no results. Since every response so far has answered everything __Except The Question You Asked__, your code runs fine on my Linux machine and prints 15. The error may be before this bit of code so it isn't getting called. Add some

Re: GC performance with lists

2007-09-04 Thread Zentrader
On Sep 4, 7:06 am, [EMAIL PROTECTED] wrote: One thing to do is to calc i+1 etc before the j loop instead of on every iteration. That is, calculate 600,000 times instead of 6*57*100,000=34,200,00, And in today's world, it probably won't make a lot of difference, This is not related to gc but is a

Re: Tkinter(2)

2007-09-04 Thread Zentrader
On Sep 4, 6:42 am, vijayca [EMAIL PROTECTED] wrote: my python installation is:Active python 2.5.1 i am using Red Hat Linux i have the Tkinter module installed but any simple script produces an error script: from Tkinter import Label widget = Label(None, text='Hello GUI world!')

Re: gucci shoes,LV handbag chanel levi's kobe max

2007-09-04 Thread Zentrader
Reported as spam -- http://mail.python.org/mailman/listinfo/python-list

Re: GC performance with lists

2007-09-04 Thread Zentrader
On Sep 4, 9:27 am, John Krukoff [EMAIL PROTECTED] wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, September 04, 2007 8:07 AM To: [EMAIL PROTECTED] Subject: GC performance with lists While

Re: Python is overtaking Perl

2007-09-04 Thread Zentrader
So, all the decline means is that the number of searches for Python programming releative to all searches done is declining. Which makes sense. There are an many python tutorial/code snippet sites, sites that list those type of python sites, as well as the python.org site which means that a

Re: list index()

2007-09-02 Thread Zentrader
On Aug 30, 11:23 am, [EMAIL PROTECTED] wrote: Neil, Steve, Thanks for the responses on sets. I have not used them before and was not even aware Python had them. I will try them out. And if there weren't sets you would still not use find or index but a brute force method or dictionaries for

Re: Pivy problem and some other stuff

2007-09-02 Thread Zentrader
On Aug 30, 8:10 pm, Scott David Daniels [EMAIL PROTECTED] wrote: Marc 'BlackJack' Rintsch wrote: A fine repy In [57]: funcs = [a, b] In [58]: funcs Out[58]: [function a at 0xb7792e2c, function b at 0xb779e1ec] In [59]: funcs[0]() Out[59]: 1 In [60]: funcs[1]() Out[60]: 2 and

Re: Let's Unite Against Jews and Mongrels!

2007-09-02 Thread Zentrader
On Aug 28, 4:50 am, Richard B. Gilbert [EMAIL PROTECTED] wrote: Unless, of course, someone has a working Killbot. If anyone has such a thing, please kill that MI5victim moron as well! I reported MI5victim to [EMAIL PROTECTED] and it appears to be gone, as well as the free air conditioner's

Re: Pivy problem and some other stuff

2007-09-02 Thread Zentrader
What meaningless error message are you talking about!? Ciao, Marc 'BlackJack' Rintsch My mistake. It appears that this is no longer the case. And my apologies. It was probably in version 2.3 or earlier that this was a problem. Given the way that the Python community constantly

Re: Python weather application

2007-08-30 Thread Zentrader
On Aug 30, 12:45 pm, seancron [EMAIL PROTECTED] wrote: Does anybody have any suggestions for getting started on desigining a desktop weather application in Python? I've been looking for access to weather data and while I have found several including the weather.com service I've decided to use

Re: include folder

2007-08-27 Thread Zentrader
My Linux version is: Debian GNU-Linux My Python version is: 2.3 Reinstalling Python would be my first option. Any of the versions can be downloaded from python.org but on debian you should be able to just use apt-get or one of the GUIs for apt-get. --

Re: beginner, idiomatic python

2007-08-23 Thread Zentrader
Does page count change? i.e. is it necessary to retrieve it in every loop or tempList = ['1','2','3','4','5','6','7','8'] sampleList=[] page_count = self.parent.GetPageCount() snipped for i in range(page_count): Also, once pagefound is set to True, all pages following will not be appended to

Re: Free Air Conditioners!!!!!!

2007-08-22 Thread Zentrader
On Aug 21, 10:13 pm, Scott M. [EMAIL PROTECTED] wrote: Oh my God! How did you know?!! You were so smart to post that here! [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] http://freeairconditioners.blogspot.com/ It's probably a handheld fan made out of a piece of paper --

Re: How to call module functions inside class instance functions?

2007-08-18 Thread Zentrader
On Aug 18, 5:40 pm, beginner [EMAIL PROTECTED] wrote: Hi Everyone, I have encountered a small problems. How to call module functions inside class instance functions? For example, calling func1 in func2 resulted in a compiling error. my module here def func1(): print hello class

Re: How to call module functions inside class instance functions?

2007-08-18 Thread Zentrader
By the way, the reason I am naming it __module_level_func() is because I'd like __module_level_func() to be private to the module, like the C static function. If the interpreter cannot really enforce it, at least it is some sort of naming convention for me. re the above: set file permissions

Re: Array and floating point

2007-08-17 Thread Zentrader
On Aug 17, 2:06 pm, Jonathan Shan [EMAIL PROTECTED] wrote: Hello, I'm experiencing a problem where the float being appended to the array is not the same as the result of the appending. from array import * x = array('f') x.append(float(0.1)) x[0] 0.1000149011612 float(0.1)

Re: What order does info get returned in by os.listdir()

2007-08-14 Thread Zentrader
On Aug 14, 1:52 pm, Jeremy C B Nicoll [EMAIL PROTECTED] wrote: What order does info get returned in by os.listdir() ? I'm just starting to write python code, on an Win XP Pro machine. I've got various directories which, when I look at them in Win XP, sorted by name, I see in order, eg:

Re: What order does info get returned in by os.listdir()

2007-08-14 Thread Zentrader
On Aug 14, 1:52 pm, Jeremy C B Nicoll [EMAIL PROTECTED] wrote: What order does info get returned in by os.listdir() ? I'm just starting to write python code, on an Win XP Pro machine. I've got various directories which, when I look at them in Win XP, sorted by name, I see in order, eg:

Re: IDLE path browser not recognizing my PYTHONPATH

2007-08-14 Thread Zentrader
On Aug 14, 2:30 am, Martin v. Löwis [EMAIL PROTECTED] wrote: I set PYTHONPATH to /home/me/bin in bash.bashrc, however the IDLE path browser is not recognizing this. Not sure why. Grateful for any insight. The file bash.bashrc has no relevance. If you meant to set the variable every time

Re: output object fields into a file

2007-08-13 Thread Zentrader
On Aug 13, 6:17 pm, Alex [EMAIL PROTECTED] wrote: Hello, I am rather new to python. Maybe my thinking is in the paradigm of C++, that makes me hard to make sense of some python scripts (interacting with C# code) written by my colleague. I am thinking of outputting all objects and their

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Zentrader
On Aug 11, 9:40 am, Adam W. [EMAIL PROTECTED] wrote: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum)

Re: float to string with different precision

2007-08-10 Thread Zentrader
On Aug 10, 1:12 am, Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I have to print float numbers to a file. Each float should be 5 characters in width (4 numbers and the decimal point). My problem is that I do not now how to specify float to have different numbers of

Re: RTF 2 Tiff

2007-08-06 Thread Zentrader
On Aug 6, 12:15 pm, [EMAIL PROTECTED] wrote: Hi all, I am trying to convert an RTF file to a Tiff image using Python. This process will convert several hundred images daily. Currently I am able to get the RTF file into a text format using Rtf2Txt.py, but I loose the images contained in the

Re: is it possible to improve traceback messages ?

2007-08-06 Thread Zentrader
On Aug 6, 10:54 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/6/07, Stef Mientki [EMAIL PROTECTED] wrote: hello, Most of time I get an error message, it is sufficient to solve to problem. Sometimes it's not clear to me what the problem is like this one: N = int

Re: i am new to python-Please somebody help

2007-08-03 Thread Zentrader
On the discussion of rudeness, we have to include the OP. He/She/it did not even attempt a Google before posting, and posted with a meaningless subject. We'll chalk that up to newness, but some sort of retort was called for IMHO. How else do we learn the conventions that govern rudeness.

Re: i am new to python-Please somebody help

2007-08-03 Thread Zentrader
BTW - on the subject of polite discussions, how about this one as an example of opinions politely expressed. Oh, and does anyone know how to use zip in Python. Yes+1. -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: unsupported operand type(s) for -: 'Decimal' and 'Decimal'. Why?

2007-07-31 Thread Zentrader
In the utter absence of any clues from the OP, Marc was demonstrating one possible way that the puzzling [Can't subtract one Decimal instance from another???] error message could have been caused. Ah yes. Until this is no longer true, In the utter absence of any clues from the OP, we can do

Re: TypeError: unsupported operand type(s) for -: 'Decimal' and 'Decimal'. Why?

2007-07-30 Thread Zentrader
from decimal import Decimal In [21]: a = Decimal() In [22]: class Decimal(object): : pass : In [23]: b = Decimal() In [24]: a - b Perhaps I don't understand what you are doing here, but on line 22 you overload Decimal. If you just have a = Decimal() b = Decimal()

Re: a simple string question

2007-07-28 Thread Zentrader
Short_Text=n=90; if n==90:print 'ok' compound_lines = Short_Text.split(;) for line in compound_lines: ... line = line.replace(:, :\n) ... print line ... n=90 if n==90: print 'ok' A variation of this will work if the input file isn't too complicated. I found this

Re: Tkinter -- Show Data in an Excel like Read-Only Grid

2007-07-28 Thread Zentrader
If you want to only display data in a table format, try MultiListBox.py. Just download and run for a demo. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52266 -- http://mail.python.org/mailman/listinfo/python-list

Re: a simple string question

2007-07-27 Thread Zentrader
On Jul 27, 8:23 am, [EMAIL PROTECTED] wrote: Hello, I have one question about string.I am trying to make an function to analyze line of some text, this is my example: HELLO;HELLO2:WORLD:, if that function in this text find ; and : ( in this example will find both) e.g that function must

Re: a simple string question

2007-07-27 Thread Zentrader
On Jul 27, 11:26 am, Wildemar Wildenburger [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: If I understand you correctly you want to replace ; by ;\n and : by :\n\t\t\t\t\t\t\t. Well guess what? The replace() method does just this. Have a read:

Re: Tkinter -- Show Data in an Excel like Read-Only Grid

2007-07-27 Thread Zentrader
On Jul 27, 2:56 pm, beginner [EMAIL PROTECTED] wrote: Hi All, I am really new to Tk and Tkinter. I googled the web but it was not mentioned how to build a data grid with Tkinter. Basically, I want to show an excel like data grid with fixed column and row headers and sortable columns. But

Re: a simple string question

2007-07-27 Thread Zentrader
[EMAIL PROTECTED] wrote: NEW TEXT : Hello world;\nHello:\n\t\t\n\n\n\n\n\nHello2 If you are doing all of this to format the output into columns, Python's print() or write() will do this, and is easier as well. Some more info on what you want to do will clear things up. --

Re: Pythonic way for missing dict keys

2007-07-21 Thread Zentrader
On Jul 21, 7:48 am, Duncan Booth [EMAIL PROTECTED] wrote: Rustom Mody [EMAIL PROTECTED] wrote: Can someone who knows about python internals throw some light on why x in dic is cheaper than dic.has_key(x) ?? From the 2.6 PEP #361 (looks like dict.has_key is deprecated) Python 3.0

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread Zentrader
rpt_file.writelines('\t' + [song].keys() \ + '\t' + I get the following error: Traceback (most recent call last): AttributeError: 'list' object has no attribute 'keys' All of these messages are correct. The first

Re: Efficiently removing duplicate rows from a 2-dimensional Numeric array

2007-07-20 Thread Zentrader
On Jul 19, 8:35 pm, Terry Reedy [EMAIL PROTECTED] wrote: Alex Mont [EMAIL PROTECTED] wrote in message I have a 2-dimensional Numeric array with the shape (2,N) and I want to remove all duplicate rows from the array. For example if I start out with: [[1,2], [1,3], [1,2], [2,3]] I want to

Re: PDF2ODT

2007-07-20 Thread Zentrader
On Jul 17, 12:47 pm, orehon [EMAIL PROTECTED] wrote: Hello, I need to convert PDF to ODT or PDF to DOC using python! I was taking a look athttp://www.kde-apps.org/content/show.php/show.php?content=18638vote=... and this project is outdated. So any idea? Thank you! I have heard

Re: really small values

2007-07-19 Thread Zentrader
On Jul 17, 2:13 pm, Dee Asbury [EMAIL PROTECTED] wrote: In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How do I get it to give me back my tiny value? Thanks! Dee Also, Python's decimal class allows theoretically unlimited precision. I have extremely limited

Re: how to compile python to have gtk and Tkinter modules in Linux environment.

2007-07-17 Thread Zentrader
On Jul 16, 8:16 pm, [EMAIL PROTECTED] wrote: import gtk and Tkinter modules. Those don't seem to be included when I use the default ./configure or python setup.py. Tkinter is supposed to be included by default, although that depends on who's Python you are using and ./configure. You have to

  1   2   >