d
http://mail.python.org/pipermail/python-list/2006-June/348241.html
what you try to do will never work because your attempts are at using
python on the client side and only javascript works for that purpose.
But for this popup thing javascript is just fine so if all you want to
do is this then you don't need python at the first place.
HTH,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> hai all,
> i am student of computer science dept. i have planned to
> design a search engine in python. i am seeking info about how to
> proceed further.
> i need to know what r the modules that can be used.
There are these two guys Sacha or Sergey and Larry (if I remember
cor
hat warrants a library.
This does not mean to simply package all the scripts into one package,
but to see if there are any common tasks among the scripts to 'refactor'
them into a library.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
enerates a list with number [0,1,2 ... 99]
and iterates through it
one could write it like
for i in [0,1,2,3,4]:
do_something_with(i)
but it gets tedious to write such a long list
>
> but im not quite grasping those functions..
>
> please bear im mind i am an extreme newbie at this...thanks in advance
>
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ne an print them on the screen!
> but...how can i say python, delete the first line?!
> thats my problem!
> in the entry of my posting i wrote, that i am a newbie and so please
> understand me, that i ask so questions?! :-)
>
> thanks for your help!
simple!
f = file("old.file")
ignore = f.readline()
file("new.file", "w+").write(f.read())
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
for now I use this
>>> import re
>>> chars = re.compile(r'[abc]')
>>> text = "aAbBcCdD"
>>> chars.sub("",text)
'ABCdD'
>>>
>
> Thanks,
> Michele
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ants from stat module
>>> import os
>>> os.stat("/etc/shadow")
(33184, 245390L, 771L, 1, 0, 15, 604L, 1151702662, 1149675585, 1149675585)
>>>
>>> import stat
>>> stat.ST_SIZE
6
>>> os.stat("/etc/shadow")[stat.ST_SIZE]
604L
>>>
http://docs.python.org/lib/module-stat.html
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ow level IO).
>>> import os
>>> fd=os.open("secret", os.O_WRONLY|os.O_CREAT, 0400)
>>> os.write(fd,"not for everybody")
17
>>> os.close(fd)
ls -l secret
-r 1 root root 17 2006-07-01 00:05 secret
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> Hi,
>
> is there a Python aquivalent to the C __LINE__?
>
> Thank you in advance
Google says:
http://www.nedbatchelder.com/blog/200410.html#e20041003T074926
--
http://mail.python.org/mailman/listinfo/python-list
just do:
for a in range(2, foo+1):
print a
range(a, b) gives [a, a+1, a+2, ..., b-2, b-1]
bruce schrieb:
> hi..
>
> basic foor/loop question..
>
> i can do:
>
> for a in foo
> print a
>
> if i want to do something like
> for a, 2, foo
> print foo
>
> where go from 2, to foo..
>
>
> Except that in the OP's example foo was a sequence, not an
> integer. I think.
Yes, possibly. But then, what's "from 2 to foo"?
this way it might be
for a in [2] + foo:
print a
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] schrieb:
> i used C too much and haven't used Python for a while...
>
> like in C, if we want an array of array of float, we use
>
> float a[200][500];
>
> now in Python, seems like we have to do something like
>
> a = [ [ ] ] * 200
>
> and then just use
>
> a[1].append(12.3
Schüle Daniel schrieb:
> [EMAIL PROTECTED] schrieb:
>> i used C too much and haven't used Python for a while...
>>
>> like in C, if we want an array of array of float, we use
>>
>> float a[200][500];
>>
>> now in Python, seems like we have to d
IGNORECASE.
Is there a way to switch-off the option resp.
switch-on the option in the middle of the pattern?
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
t stand interpreting integers as booleans, so I
wouldn't write
if count:
Everyone has their personal quirks.
>
> Note that I have much more experience with the language (6-7 years),
> whilst the majority of my collegues have about 1-2 years experience.
>
I guess they're coming from Java and not from Perl :-)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
easily check the
validity of each
command line input parameter?
Thank you
-Daniel
FYI: My code that deals with getopt is as follows:
o, a = getopt.getopt(sys.argv[1:], 'h', ['imageDir='])
opts = {}
for k,v in o:
if k in ['--imageDir'] and len(v) == 0:
> Code:
>
> value = self.dictionary.get(keyword)[0]
>
> if value == "something":
> somethingClass.func()
> elsif value == "somethingElse":
> somethingElseClass.func()
> elsif value == "anotherthing":
> anotherthingClass.func()
> elsif value == "yetanotherthing":
> yetanotherthingCla
wasn't viable. It looks like they've updated since then,
so it may be worth re-evaluating. At present I use a heavily modified
copy of SOAPpy.
If anyone happens to have feedback regarding the above issues, I'd
appreciate the input.
Daniel O'Brien
m.banaouas wrote:
> H
> Hy people, I'm new in python and comming from JAVA.
>
> Something I really like in java is the easy way to add a library to the
> project. Just put the jar file in the folder ( WEB-INF/lib ) and
> doesn't need to restart the server ( tomcat ).
>
> Can I do some like using python - I'm using apach
> >> Check out Django, it has a great database API and on the fly
> >> auto-generated admin.
> >
> > Just gone over the tutorial, really amazing, exactly what I need.
>
> That's exactly the response I had when I met with Django :)
>
Anyone with Django experience: how well does it do with respect t
ction alone
will break many Python applications (because they rely on files being
closed at end of scope etc.)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
thank all users especially those who sent bug
reports, comments, remarks, etc., I was in fact surprised by the large
amount of feedback I got this makes the developement much more fun.
Cheers,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Rob Williscroft wrote:
> Daniel Dittmar wrote in news:[EMAIL PROTECTED] in
> comp.lang.python:
>
>
>>- removing reference counting and relying on garbage collection alone
>>will break many Python applications (because they rely on files being
>>closed at end of s
I have been working on a problem for a full week now. If someone
could please help me it would be great. Even a clue would be great at
this point. What I am seeing is quite a mystery.
I have server written in python using asyncore.dispatcher. It listens
on port 9940 and does something like thi
> 2)
> Still without the above patch on windows, the software "angry ip scan"
> for example managed to output a lot of more socket connection. How is
> it possible ?
This "angry ip scan" thing is written in Java, perhaps you can find it
out from the source:
http://svn.sourceforge.net/viewvc/ipsca
Hello everybody,
I'm trying to implement a secure xmlrpc server with basis on
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496786 recipe.
The thing that I'm concerned about is how can I get/create rapidly the
.pem files (the key and cert).
Any help?
Thanks
Daniel
l
that stuff. Before getting involved in that, do you know of a faster
way to have it installed?
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
code I submited earlier, but I need the .pem
files. You told me to change generate.sh to generate.bat. How can I do
that?
Many thanks,
Daniel
Laszlo Nagy wrote:
> Daniel Crespo írta:
> > Laszlo Nagy wrote:
> >
> >>> If you have OpenSSL installed, you can do the following:
didn't know about this
other project. Perhaps I should add a note to the webpage clarifying
this.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
65064:digital envelope routines:EVP_DecryptFinal_ex:bad
decrypt:.\
crypto\evp\evp_enc.c:461:
3688:error:0906A065:PEM routines:PEM_do_header:bad
decrypt:.\crypto\pem\pem_lib.
c:425:
Any help?
Thanks in advance
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
rm -f .rnd
(for .bat, just ignore the last line and use "move" instead of "mv",
"del" instead of "rm" and "yourdomain.com" instead of "$1")
It will generate 4 files. Take the two with .pem extension, and put it
on the same directory as the SecureXMLRPCServer code.
3. In order for get running the code, install pyOpenSSL available at
http://pyopenssl.sourceforge.net/. For Windows you may prefer
http://webcleaner.sourceforge.net/pyOpenSSL-0.6.win32-py2.4.exe
That's it.
Special thanks to Laszlo Nagy
Enjoy!
Daniel Crespo
--
http://mail.python.org/mailman/listinfo/python-list
In a recent thread,
http://mail.python.org/pipermail/python-list/2006-September/361512.html,
a couple of very useful and enlightening itertools examples were given
and was wondering if my problem also can be solved in an elegant way
by itertools.
I have a bunch of tuples with varying lengths and w
Hello all:
I am using PIL to draw some graphics and I need to draw some texts
in vertical direction rather than the default left-to-right horizontal
direction.
Is there anyway I could do that?
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> > In a recent thread,
> > http://mail.python.org/pipermail/python-list/2006-September/361512.html,
> > a couple of very useful and enlightening itertools examples were given
> > and was wondering if my problem also can be solved in an elegant way
> > by itertools.
> >
> > I have a bunch of tuples
> > In a recent thread,
> > http://mail.python.org/pipermail/python-list/2006-September/361512.html,
> > a couple of very useful and enlightening itertools examples were given
> > and was wondering if my problem also can be solved in an elegant way
> > by itertools.
> >
> > I have a bunch of tuples
Hello all:
I am using PIL to draw a rectangle filled with color blue.
Is there anyway I could set the fill pattern so that the drawn
rectangle could be filled with
gradient blue?
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> Everytime I am lookink at how to do this or that in Python I write it
> down somewhere on my computer. (For ex. Threading. After reading the
> official documentation I was a bit perplex. Hopefully I found an
> article an managed to implement threads with only like 20 lines of code
> in my script.
> > > That said...the Python docs are open source. Just start going through
> > > them and adding examples.
> >
> > ASPN (activestate) is a good place for examples...
>
> Yes, but that requires a separate search and depends on an external
> organization. Wouldn't it be great if relevant examples we
Hello all:
I have a list AAA = [1, 2, 3] and would like to subtract one from list
AAA
so AAA' = [0, 1, 2]
What should I do?
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
eate wrapper scripts for the compiler (and possibly ld and ar),
which uses the proper options. Add the location of these scripts at the
start of PATH, thus overiding the compiler. Now all configures will
default to 64 bit.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
m.size, fill=128)
draw.line((0, im.size[1], im.size[0], 0), fill=128)
del draw # ===>>>> Why we should delete this object draw?
# write to stdout
im.save(sys.stdout, "PNG")
#
Is there any general rule that we must delete the obje
Hello all:
I have a python program and would like to find out the maximum memory
used
by this program.
Does Python provide such module so I could check it easily?
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hello all:
I installed IPython on my XP machine today and find that my sys.path
has been changed
as follows:
>> import sys
>> print sys.path
['',
'C:\\Program Files\\Python24\\scripts',
'C:\\WINDOWS\\system32\\python24.zip',
'C:\\Documents and
ld
console=['mycode.py'],
)
#######
Does I need to make any modification if I include IPython module in my
code?
Thank you for your helps
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
o to solve this problem?
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
hello all:
I am using Image module from PIL to save created image as JPG format.
Is there any option I could set for function Image.save so that the
stored image will have the highest quality.
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
remove the last character of
a string?
I don't know whether or not the method I used is efficient
Question two:
Does python provide any function that can remove the newline character
from a string if it exists?
Thank very much!
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Is looping over a list of objects and modifying (adding an attribute
to) each item only possible like this?
mylist = [ obj1, obj2, obj3 ]
for i in xrange( len( mylist ) ):
mylist[i].newattribute = 'new value'
I'm guessing there is a way to do this without introducing the (in
principle unnec
> Is looping over a list of objects and modifying (adding an attribute
> to) each item only possible like this?
>
> mylist = [ obj1, obj2, obj3 ]
>
> for i in xrange( len( mylist ) ):
> mylist[i].newattribute = 'new value'
>
>
> I'm guessing there is a way to do this without introducing the (in
> Call me crazy, but isn't the simple construct
> for obj in mylist:
> obj.newattribute = 'new value'
> what the OP was looking for?
Yes, of course. That's why my follow-up post was this:
> Please consider the previous question as an arbitrary random brain
> cell fluctuation whose pro
> > > Below is a simple program that will cause python to intermittently
> > > stop executing for a few seconds. it's 100% reproducible on my
> > > machine.
> >
> > Confirmed with Python 2.4.2 on Windows.
> >
> > gc.disable() fixes it, so it looks like you found an inefficiency in the
> > Python's
What would the simplest way to make an application that has both a web
interface and runs from behind a web server but also can be used as a
standalone app with a gui? More precisely is it possible to avoid
creating an html/xml/whatever based web interface for the web version
and separately creatin
> > What would the simplest way to make an application that has both a web
> > interface and runs from behind a web server but also can be used as a
> > standalone app with a gui? More precisely is it possible to avoid
> > creating an html/xml/whatever based web interface for the web version
> > an
size=-1, stdin=PIPE, stdout=PIPE,
universal_newlines=True)
fin = p.stdin
print fin.readline()
fin.close()
When this is run, I get no output :
C:\>python c:\python\sp.py
C:\>
As you can see, I get no exception.
I've tried various combinations of the Popen arguments with no joy.
The platform
Thanks /F, that was it.
Dan
On Sat, 18 Nov 2006 15:03:30 +0100, Fredrik Lundh
<[EMAIL PROTECTED]> wrote:
[snip]
>p.stdin is the *other* process' stdin. if you want to read things it
>prints, read from p.stdout instead.
>
>> print fin.readline()
>> fin.close()
>
>
--
http://mail.python.org/m
Hi list,
I have an awk program that parses a text file which I would like to
rewrite in python. The text file has multi-line records separated by
empty lines and each single-line field has two subfields:
node 10
x -1
y 1
node 11
x -2
y 1
node 12
x -3
y 1
and this I would like to parse into a l
StringIO
> return StringIO(data)
>
> converters = dict(
> x=int,
> y=int
> )
>
> def name_value(line):
> name, value = line.split(None, 1)
> return name, converters.get(name, str.rstrip)(value)
>
> if __name__ == "__main__":
>
Sorry,
how can i convert a string like "10, 20, 30" to a list [10, 20, 30]
what i can do is:
s = "10, 20, 30"
tmp = '[' + s + ']'
l = eval(tmp)
but in my opinion this is not a nice solution
daniel
--
http://mail.python.org/mailman/listinfo/python-list
ifferent for the two following code
lines:
from modul import symbol
from modul import *
In the case of the first one, it's enough if the object 'locals' implements
the necessary protocols. The second one only works if the object 'locals'
is a type or subtype of dic
tList) == "":
>
>and
>if type(artistList) == "list":
>
>but nothing..
Try it this way...
>>> artistList = []
>>> isinstance(artistList, list)
True
>>> if isinstance(artistList, list):
print "I'm a list."
I'm a list.
>>>
Daniel Klein
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to create an excel document that displays a table of data.
It does exactly what I want but takes a long time. I am writing around
1000 rows and it takes around a second to do each row.
Is there a quicker way to write this? The reason I want excel is this
needs to read and manipulate
c and you pass the same dictionary as the globals argument to
execfile, then the two scripts would share the global namespace.
Variables of the same name would really be the same variable.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Traceback (most recent call last)
/pool/PROG/python/permute/ in ()
:
I don't understand why the generator x raises StopIteration exception
I would expect that x.next() would call
permute(("a",), 4) and would stop at "abcd"
thanks in advance
regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
d he was right:
import sys
'sys' in sys.modules => True
sys in sys.modules => False
Doesn't this look wrong?
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
]: def d(x):
: return lambda:x
:
In [55]: f = [d(i) for i in range(10)]
In [56]: f[0]()
Out[56]: 0
In [57]: f[1]()
Out[57]: 1
in a C programmer sence I would say there seems to be no "sequence
point" which would separate "now" from "next"
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
he got mixed up with a crowd of ex
C++ programmers).
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina schrieb:
Gabriel Genellina schrieb:
> On 7 dic, 22:53, Schüle Daniel <[EMAIL PROTECTED]> wrote:
>
>> In [38]: f = [lambda:i for i in range(10)]
>> In [39]: ff = map(lambda i: lambda : i, range(10))
>> In [40]: f[0]()
>> Out[40]: 9
>> In
r strings happens in my code only
when a pass a string where I should have passed a list of strings.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
On 14 Dec 2006 22:47:23 -0800, [EMAIL PROTECTED] wrote:
>hi,
>how can i skip printing the last line using loops (for /while)
>
>eg
>
>for line in open("file):
> print line.
>
>I want to skip printing last line of the file.thanks
while True:
line1 = myfile.readline()
if not line1: brea
I used to have the following code to collect all (old style) class
names defined in the current module to a list called reg:
def meta( reg ):
def _meta( name, bases, dictionary ):
reg.append( name )
return _meta
reg = [ ]
__metaclass__ = meta( reg )
class c1:
pass
class c2:
> > I used to have the following code to collect all (old style) class
> > names defined in the current module to a list called reg:
> >
> >
> > def meta( reg ):
> > def _meta( name, bases, dictionary ):
> > reg.append( name )
> > return _meta
> >
> > reg = [ ]
> > __metaclass__ = m
On 27 Dec 2006 09:16:53 -0800, "hubritic" <[EMAIL PROTECTED]>
wrote:
>I am trying to set off commands on Windows 2003 from python.
>Specifically, I am trying to use diskpart with a script file (pointed
>to with path).
>
>cmd = ["diskpart", "/s", path]
>p = Popen(cmd, shell
On 28 Dec 2006 08:40:02 -0800, "jonathan.beckett"
<[EMAIL PROTECTED]> wrote:
>Hi all,
>
>Question 2...
>What is the correct way of looping through a list object in a class via
>a method of it?
Without peeking at any of the other responses, here is what I came up
with. I hope it helps...
class G
On 1 Jan 2007 11:33:42 -0800, "Ramdas" <[EMAIL PROTECTED]> wrote:
>How do I add users using Python scripts on a Linux machine?
>
>Someone has a script?
This should be as easy as something like:
os.system("/usr/sbin/useradd -m -d /home/newuser -s /bin/ksh")
Dan
--
http://mail.python.org/mailman
On 8 Jan 2007 10:59:23 -0800, "Thomas Nelson" <[EMAIL PROTECTED]>
wrote:
>O'reilly has a book called Programming Python that covers much of the
>standard library and how to use it for complex tasks. It may be out of
>date by now, though.
Programming Python (by Mark Lutz) is now in it's 3rd edi
Is it possible to have method names of a class generated somehow dynamically?
More precisely, at the time of writing a program that contains a class
definition I don't know what the names of its callable methods should
be. I have entries stored in a database that are changing from time to
time and
> > Is it possible to have method names of a class generated somehow
> dynamically?
> >
> > More precisely, at the time of writing a program that contains a class
> > definition I don't know what the names of its callable methods should
> > be. I have entries stored in a database that are changing
> > My database has 1 table with 2 fields, one called 'name' and the other
> > one called 'age', let's suppose it has the following content, but this
> > content keeps changing:
> >
> > Alice 25
> > Bob 24
> >
> > --- program1.py
> >
> > class klass:
> >
> > # do the
> Here you go:
>
> >>> database = {
> ... "Alice": 24,
> ... "Bob":25}
> ...
> >>> class Lookup(object):
> ... def __catcher(self, name):
> ... try:
> ... print "Hello my name is %s and I'm %s" % (name,
> database[name])
> ... except KeyErro
> Ouch! This certainly seems like a possible security hole!
>
> As someone else said, use rewrite rules to get this passed
> in as a parameter.
I don't get it, why is it more safe to accept GET variables than
method names? Concretely, why is the URL
http://something.com/script?q=parameter safer th
> *>* I don't get it, why is it more safe to accept GET variables than
> *>* method names? Concretely, why is the URL
> *>* http://something.com/script?q=parameter safer than
> *>* http://something.com/script/parameter if in both cases exactly the
> *>* same things are happening with 'parameter'?
>
#x27; returns None but I would expect it to
find 123 in group(1)
Am I using something that is not supported by Python
RegExp engine or what is the problem with my regexp?
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
thank you, I completely forgot that + is one of metacharacters
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
that handle or pointer
Or add a method to the Python MySQL object to get the handle and
pointer. Create all database connections in Python (precise: using the
Python API from C), get the handle and pointer to use it from C, pass
the original session to plugins.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
I'm relatively new to object oriented programming, so get confused
about its usage once in a while. Suppose there is a class Image that
has a number of methods, rotate, open, verify, read, close, etc. Then
to use this class my natural guess would be to have something like
image = Image( )
image.re
>
> In this case, Image seems to be a python module, with the open function
> defined, PIL's Image is not a class.
>
Thanks for the enlightening remarks, especially this last one, indeed,
it's not a class.
--
http://mail.python.org/mailman/listinfo/python-list
> > > In this case, Image seems to be a python module, with the open function
> > > defined, PIL's Image is not a class.
> > >
> >
> > Thanks for the enlightening remarks, especially this last one, indeed,
> > it's not a class.
>
> Actually, this way of creating a class instance is good OO practice
> > Actually, this way of creating a class instance is good OO practice in
> > many places: The Image.open() method acts as a factory-function for
> > creating Image objects.
> > You don't know, until you inspect the return value, if the created
> > object is actually an instance of class Image or
arange(0,11,.5)
>>> filter(lambda x: x!=0, a)
[0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0,
7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5]
>>> [item for item in a if item !=0 ]
[0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0,
7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5]
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> > So after all, what is a 'factory' or 'factory function'?
>
> A brief explanation in Python terms is at
> http://www.aleax.it/ep03_pydp.pdf -- "pages" (slides) 37-44 (the rest of
> the presentation is about an even more fundamental design pattern,
> "template method"). A far more extensive essa
if you want the numbers you can combine it into one-liner
nums = file(r"C:\folder\myFile.txt").read().split(";")
the numbers are in string representation in the list
you can no do
nums = [float(num) for num in nums]
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
lf):
... print "this instance has __len__"
... return 100
...
>>> x=X()
>>> len(x)
this instance has __len__
100
>>> x.__len__()
this instance has __len__
100
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
: xxx
Age
Id: 43324
OtherInfo: foo
New
here you could read all as string and split it on "New"
here small example
>>> txt = "fooXbarXfoobar"
>>> txt.split("X")
['foo', 'bar', 'foobar']
>>>
in more complicated case I would use regexp but
I doubt this is neccessary in your case
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
eturn "lst has id = %i" % id(self.lst)
... def copy(self):
... ret = Y()
... ret.lst = self.lst[:]
... return ret
...
>>> from random import randint
>>> y=Y()
>>> y.fill()
>>> y
lst has id = 1078097452
>>> print
() if number.match(line)]
fire interactive python and play with re and patterns
speaking from own experience ... the propability is
against you that you will make pattern right on first time
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
gt;> type(q.bar) is types.UnboundMethodType
True
>>> q.bar
>
>>>
I think is not very consistent
notice q.bar is bounded although type(q.bar)
says it's types.UnboundedMethodType
what do you think?
Regard, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
;> y = Q("test").bar
>>> x
>>> y
>
>>> y()
test
>>> id(x)
1078081812
>>> id(y)
1078082492
>>>
the same id-value would enforce two objects to be
of the same type (trivial case)
the reverse is not necessarily true
Is it possible to pass a python object to a python program as argument?
In my program I would like to start executing an other python program
and don't wait until that finishes, only launch it and keep running
the original program. The obvious way I can think of it is using the
exec* or spawn* fun
> >I would like to pass the whole object at once to the second python
> >program which should start doing its thing with it while the original
> >program should keep running.
>
> os.fork() does that (on Mac and Unix).
>
Okay, but how? It seems to me that if the process which issued
os.fork() ends,
> >> os.fork() does that (on Mac and Unix).
> >
> >Okay, but how?
>
> Sorry, fork() is implemented strictly on a 'need to know' basis :-)
>
> >It seems to me that if the process which issued os.fork() ends, then
> >the forked process also ends.
>
> No, no, they're not a quantum mechanic photon pair
701 - 800 of 1788 matches
Mail list logo