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. Like this:
Joachim Durchholz wrote:
Marshall schrieb:
Chris Smith wrote:
Joachim Durchholz [EMAIL PROTECTED] wrote:
I *think* I understand Marshall here. When you are saying assignment,
you mean assignment to values of attributes within tuples of the cell.
When Marshall is saying assignment, he
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):
super(A, self).__init__()
Sanjay wrote:
Not being able to figure out how are partial classes coded in Python.
Hi Sanjay,
To the best of my knowledge, Python currently has no support for
partial classes.
However, BOO (http://boo.codehaus.org/) - which is a Python-like
language for the .NET CLI)- _does_ support partial
Were you looking for more specific
features?
Parallel Processing.
Grant,
It looks like
I have a lot more studying to do, all of the information that I have seems to be
screwed up. I will look at event
loops in Python to see if that answers my question.
I was just looking at the
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. Like
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.
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, but I don't understand
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 last):
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 see it in
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 of
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
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 well designed systems, the
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 counting. It's
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.
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. Like
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. Like
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
[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.
But when I
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 the length of the list is
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 future
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 more sense? Guess
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 the
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
[...]
From the
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,
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
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
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 difference ?
I
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 of
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
talking
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 ~ 2/3 ~
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 be, if not
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-down
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 managed to
Hi,
I am looking for a library that will give me very simple text
representation of HTML.
For example
divh1Title/h1pThis is a br /test/p/div
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
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
--
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
divh1Title/h1pThis is a br /test/p/div
will be transformed to:
Title
This is a
test
i want to send plain text alternative of html email, and would
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 for
I'm trying to parse a line of html as follows:
td style=width:20% align=left101.120:( KPA (-)/td
td style=width:35% align=leftSnow on Ground)0 /td
however, sometimes it looks like this:
td style=width:20% align=leftN/A/td
td style=width:35% align=leftSnow on Ground)0 /td
I want to get either
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 they do it this
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
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. Like
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(False)` to
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 almost
In [EMAIL PROTECTED], dmbkiwi wrote:
I'm trying to parse a line of html as follows:
td style=width:20% align=left101.120:( KPA (-)/td
td style=width:35% align=leftSnow on Ground)0 /td
however, sometimes it looks like this:
td style=width:20% align=leftN/A/td
td style=width:35%
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
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 doesn't
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 be a singleton!?
Oops,
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 doesn't
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 implement feature and must be,
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 divide the
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.writelines(
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
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 it gets
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 that I need in
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 focus
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 happens.
An
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 example
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 writes chunks of
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
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 length of the list is greater
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 :
yield child
for childchild in
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 explanation.
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,
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 ...
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 prevents
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 that I need in
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 than
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 minimum,
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
interested
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
than it
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
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 other
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
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 something to
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..Tried to
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 something to
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, but if
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 rather better
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
1 - 100 of 257 matches
Mail list logo