IMDbPY 4.4

2010-01-07 Thread Davide Alberani
IMDbPY 4.4 is available (tgz, rpm, exe) from: http://imdbpy.sourceforge.net/ IMDbPY is a Python package useful to retrieve and manage the data of the IMDb movie database about movies, people, characters and companies. In this release, a huge number of bugs were fixed and many parsers were

Re: Do I have to use threads?

2010-01-07 Thread Marco Salden
On Jan 6, 5:36 am, Philip Semanchuk phi...@semanchuk.com wrote: On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: Hello people, I have 5 directories corresponding 5  different urls .I want to   download images from those urls and place them in the respective   directories.I have to

buffer interface problem

2010-01-07 Thread Andrew Gillanders
I have run into a problem running a Python script that is part of the TerraGear suite for building scenery for FlightGear. I am using Mac OS X 10.4, running Python (version 3.0.1) in a Unix terminal. The purpose of the script is to walk a directory tree, unzipping files, and passing the

RE: How to reduce the memory size of python

2010-01-07 Thread Mishra Gopal-QBX634
Hi, I use twisted framework too to handle the xmlrpc request. It takes around 3-4MB of memory while importing itself. Is there any python coding standard I should follow to save the memory. Like import logging takes 1MB of memory. We only use on function getLogger by 'from logging import

Re: buffer interface problem

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 12:19 AM, Andrew Gillanders andrew.gilland...@uqconnect.edu.au wrote: I have run into a problem running a Python script that is part of the TerraGear suite for building scenery for FlightGear. I am using Mac OS X 10.4, running Python (version 3.0.1) in a Unix terminal.

How to execute a script from another script and other script does not do busy wait.

2010-01-07 Thread Rajat
I want to run a python script( aka script2) from another python script (aka script1). While script1 executes script2 it waits for script2 to complete and in doing so it also does some other useful work.(does not do a busy wait). My intention is to update a third party through script1 that script2

RE: How to execute a script from another script and other script does notdo busy wait.

2010-01-07 Thread VYAS ASHISH M-NTB837
Use threads Regards, Ashish Vyas -Original Message- From: python-list-bounces+ntb837=motorola@python.org [mailto:python-list-bounces+ntb837=motorola@python.org] On Behalf Of Rajat Sent: Thursday, January 07, 2010 2:42 PM To: python-list@python.org Subject: How to execute a

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-07 Thread John Machin
On Jan 7, 2:40 pm, W. eWatson wolftra...@invalid.com wrote: John Machin wrote: What you have been reading is the Internal maintenance specification (large font, near the top of the page) for the module. The xml file is the source of the docs, not meant to be user-legible. What is it

Re: Python books, literature etc

2010-01-07 Thread Stuart Murray-Smith
2010/1/6 J dreadpiratej...@gmail.com: A good point was brought up to me privately, and I agree completely, that the OP should re-state the request with a bit more specifics... Since the OP says he is at least familiar with Python, does he need info on beginner level books that are general

Re: File transfer with python

2010-01-07 Thread Shawn Milochik
Have a look at Paramiko. It lets you do secure transfers easily (scp/sftp) http://www.lag.net/paramiko/ Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing plain text with exact positioning on Windows

2010-01-07 Thread Nobody
On Tue, 05 Jan 2010 11:40:25 -0800, KvS wrote: Hardcopy document formats such as PostScript and PDF use positions relative to the edges of the page, not the margins. Right. Still, Acrobat Reader by default scales the contents to fit on a page and creates some margins by doing so, no? So if

suds problem

2010-01-07 Thread Fencer
Hello, I just started using suds to use web services. First I tried suds with a very simple web service I had written and was running myself. That worked fine. Then I tried to use the web services provided by KEGG: http://soap.genome.jp/KEGG.wsdl But I get a SAXParseException due to a supposed

Re: Python books, literature etc

2010-01-07 Thread Gabriel Genellina
Stuart Murray-Smith eigh...@gmail.com wrote in news:aadebb9f1001070146n70f5be7bw2e515f9d4afed...@mail.gmail.com: Anyways, to rephrase, could someone kindly mention any of their preferred Python books, websites, tutorials etc to help me get to an intermediate/advanced level? Something that

Re: Python books, literature etc

2010-01-07 Thread Gabriel Genellina
Stuart Murray-Smith eigh...@gmail.com wrote in news:aadebb9f1001070146n70f5be7bw2e515f9d4afed...@mail.gmail.com: Anyways, to rephrase, could someone kindly mention any of their preferred Python books, websites, tutorials etc to help me get to an intermediate/advanced level? Something that

Call a DLL function with argument type as unsigned char *

2010-01-07 Thread Bhavik
Hello, I am a newbie to the python language, and I need to call a DLL function from the python program. The DLL function has following prototype: unsigned int DLLFunction(unsigned char *, unsigned int); Now, I need to declare an array of 6 bytes in the python, and pass that array as the first

Re: Call a DLL function with argument type as unsigned char *

2010-01-07 Thread Bhavik
Just to clarify, I am using Python 2.5.1 -- http://mail.python.org/mailman/listinfo/python-list

Re: creating tar file and streaming it over HTTP?

2010-01-07 Thread Gabriel Genellina
En Wed, 06 Jan 2010 13:39:08 -0300, pbienst peter.bienst...@gmail.com escribió: The problem seems to be that the receiving end (wsgi server) does not see the end of the data: socket = environ[wsgi.input] while True: sys.stderr.write(before)

Re: How to execute a script from another script and other script does notdo busy wait.

2010-01-07 Thread Rajat
On Jan 7, 2:21 pm, VYAS ASHISH M-NTB837 ashish.v...@motorola.com wrote: Use threads Regards, Ashish Vyas -Original Message- From: python-list-bounces+ntb837=motorola@python.org [mailto:python-list-bounces+ntb837=motorola@python.org] On Behalf Of Rajat Sent: Thursday,

RE: How to execute a script from another script and other script doesnotdo busy wait.

2010-01-07 Thread VYAS ASHISH M-NTB837
Did you try? Thanks Ashish. I've single CPU machine. I've a feeling that the thread created, which would run script2, would eat up all of the CPU if I do not use sleep() in script2. That way, script1 would still be waiting for script2 to finish. Thus, my program is no way different from the

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Ben Finney
Steve Holden st...@holdenweb.com writes: Brilliant. It takes a real whole human being to make an admission like that (or even to bother to question their own behavior sufficiently to bother re-reading the thread). I think a lot more of you for the admission. Seconded. -- \ “bash awk

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Roel Schroeven
Bruno Desthuilliers schreef: Phlip a écrit : On Jan 5, 8:49 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: (A related question - why can't I just go 'if record = method(): use (record)'. Why extra lines just to trap and assign the variable before using it?) Because that

Re: How to reduce the memory size of python

2010-01-07 Thread Steve Holden
Mishra Gopal-QBX634 wrote: Hi, I use twisted framework too to handle the xmlrpc request. It takes around 3-4MB of memory while importing itself. Is there any python coding standard I should follow to save the memory. Like import logging takes 1MB of memory. We only use on function

Re: Call a DLL function with argument type as unsigned char *

2010-01-07 Thread Steve Holden
Bhavik wrote: Just to clarify, I am using Python 2.5.1 Take a look at the ctypes module, which allows you to do such things (at the risk of segmentation faults and the like if you get your calls wrong). regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon is

Re: embedded python on mac - linking problem

2010-01-07 Thread Krzysztof Kobus
Hi, I have been able to solve the problem finally: Initially I was trying (wrongly) to link distutils-made module with my application and that has failed. Solution was to (instead of linking the module) compile the source files making up the module and link corresponding objects as any other

Re: buffer interface problem

2010-01-07 Thread Andrew Gillanders
Thanks Chris. The atoi function was coming from the locale library (from locale import atoi). I changed it to int and now it works. The next hurdle is this: gzin = GzipFile(fname, 'rb') data = gzin.readline() #min_x,min_y = map(atoi,data.split()[:2]) min_x,min_y =

Re: buffer interface problem

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 4:47 AM, Andrew Gillanders andrew.gilland...@uqconnect.edu.au wrote: On 07/01/2010, at 7:13 PM, Chris Rebert wrote: On Thu, Jan 7, 2010 at 12:19 AM, Andrew Gillanders andrew.gilland...@uqconnect.edu.au wrote: I have run into a problem running a Python script that is

Re: Pass multidimensional array (matrix) to c function using ctypes

2010-01-07 Thread Daniel Platz
Thanks a lot. This solves my problem and I understand now much better what is going on. Best regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-07 Thread Stefan Behnel
Phlip, 05.01.2010 18:00: On Jan 5, 12:16 am, Stefan Behnel stefan...@behnel.de wrote: Note that there are tons of ways to generate HTML with Python. Forgot to note - I'm generating schematic XML, and I'm trying to find a way better than the Django template I started with! Well, then note

Re: Python books, literature etc

2010-01-07 Thread Stuart Murray-Smith
Have a look at the Getting Started section of the wiki: http://wiki.python.org/moin/ specially the PythonBooks section Perfect! Exactly what I'm looking for :) Thanks Gabriel! -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Lie Ryan
On 1/7/2010 10:43 PM, Roel Schroeven wrote: - I tend to think that not following that practice trains me to be careful in all cases, whereas I'm afraid that following the practice will make me careless, which is dangerous in all the cases where the practice won't protect me. That's a sign of

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Dave McCormick
Lie Ryan wrote: That's a sign of a gotcha... a well-designed language makes you think about your problem at hand and less about the language's syntax. Not until you learn the language that is. From a Python newbee ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI for multiplatform multimedia project

2010-01-07 Thread CM
On Jan 6, 4:53 pm, trzewic...@trzewiczek.info wrote: Hi everyone, I posted that question on a python-forum, but got answer, so I ask here. I'm working on an artistic project and I'm looking for the best cross-platform GUI solution. The problem is that it's gonna be a tool that will have to

Recommended new way for config files

2010-01-07 Thread Peter
Hi There seems to be several strategies to enhance the old ini-style config files with real python code, for example: 1) the documentation tool sphinx uses a python file conf.py that is exefile(d) , but execfile is suppressed in Python 3 2) there is a module cfgparse on sourceforge that

Re: How to execute a script from another script and other script does not do busy wait.

2010-01-07 Thread Jorgen Grahn
On Thu, 2010-01-07, Rajat wrote: I want to run a python script( aka script2) from another python script (aka script1). While script1 executes script2 it waits for script2 to complete and in doing so it also does some other useful work.(does not do a busy wait). My intention is to update a

Re: Recommended new way for config files

2010-01-07 Thread Jean-Michel Pichavant
Peter wrote: Hi There seems to be several strategies to enhance the old ini-style config files with real python code, for example: 1) the documentation tool sphinx uses a python file conf.py that is exefile(d) , but execfile is suppressed in Python 3 2) there is a module cfgparse on

Re: Recommended new way for config files

2010-01-07 Thread Lie Ryan
On 1/8/2010 3:10 AM, Peter wrote: Is there a strategy that should be prefered for new projects ? The answer is, it depends. -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I have to use threads?

2010-01-07 Thread Jorgen Grahn
On Thu, 2010-01-07, Marco Salden wrote: On Jan 6, 5:36 am, Philip Semanchuk phi...@semanchuk.com wrote: On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: Hello people, I have 5 directories corresponding 5  different urls .I want to   download images from those urls and place them in

Re: Recommended new way for config files

2010-01-07 Thread Robert Kern
On 2010-01-07 10:10 AM, Peter wrote: Hi There seems to be several strategies to enhance the old ini-style config files with real python code, for example: 1) the documentation tool sphinx uses a python file conf.py that is exefile(d) , but execfile is suppressed in Python 3 Only because it is

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-07 Thread Phlip
On Jan 7, 5:36 am, Stefan Behnel stefan...@behnel.de wrote: Well, then note that there are tons of ways to generate XML with Python, including the one I pointed you to. from lxml.html import builder as E xml = E.foo() All I want is foo/, but I get AttributeError: 'module'

Re: Python books, literature etc

2010-01-07 Thread Jorgen Grahn
On Thu, 2010-01-07, Stuart Murray-Smith wrote: ... [...] ESR's guide to smart questions [1] helps set the pace of list culture. It's good, if you can ignore the These People Are Very Important Hacker Gods, Not Mere Mortals subtext. ... Anyways, to rephrase, could someone kindly mention any of

Re: Do I have to use threads?

2010-01-07 Thread MRAB
Jorgen Grahn wrote: On Thu, 2010-01-07, Marco Salden wrote: On Jan 6, 5:36 am, Philip Semanchuk phi...@semanchuk.com wrote: On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: Hello people, I have 5 directories corresponding 5 different urls .I want to download images from those urls and

Re: Do I have to use threads?

2010-01-07 Thread Philip Semanchuk
On Jan 7, 2010, at 11:32 AM, Jorgen Grahn wrote: On Thu, 2010-01-07, Marco Salden wrote: On Jan 6, 5:36 am, Philip Semanchuk phi...@semanchuk.com wrote: On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: Hello people, I have 5 directories corresponding 5 different urls .I want to

ANN: Pymazon 0.1.0 released!

2010-01-07 Thread S. Chris Colbert
Hello, I'm happy to announce the first non-beta release of Pymazon: a python implemented downloader for the Amazon mp3 store. Improvements from the beta: - Running download status indicator - Various fixes for Windows - Some code cleanup Pymazon was created to be a simple and easy

Re: Recommended new way for config files

2010-01-07 Thread Peter
Thanks for your answer, let me be more precise: I would add the standard module ConfigParser http://docs.python.org/library/configparser.html to your list. of course, that was the implicit starting point of my request, when talking about .ini files. I don't know exactly what you intend to do

Re: Recommended new way for config files

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 10:19 AM, Peter vm...@mycircuit.org wrote: snip The .ini file is the simpliest solution, at least from the user point of view, no need to learn any python syntax. I am speaking from the point of view of a python programmer, and I find the .ini restrictions not

Dictionary used to build a Triple Store

2010-01-07 Thread Lee
Definitely a newbie question, so please bear with me. I'm reading Programming the Semantic Web by Segaran, Evans, and Tayor. It's about the Semantic Web BUT it uses python to build a toy triple store claimed to have good performance in the tens of thousands of triples. Just in case anybody

Re: How to reduce the memory size of python

2010-01-07 Thread Terry Reedy
On 1/7/2010 3:34 AM, Mishra Gopal-QBX634 wrote: Like import logging takes 1MB of memory. We only use on function getLogger by 'from logging import getLogger' But it still take the same 1 MB memory. Instead of loading whole logging module only load the getLogger function. from x import y

Re: Python books, literature etc

2010-01-07 Thread Peter
Anyways, to rephrase, could someone kindly mention any of their preferred Python books, websites, tutorials etc to help me get to an intermediate/advanced level? Something that would help me add functionality to Ubiquity, say. I may be alone in this, but Alex Martelli's book (Python in a

Re: Dictionary used to build a Triple Store

2010-01-07 Thread S. Chris Colbert
Definitely a newbie question, so please bear with me. I'm reading Programming the Semantic Web by Segaran, Evans, and Tayor. It's about the Semantic Web BUT it uses python to build a toy triple store claimed to have good performance in the tens of thousands of triples. Just in case

Re: Dictionary used to build a Triple Store

2010-01-07 Thread Steve Holden
Lee wrote: Definitely a newbie question, so please bear with me. I'm reading Programming the Semantic Web by Segaran, Evans, and Tayor. It's about the Semantic Web BUT it uses python to build a toy triple store claimed to have good performance in the tens of thousands of triples. Just

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Roel Schroeven
Lie Ryan schreef: On 1/7/2010 10:43 PM, Roel Schroeven wrote: - I tend to think that not following that practice trains me to be careful in all cases, whereas I'm afraid that following the practice will make me careless, which is dangerous in all the cases where the practice won't protect me.

PyQt QThreadPool error

2010-01-07 Thread h0uk
Hello. I have the following code: #workers = {} QtCore.QThreadPool.globalInstance().setExpiryTimeout (30) QtCore.QThreadPool.globalInstance().setMaxThreadCount(1) for i in range(1, int(userscnt) + 1): work = wk.Worker(i)

Re: How to execute a script from another script and other script does not do busy wait.

2010-01-07 Thread danmcle...@yahoo.com
On Jan 7, 9:18 am, Jorgen Grahn grahn+n...@snipabacken.se wrote: On Thu, 2010-01-07, Rajat wrote: I want to run a python script( aka script2) from another python script (aka script1). While script1 executes script2 it waits for script2 to complete and in doing so it also does some other

Re: GUI for multiplatform multimedia project

2010-01-07 Thread Diez B. Roggisch
trzewic...@trzewiczek.info schrieb: Hi everyone, I posted that question on a python-forum, but got answer, so I ask here. I'm working on an artistic project and I'm looking for the best cross-platform GUI solution. The problem is that it's gonna be a tool that will have to be double-click

Re: PyQt QThreadPool error

2010-01-07 Thread Diez B. Roggisch
h0uk schrieb: Hello. I have the following code: #workers = {} QtCore.QThreadPool.globalInstance().setExpiryTimeout (30) QtCore.QThreadPool.globalInstance().setMaxThreadCount(1) for i in range(1, int(userscnt) + 1): work =

Re: Recommended new way for config files

2010-01-07 Thread Peter
snip So what is the worshipped approach, when you need more than name=value pairs ? JSON is one option: http://docs.python.org/library/json.html Thanks, didn't think about that, although most of the apps I know don't seem to use this approach for improved conf file handling (

Re: How to execute a script from another script and other script does notdo busy wait.

2010-01-07 Thread Jan Kaliszewski
Rajat rajat.dud...@gmail.com wrote: I've single CPU machine. I've a feeling that the thread created, which would run script2, would eat up all of the CPU if I do not use sleep() in script2. That way, script1 would still be waiting for script2 to finish. Single CPU is not a problem for

Re: File transfer with python

2010-01-07 Thread Jan Kaliszewski
Valentin de Pablo Fouce thi...@gmail.com wrote: On 6 ene, 22:42, Jan Kaliszewski z...@chopin.edu.pl wrote: Valentin de Pablo Fouce thi...@gmail.com wrote: Ok, I am trying to do a very quick application (is home based so is not a big deal...). My intention is to transfer files from one

Re: Regex help needed!

2010-01-07 Thread Aahz
In article 19de1d6e-5ba9-42b5-9221-ed7246e39...@u36g2000prn.googlegroups.com, Oltmans rolf.oltm...@gmail.com wrote: I've written this regex that's kind of working re.findall(\w+\s*\W+amazon_(\d+),str) but I was just wondering that there might be a better RegEx to do that same thing. Can you

Re: PyQt QThreadPool error

2010-01-07 Thread h0uk
On 8 янв, 01:02, Diez B. Roggisch de...@nospam.web.de wrote: h0uk schrieb: Hello. I have the following code:             #workers = {}             QtCore.QThreadPool.globalInstance().setExpiryTimeout (30)             QtCore.QThreadPool.globalInstance().setMaxThreadCount(1)  

Re: PyQt QThreadPool error

2010-01-07 Thread Diez B. Roggisch
h0uk schrieb: On 8 янв, 01:02, Diez B. Roggisch de...@nospam.web.de wrote: h0uk schrieb: Hello. I have the following code: #workers = {} QtCore.QThreadPool.globalInstance().setExpiryTimeout (30) QtCore.QThreadPool.globalInstance().setMaxThreadCount(1)

Re: PyQt QThreadPool error

2010-01-07 Thread h0uk
On 8 янв, 02:25, Diez B. Roggisch de...@nospam.web.de wrote: h0uk schrieb: On 8 янв, 01:02, Diez B. Roggisch de...@nospam.web.de wrote: h0uk schrieb: Hello. I have the following code:             #workers = {}             QtCore.QThreadPool.globalInstance().setExpiryTimeout

Re: PyQt QThreadPool error

2010-01-07 Thread Phil Thompson
On Thu, 7 Jan 2010 13:03:24 -0800 (PST), h0uk vardan.pogos...@gmail.com wrote: On 8 янв, 01:02, Diez B. Roggisch de...@nospam.web.de wrote: h0uk schrieb: Hello. I have the following code:             #workers = {}             QtCore.QThreadPool.globalInstance().setExpiryTimeout

Re: a huge shared read-only data in parallel accesses -- How? multithreading? multiprocessing?

2010-01-07 Thread Klauss
On Dec 31 2009, 6:36 pm, garyrob gary...@mac.com wrote: One thing I'm not clear on regarding Klauss' patch. He says it's applicable where the data is primarily non-numeric. In trying to understand why that would be the case, I'm thinking that the increased per-object memory overhead for

Threading change, 2.5.4 - 2.6.1

2010-01-07 Thread Gib Bogle
The code below runs with Python 2.5.4, but gives the following error messages with Python 2.6.1. What needs to be done to make it work? Thanks. C:\Summer09\Tutorialspython url_queue.pyw Traceback (most recent call last): File url_queue.pyw, line 3, in module import threading File

Re: Regex help needed!

2010-01-07 Thread Rolando Espinoza La Fuente
# http://gist.github.com/271661 import lxml.html import re src = lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id = amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div hello, my age is 86 years old and I was born in 1945. Do you know that PI is roughly 3.1443534534534534534

One function calling another defined in the same file being exec'd

2010-01-07 Thread Mitchell L Model
[Python 3.1] I thought I thoroughly understood eval, exec, globals, and locals, but I encountered something bewildering today. I have some short files I want to exec. (Users of my application write them, and the application gives them a command that opens a file dialog box and execs the

Re: Threading change, 2.5.4 - 2.6.1

2010-01-07 Thread anon
Gib Bogle wrote: The code below runs with Python 2.5.4, but gives the following error messages with Python 2.6.1. What needs to be done to make it work? Thanks. C:\Summer09\Tutorialspython url_queue.pyw Traceback (most recent call last): File url_queue.pyw, line 3, in module import

Re: Dictionary used to build a Triple Store

2010-01-07 Thread Lee
Lee wrote: Definitely a newbie question, so please bear with me. I'm reading Programming the Semantic Web by Segaran, Evans, and Tayor. It's about the Semantic Web BUT it uses python to build a toy triple store claimed to have good performance in the tens of thousands of triples. Just in

Re: Threading change, 2.5.4 - 2.6.1

2010-01-07 Thread MRAB
Gib Bogle wrote: The code below runs with Python 2.5.4, but gives the following error messages with Python 2.6.1. What needs to be done to make it work? Thanks. C:\Summer09\Tutorialspython url_queue.pyw Traceback (most recent call last): File url_queue.pyw, line 3, in module import

Re: PyQt QThreadPool error

2010-01-07 Thread h0uk
On 8 янв, 03:02, Phil Thompson p...@riverbankcomputing.com wrote: On Thu, 7 Jan 2010 13:03:24 -0800 (PST), h0uk vardan.pogos...@gmail.com wrote: On 8 янв, 01:02, Diez B. Roggisch de...@nospam.web.de wrote: h0uk schrieb: Hello. I have the following code:             #workers = {}

Accessing python from a network share in windows 7

2010-01-07 Thread aj
I access python from a network share. This works fine on XP but on windows 7 it throws the following error: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import random Traceback (most recent

Re: One function calling another defined in the same file being exec'd

2010-01-07 Thread Mitchell L Model
I forgot to offer one answer for question [3] in what I just posted: I can define all the secondary functions inside one main one and just call the main one. That provides a separate local scope within the main function, with the secondary functions defined inside it when (each time) the

Re: One function calling another defined in the same file being exec'd

2010-01-07 Thread anon
Rather than exec the files, why not import them? I can get both your examples to work using the 'imp' module. http://docs.python.org/3.1/library/imp.html#module-imp I used python 2.6.4. Note that 3.1 also has 'importlib' module. import imp # the name of the python file written by a user name

Re: Accessing python from a network share in windows 7

2010-01-07 Thread MRAB
aj wrote: I access python from a network share. This works fine on XP but on windows 7 it throws the following error: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import random Traceback

Re: Accessing python from a network share in windows 7

2010-01-07 Thread aj
On Jan 7, 3:51 pm, MRAB pyt...@mrabarnett.plus.com wrote: aj wrote: I access python from a network share. This works fine on XP but on windows 7 it throws the following error: Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright,

PIL show() not working for 2nd pic

2010-01-07 Thread suresh.amritapuri
Hi I am using PIL for image processing in ubuntu 9.04. When i give two im.show() commands for two different images, the second image is not displayed (eye of gnome is the display program). It says no such file or directory. Any ideas? thanks suresh --

Re: Threading change, 2.5.4 - 2.6.1

2010-01-07 Thread Gib Bogle
MRAB wrote: Gib Bogle wrote: The code below runs with Python 2.5.4, but gives the following error messages with Python 2.6.1. What needs to be done to make it work? Thanks. C:\Summer09\Tutorialspython url_queue.pyw Traceback (most recent call last): File url_queue.pyw, line 3, in module

How do I access what's in this module?

2010-01-07 Thread Fencer
Hello, look at this lxml documentation page: http://codespeak.net/lxml/api/index.html How do I access the functions and variables listed? I tried from lxml.etree import ElementTree and the import itself seems to pass without complaint by the python interpreter but I can't seem to access

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-07 Thread Stephen Hansen
On Thu, Jan 7, 2010 at 8:44 AM, Phlip phlip2...@gmail.com wrote: On Jan 7, 5:36 am, Stefan Behnel stefan...@behnel.de wrote: Well, then note that there are tons of ways to generate XML with Python, including the one I pointed you to. from lxml.html import builder as E xml

Re: One function calling another defined in the same file being exec'd

2010-01-07 Thread Steven D'Aprano
On Thu, 07 Jan 2010 17:47:13 -0500, Mitchell L Model wrote: Next I call dofile() on a slightly more complex file, in which one function calls another function defined earlier in the same file. def fn1(val): return sum(range(val)) def fn2(arg):

Re: How do I access what's in this module?

2010-01-07 Thread John Machin
On Jan 8, 12:21 pm, Fencer no.i.d...@want.mail.from.spammers.com wrote: Hello, look at this lxml documentation page:http://codespeak.net/lxml/api/index.html That's for getting details about an object once you know what object you need to use to do what. In the meantime, consider reading the

Ask how to use HTMLParser

2010-01-07 Thread Water Lin
I am a new guy to use Python, but I want to parse a html page now. I tried to use HTMLParse. Here is my sample code: -- from HTMLParser import HTMLParser from urllib2 import urlopen class MyParser(HTMLParser): title = is_title = def __init__(self, url):

Re: How do I access what's in this module?

2010-01-07 Thread Fencer
On 2010-01-08 04:40, John Machin wrote: For example: from lxml.etree import ElementTree ElementTree.dump(None) Traceback (most recent call last): File console, line 1, inmodule lxml.etree is a module. ElementTree is effectively a class. The error message that you omitted to show

Re: How do I access what's in this module?

2010-01-07 Thread John Machin
On Jan 8, 2:45 pm, Fencer no.i.d...@want.mail.from.spammers.com wrote: On 2010-01-08 04:40, John Machin wrote: For example:    from lxml.etree import ElementTree    ElementTree.dump(None) Traceback (most recent call last):     File console, line 1, inmodule lxml.etree is a

Re: Ask how to use HTMLParser

2010-01-07 Thread h0uk
On 8 янв, 08:44, Water Lin water...@ymail.invalid wrote: I am a new guy to use Python, but I want to parse a html page now. I tried to use HTMLParse. Here is my sample code: -- from HTMLParser import HTMLParser from urllib2 import urlopen class MyParser(HTMLParser):    

Re: Ask how to use HTMLParser

2010-01-07 Thread h0uk
On 8 янв, 08:44, Water Lin water...@ymail.invalid wrote: I am a new guy to use Python, but I want to parse a html page now. I tried to use HTMLParse. Here is my sample code: -- from HTMLParser import HTMLParser from urllib2 import urlopen class MyParser(HTMLParser):    

Re: Need help to pass self.count to other classes.

2010-01-07 Thread Steven D'Aprano
On Wed, 06 Jan 2010 08:56:23 -0500, Steve Holden wrote: This is untested code (some days I don't seem to write any other kind ...) but it should give you the flavor: class kbInterface(object): def __init__(self): self.zxc = 0 def prompt1(self): self.count += 1

Clarifications on compiling for Windows

2010-01-07 Thread peteshinners
My presentation for Pycon is coming together, but I need to make sure my information about compiling Python and Python extensions for Windows is correct. I'm really only experienced with this on the Linux side of things. First of all, is the Windows FAQ fairly up to date? Should people be

Re: Ask how to use HTMLParser

2010-01-07 Thread Water Lin
h0uk vardan.pogos...@gmail.com writes: On 8 янв, 08:44, Water Lin water...@ymail.invalid wrote: I am a new guy to use Python, but I want to parse a html page now. I tried to use HTMLParse. Here is my sample code: -- from HTMLParser import HTMLParser from urllib2 import

Re: Clarifications on compiling for Windows

2010-01-07 Thread Mensanator
On Jan 8, 12:19 am, peteshinners p...@shinners.org wrote: My presentation for Pycon is coming together, but I need to make sure my information about compiling Python and Python extensions for Windows is correct. I'm really only experienced with this on the Linux side of things. First of all,

[issue1006238] cross compile patch

2010-01-07 Thread Jacob Godserv
Jacob Godserv jacobgods...@gmail.com added the comment: This bug affects me as well. Adding myself to CC. -- nosy: +javaJake ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1006238 ___

[issue1006238] cross compile patch

2010-01-07 Thread Jacob Godserv
Jacob Godserv jacobgods...@gmail.com added the comment: The stage of this bug could be changed to patch review, since a patch is available. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1006238

[issue1006238] cross compile patch

2010-01-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +needs review stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1006238 ___

[issue7651] Python3: guess text file charset using the BOM

2010-01-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Oops, fix read() method of my previous patch. -- Added file: http://bugs.python.org/file15783/open_bom-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7651

[issue7654] [patch] Enable additional bytes and memoryview tests.

2010-01-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti priority: - normal stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7654 ___

[issue5827] os.path.normpath doesn't preserve unicode

2010-01-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: - ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5827 ___ ___

[issue7635] 19.6 xml.dom.pulldom doc: stub?

2010-01-07 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: The xml.dom.pulldom module doesn't have docstrings so I guess that when the doc page has been created only the names of the classes/method have been listed. -- nosy: +ezio.melotti, loewis priority: - normal versions: +Python 2.6,

[issue5127] Use Py_UCS4 instead of Py_UNICODE in unicodectype.c

2010-01-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- title: UnicodeEncodeError - I can't even see license - Use Py_UCS4 instead of Py_UNICODE in unicodectype.c versions: +Python 3.1, Python 3.2 -Python 3.0 ___ Python tracker rep...@bugs.python.org

[issue7656] test_hashlib fails on some installations (specifically Neal's regression test runner)

2010-01-07 Thread R. David Murray
New submission from R. David Murray rdmur...@bitdance.com: The patch in issue3745 to build and run all hash tests in a debug build seems to have caused test_hashlib to start failing when run by the build.sh regression test runner. See the recent emails on python-checkins, where I used -W to

  1   2   >