Re: Clarifications on compiling for Windows

2010-01-07 Thread Mensanator
On Jan 8, 12:19 am, peteshinners 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, is the Wind

Re: Ask how to use HTMLParser

2010-01-07 Thread Water Lin
h0uk writes: > On 8 янв, 08:44, Water Lin 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(HTMLParse

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 referrin

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 +

Re: Ask how to use HTMLParser

2010-01-07 Thread h0uk
On 8 янв, 08:44, Water Lin 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): >     title = "" >  

Re: Ask how to use HTMLParser

2010-01-07 Thread h0uk
On 8 янв, 08:44, Water Lin 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): >     title = "" >  

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

2010-01-07 Thread John Machin
On Jan 8, 2:45 pm, Fencer 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 "", line 1, in > > > lxml.etree is a module. ElementTree is eff

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 "", line 1, in lxml.etree is a module. ElementTree is effectively a class. The error message that you omitted to show us mig

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 John Machin
On Jan 8, 12:21 pm, Fencer 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 tutorial and executing some of the exa

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: 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 wrote: > On Jan 7, 5:36 am, Stefan Behnel 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 ""

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 anythi

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\Tutorials>python url_queue.pyw Traceback (most recent call last): File "url_queue.pyw", line 3, in import

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 -- http://mail.python.org/mailman/listinfo/pyth

Re: Accessing python from a network share in windows 7

2010-01-07 Thread aj
On Jan 7, 3:51 pm, MRAB 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", "credits"

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 Trace

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: 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 ma

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

Re: PyQt QThreadPool error

2010-01-07 Thread h0uk
On 8 янв, 03:02, Phil Thompson wrote: > On Thu, 7 Jan 2010 13:03:24 -0800 (PST), h0uk > wrote: > > > On 8 янв, 01:02, "Diez B. Roggisch" wrote: > >> h0uk schrieb: > > >> > Hello. > > >> > I have the following code: > > >> >             #workers = {} > >> >             QtCore.QThreadPool.globalIn

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\Tutorials>python url_queue.pyw Traceback (most recent call last): File "url_queue.pyw", line 3, in import threading Fi

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

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\Tutorials>python url_queue.pyw Traceback (most recent call last): File "url_queue.pyw", line 3, in import threading Fi

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 chose

Re: Regex help needed!

2010-01-07 Thread Rolando Espinoza La Fuente
# http://gist.github.com/271661 import lxml.html import re src = """ lksjdfls kdjff lsdfs sdjfls sdfsdwelcome hello, my age is 86 years old and I was born in 1945. Do you know that PI is roughly 3.1443534534534534534 """ regex = re.compile('amazon_(\d+)') doc = lxml.html.document_fromstring(s

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\Tutorials>python url_queue.pyw Traceback (most recent call last): File "url_queue.pyw", line 3, in import threading File "C:\Summer09\Tut

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 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 reference-counting

Re: PyQt QThreadPool error

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

Re: PyQt QThreadPool error

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

Re: PyQt QThreadPool error

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

Re: PyQt QThreadPool error

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

Re: Regex help needed!

2010-01-07 Thread Aahz
In article <19de1d6e-5ba9-42b5-9221-ed7246e39...@u36g2000prn.googlegroups.com>, Oltmans 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 kindly suggest a

Re: File transfer with python

2010-01-07 Thread Jan Kaliszewski
Valentin de Pablo Fouce wrote: On 6 ene, 22:42, "Jan Kaliszewski" wrote: Valentin de Pablo Fouce 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 > computer to another. > My intention is to be abl

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

2010-01-07 Thread Jan Kaliszewski
Rajat 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 threads (in fact it's even

Re: Recommended "new" way for config files

2010-01-07 Thread Peter
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 ( ip

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 = wk.Wo

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 ins

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 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 useful work.(does not

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: 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 pro

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 > trip

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

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: 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

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 an

Re: Recommended "new" way for config files

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: >> 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 necessarily simple, for ex

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 wi

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 alternative

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

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 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 respe

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 an

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 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 "", but I get "AttributeError: 'module' object has no attribute

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: 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 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

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: 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 sourcefo

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

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 suppo

Re: GUI for multiplatform multimedia project

2010-01-07 Thread CM
On Jan 6, 4:53 pm, 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 be double-click inst

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: 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 a

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: 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 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 that there are tons o

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: buffer interface problem

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 4:47 AM, Andrew Gillanders wrote: > On 07/01/2010, at 7:13 PM, Chris Rebert wrote: >> On Thu, Jan 7, 2010 at 12:19 AM, Andrew Gillanders >> wrote: >>> >>> I have run into a problem running a Python script that is part of the >>> TerraGear suite for building scenery for Flig

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 = map(int,data.

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 s

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 comin

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 func

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 >> 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 idiom is respons

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Ben Finney
Steve Holden 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 grep perl sed,

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 samp

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" 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, January 07,

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 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") chunk = socket.re

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

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 ar

Re: Python books, literature etc

2010-01-07 Thread Gabriel Genellina
Stuart Murray-Smith 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 would help me

Re: Python books, literature etc

2010-01-07 Thread Gabriel Genellina
Stuart Murray-Smith 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 would help me

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 m

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

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: Python books, literature etc

2010-01-07 Thread Stuart Murray-Smith
2010/1/6 J : > 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 purpose, or is he > inte

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-07 Thread John Machin
On Jan 7, 2:40 pm, "W. eWatson" 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 used for? T

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 scrip

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: buffer interface problem

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 12:19 AM, Andrew Gillanders 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. > > The purpose of the script is t

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 getLog

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 con

Re: Do I have to use threads?

2010-01-07 Thread Marco Salden
On Jan 6, 5:36 am, Philip Semanchuk 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 extrac