Re: python24 symbol file...pyhon24.pdb

2008-01-23 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > I've seen a few references on the net to a python24.pdb file. I assume > it's a symbol file along the lines of the pdb files issued by > microsoft for their products. Maybe I'm wrong. .pdb files (program database) are created by MS' compiler, see http://en.wikipedia.org/

python2.4-dbg and C modules

2008-01-23 Thread hanke
Hello, please, when I try to run my code under python2.4-dbg from Ubuntu, the interpreter complains that the Py_InitModule4 symbol is undefined in a C module I'm using (PyOpenAL): ImportError: /var/lib/python-support/python2.4/_openal.so: undefined symbol: Py_InitModule4 Google reveals that thi

Re: python24 symbol file...pyhon24.pdb

2008-01-23 Thread Gabriel Genellina
En Wed, 23 Jan 2008 05:04:35 -0200, <[EMAIL PROTECTED]> escribió: > I've seen a few references on the net to a python24.pdb file. I assume > it's a symbol file along the lines of the pdb files issued by > microsoft for their products. Maybe I'm wrong. > > Has anyone seen such an animal? I don't g

Re: translating Python to Assembler

2008-01-23 Thread Wim Vander Schelden
On 1/23/08, Christian Heimes <[EMAIL PROTECTED]> wrote: > > Wim Vander Schelden wrote: > > Python modules and scripts are normally not even compiled, if they have > > been, > > its probably just the Python interpreter packaged with the scripts and > > resources. > > No, that is not correct. Python

Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Kristian Domke
Hello to all I am trying to learn python at the moment studying an example program (cftp.py from the twisted framework, if you want to know) There I found a line foo = (not f and 1) or 0 In this case f may be None or a string. If I am not wrong here, one could simply write foo = not f becaus

Re: HTML parsing confusion

2008-01-23 Thread M.-A. Lemburg
On 2008-01-23 01:29, Gabriel Genellina wrote: > En Tue, 22 Jan 2008 19:20:32 -0200, Alnilam <[EMAIL PROTECTED]> escribió: > >> On Jan 22, 11:39 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> Alnilam wrote: On Jan 22, 8:44 am, Alnilam <[EMAIL PROTECTED]> wrote: >> Pardon me, but the

Re: difflib confusion

2008-01-23 Thread krishnakant Mane
On 23/01/2008, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Jan 22, 6:57 pm, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > > hello all, > > I have a bit of a confusing question. > > firstly I wanted a library which can do an svn like diff with two files. > > let's say I have file1 and file2 where

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread cokofreedom
On Jan 23, 9:45 am, Kristian Domke <[EMAIL PROTECTED]> wrote: > Hello to all > > I am trying to learn python at the moment studying an example program > (cftp.py from the twisted framework, if you want to know) > > There I found a line > > foo = (not f and 1) or 0 > > In this case f may be None or

Re: HTML parsing confusion

2008-01-23 Thread cokofreedom
> The pages I'm trying to write this code to run against aren't in the > wild, though. They are static html files on my company's lan, are very > consistent in format, and are (I believe) valid html. Obvious way to check this is to go to http://validator.w3.org/ and see what it tells you about you

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Gary Herron
Kristian Domke wrote: > Hello to all > > I am trying to learn python at the moment studying an example program > (cftp.py from the twisted framework, if you want to know) > > There I found a line > > foo = (not f and 1) or 0 > > In this case f may be None or a string. > > If I am not wrong here, on

Re: Removing objects

2008-01-23 Thread Patrick Mullen
On Jan 22, 2008 10:59 PM, <[EMAIL PROTECTED]> wrote: > I am writing a game, and it must keep a list of objects. I've been > representing this as a list, but I need an object to be able to remove > itself. It doesn't know it's own index. If I tried to make each object > keep track of it's own index

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Jarek Zgoda
Gary Herron napisał(a): > However there *is* a (subtle) difference between > not f > and > (not f and 1) or 0 > > The first produces a boolean value, and the second produces an int > value, but since one is a subclass of the other, you'd have to write > quite perverse code care about the dif

Re: Hebrew in idle ans eclipse (Windows)

2008-01-23 Thread Martin v. Löwis
> Recall: > When I read data using sql I got a sequence like this: > \x88\x89\x85 > But when I entered heberw words directly in the print statement (or as > a dictionary key) > I got this: > \xe8\xe9\xe5 > > Now, scanning the encoding module I discovered that cp1255 maps > '\u05d9' to \xe9 > while

Re: python24 symbol file...pyhon24.pdb

2008-01-23 Thread Martin v. Löwis
> Also, is there source code available for python24 for Windoze? I have > seen reference to source code but not in a package for Windows. It's available from http://www.python.org/ftp/python/2.4/Python-2.4.tgz Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python2.4-dbg and C modules

2008-01-23 Thread Martin v. Löwis
> please, when I try to run my code under python2.4-dbg > from Ubuntu, the interpreter complains that the Py_InitModule4 > symbol is undefined in a C module I'm using (PyOpenAL): > > ImportError: /var/lib/python-support/python2.4/_openal.so: undefined > symbol: Py_InitModule4 > > Google reveals t

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread cokofreedom
Sorry, posted to quickly. Yes your logic is correct about the "logic" of the return, but theirs actually differs in what it returns, and I am guessing it is an important change. Where is this "foo" used? Perhaps its value is used in a way a boolean return couldn't be? Just a note, with these kind

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Duncan Booth
Kristian Domke <[EMAIL PROTECTED]> wrote: > foo = (not f and 1) or 0 > > In this case f may be None or a string. > > If I am not wrong here, one could simply write > > foo = not f > Yes, it sounds pretty silly, and not just on the level you spotted. The only difference between the two expres

InstallShield file properties issues

2008-01-23 Thread pakmarshal
Hi, I am using Install Shield 11 express to create an upgrade package (msi) and came across an issue i.e. when installer installs the package it changes the created date of the files to modified date (changes created date with modified date), in my situation the files have modified date newer than

what's wrong with the wmi.Terminate() method?

2008-01-23 Thread thunder54007
hi, here is my script: import win32con import time import wmi c = wmi.WMI() for process in c.Win32_Process(name = "notepad.exe"): print process.ProcessId, process.Name process.Terminate () when I have only one notepad.exe process in my system, this works fine, but when I have more than o

Module/package hierarchy and its separation from file structure

2008-01-23 Thread Peter Schuller
Hello, In writing some non-trivial amount of Python code I keep running into an organizational issue. I will try to state the problem fairly generally, and follow up with a (contrived) example. The root cause of my difficulties is that by default, the relationship between a module hierarchy and t

Re: what's wrong with the wmi.Terminate() method?

2008-01-23 Thread Tim Golden
[EMAIL PROTECTED] wrote: [... snip same problem as reported to python-win32 ...] See my reply on python-win32. TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: pairs from a list

2008-01-23 Thread Steven D'Aprano
On Tue, 22 Jan 2008 23:33:00 -0800, George Sakkis wrote: > As I mentioned already, I consider the seeking of the most efficient > solution a legitimate question, regardless of whether a "dumb" solution > is fast enough for an application. Call it a "don't be sloppy" principle > if you wish. Sure,

Computer Laptops

2008-01-23 Thread Richi
Zenith Director Laptop, Lenovo Laptop Model No: 3000 Y500, HCL Notebook Model No: AXX2202, Zenith Presidio Laptop many model of laptop please visit - http://www.homeshop18.com/hs18shop/faces/tiles/category.jsp?catalogueID=2&categoryID=920&parentCategoryID=909&q=&sid=&bid=&prc=&k1=&k2=&k3=&k4=&k

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Boris Borcic
I am surprised nobody pointed out explicitely that True==1 and False==0 so that for instance 5*(True+True)==10 and even (but implementation-dependent) : 5*(True+True) is 10 BB -- http://mail.python.org/mailman/listinfo/python-list

Announcement: Python module for pacparser (parses proxy auto-config files)

2008-01-23 Thread Manu Garg
Fellas, I am mighty pleased to announce the release of python module for pacparser. pacparser is a library to parse proxy auto-config (PAC) files. Proxy auto-config files are already a vastly used web proxy configuration method these days (either directly or via web proxy autodiscovery protocol) a

Re: Module/package hierarchy and its separation from file structure

2008-01-23 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jan 2008 03:49:56 -0600, Peter Schuller wrote: > Let me just shoot down one possible suggestion right away, to show you > what I am trying to accomplish: > > I do *not* want to simply break out X into org.lib.animal.x, and have > org.lib.animal import org.lib.animal.x.X as X. Then you

Re: subprocess and & (ampersand)

2008-01-23 Thread Tim Golden
Steven Bethard wrote: > I'm having trouble using the subprocess module on Windows when my > command line includes special characters like "&" (ampersand):: > > >>> command = 'lynx.bat', '-dump', 'http://www.example.com/?x=1&y=2' > >>> kwargs = dict(stdin=subprocess.PIPE, > ... std

Re: UDP Client/Server

2008-01-23 Thread Martin Marcher
Guilherme Polo wrote: >> >>> class FooRequestHandler(BaseRequestHandler): >> ... def handle(self): >> ... data, addr_info = self.request[1].recvfrom(65534) > > Your FooReceiveServer subclasses UDPServer, it already handled the > recvfrom for you, so, this is wrong. > hmm then why

Re: Removing objects

2008-01-23 Thread Helmut Jarausch
[EMAIL PROTECTED] wrote: > I am writing a game, and it must keep a list of objects. I've been > representing this as a list, but I need an object to be able to remove > itself. It doesn't know it's own index. If I tried to make each object > keep track of it's own index, it would be invalidated whe

application error in python

2008-01-23 Thread abhishek
hello group i am working on a project where most of the code has been written in c++ but the web component is written in python. Initially we have been using python2.4 and vs.net2003 but recently we decided to move ahead with python2.5 and vs.net2005. the problem that has been haunting me for whil

Re: subprocess and & (ampersand)

2008-01-23 Thread Tim Golden
Steven Bethard wrote: > I'm having trouble using the subprocess module on Windows when my > command line includes special characters like "&" (ampersand):: > > >>> command = 'lynx.bat', '-dump', 'http://www.example.com/?x=1&y=2' > >>> kwargs = dict(stdin=subprocess.PIPE, > ... std

Re: Problem with processing XML

2008-01-23 Thread Stefan Behnel
Hi, Paul Boddie wrote: > People will, of course, tell you that you shouldn't use a DOM for > anything and that the "consensus" is to use ElementTree or lxml (see > above), but I can't help feeling that this has a damaging effect on > the XML situation for Python: some newcomers would actually bene

wxpython

2008-01-23 Thread joe jacob
I am trying to open a file containing non displayable characters like contents an exe file. The is is with the below mentioned code: self.text_ctrl_1.SetValue(file_content) If the file_content contains non displayable characters I am getting an error like this: Traceback (most recent call last):

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Stefan Behnel
Hi, Mike Driscoll wrote: > I got lxml to create a tree by doing the following: > > from lxml import etree > from StringIO import StringIO > > parser = etree.HTMLParser() > tree = etree.parse(filename, parser) > xml_string = etree.tostring(tree) > context = etree.iterparse(StringIO(xml_string))

Re: UDP Client/Server

2008-01-23 Thread Guilherme Polo
2008/1/23, Martin Marcher <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > >> >>> class FooRequestHandler(BaseRequestHandler): > >> ... def handle(self): > >> ... data, addr_info = self.request[1].recvfrom(65534) > > > > Your FooReceiveServer subclasses UDPServer, it already handled t

Re: Is there a HTML parser who can reconstruct the original html EXACTLY?

2008-01-23 Thread A.T.Hofkamp
On 2008-01-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, I am looking for a HTML parser who can parse a given page into > a DOM tree, and can reconstruct the exact original html sources. Why not keep a copy of the original data instead? That would be VERY MUCH SIMPLER than trying to

Re: wxpython

2008-01-23 Thread Tim Golden
joe jacob wrote: > I am trying to open a file containing non displayable characters like > contents an exe file. The is is with the below mentioned code: > > self.text_ctrl_1.SetValue(file_content) > > If the file_content contains non displayable characters I am getting > an error like this: > >

Re: Removing objects

2008-01-23 Thread Steven D'Aprano
On Tue, 22 Jan 2008 22:59:07 -0800, bladedpenguin wrote: > I am writing a game, and it must keep a list of objects. I've been > representing this as a list, but I need an object to be able to remove > itself. It doesn't know it's own index. If I tried to make each object > keep track of it's own i

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Steven D'Aprano
On Wed, 23 Jan 2008 09:30:28 +, Duncan Booth wrote: > Kristian Domke <[EMAIL PROTECTED]> wrote: > >> foo = (not f and 1) or 0 >> >> In this case f may be None or a string. >> >> If I am not wrong here, one could simply write >> >> foo = not f >> >> > Yes, it sounds pretty silly, and not

Re: Removing objects

2008-01-23 Thread bladedpenguin
On Jan 23, 2:24 am, Robert Kern <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I am writing a game, and it must keep a list of objects. I've been > > representing this as a list, but I need an object to be able to remove > > itself. It doesn't know it's own index. If I tried to make each

Re: translating Python to Assembler...sorry if this is duplicated...it's unintentional

2008-01-23 Thread GHUM
> My expertise, if any, is in assembler. I'm trying to understand Python > scripts and modules by examining them after they have been > disassembled in a Windows environment. Maybe you could also profit from diassembling Pythons bytecode into MNEmonics of the Python Virtual Machine ? http://docs.

Re: docbook and xmlproc

2008-01-23 Thread Stefan Behnel
Tim Arnold wrote: > I'm unable to get xmlproc to validate my docbook test file. This is new > territory for me, so I'd appreciate any advice on what I'm doing wrong. > Using python 2.4 on HPux10.20. I do not have much experience with xmlproc, but I'd encourage you to use lxml, which uses the pars

Re: Removing objects

2008-01-23 Thread Eduardo O. Padoan
On Jan 23, 2008 9:55 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > For that to work, you need to give your class an __eq__ method, and have > it match by name: > > # put this in MyClass > def __eq__(self, other): > return self.name == self.other Do you mean: # put this in M

Re: HTML parsing confusion

2008-01-23 Thread Alnilam
On Jan 23, 3:54 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > >> I was asking this community if there was a simple way to use only the > >> tools included with Python to parse a bit of html. > > There are lots of ways doing HTML parsing in Python. A common > one is e.g. using mxTidy to convert

Re: Problem with processing XML

2008-01-23 Thread Paul Boddie
On 23 Jan, 12:03, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > I had a discussion with Java people lately and they were all for Ruby, Groovy > and similar languages, "because they have curly braces and are easy to learn > when you know Java". > > My take on that is: Python is easy to learn, full-st

Re: translating Python to Assembler

2008-01-23 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > My expertise, if any, is in assembler. I'm trying to understand > Python scripts and modules by examining them after they have been > disassembled in a Windows environment. IMHO, that approach doesn't make sense to understand scripts or modules (except if you have some

Re: translating Python to Assembler

2008-01-23 Thread Bjoern Schliessmann
Grant Edwards wrote: > Trying to find assembly language stuff to look at is futile. > Python doesn't get compiled into assembly language. So, how do processors execute Python scripts? :) > If you want to learn Python, then read a book on Python. ACK. Regards, Björn -- BOFH excuse #198:

Re: problem deriving form type long

2008-01-23 Thread Frederic Rentsch
Gabriel Genellina wrote: > En Mon, 21 Jan 2008 18:33:10 -0200, Frederic Rentsch > <[EMAIL PROTECTED]> escribió: > >> Hi, here's something that puzzles me: >> >> >>> class Fix_Point (long): >> def __init__ (self, l): >>long.__init__ (self, l * 0x1): >> >> >>> fp = Fix_Point

Re: Removing objects

2008-01-23 Thread Peter Otten
bladedpenguin wrote: > So, in general, is it more efficient to use a dictionary or to override > the __eq__ function? Rule of thumb: If you want to add/remove arbitrary objects from a collection a dictionary (or set) is always faster than a list. You may still have to override the __eq__() and

Re: Max Long

2008-01-23 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Indeed, as the docs pointed out. I guess I was confused by > > "If pylong is greater than ULONG_MAX, an OverflowError is raised." > > at http://docs.python.org/api/longObjects.html. Take care -- this is about "unsigned long" data type of C, not a Python "long" instan

Re: Is there a HTML parser who can reconstruct the original html EXACTLY?

2008-01-23 Thread kliu
On Jan 23, 7:39 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-01-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, I am looking for a HTML parser who can parse a given page into > > a DOM tree, and can reconstruct the exact original html sources. > > Why not keep a copy of th

Re: translating Python to Assembler

2008-01-23 Thread Christian Heimes
Wim Vander Schelden wrote: > I didn't know that python uses a VM, I thought it still used an > interpretter! You > learn something new everyday :) still? I don't think Python ever used a different model. Most modern languages are using an interpreted byte code approach: http://en.wikipedia.org/wi

pythonic backtrace with gdb

2008-01-23 Thread Hynek Hanke
Hello, please, I'm trying to obtain a pythonic backtrace via gdb to be able to debug deadlock situations in a multi-threaded program by attaching to the running process. I'm running the program under python2.4-dbg, When I try to load the .gdbinit script obtained at http://wiki.python.org/moin

Re: A global or module-level variable?

2008-01-23 Thread Bret
On Jan 22, 1:00 pm, Paul Rubin wrote: > If you have to do it that way, use: Is there a better way? A more Pythonic way? -- http://mail.python.org/mailman/listinfo/python-list

How avoid both a newline and a space between 2 print commands?

2008-01-23 Thread [EMAIL PROTECTED]
print "foo" print "bar" has a newline in between "foo" and "bar" print "foo", print "bar" has a space in between "foo" and "bar" How prevent ANYTHING from going in between "foo" and "bar" ?? (Without defining a string variable.) Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a HTML parser who can reconstruct the original html EXACTLY?

2008-01-23 Thread Paul Boddie
On 23 Jan, 14:20, kliu <[EMAIL PROTECTED]> wrote: > > Thank u for your reply. but what I really need is the mapping between > each DOM nodes and the corresponding original source segment. At the risk of promoting unfashionable DOM technologies, you can at least serialise fragments of the DOM in li

RE: question

2008-01-23 Thread jyoung79
Just wanted to say thanks to everyone for these helpful replies! I really appreciate it! :-) Jay -- http://mail.python.org/mailman/listinfo/python-list

A GUI framework for running simulations

2008-01-23 Thread [EMAIL PROTECTED]
Hello! I am currently working on writing a simulation engine for special relativity physics. I'm writing it in Python, of course. I'm doing fine with the engine, but I want a GUI framework in which I could use it conveniently, and test different setups on it. I'm not so strong with GUI programming.

Re: Problem with processing XML

2008-01-23 Thread Stefan Behnel
Hi, Paul Boddie wrote: > I'm not disputing the benefits of the ElementTree approach, but one > has to recall that the DOM is probably the most widely used XML API > out there (being the one most client-side developers are using) and > together with the other standards (XPath and so on) isn't as ba

Re: How avoid both a newline and a space between 2 print commands?

2008-01-23 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > print "foo" > print "bar" > > has a newline in between "foo" and "bar" > > print "foo", > print "bar" > > has a space in between "foo" and "bar" > > How prevent ANYTHING from going in between "foo" and "bar" ?? > > (Without defining a string variable.) sys.stdout.w

Re: How avoid both a newline and a space between 2 print commands?

2008-01-23 Thread Remco Gerlich
Hi, Use import sys sys.stdout.write("foo") sys.stdout.write("bar") (and, possibly, sys.stdout.flush() to get the text to show up, it might wait for the end of a complete line otherwise). The alternative import sys print "foo", sys.stdout.softspace=0 print "bar" is just too hackish. In Python

Re: A GUI framework for running simulations

2008-01-23 Thread Guilherme Polo
2008/1/23, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hello! I am currently working on writing a simulation engine for > special relativity physics. I'm writing it in Python, of course. I'm > doing fine with the engine, but I want a GUI framework in which I > could use it conveniently, and test diffe

csv to xls using python 2.1.3

2008-01-23 Thread LizzyLiz
Hi I need to convert a .csv file to .xls file using python 2.1.3 which means I can't use pyExcelerator! Does anyone know how I can do this? Many thanks LizzyLiz -- http://mail.python.org/mailman/listinfo/python-list

twisted: problem with sftp-client

2008-01-23 Thread Kristian Domke
Hello Folks, I don't know, if it is ok to post large portions of code, but I have really no idea where the problem lies, so I don't have much of a choice. I am programming a tool, which in the end shall connect to an sftp-server, take the list of files in a specified directory, searches for some

Re: csv to xls using python 2.1.3

2008-01-23 Thread Tim Golden
LizzyLiz wrote: > Hi > > I need to convert a .csv file to .xls file using python 2.1.3 which > means I can't use pyExcelerator! Does anyone know how I can do this? > > Many thanks > LizzyLiz Use win32com.client to start Excel, tell it to .Open the .csv file and then tell it to .SaveAs an Excel

Re: A GUI framework for running simulations

2008-01-23 Thread km
Hi, check SimPy module and then http://www.showmedo.com/videos/series?name=pythonThompsonVPythonSeries KM On Jan 23, 2008 8:10 PM, Guilherme Polo <[EMAIL PROTECTED]> wrote: > 2008/1/23, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Hello! I am currently working on writing a simulation engine for

Re: csv to xls using python 2.1.3

2008-01-23 Thread LizzyLiz
Perfect! Thanks :-) LizzyLiz -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess and & (ampersand)

2008-01-23 Thread Ross Ridge
Tim Golden <[EMAIL PROTECTED]> wrote: >but this doesn't: > > >"c:\Program Files\Mozilla Firefox\firefox.exe" "%*" > > > >import subprocess > >cmd = [ >r"c:\temp\firefox.bat", >"http://local.goodtoread.org/search?word=tim&cached=0"; >] >subprocess.Popen (cmd) > > You need to use double quotes both

Re: subprocess and & (ampersand)

2008-01-23 Thread Tim Golden
Ross Ridge wrote: > Tim Golden <[EMAIL PROTECTED]> wrote: >> but this doesn't: >> >> >> "c:\Program Files\Mozilla Firefox\firefox.exe" "%*" >> >> >> >> import subprocess >> >> cmd = [ >> r"c:\temp\firefox.bat", >> "http://local.goodtoread.org/search?word=tim&cached=0"; >> ] >> subprocess.Popen

Re: A GUI framework for running simulations

2008-01-23 Thread Stef Mientki
[EMAIL PROTECTED] wrote: > Hello! I am currently working on writing a simulation engine for > special relativity physics. I'm writing it in Python, of course. I'm > doing fine with the engine, but I want a GUI framework in which I > could use it conveniently, and test different setups on it. I'm no

Re: How avoid both a newline and a space between 2 print commands?

2008-01-23 Thread Mike Kent
On Jan 23, 9:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > print "foo" > print "bar" > > has a newline in between "foo" and "bar" > > print "foo", > print "bar" > > has a space in between "foo" and "bar" > > How prevent ANYTHING from going in between "foo" and "bar" ?? > > (Without defini

Python CGI script and CSS style sheet

2008-01-23 Thread epsilon
All: I'm working with a Python CGI script that I am trying to use with an external CSS (Cascading Style Sheet) and it is not reading it from the web server. The script runs fine minus the CSS formatting. Does anyone know if this will work within a Python CGI? It seems that line 18 is not being

Lxml on mac

2008-01-23 Thread marcroy . olsen
Hi, What to one do if one what to use lxml(http://codespeak.net/lxml/ index.html) on a mac? Best regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a HTML parser who can reconstruct the original html EXACTLY?

2008-01-23 Thread Stefan Behnel
Hi, kliu wrote: > what I really need is the mapping between each DOM nodes and > the corresponding original source segment. I don't think that will be easy to achieve. You could get away with a parser that provides access to the position of an element in the source, and then map changes back into

Re: Lxml on mac

2008-01-23 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > What to one do if one what to use lxml(http://codespeak.net/lxml/ > index.html) on a mac? Have you tried installing up-to-date versions of libxml2/libxslt and running easy_install lxml ? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with processing XML

2008-01-23 Thread Paul Boddie
On 23 Jan, 15:12, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > Paul Boddie wrote: > > I'm not disputing the benefits of the ElementTree approach, but one > > has to recall that the DOM is probably the most widely used XML API > > out there (being the one most client-side developers are using) and >

Python printing!

2008-01-23 Thread SMALLp
Hy. How to use printer in python. I goggled little i I found only some win32 package which doesn't look processing for cross platform application. (I'm using USB printer and I tried to f=open("dev/...") usb port but i couldn't fond where printer is! Tnx! SMALLp -- http://mail.python.org/mail

Re: twisted: problem with sftp-client

2008-01-23 Thread Jean-Paul Calderone
On Wed, 23 Jan 2008 15:43:47 +0100, Kristian Domke <[EMAIL PROTECTED]> wrote: >Hello Folks, > >I don't know, if it is ok to post large portions of code, but I have >really no idea where the problem lies, so I don't have much of a choice. > >I am programming a tool, which in the end shall connect to

Re: HTML parsing confusion

2008-01-23 Thread Jerry Hill
On Jan 23, 2008 7:40 AM, Alnilam <[EMAIL PROTECTED]> wrote: > Skipping past html validation, and html to xhtml 'cleaning', and > instead starting with the assumption that I have files that are valid > XHTML, can anyone give me a good example of how I would use _ htmllib, > HTMLParser, or ElementTre

Re: Lxml on mac

2008-01-23 Thread marcroy . olsen
On Jan 23, 4:19 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > What to one do if one what to use lxml(http://codespeak.net/lxml/ > > index.html) on a mac? > > Have you tried installing up-to-date versions of libxml2/libxslt and running > >    easy_install lxml > > ? > >

Re: A GUI framework for running simulations

2008-01-23 Thread [EMAIL PROTECTED]
On Jan 23, 5:12 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello! I am currently working on writing a simulation engine for > > special relativity physics. I'm writing it in Python, of course. I'm > > doing fine with the engine, but I want a GUI framework in which I

Re: PyGTK, Glade, and ComboBoxEntry.append_text()

2008-01-23 Thread Greg Johnston
On Jan 21, 5:44 pm, Greg Johnston <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm a relative newbie to Python (switched over from Scheme fairly > recently) but I've been usingPyGTKand Glade to create an interface, > which is a combo I'm very impressed with. > > There is, however, one thing I've been

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Mike Driscoll
John and Stefan, On Jan 23, 5:33 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi, > > Mike Driscoll wrote: > > I got lxml to create a tree by doing the following: > > > from lxml import etree > > from StringIO import StringIO > > > parser = etree.HTMLParser() > > tree = etree.parse(filename, par

Re: Just for fun: Countdown numbers game solver

2008-01-23 Thread Terry Jones
Hi Arnaud and Dan > "Arnaud" == Arnaud Delobelle <[EMAIL PROTECTED]> writes: >> What was wrong with the very fast(?) code you sent earlier? Arnaud> I thought it was a bit convoluted, wanted to try something I Arnaud> thought had more potential. I think the problem with the second Arnaud> one

Re: Trouble writing to database: RSS-reader

2008-01-23 Thread Arne
On Jan 21, 11:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 21 Jan 2008 18:38:48 -0200, Arne <[EMAIL PROTECTED]> escribi�: > > > > > On 21 Jan, 19:15, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > > >> This should not prevent you from learning how to properly parse XML > >> (

Re: Lxml on mac

2008-01-23 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > On Jan 23, 4:19 pm, Stefan Behnel wrote: >> [EMAIL PROTECTED] wrote: >>> What to one do if one what to use lxml(http://codespeak.net/lxml/ >>> index.html) on a mac? >> Have you tried installing up-to-date versions of libxml2/libxslt and running >> >>easy_install lxml

Re: subprocess and & (ampersand)

2008-01-23 Thread Steven Bethard
Ross Ridge wrote: > Tim Golden <[EMAIL PROTECTED]> wrote: >> but this doesn't: >> >> >> "c:\Program Files\Mozilla Firefox\firefox.exe" "%*" >> >> >> >> import subprocess >> >> cmd = [ >> r"c:\temp\firefox.bat", >> "http://local.goodtoread.org/search?word=tim&cached=0"; >> ] >> subprocess.Popen

Re: Python CGI script and CSS style sheet

2008-01-23 Thread Tim Chase
> I'm working with a Python CGI script that I am trying to use with an > external CSS (Cascading Style Sheet) and it is not reading it from the > web server. The script runs fine minus the CSS formatting. Does > anyone know if this will work within a Python CGI? It seems that line > 18 is not be

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Mike Driscoll
Stefan, > I would really encourage you to use the normal parser here instead of > iterparse(). > > from lxml import etree > parser = etree.HTMLParser() > > # parse the HTML/XML melange > tree = etree.parse(filename, parser) > > # if you want, you can construct a pure XML document > ro

Re: Python CGI script and CSS style sheet

2008-01-23 Thread epsilon
Tim, Thanks for the information and I'll work with you suggestions. Also, I will let you know what I find. Thanks again, Christopher Tim Chase wrote: > > I'm working with a Python CGI script that I am trying to use with an > > external CSS (Cascading Style Sheet) and it is not reading it from

Re: subprocess and & (ampersand)

2008-01-23 Thread Ross Ridge
Tim Golden <[EMAIL PROTECTED]> wrote: > but this doesn't: > > > "c:\Program Files\Mozilla Firefox\firefox.exe" "%*" > > > > import subprocess > > cmd = [ > r"c:\temp\firefox.bat", > "http://local.goodtoread.org/search?word=tim&cached=0"; > ] > subprocess.Popen (cmd) > > Ross Ridge wrote: > Y

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Mike Driscoll
On Jan 22, 5:31 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jan 22, 10:57 am, Mike Driscoll <[EMAIL PROTECTED]> wrote:> Hi, > > > I need to parse a fairly complex HTML page that has XML embedded in > > it. I've done parsing before with the xml.dom.minidom module on just > > plain XML, but I ca

py2exe: python modules and applicaation

2008-01-23 Thread vedrandekovic
Hello again, I'am working a simple application with wxpython, py2exe and directpython.After I write python code in my wxpython textctrl, then my application must save that code and create ( pgssetup2.py script ), and then with py2exe create (.exe) of the code. ( my application is builded with py2

Re: Python printing!

2008-01-23 Thread Tim Golden
SMALLp wrote: > Hy. How to use printer in python. I goggled little i I found only some > win32 package which doesn't look processing for cross platform > application. (I'm using USB printer and I tried to f=open("dev/...") usb > port but i couldn't fond where printer is! You perhaps want to lo

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Stefan Behnel
Mike Driscoll wrote: > Both the normal parser example and the objectify example you gave me > give a traceback as follows: > > Traceback (most recent call last): > File "\\clippy\xml_parser2.py", line 70, in -toplevel- > for row in tree.iterfind("//Row"): > AttributeError: 'etree._ElementTre

Re: Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'?

2008-01-23 Thread Gary Herron
Boris Borcic wrote: > I am surprised nobody pointed out explicitely that > > True==1 and False==0 > Several of us did indeed point this out by saying that bool's are a subclass of ints. > so that for instance > > 5*(True+True)==10 > > and even (but implementation-dependent) : > > 5*(True+True) i

Re: Is there a HTML parser who can reconstruct the original html EXACTLY?

2008-01-23 Thread A.T.Hofkamp
On 2008-01-23, kliu <[EMAIL PROTECTED]> wrote: > On Jan 23, 7:39 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: >> On 2008-01-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> > Hi, I am looking for a HTML parser who can parse a given page into >> > a DOM tree, and can reconstruct the exact

Re: pairs from a list

2008-01-23 Thread Alan G Isaac
Steven D'Aprano wrote: > In fact, "fastest" isn't even a meaningful attribute. Does it mean: > > * the worst-case is fastest > * the best-case is fastest > * the average-case is fastest > * fastest on typical data > * all of the above I confess that it did not occur to me that there might be an

Re: application error in python

2008-01-23 Thread Jason
On Jan 23, 4:29 am, abhishek <[EMAIL PROTECTED]> wrote: > hello group i am working on a project where most of the code has been > written in c++ but the web component is written in python. Initially > we have been using python2.4 and vs.net2003 but recently we decided to > move ahead with python2.5

Re: Bug in __init__?

2008-01-23 Thread Bruno Desthuilliers
Bart Ogryczak a écrit : > On 2008-01-22, citizen Bruno Desthuilliers testified: >>> from copy import copy >>> ### see also deepcopy >>> self.lst = copy(val) >> What makes you think the OP wants a copy ? > > I´m guessing he doesn´t want to

  1   2   3   >