Re: tough-to-explain Python

2009-07-07 Thread norseman
Bearophile wrote: kj, as Piet van Oostrum as said, that's the difference between mutable an immutable. It comes from the procedural nature of Python, and probably an explanation of such topic can't be avoided if you want to learn/teach Python. ...(snip) See you later, bearophile

Re: csv blank fields

2009-06-30 Thread norseman
Mag Gam wrote: I am using the csv package to parse a compressed .csv.gz file. So far its working perfectly fine but it fails when I have a missing value in on of the fields. For example, I have this Abc,def,,jkl Is it possible to fill the missing column with a null? I want, Abc,def,NULL,jkl

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread norseman
Scott David Daniels wrote: norseman wrote: ... A note here: In reading the original posting I get symbols that are not familiar to me as alphabet. From the line in your original: Label(root, text='ęóąśłżźćń').pack() I see text=' then an e with a goatee

Re: tkinter: get filename of askopenfilename

2009-06-25 Thread norseman
root.mainloop() ## Is this what you mean? On Jun 25, 1:28 pm, norseman norse...@hughes.net wrote: OOPS - I left out the global statement rom wrote: Hi there, I am writing an interface with Tkinter. My minimal program looks like this: # import Tkinter import

Re: tkinter: get filename of askopenfilename

2009-06-25 Thread norseman
= tkFileDialog.askopenfilename(filetypes= [(allfiles,*)]) print filename root.mainloop() ## Is this what you mean? On Jun 25, 1:28 pm, norseman norse...@hughes.net wrote: OOPS - I left out the global statement rom wrote: Hi there, I am writing an interface with Tkinter

Re: tkinter: get filename of askopenfilename

2009-06-25 Thread norseman
rom wrote: Thanks again. After your replies, I have understood how to do what I wanted. What I wanted to do is to get a value after clicking a button and use it in another part of the program. As you said, after getting the value, I have to store it in a global variable. However, the program

Re: [Gimp-user] Color change a whole range based on a break point

2009-06-25 Thread norseman
with black. 2) starting round 2 Quoting norseman norse...@hughes.net: I understand the idea. I am not getting any usable results. If I cut out a small piece of a project raster and send it to you would you have the time to try your idea(s) on it? That would be fine. Perhaps I

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-25 Thread norseman
Sebastian Pająk wrote: 2009/6/25 Martin v. Löwis mar...@v.loewis.de: I've tried various UTF file encoding (also with BOM mark), use of utext Always use utext. This should work. Everything else might not work. But I tried this here without success After applying this, the effect remains the

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-25 Thread norseman
Sebastian Pająk wrote: Can, but should not. I read that the problem is when using the Polish language only. Otherwise things work normally. Is that correct? Yes, correct If so then byte swap may be a problem. Using the u'string' should solve that. I am assuming you have the Polish alphabet

Re: tkinter: get filename of askopenfilename

2009-06-24 Thread norseman
rom wrote: Hi there, I am writing an interface with Tkinter. My minimal program looks like this: # import Tkinter import tkFileDialog # define globals here filename= '' # will take care of the problem root = Tkinter.Tk() Tkinter.Button(root, text='Notch genes...',

Re: tkinter: get filename of askopenfilename

2009-06-24 Thread norseman
OOPS - I left out the global statement rom wrote: Hi there, I am writing an interface with Tkinter. My minimal program looks like this: # import Tkinter import tkFileDialog # define globals here filename= '' # will take care of the problem root = Tkinter.Tk()

Re: Trouble with running java using Popen

2009-06-23 Thread norseman
Edward Grefenstette wrote: I have a java prog I need to run at some point during the execution of a python module. The path to the folder containing the all the relevant java stuff (which runs fine from the command line) is stored in pkgpath. The relevant code is this: os.chdir(pkgpath)

Re: Create 3D Surface / Contour (with vpython?)

2009-06-17 Thread norseman
Philip Gröger wrote: Hi! How can I create a 3D surface (or something like the picture on the FAQ page http://www.vpython.org/contents/FAQ.html ) with python [or vpython]. Didnt find anything in the Documentation under graph Basically like a contourf diagram in 3D

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread norseman
Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread norseman
Scott David Daniels wrote: norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: ... I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line

Re: Python, Tkinter and popen problem

2009-06-01 Thread norseman
Piet van Oostrum wrote: norseman norse...@hughes.net (n) wrote: n Piet van Oostrum wrote: norseman norse...@hughes.net (n) wrote: n I have tried both and Popen2.popen2(). n os.popen runs both way, contrary to docs. What do you mean `os.popen runs both way'? n It reads from child while

Re: Python, Tkinter and popen problem

2009-06-01 Thread norseman
MRAB wrote: norseman wrote: Piet van Oostrum wrote: norseman norse...@hughes.net (n) wrote: [snip] n Some questions: n 1) ...], stdout=PIPE).stdout n^^ why the double use? It is not a double use. Popen([z6.py], stdout=PIPE) gives you a Popen object

Re: Python, Tkinter and popen problem

2009-05-29 Thread norseman
Piet van Oostrum wrote: norseman norse...@hughes.net (n) wrote: n I have tried both and Popen2.popen2(). n os.popen runs both way, contrary to docs. What do you mean `os.popen runs both way'? It reads from child while console writes directly to child - thus eliminating the problem

Re: Python, Tkinter and popen problem

2009-05-28 Thread norseman
Peter Otten wrote: norseman wrote: Peter Otten wrote: norseman wrote: This was sent 5/19/09 and as yet has received no comments. I'm resending just in case a new reader might have an answer. If you had posted two tiny scripts demonstrating your problem instead of the longwinded explanation

Re: py2app and OpenGL, No module named util in ctypes

2009-05-28 Thread norseman
Ned Deily wrote: In article b09874da-5dcb-4b60-aae8-f430f1db5...@o20g2000vbh.googlegroups.com, trhaynes trhay...@gmail.com wrote: I'm trying to use py2app to package an OpenGL app [...] You might try asking on the pythonmac-sig list: more py2app users there most likely.

Re: What text editor is everyone using for Python

2009-05-28 Thread norseman
jeffFromOz wrote: On May 26, 10:07 pm, Lacrima lacrima.ma...@gmail.com wrote: I am new to python. And now I am using trial version of Wing IDE. But nobody mentioned it as a favourite editor. So should I buy it when trial is expired or there are better choices? No one mentioned textmate either

Python, Tkinter and popen problem

2009-05-27 Thread norseman
This was sent 5/19/09 and as yet has received no comments. I'm resending just in case a new reader might have an answer. == I have come across a problem that, as I understand all documentation I have found, should not exist. Python version is 2.5.2, Tinker in

Re: Python, Tkinter and popen problem

2009-05-27 Thread norseman
Peter Otten wrote: norseman wrote: This was sent 5/19/09 and as yet has received no comments. I'm resending just in case a new reader might have an answer. If you had posted two tiny scripts demonstrating your problem instead of the longwinded explanation I might have tinkered. Peter

Re: popen - reading strings - constructing a list from the strings

2009-05-21 Thread norseman
MRAB wrote: Aytekin Vargun wrote: First of all, Thanks for the suggestions, MRAB and norseman. split() was what I was looking for. Now I have a follow up question. In my application I create radio buttons in a frame. These radio buttons are constructed whenever a button is clicked. Therefore

Re: reseting an iterator

2009-05-21 Thread norseman
Terry Reedy wrote: Jan wrote: Wouldn't it be easy for Python to implement generating functions so that the iterators they return are equipped with a __reset__() method? No. Such a method would have to poke around in the internals of the __next__ function in implementation specific ways.

Re: 4 hundred quadrillonth?

2009-05-21 Thread norseman
seanm...@gmail.com wrote: The explaination in my introductory Python book is not very satisfying, and I am hoping someone can explain the following to me: 4 / 5.0 0.80004 4 / 5.0 is 0.8. No more, no less. So what's up with that 4 at the end. It bothers me.

Re: reseting an iterator

2009-05-21 Thread norseman
Terry Reedy wrote: I will clarify by starting over with current definitions. Ob is an iterator iff next(ob) either returns an object or raises StopIteration and continues to raise StopIteration on subsequent calls. Ob is an iterable iff iter(ob) raturns an iterator. It is intentional that

Re: finding repeated data sequences in a column

2009-05-21 Thread norseman
yadin wrote: On May 20, 6:53 pm, norseman norse...@hughes.net wrote: bearophileh...@lycos.com wrote: yadin: How can I build up a program that tells me that this sequence 128706 128707 128708 is repeated somewhere in the column, and how can i know where? Can such patterns nest

Re: finding repeated data sequences in a column

2009-05-20 Thread norseman
bearophileh...@lycos.com wrote: yadin: How can I build up a program that tells me that this sequence 128706 128707 128708 is repeated somewhere in the column, and how can i know where? Can such patterns nest? That is, can you have a repeated pattern made of an already seen pattern

Re: popen - reading strings - constructing a list from the strings

2009-05-20 Thread norseman
MRAB wrote: Aytekin Vargun wrote: mailto:python-list@python.org Hello everybody, I have a question about the way I use os.popen. I am open to other alternative suggestions like using subprocess or communicate. I have an executable (say read_cell_types.exe) that produces string outputs. For

Re: Which C compiler?

2009-05-19 Thread norseman
Jorgen Grahn wrote: On Mon, 18 May 2009 15:47:41 -0700, norseman norse...@hughes.net wrote: I suspect that if all python users were in the same room and the question Are you NOT happy with python's upgrade requirements? was asked you would find most hands in the air. I have said it before

Python, Tkinter and popen problem

2009-05-19 Thread norseman
I have come across a problem that, as I understand all documentation I have found, should not exist. Python version is 2.5.2, Tinker in that package. Linux Slackware 10.2 I went to test os.popen and got mixed answers. 1) IF os.popen opens a command line or command window type

Re: Just wondering

2009-05-18 Thread norseman
Dave Angel wrote: norseman wrote: div class=moz-text-flowed style=font-family: -moz-fixedMarco Mariani wrote: Gediminas Kregzde wrote: def doit(i): pass def main(): a = [0] * 1000 t = time() map(doit, a) print map time: + str(time() - t) Here you are calling

Re: Which C compiler?

2009-05-18 Thread norseman
Jive Dadson wrote: Martin v. Löwis wrote: Jive Dadson wrote: I am using Python 2.4. I need to make a native Python extension for Windows XP. I have both VC++ 6.0 and Visual C++ 2005 Express Edition. Will VC++ 6.0 do the trick? That would be easier for me, because the project is written for

Re: Which C compiler?

2009-05-18 Thread norseman
Emile van Sebille wrote: On 5/18/2009 1:27 PM Jive Dadson said... I love Python, but the update regimen is very frustrating. It's a misery to me why every major release requires new versions of so much application stuff. No other software that I use is like that. When I upgrade Windoze,

Re: Just wondering

2009-05-15 Thread norseman
Gediminas Kregzde wrote: Hello, I'm Vilnius college II degree student and last semester our teacher introduced us to python I've used to program with Delphi, so I very fast adopted to python Now I'm developing cross platform program and use huge amounts of data. Program is needed to run as

Re: Just wondering

2009-05-15 Thread norseman
Marco Mariani wrote: Gediminas Kregzde wrote: def doit(i): pass def main(): a = [0] * 1000 t = time() map(doit, a) print map time: + str(time() - t) Here you are calling a function ten million times, build a list with of ten million None results, then throw it away.

Re: matplotlib - overlaying plots.

2009-05-14 Thread norseman
Ant wrote: Hi All, I am trying to get matplotlib to overlay a couple of graphs, but am getting nowhere. I originally thought that the following may work: x = [1,2,3,4,5] y = [2,4,6,8,10] y2 = [1,4,9,16,25] plot(x, y) plot(x, y2) Now this works as desired, however, the actual case I have

Re: about Python doc reader

2009-05-14 Thread norseman
Tim Golden wrote: norseman wrote: I did try these. Doc at once: outputs two x'0D' and the file. Then it appends x'0D' x'0D' x'0A' x'0D' x'0A' to end of file even though source file itself has no EOL. ( EOL is EndOfLine aka newline ) That's cr cr There are two blank lines

Re: Odd list behavior

2009-05-14 Thread norseman
Rhodri James wrote: On Wed, 13 May 2009 23:08:26 +0100, norseman norse...@hughes.net wrote: Evan Kroske wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key

Re: capture stdout and stderror from within a Windows Service?

2009-05-14 Thread norseman
Chris Curvey wrote: I'm trying to get this invocation right, and it is escaping me. How can I capture the stdout and stderr if I launch a subprocess using subprocess.check_call()? The twist here is that the call is running from within a Windows service. I've tried: check_call(mycmd.exe,

Re: OS independent file associate ?

2009-05-14 Thread norseman
Stef Mientki wrote: hello, I would like to make my programs available under the standard OS's, like Windows, Linux (,Mac) One of the problems I encounter, is launching of files through their file associates (probably a windows only terminology ;-) Now I can detect the OS, but only the main

Re: How to get the formal args of a function object?

2009-05-14 Thread norseman
kj wrote: Suppose that f is an object whose type is 'function'. Is there a way to find out f's list of formal arguments? The reason for this is that I'm trying to write a decorator and I'd like the wrapper to be able to check the number of arguments passed. Specifically, I'd like the wrapper

Re: How to get the formal args of a function object?

2009-05-14 Thread norseman
Scott David Daniels wrote: kj wrote: Suppose that f is an object whose type is 'function'. Is there a way to find out f's list of formal arguments? The reason for this is that I'm trying to write a decorator and I'd like the wrapper to be able to check the number of arguments passedbut

Re: about Python doc reader

2009-05-13 Thread norseman
Kushal Kumaran wrote: On Wed, May 13, 2009 at 4:28 PM, Shailja Gulati shailja.gul...@tcs.com wrote: Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word

Re: about Python doc reader

2009-05-13 Thread norseman
Tim Golden wrote: Shailja Gulati wrote: Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? If you haven't already, get hold of the pywin32

Re: about Python doc reader

2009-05-13 Thread norseman
norseman wrote: Tim Golden wrote: Shailja Gulati wrote: Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? If you haven't already, get hold

Re: Odd list behavior

2009-05-13 Thread norseman
Evan Kroske wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key = string.split()[0] Error! However, I can slice the list like normal, but that gives me a

Re: piping input to an external script

2009-05-12 Thread norseman
Steve Howell wrote: On May 11, 10:16 pm, norseman norse...@hughes.net wrote: Tim Arnold wrote: Hi, I have some html files that I want to validate by using an external script 'validate'. The html files need a doctype header attached before validation. The files are in utf8 encoding. My code

Re: piping input to an external script

2009-05-12 Thread norseman
Steve Howell wrote: On May 11, 11:31 pm, norseman norse...@hughes.net wrote: Steve Howell wrote: On May 11, 10:16 pm, norseman norse...@hughes.net wrote: Tim Arnold wrote: Hi, I have some html files that I want to validate by using an external script 'validate'. The html files need a doctype

Re:

2009-05-12 Thread norseman
karlos barlos wrote: hello to all i have been using this script to add users to my active directory structure i wise to make a loop in order for it to run for A large Number of Users can anyone give me some advice on the loop ?? import win32com,win32com.client def

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread norseman
walterbyrd wrote: I have about 150 unix formated text files that I would like to convert to dos formated. I am guessing that I loop though each file in the directory, read each line and conver the last character, then save to a file with the same name in another directory. I am not really sure

Re: Complete frustration

2009-05-11 Thread norseman
that is dated July 8, 2008 (07/08/2008) that was sent by norseman. It works for me. Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping comments

2009-05-11 Thread norseman
Tobias Weber wrote: Hi, the guideline (PEP 8) is hard wrap to 7x characters. The reason given is that soft wrap makes code illegible. So what if you hard wrap code but let comments and docstrings soft-wrap? Otherwise it's hugely annoying to edit them. Say you remove the first three words of

Re: unicode bit me

2009-05-11 Thread norseman
* == In Linux get/use gpm and copy paste is simple. In Microsoft see: Python-List file dated May 6, 2009 (05/06/2009) sent by norseman. -- http://mail.python.org/mailman/listinfo/python-list

Re: piping input to an external script

2009-05-11 Thread norseman
Tim Arnold wrote: Hi, I have some html files that I want to validate by using an external script 'validate'. The html files need a doctype header attached before validation. The files are in utf8 encoding. My code: --- import os,sys import codecs,subprocess HEADER = '!DOCTYPE html

Re: subprocess.Popen howto?

2009-05-08 Thread norseman
Øystein ; Down below: change yourPy.py to | yourPy.py I just noticed the typo. Sorry Steve norseman wrote: Øystein Johansen (OJOHANS) wrote: Hi, I have problems understanding the subprocess.Popen object. I have a iterative calculation in a process running and I want to pipe

Re: subprocess.Popen howto?

2009-05-08 Thread norseman
Carl Banks wrote: On May 7, 2:58 pm, norseman norse...@hughes.net wrote: If you don't like a lot of typing that obscures the process, take a look at os.Popen2 Pg.39 or so in Lib.pdf for 2.5.2 In this case - the popen3 is probably your best bet. I took a test run on subprocess a few months ago

Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread norseman
Dotan Cohen wrote: As you might have mentioned I'm just working on a txt to html converter called thc. This project is intended for me to learn Python and now pyQT4 to which I changed a few days ago (started with Tkinter). I have implemented the following features so far: - Giving a title for

Re: Which one is best Python or Java for developing GUI applications?

2009-05-07 Thread norseman
Tim Rowe wrote: 2009/5/6 Dennis Lee Bieber wlfr...@ix.netcom.com: (the near is because I feel Ada is stricter than any other language) Try SPARK -- it's Ada based, but /much/ stricter. It's just right for some really critical stuff, but is no sort of an answer to Which one is best Python or

Re: subprocess.Popen howto?

2009-05-07 Thread norseman
box from norseman 05/06/2009 4:28PM ) Python 2.5.1 ... on win32 import os result = os.spawnl( os.P_WAIT, d:\\winmcad\\mcad,) Runs the program mcad. Returns to python when mcad exits. --- In your case: substitute ...your_compiled_c_program, yourPy.py

Re: Pyhton script to call another program

2009-05-06 Thread norseman
Ben Keshet wrote: Hi, I am trying to write a simple python script to manipulate files and call other programs. I have a program installed (rocs) which I run using cygwin on my XP (but is not in python). Can I run the pyhton script and then call the other program in the same script? For

Re: Copy Paste in a Dos box

2009-05-06 Thread norseman
Shawn Milochik wrote: On Wed, May 6, 2009 at 1:54 PM, Tim Chase python.l...@tim.thechases.com wrote: for windows this works: (can't cut and paste from a dos box!###%*!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use enter to

Re: Copy Paste in a Dos box

2009-05-06 Thread norseman
Mensanator wrote: On May 6, 12:54 pm, Tim Chase python.l...@tim.thechases.com wrote: for windows this works: (can't cut and paste from a dos box!###%*!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use enter to terminate the

Re: Copy Paste in a Dos box

2009-05-06 Thread norseman
Dave Angel wrote: Tim Chase wrote: div class=moz-text-flowed style=font-family: -moz-fixed for windows this works: (can't cut and paste from a dos box!###%*!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use enter to

Re: Any idea to emulate tail -f

2009-05-05 Thread norseman
Joel Juvenal Rivera Rivera wrote: I want to make something very similar to the command tail -f (follow a file), i have been trying with some while True and some microsleeps (about .1 s); did someone has already done something like this? And about the file is the apache acceslog of a site

Re: change some lines from a read file

2009-05-04 Thread norseman
Anthra Norell wrote: utab wrote: Dear all, I have to change some lines from a template file, which is rather long to paste here, but I would like to make some parts of some lines optional with my command line arguments but I could not see this directly, I can count the line numbers and decide

Re: change some lines from a read file

2009-05-04 Thread norseman
Anthra Norell wrote: utab wrote: Dear all, I have to change some lines from a template file, which is rather long to paste here, but I would like to make some parts of some lines optional with my command line arguments but I could not see this directly, I can count the line numbers and decide

Re: Tkinter, Trouble with Message,Label widget

2009-05-04 Thread norseman
Ioannis Lalopoulos wrote: I assume that you create the two windows through two different calls to Tkinter.Tk() but you cannot enter two mainloops (at least not in a normal way). If you want a second window use the Toplevel widget. Try the following, it does what you want: import Tkinter root

Tkinter, Trouble with Message,Label widget

2009-05-03 Thread norseman
Intended action: Two Tkinter windows. W1 is complex, user interacts with program from here ONLY W2 is for display only, NO user interactions I can get info to W2. But to get it to update I first have to manually kill it. Program does create both. Both terminate when

Re: Importing modules

2009-05-01 Thread norseman
Gabriel Genellina wrote: En Thu, 30 Apr 2009 14:33:38 -0300, Jim Carlock escribió: I'm messing around with a program right at the moment. It ends up as two applications, one runs as a server and one as a client which presents a Window. It almost works, so I need to work through it to work out

Re: don't understand namespaces...

2009-05-01 Thread norseman
Simon Forman wrote: On Apr 30, 10:11 am, Lawrence Hanser lhan...@gmail.com wrote: Dear Pythoners, I think I do not yet have a good understanding of namespaces. Here is what I have in broad outline form: import Tkinter Class App(Frame) define two

Re: string processing question

2009-05-01 Thread norseman
Piet van Oostrum wrote: Kurt Mueller m...@problemlos.ch (KM) wrote: KM But from the command line python interprets the code KM as 'latin_1' I presume. That is why I have to convert KM the ä with unicode(). KM Am I right? There are a couple of stages: 1. Your terminal emulator interprets

Re: Geohashing

2009-04-30 Thread norseman
Marco Mariani wrote: norseman wrote: The posting needs (its creation) ... DATE. ... The code needs to state OS and program and version used to write it. And from there - user beware. Which would reduce the confusion greatly. I got the same error message and decided it was from

Re: string processing question

2009-04-30 Thread norseman
Kurt Mueller wrote: Hi, on a Linux system and python 2.5.1 I have the following behaviour which I do not understand: case 1 python -c 'a=ä; print a ; print a.center(6,-) ; b=unicode(a, utf8); print b.center(6,-)' ä --ä-- --ä--- case 2 - an UnicodeEncodeError in this case: python

Re: suggestion on a complicated inter-process communication

2009-04-30 Thread norseman
Aaron Brady wrote: Um, that's the limit of what I'm familiar with, I'm afraid. I'd have to experiment. On Apr 28, 10:44 am, Way csw...@gmail.com wrote: Thanks a lot for the reply. I am not familiar with multi-process in Python. I am now using something like: snip However, in this case,

Re: import and package confusion

2009-04-30 Thread norseman
Terry Reedy wrote: Dale Amon wrote: Now I can move on to parsing those pesky Fortran card images... There wouldn't happen to be a way to take n continguous slices from a string (card image) where each slice may be a different length would there? Fortran you know. No spaces between input

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-30 Thread norseman
Martin v. Löwis wrote: How do get a printable unicode version of these path strings if they contain none unicode data? Define printable. One way would be to use a regular expression, replacing all codes in a certain range with a question mark. What I mean by printable is that the string must

Re: Geohashing

2009-04-29 Thread norseman
Marco Mariani wrote: djc wrote: Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17) geohash(37.421542, -122.085589, b'2005-05-26-10458.68') ^ SyntaxError: invalid syntax The byte type is new in 2.6 --

Re: suggestion on a complicated inter-process communication

2009-04-28 Thread norseman
Way wrote: Hello friends, I have a little messy situation on IPC. Please if you can, give me some suggestion on how to implement. Thanks a lot! - denotes create MainProcess - Process1 - Process3 (from os.system) | - Process2 (from os.system) - Process4

Re: Connecting/talking to OpenOffice Base files

2009-04-28 Thread norseman
deostroll wrote: Hi, I was wondering if the python interpretor can talk to files with extension *.odb (OpenOffice Base files). They are like flat database files, similar to Microsoft Access files. I want to store data into them as well as extract data out of them. --deostroll --

Re: best way to compare contents of 2 lists?

2009-04-24 Thread norseman
Esmail wrote: What is the best way to compare the *contents* of two different lists regardless of their respective order? The lists will have the same number of items, and be of the same type. E.g. a trivial example (my lists will be larger), a=[1, 2, 3] b=[2, 3, 1] should yield true if a==b

Re: best way to compare contents of 2 lists?

2009-04-24 Thread norseman
Steven D'Aprano wrote: On Fri, 24 Apr 2009 10:39:39 -0700, norseman wrote: Technically, == is reserved for identical, as in byte for byte same Really? Then how do you explain these? u'abc' == 'abc' True 1 == 1.0 True 2L == 2 True import decimal decimal.Decimal('42') == 42 True

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread norseman
David Lyon wrote: On Thu, 23 Apr 2009 07:04:35 -0400, David Stanek dsta...@dstanek.com wrote: If I use win32com how do you expect me to support Linux? Of course not... What about the many packages on PYPI containing C? Exactly. What if I decide to write only to Python 3? Fair

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread norseman
David Stanek wrote: On Thu, Apr 23, 2009 at 1:12 PM, norseman norse...@hughes.net wrote: BB's, User Lists, all repositories can make these required before acceptance. This is open source. I volunteer my time on the projects that I maintain. If you don't like the quality or lack

Re: Would you support adding UNC support to os.path on Windows?

2009-04-22 Thread norseman
Larry Hastings wrote: I've written a patch for Python 3.1 that changes os.path so it handles UNC paths on Windows. You can read about it at the Python bug tracker: http://bugs.python.org/issue5799 I'd like to gauge community interest in the patch. After all, it's has been declined

Re: pylab quick reference? (matplotlib)

2009-04-22 Thread norseman
Esmail wrote: Hello all, Does anyone know of a quick reference for the various plotting functions for pylab? I'm just getting started with this after years of work with gnuplot. I found this http://matplotlib.sourceforge.net/api/pyplot_api.html which is very comprehensive and would be good

Re: looking for a pattern to code logic shared by gui/cli

2009-04-22 Thread norseman
Chris Rebert wrote: On Thu, Apr 16, 2009 at 12:36 PM, Andreas Balogh balo...@gmail.com wrote: Only recently I have started developing code for application providing both a GUI and a command line interface (CLI). Naturally I want to reuse the business logic code for both GUI and CLI interfaces.

Re: polar plots, clockwise, north

2009-04-20 Thread norseman
enric...@gmail.com wrote: Thanks, I had tried this earlier but by rotating the data in this fashion, it has problems connecting the endpoints between 0 and 360 and tries to go counter clockwise around. I am then left with an extra circle in all my plots where it attempts to connect the points

A Special Thanks

2009-04-20 Thread norseman
I'm one of those that tries to get an outline of the project and then puts in code as things become clear. Once the basics are working reasonably I go back and organize the thing for maintainability. Then finish flushing it out. It is the one stage I dread the most. Why not organize it up

Re: binary file compare...

2009-04-17 Thread norseman
Adam Olsen wrote: On Apr 16, 11:15 am, SpreadTooThin bjobrie...@gmail.com wrote: And yes he is right CRCs hashing all have a probability of saying that the files are identical when in fact they are not. Here's the bottom line. It is either: A) Several hundred years of mathematics and

Re: Suggestions wanted on Tkinter problem

2009-04-17 Thread norseman
Dave Angel wrote: norseman wrote: div class=moz-text-flowed style=font-family: -moz-fixedOne suggested I change the subject line - OK I also replaced the [TAB]s since I noticed the Emailer seems to get very confused with them. Problem: Using Python 2.5.2 and Tkinter ??? (came

Re: Is there a programming language that is combination of Python and Basic?

2009-04-17 Thread norseman
baykus wrote: Hi I am looking for one of those experimental languages that might be combination of python+basic. Now thta sounds weird and awkward I know. The reason I am asking is that I always liked how I could reference- call certain line number back in the days. It would be interesting to

Re: Is there a programming language that is combination of Python and Basic?

2009-04-17 Thread norseman
Steven D'Aprano wrote: On Fri, 17 Apr 2009 14:00:18 -0700, Mensanator wrote: ...(snip) Pascal has GOTOs. People rarely used them, because even in the 1970s and 80s they knew that unstructured gotos to arbitrary places was a terrible idea. Even in primarily assembly only days that was

Re: get text from rogramms runn by subprocess.Popen immediatetly

2009-04-16 Thread norseman
Rüdiger Ranft wrote: Hi all, I need to call some programms and catch their stdout and stderr streams. While the Popen class from subprocess handles the call, I get the results of the programm not until the programm finishes. Since the output of the programm is used to generate a progress

Re: Create standalone Windows program with simple graphics?

2009-04-16 Thread norseman
Poster28 wrote: Hi, I'd like to program and compile a simple graphics program (showing something like a chess board, some numbers and buttons, mouse support) and provide it as a standalone binary for Windows users. What is the easiest way to do that? Which libraries or compilers I should use?

Suggestions wanted

2009-04-16 Thread norseman
Problem: Using Python 2.5.2 and Tkinter ??? (came with system) List made and for loop in use lst=[ (S, Single), .] for mode, text c = Radiobuton(. c.pack() At this point the program runs, but I cannot control gray-out

Suggestions wanted on Tkinter problem

2009-04-16 Thread norseman
One suggested I change the subject line - OK I also replaced the [TAB]s since I noticed the Emailer seems to get very confused with them. Problem: Using Python 2.5.2 and Tkinter ??? (came with system) List made and for loop in use lst=[ (S, Single), .] for

Re: [OT] large db question about no joins

2009-04-16 Thread norseman
Robert Kern wrote: ...(snip) Large database is not synonymous with distributed database. === True! And cross-code lookup tables can make otherwise very large 'bytes on disk' rather small overall. Z3 in common_names.dbf African Pygmy Zebra Z3 in

Re: zProblem

2009-04-15 Thread norseman
Steven D'Aprano wrote: On Tue, 14 Apr 2009 14:42:32 -0700, norseman wrote: Grids are uniform! Same size, non-changing across whole backdrop. There is nothing in uniform that says X==Y. Units along axis need not be same. Corners don't even have to be 90degrees. (Spherical) But they must

  1   2   >