On 29 Mar 2007 20:34:26 -0700, "Evil Otto" <[EMAIL PROTECTED]> wrote:
>On Mar 29, 2:19 pm, [EMAIL PROTECTED] wrote:
>> I am looking for a fake consumer review generator that could generate
>> realistic looking reviews for any products, kind of like on amazon.com but
>> generated by Artificial In
Peter Otten wrote:
> I think Exception.args always was supposed to be a tuple. Starting with 2.5
> Python enforces that constraint:
[...]
> http://docs.python.org/tut/node10.html#SECTION001030
> """
> But use of .args is discouraged. Instead, the preferred use is to pass a
> single
How can I parse a remote XML file with Python?
And what will I be able to do with this XML file in Python?
Sorry if this is a noob-ish question.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I'm planning to give a game programming course for kids of mixed age.
For this, I am looking for an open source 2D game development kit.
I am also willing to participate in the development of the development kit.
Features I'd like to see
- Possibility to construct simple games via drag and
I'm a frequent helper in the IRC channel for the Pylons web framework.
Pylons is installed from eggs using easy_install, and when Cheeseshop
is down (or so slow it might as well be down), it gives a bad
impression of our framework and Python in general. It took us half an
hour to figure out how to
Terry Reedy wrote:
> If I understand correctly, you want to multiiply each of m numbers by each
> of n numbers, giving m*n products. That is O(m*n) work. Inserting (and
> extracting) each of these is a constant size m priority cue takes, I
> believe, O(log(m)) work, for a total of m*n*log(m).
Xah Lee wrote:
> So, a simple code like this in normal languages:
>
> a = "a string";
> b = "another one";
> c = join(a,b);
> print c;
>
> or in lisp style
>
> (set a "a string")
> (set b "another one")
> (set c (join a b))
> (print c)
>
> becomes in Java:
>
> public class test {
> public static
Heikki Toivonen wrote:
> We have successfully used a script to run external programs for several
> years. Now we upgraded our Python to 2.5, and are hitting a mysterious
> error.
>
> The expected output from the sample script (see below) with 2.4 looks
> like this:
>
> ret ['5\n']
> else
> *
On Mar 30, 1:10 am, Damjan <[EMAIL PROTECTED]> wrote:
> .. like me.
>
> Ok, this is what I understood why PyPy is important.
>
> Writing programing languages and implementations (compilers, interpreters,
> JITs, etc) is hard. Not many people can do it from scratch and create
> something comparable
On Mar 30, 2:58 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Paddy <[EMAIL PROTECTED]> wrote:
>
>...
>
>
>
> > > A bit more directly:
>
> > > >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"]
> > > >>> max(foo, key=foo.count)
>
> > > 'spam'
>
> > > Alex
>
> > This doesn't ca
We have successfully used a script to run external programs for several
years. Now we upgraded our Python to 2.5, and are hitting a mysterious
error.
The expected output from the sample script (see below) with 2.4 looks
like this:
ret ['5\n']
else
ExternalCommandErrorWithOutp
On Mar 29, 2:19 pm, [EMAIL PROTECTED] wrote:
> I am looking for a fake consumer review generator that could generate
> realistic looking reviews for any products, kind of like on amazon.com but
> generated by Artificial Intelligence. Is there a package available in your
> favorite programing lan
On 2007-03-28, André Wyrwa <[EMAIL PROTECTED]> wrote:
> can anyone please point me to the relevant pygtk window properties i
> need to set to make a window
> - fullscreen
> - stay in front
> - grab all input focus
> so that i can use it as a screen lock the likes that gksu or
> gnome-power-manager
[EMAIL PROTECTED] wrote:
> Hi everyone.
>
> I'm trying to work with very simple data structures but I'm stuck in the very
> first steps. If someone has the luxury of a few minutes and can give an
> advice how to resolve this, I'll really appreciate it.
>
> 1- I have a list of tuples like this:
Russ <[EMAIL PROTECTED]> wrote:
> This little squabble got me thinking. I normally just use the
> myDict={} method of "clearing" a
> dictionary when I know there are no other references to it. However, I
> wonder how the
> efficiency of relying on the garbage collector to clear a dictionary
> comp
Paddy <[EMAIL PROTECTED]> wrote:
...
> > A bit more directly:
> >
> > >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"]
> > >>> max(foo, key=foo.count)
> >
> > 'spam'
> >
> > Alex
>
> This doesn't call foo.count for duplicate entries by keeping a cache
>
> >>> foo = ["spam",
Joshua J. Kugler <[EMAIL PROTECTED]> wrote:
> On Thursday 29 March 2007 07:33, Alex Martelli wrote:
>
> > Joshua J. Kugler <[EMAIL PROTECTED]> wrote:
> >
> >> still be nicely portable. It just seems that since Python is gathering
> >> that information anyway, it should make it available without
This little squabble got me thinking. I normally just use the
myDict={} method of "clearing" a
dictionary when I know there are no other references to it. However, I
wonder how the
efficiency of relying on the garbage collector to clear a dictionary
compares with using the
"clear" method. Does anyo
Wow, that works great! Thanks all!
On Mar 28, 12:02 am, Ben Finney <[EMAIL PROTECTED]>
wrote:
> "Silfheed" <[EMAIL PROTECTED]> writes:
> = foo.py =
> class Bar(object):
> def __init__(self):
> self.name = "bar"
> =
>
> = dostuff.py =
> import foo
>
> def get_bar()
James Stroud wrote:
there's a serious bug waiting here
> This idiot is a troll. This idiot is a troll. ThThis idiot is a troll.
> This idiot is a troll. is idiot is a troll. This idiot is a troll. This
Remember, rockets went back to earth on such things (in pieces) ...
> idiot is a troll. Thi
.. like me.
Ok, this is what I understood why PyPy is important.
Writing programing languages and implementations (compilers, interpreters,
JITs, etc) is hard. Not many people can do it from scratch and create
something comparable to what's available today. But we need people with new
aproaches,
This idiot is a troll. This idiot is a troll. ThThis idiot is a troll.
This idiot is a troll. is idiot is a troll. This idiot is a troll. This
idiot is a troll. This idiot is a troll. This idiot is a troll. This
idiot is a troll. This idiot is a troll. This idiot is a troll. This
idiot is a tro
>> So set a long timeout when you want to write and short timeout when you
>> want to read.
>>
>
> Are sockets full duplex?
>
> I know Ethernet isn't.
Both are full duplex.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 29, 8:49 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Ben Finney <[EMAIL PROTECTED]> wrote:
>
>...
>
> > That's not the only case though. What do you expect to be returned for
> > an input of ["eggs", "beans", "beans", "eggs", "spam"] ?
>
> > Assuming you want *a* mode value, and any o
Uri Guttman wrote:
> please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is
> not wanted there and is considered a troll. he hates perl so why he
> crossposts there is a question. if you want to followup, post only in
> your own group. keep him and his useless threads out of c.l.p.
On Mar 29, 3:40 pm, [EMAIL PROTECTED] wrote:
> On Mar 29, 9:19 pm, [EMAIL PROTECTED] wrote:
>
> > I am looking for a fake consumer review generator that could generate
> > realistic looking reviews for any products, kind of like on amazon.com but
> > generated by Artificial Intelligence. Is there
On Mar 29, 3:22 pm, "aspineux" <[EMAIL PROTECTED]> wrote:
> I want to parse
>
> '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL
> PROTECTED]
>
> the regex is
>
> r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]'
>
> now, I want to give it a name
>
> r'<(?P[EMAIL PROTECTED])>|(
Paul McGuire wrote:
> On Mar 29, 1:19 pm, [EMAIL PROTECTED] wrote:
>> I am looking for a fake consumer review generator that could generate
>> realistic looking reviews for any products, kind of like on amazon.com
>> but generated by Artificial Intelligence. Is there a package available in
>> your
U.S. Officials React to Saudi Condemnation
Abdullah Says Iraq Under "Illigitimate Foreign Occupation" at Arab
Summit
By SANDRA HERNANDEZ Posted 1 hr. 33 min. ago
Riyadh, SAUDI ARABIA: Saudi King Abdullah attends the Arab Summit, 28
March 2007 in Riyadh.
Hassan Amar/AFP/Getty
Riyadh, SAUDI ARABIA: S
On Thu, 29 Mar 2007 16:45:08 -0300
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> If you think that Python got confused and has two duplicate modules, try
> to find them in sys.modules. Perhaps under the names 'log' and 'xxx.log'
> Or, using print, try to see *when* your global variable is res
please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is
not wanted there and is considered a troll. he hates perl so why he
crossposts there is a question. if you want to followup, post only in
your own group. keep him and his useless threads out of c.l.p.misc.
uri
--
Uri Guttma
When using starttls(), calling quit() throws an exception:
-> server.quit()
(Pdb) n
send: 'quit\r\n'
sslerror: (8, 'EOF occurred in violation of protocol')
For the moment I and catching it like so:
try:
# this throws an exception when using tls
server.
As if its worse than a mountain of naked people in the Abu Ghraib or
Guantanamo style or with secret prisons according to the WASHINGTON
CONVENTIONS and she suddenly transmogrified from a UK marine to a
mother ... Brits are truly hilarious !!!
http://www.wbir.com/news/national/story.aspx?stor
Xah Lee wrote:
> As part of this new syntax and purity, where everything in a program
> is of Classes and Objects and Methods, many complex issues and concept
> have arisen in OOP from both the OOP language machinery as well as a
> engineering practice.
I think the fact that many design patterns f
> Python's standard module "ai" has a function called
> "generateFakeReview". I believe it does what you want, but I haven't
> used it myself.
It's nice to have an ai module too in the standard library (A*, CSP,
etc), Norvig may help with the Python version of his AIMA sofware ;-]
Bye,
bearophile
I'd have to go dig into the library code again as I haven't been in there
since I did this myself a few months ago, but I believe you're correct. If
you inherit from ThreadingMixIn, it will create a new thread for each
incoming request. I believe it's the same way the standard
ThreadingTCPServer
Jeff McNeil wrote:
> This is off of memory so I apologize if I don't get all of the details right.
>
> The base SimpleXMLRPCServer uses TCPServer as it's server component
> and SimpleXMLXMLRPCRequestHandler as it's handler. The handler is a
> subclass of BaseHTTPRequestHandler, which itself doesn't
Hi,
I am following the example of Python cookbook (14.7) about using
cookielib in python2.4
cj = cookielib.LWPCookieJar()
// code to send out the request
print "Coookie-"
if cj is not None:
for index, cookie in enumerate(cj):
On Mar 29, 12:02 pm, [EMAIL PROTECTED] wrote:
> Alex> I'm looking for a simple method to delete a folder after 72
> Alex> "Business hours" (saturday/sunday doesnt count) since its
> Alex> creation. Note that This is on a linux system and I realize that
> Alex> it will be the last mo
On Mar 29, 9:19 pm, [EMAIL PROTECTED] wrote:
> I am looking for a fake consumer review generator that could generate
> realistic looking reviews for any products, kind of like on amazon.com but
> generated by Artificial Intelligence. Is there a package available in your
> favorite programing lan
On Mar 29, 3:05 am, greg <[EMAIL PROTECTED]> wrote:
> In my quest to eliminate C compiler warnings from
> Pyrex output, I've discovered some utterly bizarre
> behaviour from gcc 3.3.
>
> The following code:
>
>void g(struct foo *x) {
>}
>
>void f(void) {
> void (*h)(struct foo *);
On Mar 29, 10:49 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Thanks. Can you please tell me how can I do a Post form submission
> using the urlLib2 library? I look at your link, but i cant find an
> example there.
>
> Thank you.
http://www.python.org/doc/current/lib/module-urllib2.html
L
Hi all,
I am using Python 2.4. I am trying to run a C++ program on Red hat linux
enterprise edition from Python by using various methods like > Os.system
Os.popen
Subprocess.popen
Os.execvp
Os.spawnl
In all of these methods the program kills python program also. So, let's say
i am in pytho
Hi all,
I am using Python 2.4. I am trying to run a C++ program on Red hat linux
enterprise edition from Python by using various methods like > Os.system
Os.popen
Subprocess.popen
Os.execvp
Os.spawnl
In all of these methods the program kills python program also. So, let's say
i am in pytho
On Mar 29, 3:07 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote:
> * [EMAIL PROTECTED] (29 Mar 2007 12:18:19 -0700)
>
> > I am trying to get the content of a web site like this:
> > But my question is how can I do a 'GET' request without putting the '/
> > index.html''
>
> import urllib
> print urllib
The BT Web21C python SDK is a package which abstract the SOAP/WsSecurity
stack from end users allowing them to write python
code to access BT plethora of webservices directly.
You can use it to make phone calls, conference calls, send text messages
(SMS) and locate people based on cell of origin
* [EMAIL PROTECTED] (29 Mar 2007 12:18:19 -0700)
> I am trying to get the content of a web site like this:
> But my question is how can I do a 'GET' request without putting the '/
> index.html''
import urllib
print urllib.urlopen('http://www.yahoo.com/').read()
--
http://mail.python.org/mailman/l
On Mar 29, 2:34 pm, [EMAIL PROTECTED] wrote:
> On Mar 29, 2:18 pm, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > I am trying to get the content of a web site like this:
> > But my question is how can I do a 'GET' request without putting the '/
> > index.html''
>
> >h = httplib.HTTP
En Thu, 29 Mar 2007 15:56:54 -0300, Mitko Haralanov <[EMAIL PROTECTED]>
escribió:
>> You may check if this is the case, looking at sys.modules
>
> I did look at sys.modules but I wasn't sure what to look for. There was
> a log module in the list but what else should I look for?
If you think tha
On Mar 29, 2:18 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I am trying to get the content of a web site like this:
> But my question is how can I do a 'GET' request without putting the '/
> index.html''
>
>h = httplib.HTTP('www.yahoo.com')
>
> # it takes 2 arguments here, but
Hi All ..I am looking for PDF version of " Practical Python" and a language to
stick to .Should I find that book ,I wil lconsder this Python :)
Thanks
-
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Tr
I am trying to get the content of a web site like this:
But my question is how can I do a 'GET' request without putting the '/
index.html''
h = httplib.HTTP('www.yahoo.com')
# it takes 2 arguments here, but I don't know if the site has
'/index.html' , how can I leave this out?
On Mar 28, 5:36 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Carl Friedrich Bolz napisa³(a):
>
> > Welcome to the PyPy 1.0 release - a milestone integrating the results
> > of four years of research, engineering, management and sprinting
> > efforts, concluding the 28 months phase of EU co-funding!
On Thursday 29 March 2007 07:33, Alex Martelli wrote:
> Joshua J. Kugler <[EMAIL PROTECTED]> wrote:
>
>> still be nicely portable. It just seems that since Python is gathering
>> that information anyway, it should make it available without me having to
>> walk the directory tree.
>
> Sorry, whe
> "a" == aralsky <[EMAIL PROTECTED]> writes:
a> I am looking for a fake consumer review generator that could
a> generate realistic looking reviews for any products, kind of like
a> on amazon.com but generated by Artificial Intelligence. Is there a
a> package available in your favorite
Paul McGuire wrote:
> On Mar 29, 1:19 pm, [EMAIL PROTECTED] wrote:
>> I am looking for a fake consumer review generator that could generate
>> realistic looking reviews for any products, kind of like on amazon.com
>> but generated by Artificial Intelligence. Is there a package available in
>> your
On Thu, 29 Mar 2007 15:43:46 -0300
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> Surely there is a ./resources/__init__.py too?
There sure is:
./resources/__init__.py is:
__all__ = ['simple', 'other']
> You may check if this is the case, looking at sys.modules
I did look at sys.modules but I
En Thu, 29 Mar 2007 14:42:33 -0300, Mitko Haralanov <[EMAIL PROTECTED]>
escribió:
> I have three modules that a comprising the problem:
> ./core.py
> ./log.py
> ./resources/simple/__init__.py
Surely there is a ./resources/__init__.py too?
> The problem that I am seeing is that 'global_info' in
Diez B. Roggisch wrote:
> Nick Craig-Wood wrote:
>
>
>>Did anyone write a contextmanager implementing a timeout for
>>python2.5?
>>
>>And have it work reliably and in a cross platform way!
>
> Cross platform isn't the issue here - reliability though is. To put it
> simple: can't be done that way
On Mar 29, 1:19 pm, [EMAIL PROTECTED] wrote:
> I am looking for a fake consumer review generator that could generate
> realistic looking reviews for any products, kind of like on amazon.com but
> generated by Artificial Intelligence. Is there a package available in your
> favorite programing lan
I am looking for a fake consumer review generator that could generate realistic
looking reviews for any products, kind of like on amazon.com but generated by
Artificial Intelligence. Is there a package available in your favorite
programing language... thx alan
--
http://mail.python.org/mailman/
In <[EMAIL PROTECTED]>, Tim Arnold wrote:
> I have the contents of a file that contains French documentation.
> I've iterated over it and now I want to write it out to a file.
>
> I'm running into problems and I don't understand why--I don't get how the
> encoding works.
> My first attempt was j
In <[EMAIL PROTECTED]>, kevinliu23
wrote:
> Python newbie here for some expert help. So basically I want to design
> a menu system that waits for a string input. I'm not sure what the
> best way of going about this is. The current system waits for a single
> character input using msvcrt.kbhit( ) a
En Thu, 29 Mar 2007 01:56:15 -0300, Steven D'Aprano
<[EMAIL PROTECTED]> escribió:
> By the way, "id(obj) == id(another_object)" is just a long way of writing
> "obj is another_object".
Just as a side note: that's not true, testing by id() only works if both
objects are alive at the same time.
Hi all,
I am going to do my best to describe the issue that I am having and
hopefully someone can shed some light on it:
I have three modules that a comprising the problem:
./core.py
./log.py
./resources/simple/__init__.py
core.py looks something like this (simplified version):
import log
class
Hi guys,
Python newbie here for some expert help. So basically I want to design
a menu system that waits for a string input. I'm not sure what the
best way of going about this is. The current system waits for a single
character input using msvcrt.kbhit( ) and msvcrt.getch( ). Is there
something eq
I have the contents of a file that contains French documentation.
I've iterated over it and now I want to write it out to a file.
I'm running into problems and I don't understand why--I don't get how the
encoding works.
My first attempt was just this:
< snipped code for classes, etc; fname is str
On Thu, 29 Mar 2007 11:30:04 -0500, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>> >
>> > I beleive the convention is when calling an OS function which might
>> > block the global interpreter lock is dropped, thus allowing other
>> > python bytecode to ru
Duncan Booth wrote:
> Robin Becker <[EMAIL PROTECTED]> wrote:
>
>> I am hugely encouraged by this
>>
>> C:\Python\devel\pypy-1.0.0>\python24\python \python\lib\test
> \pystone.py
>> Pystone(1.1) time for 5 passes = 1.49586
>> This machine benchmarks at 33425.6 pystones/second
>>
>> C:\Python\d
ken wrote:
> i.e. how long python will wait for a response in the below code?
>
>h = httplib.HTTP(self.url, 8080)
> h.putrequest('GET', '/sample/?url=' + self.url)
> h.endheaders()
For ever.
In Py<=2.5, httplib.HTTP doesn't have a timeout, so you have to do
something like:
Duncan Booth wrote:
> John Nagle <[EMAIL PROTECTED]> wrote:
>
>
>>Strictly speaking, it's Microsoft's fault.
>>
>> title="". So all that following stuff is from what
>>follows the next "-->" which terminates a comment.
>
>
> It is an attribute value, and unescaped angle brackets are valid
En Wed, 28 Mar 2007 17:16:43 -0300, kickslop <[EMAIL PROTECTED]> escribió:
> Clearly I am doing something braindead here with psycopg 1.1.21
> (psycopg2 is not an option).
>
> Any ideas? I get the same results when I build it with Red Hat's GCC
> 3.4.6 setup as well as our in-house GCC 3.3.5 setu
Bruno Desthuilliers wrote:
> Larry Bates a écrit :
>> Aahz wrote:
>>> In article <[EMAIL PROTECTED]>,
>>> Larry Bates <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
> I create a dictionary like this
> myDict = {}
>
> and I add entry like this:
> myDict['a'] = 1
>
Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
> >
> > I beleive the convention is when calling an OS function which might
> > block the global interpreter lock is dropped, thus allowing other
> > python bytecode to run.
>
>
> So what? That doesn't help you, as you are single-threaded here. The
>
On 28 mar, 23:36, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Carl Friedrich Bolz napisa³(a):
>
> > Welcome to the PyPy 1.0 release - a milestone integrating the results
> > of four years of research, engineering, management and sprinting
> > efforts, concluding the 28 months phase of EU co-funding!
>
On Mar 29, 10:30 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> [resending as the original seems to have got lost;
> apologies if it appears as a duplicate]
>
> At the risk of insulting your intelligence, here's a
> rough-and-ready non-AD solution (culled from some code I
> had somewhere):
>
>
> impo
Alex> I'm looking for a simple method to delete a folder after 72
Alex> "Business hours" (saturday/sunday doesnt count) since its
Alex> creation. Note that This is on a linux system and I realize that
Alex> it will be the last modified time. These files wont be modified
Alex> s
Hi Paul,
Paul McGuire schrieb am 03/27/2007 07:19 PM:
> On Mar 27, 3:13 pm, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi to all,
>>
>> Wojciech Mu?a schrieb am 03/27/2007 03:34 PM:
>>
>>> Fabian Braennstroem wrote:
Now, I would like to improve it by searching for different 'real'
On 29 mar, 16:22, "aspineux" <[EMAIL PROTECTED]> wrote:
> I want to parse
>
> '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL
> PROTECTED]
>
> the regex is
>
> r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]'
>
> now, if I want to give it a name
>
> r'<(?P[EMAIL PROTECTED])>|
On Mar 29, 6:05 am, greg <[EMAIL PROTECTED]> wrote:
> In my quest to eliminate C compiler warnings from
> Pyrex output, I've discovered some utterly bizarre
> behaviour from gcc 3.3.
>
> The following code:
>
>void g(struct foo *x) {
>}
>
>void f(void) {
> void (*h)(struct foo *);
I'm looking for a simple method to delete a folder after 72 "Business
hours" (saturday/sunday doesnt count) since its creation. Note that
This is on a linux system and I realize that it will be the last
modified time. These files wont be modified since their creation.
Im very confused on how to wo
7stud <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Can someone show me how to manually implement staticmethod()? Here is
Simplest way:
class smethod(object):
def __init__(self, f): self.f=f
def __call__(self, *a, **k): return self.f(*a, **k)
Alex
--
http://mail.python.org/mailman/listinfo/pytho
On Mar 29, 9:42 am, Shane Geiger <[EMAIL PROTECTED]> wrote:
> It would be worth learning pyparsing to do this.
>
Thanks to Shane and Steven for the ref to pyparsing. I also was
struck by this post, thinking "this is pyparsing written in re's and
dicts".
The approach you are taking is *very* much
Joshua J. Kugler <[EMAIL PROTECTED]> wrote:
> still be nicely portable. It just seems that since Python is gathering
> that information anyway, it should make it available without me having to
> walk the directory tree.
Sorry, where is Python "gathering that information anyway"? Unless I'm
mist
ken <[EMAIL PROTECTED]> wrote:
> Can you please tell me what is the timeout value of httplib.HTTP?
>
> i.e. how long python will wait for a response in the below code?
>
>h = httplib.HTTP(self.url, 8080)
> h.putrequest('GET', '/sample/?url=' + self.url)
> h.endheaders()
HTTP
[resending as the original seems to have got lost;
apologies if it appears as a duplicate]
At the risk of insulting your intelligence, here's a
rough-and-ready non-AD solution (culled from some code I
had somewhere):
import win32net
import win32netcon
dc = win32net.NetGetAnyDCName (None, None)
On Mar 28, 1:44 pm, <[EMAIL PROTECTED]> wrote:
> Hi everyone.
>
> I'm trying to work with very simple data structures but I'm stuck in the very
> first steps. If someone has the luxury of a few minutes and can give an
> advice how to resolve this, I'll really appreciate it.
>
> 1- I have a list o
Can you please tell me what is the timeout value of httplib.HTTP?
i.e. how long python will wait for a response in the below code?
h = httplib.HTTP(self.url, 8080)
h.putrequest('GET', '/sample/?url=' + self.url)
h.endheaders()
Thank you.
--
http://mail.python.org/mailman/lis
On Mar 29, 7:22 am, "aspineux" <[EMAIL PROTECTED]> wrote:
> I want to parse
>
> '[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL
> PROTECTED]
>
> the regex is
>
> r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]'
>
> now, I want to give it a name
>
> r'<(?P[EMAIL PROTECTED])>|(
On Thu, 29 Mar 2007 00:57:03 -0700
[EMAIL PROTECTED] (Alex Martelli) wrote:
> Martin Manns <[EMAIL PROTECTED]> wrote:
> > 2) Is there any inf type around with
> > a + inf == inf
> > inf > a (as long as a != inf)
> > etc.
> > that works with any other type?
>
> You mean something like:
>
> class
What are OOP's Jargons and Complexities
Xah Lee, 20050128
Classes, Methods, Objects
In computer languages, often a function definition looks like this:
subroutine f (x1, x2, ...) {
variables ...
do this or that
}
In advanced languages such as LISP family, it is not uncommon to
define funct
Here is what I currently have. Still missing prolog information and
namespace info. Encoding is irritating me also. :)
import os,sys
import csv
from elementtree.ElementTree import Element, SubElement, ElementTree,
tostring
def indent(elem, level=0):
i = "\n" + level*" "
if len(elem):
> To get python to run the __get__ method I think you have to call
> __getattr__ explicitly:
> a.__getattr__('test')
>
> If you do:
> a.test
> python follows a different routine: it checks for the existence of the
> attribute, then check if there is a __getattr__ attribute. Now the
> speculative b
It would be worth learning pyparsing to do this.
aspineux wrote:
My goal is to write a parser for these imaginary string from the SMTP
protocol, regarding RFC 821 and 1869.
I'm a little flexible with the BNF from these RFC :-)
Any comment ?
tests=[ 'MAIL FROM:<[EMAIL PROTECTED]>',
'MA
Larry Bates a écrit :
> Aahz wrote:
>> In article <[EMAIL PROTECTED]>,
>> Larry Bates <[EMAIL PROTECTED]> wrote:
>>> [EMAIL PROTECTED] wrote:
I create a dictionary like this
myDict = {}
and I add entry like this:
myDict['a'] = 1
but how can I empty the whole dictionar
Excuse me!!
Would you stop for a moment?!
O...man...Haven't you thought-one day- about yourself ?
Who has made it?
Have you seen a design which hasn't a designer ?!
Have you seen a wonderful,delicate work without a worker ?!
It's you and the whole universe!..
Who has made them all ?!!
You know who
My goal is to write a parser for these imaginary string from the SMTP
protocol, regarding RFC 821 and 1869.
I'm a little flexible with the BNF from these RFC :-)
Any comment ?
tests=[ 'MAIL FROM:<[EMAIL PROTECTED]>',
'MAIL FROM:[EMAIL PROTECTED]',
'MAIL FROM:<[EMAIL PROTECTED]> SI
On Mar 28, 4:44 pm, <[EMAIL PROTECTED]> wrote:
> Hi everyone.
>
> I'm trying to work with very simple data structures but I'm stuck in the very
> first steps. If someone has the luxury of a few minutes and can give an
> advice how to resolve this, I'll really appreciate it.
>
> 1- I have a list o
I want to parse
'[EMAIL PROTECTED]' or '<[EMAIL PROTECTED]>' and get the email address [EMAIL
PROTECTED]
the regex is
r'<[EMAIL PROTECTED]>|[EMAIL PROTECTED]'
now, I want to give it a name
r'<(?P[EMAIL PROTECTED])>|(?P[EMAIL PROTECTED])'
sre_constants.error: redefinition of group name 'emai
On Mar 29, 9:05 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > On Mar 29, 8:23 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> >> [EMAIL PROTECTED] wrote:
> >>> One of my co-workers thought I could do
> >>> something like this:
> >>> c = wmi.WMI()
> >>> for i in c.Win32_UserAc
1 - 100 of 144 matches
Mail list logo