Re: Automatic import ?

2010-03-27 Thread C. B.
> In that particular case, replace automatic by implicit, and you got the > reason why it is not a good idea. > Maybe in your case the C habits clashes to the python habits. > You're right ! As a C developer, I appreciate to only include to deal with strings, without wondering which other heade

Re: Automatic import ?

2010-03-26 Thread C. B.
At first, thank you all for your answers. Some more details about what I'm coding and what I need... The classes AAA and BBB are just given as examples. In fact, BBB's constructor accepts several parameters, meaning it can be different for each creation of AAA. So it can't be simply skipped from

Re: Automatic import ?

2010-03-26 Thread C. B.
> > What is the behaviour of the __init__.py file? > Not yet used, but I read this file is run by Python when a module of a package is imported. So you can insert default importations in it. -- http://mail.python.org/mailman/listinfo/python-list

Automatic import ?

2010-03-25 Thread C. B.
Hi everyone, I'm currently coding a C library which provides several modules and objects. Let's say that some of these objects are classes called AAA and BBB. The constructor of AAA needs to get BBB as argument. So I can run the following code : from mymodule import AAA from mymodule import BBB

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Jeremy C B Nicoll
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Jeremy C B Nicoll a écrit : > > Figuring out how IDLE works is a bit beyond me at this stage. > > Did you try out, or is it just an a priori ? Sort of, no and yes... A few weeks ago I started trying to use Python & ID

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Jeremy C B Nicoll
Simon Forman <[EMAIL PROTECTED]> wrote: > On Dec 8, 6:45 pm, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > Ah, I've been using IDLE so far (but would probably prefer to write > > Python in my normal text editor). In IDLE Alt-X syntax checks the saved >

Re: searching a value of a dict (each value is a list)

2007-12-09 Thread Jeremy C B Nicoll
ored is suitable, you might sensibly use several or many smaller dicts to store all the data (and thus save time reverse-keying much less of it). -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: searching a value of a dict (each value is a list)

2007-12-09 Thread Jeremy C B Nicoll
[EMAIL PROTECTED] wrote: > Jeremy C B Nicoll: > > The code someone else posted ... > > If you are talking about my D code then I know it... No I meant the code that used python to iterate over the dict and create zillions of extra keys. I've deleted earlier posts in the th

Re: searching a value of a dict (each value is a list)

2007-12-09 Thread Jeremy C B Nicoll
put to. The code someone else posted to reverse the keys is all very well, but surely hugely wasteful on cpu, maybe storage, and elapsed time. Even if the dict in this form is needed for some other reason, couldn't the code that created it also create a reverse index at the same

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Jeremy C B Nicoll
Steve Howell <[EMAIL PROTECTED]> wrote: > > --- Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > > Steve Howell <[EMAIL PROTECTED]> wrote: > > > > > --- Jeremy C B Nicoll <[EMAIL PROTECTED]> > > wrote: > > > >

Re: Different kinds of Import Errors

2007-12-09 Thread Jeremy C B Nicoll
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 09 Dec 2007 00:25:53 +0000, Jeremy C B Nicoll wrote: > > > > for app_name in settings.INSTALLED_APPS: > > > try: > > > __import__(app_name + '.management',

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Jeremy C B Nicoll
Steve Howell <[EMAIL PROTECTED]> wrote: > > --- Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > What command (in XP) does one need to issue to > > syntax check a saved python > > script without running it? > > Perhaps oversimplifying a bit, running

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Jeremy C B Nicoll
ython script without running it? Does a syntax check report all syntax errors or just the first one found? -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: Different kinds of Import Errors

2007-12-08 Thread Jeremy C B Nicoll
that could be raised? How does one write a try/except piece of code that works (ie traps whatever exception occurs, though obviously it can't necessarily fix an arbitrary exception) for any exception, even those not known of in advance by the author? -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: File to dict

2007-12-08 Thread Jeremy C B Nicoll
is vast surely there's some or a lot of point in breaking it up into a group of smaller files? -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Finding out what other tasks are running

2007-11-23 Thread Jeremy C B Nicoll
and Linux/Unix ways of doing this? -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: What order does info get returned in by os.listdir()

2007-08-15 Thread Jeremy C B Nicoll
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 15 Aug 2007 12:34:27 +0100, Jeremy C B Nicoll wrote: > > > I've some supplementary questions... my original code was looking at > > each leafname in turn via > > > > for leaf in o

Re: What order does info get returned in by os.listdir()

2007-08-15 Thread Jeremy C B Nicoll
Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > When I use os.listdir() to return that list of leaf values, I do seem to > get them in alphabetical order, A before B before C etc, but the > ~-prefixed ones are returned after the Z-prefixed files rather than before > the A-ones.

What order does info get returned in by os.listdir()

2007-08-14 Thread Jeremy C B Nicoll
er than before the A-ones. I was wondering why... -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: Working with fixed format text db's

2007-06-08 Thread Jeremy C B Nicoll
Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-08, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > Neil Cerutti <[EMAIL PROTECTED]> wrote: > >> Luckily, the output format has not changed yet, so issues with > >> maintaining the above haven'

Re: Working with fixed format text db's

2007-06-08 Thread Jeremy C B Nicoll
ed to be sure that you don't have any other code anywhere that implicitly relies on a particular field being a known fixed length. > > However, I'd like something better. What precisely do you want to achieve? -- Jeremy C B Nicoll - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ruby/Python/REXX as a MUCK scripting language

2006-11-26 Thread Jeremy C B Nicoll
so that either no commands are passed to an external environment, or that only some are. Surely that'd be less work than creating something from scratch. -- Jeremy C B Nicoll, Edinburgh, Scotland - my opinions are my own. -- http://mail.python.org/mailman/listinfo/python-list