Try this:
http://www.demonseed.net/~jp/code/magic.py
--
http://mail.python.org/mailman/listinfo/python-list
Hi Alex,
Thanks for the input.
Being new to Python, and after having selected Python in comparison to
ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
be an obvious and easy to implement feature and must be, if not already
have been, planned in future releases of Python.
W
Bruno Desthuilliers wrote:
> Boris Borcic a écrit :
>
>>Hello Bruno,
>>
>>Bruno Desthuilliers wrote:
[...]
>>>Or how to *not* address the real problem...
>>>
>>>Boris, using a generator may be a pretty good idea, but *not* as a way
>>>to solve a problem that happens to be a FAQ !-)
>>>
>>
>>Sorry,
Terry Reedy wrote:
> Guido has so far vetoed adding .__len__() to the iterator protocol because
> a) it is not always possible and
Be warned that this is a veto after the fact:
# (only) python 2.4
>>> len(iter(range(42)))
42
# python 2.5
>>> len(iter(range(42)))
Traceback (most recent call la
tac-tics wrote:
> [EMAIL PROTECTED] wrote:
>
>>Hey there,
>>i have been learning python for the past few months, but i can seem to
>>get what exactly a lamda is for. What would i use a lamda for that i
>>could not or would not use a def for ? Is there a notable difference ?
>>I only ask because i
In <[EMAIL PROTECTED]>, Sanjay wrote:
> Being new to Python, and after having selected Python in comparison to
> ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
> be an obvious and easy to implement feature and must be, if not already
> have been, planned in future releases
On Wed, 18 Jul 2006, Sanjay wrote:
> What is the equivalent in Python? Inheriting is a way, but is not
> working in all scenerios.
Have you tried multiple inheritance? For example:
from GeneratedPerson import GeneratedPerson
from HandcraftedPerson import HandcraftedPerson
class Person(Generated
Is there a Python library that would allow me to take a paragraph of text,
and generate a one or two sentence summary of that paragraph?
--
http://mail.python.org/mailman/listinfo/python-list
mystilleef wrote, making me somewhat tired of his/her repeated inability
to get what's being said [sigh]:
> Bruno Desthuilliers wrote:
>>mystilleef wrote:
>>>Bruno Desthuilliers wrote:
mystilleef wrote:
>Gerhard Fiedler wrote:
>>On 2006-07-15 06:55:14, mystilleef wrote:
>>>In very
Trying to convert TCL code to python.
Have a property file from where I read some VAR's. Looks like this:
EARPROJECT = sgs-procDist
APPNAME = SGSProcedure
In my TCL code I confirm the existence of the VAR = f.ex EARPROJECT by
using code:
if { ([info exists APPNAME] && [info exists STAGEDIR] &&
[EMAIL PROTECTED] wrote:
> T> Do I need to close the file in this case? Why or why not?
>
> T> for line in file('foo', 'r'):
> T> print line
>
> No. The magic of reference counting.
>
Though of course we have to remember that not all Python implementations
*use* reference counti
Mark Lutz's Python Training Services is pleased to announce that
our Fall 2006 public Colorado seminar is now open. This 5-day
Python training event will be held November 6 through November 10.
This year, our Fall seminar will be held at Historic Crag's Lodge,
a resort in Estes Park, Colorado. E
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files.
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files.
> Can you flesh out your use case a little bit and tell why you can't solve
> the problem with inheritance or a meta class?
I have to study about metaclass and see whether this can be handled. It
seemed inheritence is not working.
PROBLEM: Separating plumbing code and business logic while using
S
[EMAIL PROTECTED] wrote:
> T wrote:
> > Do I need to close the file in this case? Why or why not?
> >
> > for line in file('foo', 'r'):
> > print line
>
> I was running a program in IDLE that opened a file for
> reading and forgot to add the close.
>
> The program ran and terminated normally.
>
Jim Jones wrote:
> Is there a Python library that would allow me to take a paragraph of text,
> and generate a one or two sentence summary of that paragraph?
There is a OTS wrapper.
--
http://mail.python.org/mailman/listinfo/python-list
In message <[EMAIL PROTECTED]>, Bruno Desthuilliers
wrote:
> Lawrence D'Oliveiro wrote:
>> In message <[EMAIL PROTECTED]>, Bob Greschke
>> wrote:
>>
>>
>>>I'd go even one step further. Turn it into English (or your favorite
>>>non-computer language):
>>>
>>>1. While list, pop.
>>>
>>>2. While t
Sanjay wrote:
> Hi Alex,
>
> Thanks for the input.
>
> Being new to Python, and after having selected Python in comparison to
> ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
> be an obvious and easy to implement feature and must be, if not already
> have been, planned in
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Bob Greschke wrote:
>
>> I'd go even one step further. Turn it into English (or your favorite
>> non-computer language):
>>
>> 1. While list, pop.
>>
>> 2. While the length of the list is greater than 0, pop.
>>
>> Which one makes mo
Jim Jones wrote:
> Is there a Python library that would allow me to take a paragraph of
> text, and generate a one or two sentence summary of that paragraph?
>
If you are on Windows you could use COM to stuff the text into a Word
document and then use Word's autosummarize feature to generate th
John J. Lee wrote:
> "Vlad Dogaru" <[EMAIL PROTECTED]> writes:
>
> > I am trying to use cookies and Python to create a simple login example.
> > But I am very disoriented at the existence of two cookie libraries,
> > namely Cookie and cookielib. I have seen examples of setting cookies
> [...]
>
>
I was reading an article about the One Laptop Per Child initiative the
other day, and being a Python fan I wondered if there are any plans to
put Python on it, or at least make it available. A cut-down version of
python, preferably with bindings to the Sugar GUI framework they are
developing, would
I have a simple form with some input values and some calculated values
in TextCtrl widgets.
What I would like to do is have the display update automaticaly when
the user changes one of the input fields, without having to click on a
'Calculate' button. I was thinking of having an update triggered w
Simon Brunning wrote:
> So, they'll download and install the .NET framework at 23 MB, but they
> won't download and install Python at 9 and half?
I think the .NET framework gets thrown down via Windows Update - or at
least it did for me - so that doesn't count as a 'separate download'
for many pur
On 19 Jul 2006 02:34:09 -0700, Simon Hibbs <[EMAIL PROTECTED]> wrote:
> I was reading an article about the One Laptop Per Child initiative the
> other day, and being a Python fan I wondered if there are any plans to
> put Python on it, or at least make it available. A cut-down version of
> python,
Steve Holden wrote:
> tac-tics wrote:
> > [EMAIL PROTECTED] wrote:
> >
> >>Hey there,
> >>i have been learning python for the past few months, but i can seem to
> >>get what exactly a lamda is for. What would i use a lamda for that i
> >>could not or would not use a def for ? Is there a notable di
Simon Hibbs wrote:
> I have a simple form with some input values and some calculated values
> in TextCtrl widgets.
>
> What I would like to do is have the display update automaticaly when
> the user changes one of the input fields, without having to click on a
> 'Calculate' button. I was thinking
Sion Arrowsmith wrote:
> Er, what? How are you generating your standalone executables? What
> size is "acceptable"? python24.dll is only 1.8M -- surely on any
> non-embedded platform these days 1.8M isn't worth bothering about.
> And since you mention wx (all of another 4.8M) I'd guess we're
> talk
PTY wrote:
> Which is better?
>
> lst = [1,2,3,4,5]
>
> while lst:
> lst.pop()
>
> OR
>
> while len(lst) > 0:
> lst.pop()
>
allways that either-or stuff ! And why did you not consider
while len(lst) : list.pop()
a neat middle ground, wouldn't you say ?
Cheers, BB
--
666 ?? - 666 ~ .666
Bruno Desthuilliers wrote:
> Sanjay wrote:
> > Hi Alex,
> >
> > Thanks for the input.
> >
> > Being new to Python, and after having selected Python in comparison to
> > ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
> > be an obvious and easy to implement feature and must
Simon Brunning wrote:
> On 19 Jul 2006 02:34:09 -0700, Simon Hibbs <[EMAIL PROTECTED]> wrote:
>> I was reading an article about the One Laptop Per Child initiative the
>> other day, and being a Python fan I wondered if there are any plans to
>> put Python on it, or at least make it available. A cut
Bruno Desthuilliers wrote:
>
> empty_list = []
> bool(empty_list) is False
> => True
it's just a pity that the symmetric expression
list(False) is []
doesn't hold.
I guess the problem is that if list(False) was thus defined, it would be
difficult not to define list(True). And then the zen of
On Jul 12, 2006, at 15:57, Konrad Hinsen wrote:
> I am trying to install Python 2.4.3 on an AMD Opteron system using
> the Portland Group's compiler (pgcc). Using
>
> CC="pgcc -DNCURSES_ENABLE_STDBOOL_H=0" OPT="-O0" LINKFORSHARED="-Wl,-
> export-dynamic" ./configure --without-cxx
>
> I finally man
Hi,
I am looking for a library that will give me very simple text
representation of HTML.
For example
TitleThis is a test
will be transformed to:
Title
This is a
test
i want to send plain text alternative of html email, and would prefer
to do it automatically from HTML source.
Any hints?
Tha
Shan wrote:
> If i have a list of urls how can I extract or pull their respective xml
> feeds?
from lxml import etree
feeds = []
for url in my_url_list:
feeds.append( etree.parse(url) )
For the rest, find out about the ElementTree API.
Stefan
--
http://mail.python.org/mailma
Steve Holden wrote:
> It should be quite simple: you need to handle EVT_SET_FOCUS and/or
> EVT_KILL_FOCUS events (documented in the wxPython docs) to know when to
> recaclulate the values. Sounds like that should be enough of a hint to you.
I've tried that, but it doesn't work. Here is the test
Ksenia Marasanova wrote:
> Hi,
>
> I am looking for a library that will give me very simple text
> representation of HTML.
> For example
> TitleThis is a test
>
> will be transformed to:
>
> Title
>
> This is a
> test
>
>
> i want to send plain text alternative of html email, and would prefe
looping wrote:
> Michael J. Fromberger wrote:
> >
> > Is there a better (i.e., more elegant) way to handle the case marked
> > (**) above?
> >
>
> You have to call super in each method __init__, if you don't, the call
> chain break before the end:
>
> class A (object):
> def __init__(self):
>
Patrick Maupin a écrit :
> The perverse wish, expressed in the specific example, that SOME piece
> of code SOMEWHERE should PLEASE throw an exception because some idiot
> passed a generator expression rather than a list into a function, is
> not apt to be well received by an audience which strives
I'm trying to parse a line of html as follows:
101.120:( KPA (-)
Snow on Ground)0
however, sometimes it looks like this:
N/A
Snow on Ground)0
I want to get either the numerical value 101.120 (which could be a
different number depending on the data that's been fed into the page,
or in terms o
alfa1234:
> Does anyone know and equalent way to confirm a Variable from the same
> property file using PYTHON code ???
Using globals(), locals(), and dir() you can find if your name exists
already.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-07-18, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On 2006-07-17, Terry Reedy <[EMAIL PROTECTED]> wrote:
>>> Or, whether docs (and reasonable interpretation thereof) and
>>> implementation match, which I claim
Since the event handler of a textctrl inherits from wxCommandEvent,
I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS
Not tested...
Rony
Le Wed, 19 Jul 2006 03:15:36 -0700, Simon Hibbs a écrit :
>
> Steve Holden wrote:
>
>> It should be quite simple: you need to handle EVT
rony steelandt wrote:
> Since the event handler of a textctrl inherits from wxCommandEvent,
> I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS
Still not working :(
Simon
--
http://mail.python.org/mailman/listinfo/python-list
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files. Li
In <[EMAIL PROTECTED]>, Boris Borcic wrote:
> Bruno Desthuilliers wrote:
>>
>> empty_list = []
>> bool(empty_list) is False
>> => True
>
> it's just a pity that the symmetric expression
>
> list(False) is []
>
> doesn't hold.
You want the empty list to be a singleton!? And I don't find
`list
Simon Hibbs wrote:
> rony steelandt wrote:
> > Since the event handler of a textctrl inherits from wxCommandEvent,
> > I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS
>
> Still not working :(
I can trap EVT_TEXT_ENTER events successfuly, without using
EVT_COMMAND_ENTER. This al
In <[EMAIL PROTECTED]>, dmbkiwi wrote:
> I'm trying to parse a line of html as follows:
>
> 101.120:( KPA (-)
> Snow on Ground)0
>
> however, sometimes it looks like this:
>
> N/A
> Snow on Ground)0
>
>
> I want to get either the numerical value 101.120 (which could be a
> different number
Christophe wrote:
> ... you haven't beed using enouth generator expressions ...
You should get yourself to the doctors about that cold dude. :-)
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I've often found that I am writing little scripts at the interpretor to
read a text file, perform some conversion, and then write the converted
data back out to a file. I normally accomplish the above task by
reading the lines of the entire file into a list, preforming some
function to that
Simon Hibbs wrote:
> Steve Holden wrote:
>
> > It should be quite simple: you need to handle EVT_SET_FOCUS and/or
> > EVT_KILL_FOCUS events (documented in the wxPython docs) to know when to
> > recaclulate the values. Sounds like that should be enough of a hint to you.
>
> I've tried that, but it
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Boris Borcic wrote:
>
>> Bruno Desthuilliers wrote:
>>> empty_list = []
>>> bool(empty_list) is False
>>> => True
>> it's just a pity that the symmetric expression
>>
>> list(False) is []
>>
>> doesn't hold.
>
> You want the empty list to
Simon Hibbs wrote:
> Steve Holden wrote:
>
>
>>It should be quite simple: you need to handle EVT_SET_FOCUS and/or
>>EVT_KILL_FOCUS events (documented in the wxPython docs) to know when to
>>recaclulate the values. Sounds like that should be enough of a hint to you.
>
>
> I've tried that, but it
Kay Schluehr wrote:
> Bruno Desthuilliers wrote:
>
>>Sanjay wrote:
>>
>>>Hi Alex,
>>>
>>>Thanks for the input.
>>>
>>>Being new to Python, and after having selected Python in comparison to
>>>ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
>>>be an obvious and easy to imple
Thanks for the code showing how to implement partial classes. Infact, I
was searching for this code pattern. I will have a study on metaclass
and then try it.
Thanks
Sanjay
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 18, 2006, at 3:17 PM, Yu-Xi Lim wrote:
> This is going to be quite off-topic.
But helpful nonetheless.
> I'm not entirely familiar with SOX regulations. Is it necessary to
> capture it at the gateway?
I'm no lawyer either, so I probably know as much about this as you
do
[EMAIL PROTECTED] wrote:
> Sanjay wrote:
> > Hi All,
> >
> > Not being able to figure out how are partial classes coded in Python.
> >
> > Example: Suppose I have a code generator which generates part of a
> > business class, where as the custome part is to be written by me. In
> > ruby (or C#), I
Frank Millman wrote:
> Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl)
And Voila! It works. Many, many thanks.
Any idea what is going on?
Simon
--
http://mail.python.org/mailman/listinfo/python-list
cdecarlo wrote:
>
> fout = open('somefile','w')
> for line in convertedData:
> fout.write("%s\n" % line)
> fout.close()
>
> -- or --
>
> fout = open('somefile','w')
> fout.write("%s" % '\n'.join(convertedData))
> fout.close()
>
I'd go for something like...
fout = open('somefile','w')
fout.wri
Imagine I have x projects and they all use util.py
What would be the best way to organise this
1.
c --\project1\*.py
|
|-\project2\*.py
|
--\globals\util.py
This organisation has the problem that if I have to modify something to
util.py that I need in project2, I'll have to retest projec
Simon Hibbs wrote:
> Frank Millman wrote:
>
> > Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl)
>
> And Voila! It works. Many, many thanks.
>
> Any idea what is going on?
AIUI, wx.EVT_KILL_FOCUS is not a Command Event i.e. it doesn't
propagate up the hierarchy of widgets until i
rony steelandt wrote:
> Imagine I have x projects and they all use util.py
>
> What would be the best way to organise this
>
> 1.
> c --\project1\*.py
> |
> |-\project2\*.py
> |
> --\globals\util.py
>
> This organisation has the problem that if I have to modify something to
> util.py tha
On 19 Jul 2006 04:55:24 -0700, Simon Hibbs <[EMAIL PROTECTED]> wrote:
>
> Frank Millman wrote:
>
> > Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl)
>
> And Voila! It works. Many, many thanks.
>
> Any idea what is going on?
Your first attempt used self.Bind, which binds the kill
> fout = open('somefile','w')
> for line in convertedData:
> fout.write("%s\n" % line)
> fout.close()
>
> -- or --
>
> fout = open('somefile','w')
> fout.write("%s" % '\n'.join(convertedData))
> fout.close()
I shouldn't think it matters too much which of these you use - time
them and see what h
Hello,
I have a class called MyConfig, it is based on Python's
ConfigParser.ConfigParser.
It implements add_section(self, section), which is also implemented on
ConfigParser.ConfigParser, which I want to call.
So, reducing the problem to the bare minimum, the class (with a useless
add_section that
Hi,
I guess stripogram would be more pythonic :
http://sourceforge.net/project/showfiles.php?group_id=1083
Regards,
Laurent
Diez B. Roggisch wrote:
> Ksenia Marasanova wrote:
>
>> Hi,
>>
>> I am looking for a library that will give me very simple text
>> representation of HTML.
>> For exampl
> cdecarlo <[EMAIL PROTECTED]> writes:
> fout = open('somefile','w')
> for line in convertedData:
> fout.write("%s\n" % line)
> fout.close()
> -- or --
> fout = open('somefile','w')
> fout.write("%s" % '\n'.join(convertedData))
> fout.close()
> ... or maybe some hybrid of the two which
Whoops:
> outfile = open(out_f)
outfile = open(out_f, 'w')
may be better ;-)
--
http://mail.python.org/mailman/listinfo/python-list
Kay Schluehr wrote:
> This definition lacks a check for disjointness of the parts. No two
> partial classes shall contain a method with the same name.
Yes - I mentioned at the bottom that the last one evaluated will
overwrite any existing one. You're right that its probably a better
idea to che
On 2006-07-19, Georg Brandl <[EMAIL PROTECTED]> wrote:
> Lawrence D'Oliveiro wrote:
>> In message <[EMAIL PROTECTED]>, Bob Greschke wrote:
>>
>>> I'd go even one step further. Turn it into English (or your favorite
>>> non-computer language):
>>>
>>> 1. While list, pop.
>>>
>>> 2. While the len
Bruno Desthuilliers wrote:
> Boris Borcic a écrit :
>> Hello Bruno,
>>
>> Bruno Desthuilliers wrote:
>>
>>> Boris Borcic wrote:
>>>
> Do you have any ideas?
you could use a recursive generator, like
def genAllChildren(self) :
for child in self.children :
Pupeno írta:
> Hello,
> I have a class called MyConfig, it is based on Python's
> ConfigParser.ConfigParser.
> It implements add_section(self, section), which is also implemented on
> ConfigParser.ConfigParser, which I want to call.
> So, reducing the problem to the bare minimum, the class (with a
Simon Hibbs wrote:
> Frank Millman wrote:
>
> > Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl)
>
> And Voila! It works. Many, many thanks.
>
My pleasure
> Any idea what is going on?
I only understand it in simple terms, though it can get complex. Here
is my simple explanatio
i am trying to include a new Address family (PF_CAN) in the extension
module of socket - socketmodule.c... At first i am just trying to
create a socket. When I use
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM), a socket is
created at a address
but
s=socket.socket(socket.PF_CAN, socket.SOCK_RA
Hi ,
I have a web site and i want to write a perogram with python that my
users can convert custom web page of site to pdf (or other type :jpeg,
doc,odt,or...) and download it . i dont want only convert text . it is
be very good to i can don it for both text and images ... similar to
web page ... c
>> Then why do you advise "(making) all attributes of a class
>> private/protected" and systematically using properties ?
>>
>
> Because you don't want third parties illegimately tampering with an
> object's internal data and thus crashing your system?
Ah, you mean like in JAVA where the compiler
>> What I'm saying here is that it's totally useless to duplicate default
>> behaviour.
>>
>
> And who's doing that?
Somebody who uses setters that only set a property?
Diez
--
http://mail.python.org/mailman/listinfo/python-list
rony steelandt wrote:
> Imagine I have x projects and they all use util.py
>
> What would be the best way to organise this
>
> 1.
> c --\project1\*.py
> |
> |-\project2\*.py
> |
> --\globals\util.py
>
> This organisation has the problem that if I have to modify something to
> util.py tha
Lars wrote:
> Diez B. Roggisch wrote:
>> will make the devices world readable. While I haven't thought about any
>> security implications that might have (and am not especially
>> knowledgeable in such things to be honest), I'm convinced it is way less
>> likely to introduce any exploitable holes
Laszlo Nagy wrote:
> Pupeno írta:
>> Hello,
>> I have a class called MyConfig, it is based on Python's
>> ConfigParser.ConfigParser.
>> It implements add_section(self, section), which is also implemented on
>> ConfigParser.ConfigParser, which I want to call.
>> So, reducing the problem to the bare
> I see, thank you.
>
> class MyConfig(ConfigParser, object):
> def add_section(self, section)
> super(MyConfig, self).add_section(section)
>
> seems to work and as expected. Is there anything wrong with it ?
>
I have never seen this before. :) I don't know the answer, but I'm
int
Antoon Pardon wrote:
> The language reference doesn't talk about objects. And IMO you
> should be carefull if you want to use the word "object" here.
> In the line: "foo += 1", you can't talk about the object foo,
> since foo will
possibly
> be bound to a different object after the assignment
>
David Hughes wrote:
>
> AIUI, wx.EVT_KILL_FOCUS is not a Command Event i.e. it doesn't
> propagate up the hierarchy of widgets until it gets handled, so it has
> to be bound explicitly to the control itself, as above.
>
Right.
This is one of the sources of confusion with events - which ones
'pro
Daniel Dittmar <[EMAIL PROTECTED]> wrote:
> if line [:1] == '#':
What's wrong with line[0] == '#' ? (For one thing, it's fractionally
faster than [:1].)
--
\S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the oth
hi.
This is my first try on modules.
I've got :
tom/
__init__.py
core.py
ui.py
data.py
then, when I'm in my ipython shell :
?> from tom import *
this works, it loads core, ui and data
but when I do this :
?> import tom
?> tom.core
AttributeError: 'module' object has no att
On Wednesday 19 July 2006 3:12 pm, rony steelandt wrote:
> Imagine I have x projects and they all use util.py
>
> What would be the best way to organise this
>
> 1.
> c --\project1\*.py
>
> |-\project2\*.py
>
> --\globals\util.py
>
> This organisation has the problem that if I have to modify so
I've just found this :
If I add :
"import core, data, ui" inside my "tom/__init__.py" file, it will
work. But this line does not seems to exist in other files (after
having a look at several files inside /usr/lib/python2.4).
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] skrev:
> alfa1234:
> > Does anyone know and equalent way to confirm a Variable from the same
> > property file using PYTHON code ???
>
> Using globals(), locals(), and dir() you can find if your name exists
> already.
>
> Bye,
> bearophile
Hi bearophile !!
Thanks for the answer
rony steelandt <[EMAIL PROTECTED]> writes:
> Imagine I have x projects and they all use util.py
>
> What would be the best way to organise this
>
> 1.
> c --\project1\*.py
> |
> |-\project2\*.py
> |
> --\globals\util.py
>
> This organisation has the problem that if I have to modify some
Sion Arrowsmith wrote:
> Daniel Dittmar <[EMAIL PROTECTED]> wrote:
>> if line [:1] == '#':
>
> What's wrong with line[0] == '#' ? (For one thing, it's fractionally
> faster than [:1].)
>
line[0] assumes that the line isn't blank. If the input iterator is a file
then that will hold true
Sion Arrowsmith wrote:
> Daniel Dittmar <[EMAIL PROTECTED]> wrote:
>
>>if line [:1] == '#':
>
>
> What's wrong with line[0] == '#' ? (For one thing, it's fractionally
> faster than [:1].)
>
>
For that matter, what's wrong with
line.startswith('#')
which expresses the intent rat
In <[EMAIL PROTECTED]>, Boris Borcic wrote:
>> And I don't find `list(False)` to return an empty list be very obvious.
>
> What would be your choice ?
``list()`` or ``[]`` for empty lists and a `TypeError` for
``list(False)``. Just like it is right now.
Ciao,
Marc 'BlackJack' Rintsch
--
when I set mysql some fields collate utf8_bin, and then fetch these
fields is array.array,not the string I expected
--
http://mail.python.org/mailman/listinfo/python-list
Marc 'BlackJack' Rintsch wrote:
> Can you flesh out your use case a little bit and tell why you can't solve
> the problem with inheritance or a meta class?
From my experience with C#, the only real use for partial classes is
when you want to separate your GUI code from the rest of your logic. B
>> > from tom import *
You CAN do this, but it's a bad habit.
Try:
>>import tom
Then call by tom.function()
rd
--
http://mail.python.org/mailman/listinfo/python-list
Le Wed, 19 Jul 2006 14:31:06 +0100, Phil Thompson a écrit :
> On Wednesday 19 July 2006 3:12 pm, rony steelandt wrote:
>> Imagine I have x projects and they all use util.py
>>
>> What would be the best way to organise this
>>
>> 1.
>> c --\project1\*.py
>>
>> |-\project2\*.py
>>
>> --\globals\
Hi all,
Just wondering if there is a better way of generating a 4 digit number
(that gets converted to a string), ive got the following code which
generates strings between -.
for a in range(0,10):
for b in range(0,10):
for c in range(0,10):
for d in range(0,10):
See also this recent discussion on techniques for making sure you get
the file closed, even if there is an exception.
http://tinyurl.com/fryrv
rd
--
http://mail.python.org/mailman/listinfo/python-list
I know this is a bad habit ... I was just doing it to show what is
disturbing me.
Obviously the "star" syntax finds the submodules because they are
loaded, but when I properly load the module alone with "import tom",
the "dot" syntax does not find "tom.core".
BartlebyScrivener wrote:
> >> > from
1 - 100 of 247 matches
Mail list logo