Re: Python modules

2014-11-11 Thread Ben Finney
Will Acheson writes: > I have had a lot of trouble with executing relative imports with some > of my projects in python. > > Are there any best practices or methods besides '../../' type > hard-coding? The important point to learn with Python's import system, as contrasted with various other la

Re: Python modules

2014-11-11 Thread Will Acheson
On Sunday, November 9, 2014 11:51:41 PM UTC-5, Steve Hayes wrote: > I have a book on Python that advocates dividing programs into modules, and > importing them when needed. > > I have a question about this. > > I can understand doing that in a compiled language, where different modules > can be

Re: Python modules

2014-11-10 Thread Chris Angelico
On Tue, Nov 11, 2014 at 12:36 AM, Roy Smith wrote: > Yes, exactly. When you deploy your application someplace, you need to > include all the things it depends on. In the simple case of a few > python files (say, a main program and a few modules that you're > written), the easiest thing to do mig

Re: Python modules

2014-11-10 Thread Roy Smith
In article , Steve Hayes wrote: > I have a book on Python that advocates dividing programs into modules, and > importing them when needed. Yes, this is a good idea. Breaking your program down into modules, each of which does a small set of closely related things, makes it easier to manage.

Re: Python modules

2014-11-09 Thread Ben Finney
Steve Hayes writes: > So if I want to run it on another computer, where do I look for the > compiled executable program to copy? You generally don't do that (the compiled files tend to be specific to various aspects of the target platform). This is a way that i's important to remember that most

Re: Python modules

2014-11-09 Thread Steve Hayes
On Mon, 10 Nov 2014 16:12:07 +1100, Ben Finney wrote: >Steve Hayes writes: > >> I have a book on Python that advocates dividing programs into modules, >> and importing them when needed. > >Which book is this? (This is not essential to your question, but it >might help to gauge your broader learn

Re: Python modules

2014-11-09 Thread Ben Finney
Steve Hayes writes: > I have a book on Python that advocates dividing programs into modules, > and importing them when needed. Which book is this? (This is not essential to your question, but it might help to gauge your broader learning environment.) > I can understand doing that in a compiled

Re: Python modules

2014-11-09 Thread Deepfriedice
On 10/11/14 14:55, Steve Hayes wrote: I have a book on Python that advocates dividing programs into modules, and importing them when needed. I have a question about this. I can understand doing that in a compiled language, where different modules can be imported from all sorts of places when th

Re: Python modules

2013-01-14 Thread Grant Edwards
On 2013-01-14, Rick Johnson wrote: > Only a fool would do "from Tkinter import *"[2]. > [2] With the exception of command line testing, learning, or playing. I don't think those should be excepted. Habits acquired during learning/playing will be continue when doing real work, and "Example" code

Re: Python modules

2013-01-14 Thread Rick Johnson
On Monday, January 14, 2013 9:04:00 AM UTC-6, Chris Angelico wrote: > The performance cost of reimporting a module is very low; > in fact, trying to avoid it by adorning all your usage > with an extra dot-level will probably cost you a lot more, > since there'll be an extra lookup every time. Most

Re: Python modules

2013-01-14 Thread Dan Sommers
On Mon, 14 Jan 2013 15:54:27 +0100, zoom wrote: > Is there any "rules" regarding importing python modules within your own > module? I mean, how does this affects the performance of the program? "Even the initializers are optimized!" -- Mel, the real programmer Unless you've profiled it, and the

Re: Python modules

2013-01-14 Thread zoom
On 01/14/2013 04:01 PM, Dan Sommers wrote: On Mon, 14 Jan 2013 15:54:27 +0100, zoom wrote: Is there any "rules" regarding importing python modules within your own module? I mean, how does this affects the performance of the program? "Even the initializers are optimized!" -- Mel, the real prog

Re: Python modules

2013-01-14 Thread Chris Angelico
On Tue, Jan 15, 2013 at 1:54 AM, zoom wrote: > Is there any "rules" regarding importing python modules within your own > module? I mean, how does this affects the performance of the program? > > In short, when creating a module, is it worthwhile to be careful and import > only necessary functions,

Re: python modules collection

2008-01-31 Thread [EMAIL PROTECTED]
On 31 jan, 02:57, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/1/30, J. Peng <[EMAIL PROTECTED]>: > > > Hello, > > > Is there a site for python,which collects most kinds of python modules? > > like CPAN for Perl. > > Sometime I want to use a module,like the time/date modules,don't know > >

Re: python modules collection

2008-01-30 Thread Guilherme Polo
2008/1/30, J. Peng <[EMAIL PROTECTED]>: > Hello, > > Is there a site for python,which collects most kinds of python modules? > like CPAN for Perl. > Sometime I want to use a module,like the time/date modules,don't know > where I should search from. > Sorry if I have repeated this question on t

Re: Python modules

2006-05-15 Thread Robert Kern
Shirley Li wrote: > Dear Python experts, > > I'm a beginner of Python programming.I have a question about Python > modules. > > With the following: > = > import sys, os, string, math > from Numeric import * > from Matrix import * > = > at the beginning of my Py

Re: python modules in home dir

2005-04-23 Thread Uche Ogbuji
On Sat, 2005-04-16 at 08:12 -0600, Uche Ogbuji wrote: > On Sat, 2005-04-09 at 14:09 -0700, dzieciou wrote: > > > I'm new-comer in Python. > > I want to install few Python modules (4Suite, RDFLib, Twisted and Racoon) > > in my home directory, since Python installation is already installed in the >

Re: python modules in home dir

2005-04-16 Thread Uche Ogbuji
On Sat, 2005-04-09 at 14:09 -0700, dzieciou wrote: > I'm new-comer in Python. > I want to install few Python modules (4Suite, RDFLib, Twisted and Racoon) > in my home directory, since Python installation is already installed in the > system > and I'm NOT its admin. > I cannot install pyvm (portabl

Re: python modules in home dir

2005-04-11 Thread Laszlo Zsolt Nagy
[EMAIL PROTECTED] wrote: set the PYTHON_PATH to include your home directory Its correct name is 'PYTHONPATH'. Under C shell: setenv PYTHONPATH /home/yourlogin/pythonlibs Under bourne/bash: set PYTHONPATH=/home/yourlogin/pythonlibs export PYTHONPATH --

Re: python modules in home dir

2005-04-09 Thread [EMAIL PROTECTED]
set the PYTHON_PATH to include your home directory -- http://mail.python.org/mailman/listinfo/python-list

Re: Python modules for image / map manipulation?

2005-04-06 Thread [EMAIL PROTECTED]
my image file is only about 5 MB, so, it's not too large. I've done some testing with PIL and it will meet my needs, I think. I can see how I could slice and dice my image, or only present the cropped section that I need. thanks, S -- http://mail.python.org/mailman/listinfo/python-list

Re: Python modules for image / map manipulation?

2005-04-04 Thread Robert Kern
Robert Kern wrote: I use PROJ.4 via pipes for cartographic projections. http://proj.maptools.org/ There is an addon to the matplotlib plotting library that contains a binding for the PROJ.4 library, but I haven't gotten it to work on my Mac. http://matplotlib.sourceforge.net/toolkits.html Jus

Re: Python modules for image / map manipulation?

2005-04-04 Thread Robert Kern
Stewart Midwinter wrote: I would like to do some image / map manipulation with Python. I've got a very large map file in .png format. My thought is to chop it up into small tiles using some method. What Python module would be helpful for this? The PIL. I'm not sure how well it handles files of y

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Efrat Regev
"Kartic" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Efrat Regev wrote: > > Hello, > > > > I was wondering whether there are any Python > Erfat...yes...batteries included! > > http://docs.python.org/lib/internet.html > > Thanks, > -Kartic > Excellent! more like generator inc

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Christopher De Vries
On Thu, Feb 24, 2005 at 11:11:07AM -0600, Efrat Regev wrote: > I was wondering whether there are any Python modules for various > Internet protocols, ... Twisted (http://twistedmatrix.com/products/twisted) is an event driven framework for writing network applications. It includes many internet

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Kartic
Efrat Regev wrote: > Hello, > > I was wondering whether there are any Python modules for various > Internet protocols, e.g., is there something similar to > Erfat...yes...batteries included! http://docs.python.org/lib/internet.html Thanks, -Kartic -- http://mail.python.org/mailman/listinf