Hi,
As Wrote in
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
http://pypi.python.org/pypi/MultipartPostHandler/0.1.0 is not updated ,
the author email doesn't not exist ,
how I send a comment update MultipartPostHandler
anyway patch attach
--
Sérgio M.B.
Only in MultipartPostHan
Rob Wolfe wrote:
>
> Sérgio Monteiro Basto wrote:
>> Stefan Behnel wrote:
>>
>> > Sérgio Monteiro Basto wrote:
>> >> but is one single error that blocks this.
>> >> Finally I found it , it is :
>> >> > >> if I put :
>> >> > >>
>> >> p = re.compile('"align')
>> >> content = p.sub('" align', conten
Evan Klitzke wrote:
> Although it is not present in ANSI C, the GNU version of stftime
> supports the conversion character %z, which is a time offset from GMT.
> The four digit time offset is required in RFC 2822 dates/times, and is
> used by a number of other programs as well. I need to convert t
John Nagle wrote:
> In Python, of course, "urlparse.urlparse", which is
> the main function used to disassemble a URL, has no idea whether it's
> being used by a client or a server, so it, reasonably enough, takes option
> 1.
>>> import urlparse
>>> base="http://somesite.com/level1/";
>>> path="
Gabriel Genellina wrote:
> En Tue, 26 Jun 2007 17:26:06 -0300, sergio <[EMAIL PROTECTED]>
> escribió:
>
>> John Nagle wrote:
>>
>>> In Python, of course, "urlparse.urlparse", which is
>>> the main function used to disassemble a URL, h
crxor 666 wrote:
>
>> Evidentemente equivocherò sul termine "potenza di un linguaggio", ma
>> dubito che io possa scrivere un device driver in Python,
>> indipendentemente dalla potenza processore o dall'esistenza di un
>> compilatore Python (ho preso per esempio il Python ma potevo usare molti
, this is what I get:
Traceback (most recent call last):
File "", line 1, in
File "pp.py", line 9, in tst
s = sign(x)
NameError: global name 'sign' is not defined
Do you have any idea why is this happening?
T
>> s
'NEXT1\n'
Up to this point it worked as expected. However, when I tryied with the methods
that write and read several lines, apparently the process got stalled:
->>> fi.writelines(["uno\n","dos\n","tres\n"])
->>> fi.flush()
->>> s = fo.readlines()
.
.
.
Do you have any comments on this?
Thanks,
--Sergio
--
http://mail.python.org/mailman/listinfo/python-list
MRAB mrabarnett.plus.com> writes:
>
> I believe it's waiting for the end of the input, i.e. for the pipe to
> close.
>
> Have you tried calling fo.readline() 3 times instead?
>
yeah! It worked!...
A question remains: what is then the purpose of fo.readlin
])
->>> fi.close()
->>> l = fo.readlines()
->>> l
['uno\n', 'dos\n', 'tres\n']
--Sergio
--
http://mail.python.org/mailman/listinfo/python-list
nction.
Do you have any comments on this?
Thanks,
--Sergio.
--
http://mail.python.org/mailman/listinfo/python-list
line 12, in
a = something(5)
NameError: global name 'something' is not defined
Do you have any comments?
Thanks,
--Sergio.
--
http://mail.python.org/mailman/listinfo/python-list
Jose H. Martinez gmail.com> writes:
>
>
> You should define the function first and then call it.
>
>
> def something(i): return i
>
>
> a = something(5)
>
>
> If you want a reference to the function somewhere else you can do this:
>
I know that. That was what I meant by "changing t
Ethan Furman stoneleaf.us> writes:
>
>
> No. The reply from MRAB explains this.
>
> ~Ethan~
>
Thanks, you're right!
I was confusing statemens with declarations.
--
http://mail.python.org/mailman/listinfo/python-list
I'm running a python3 program that requires html5lib but I receive the error No
module named 'html5lib'.
Here are two session of terminal:
sam@pc ~ $ python
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
>>> import html5lib
>>> html5lib.__file__
'/us
Il giorno giovedì 14 aprile 2016 17:54:00 UTC+2, Wildman ha scritto:
> On Thu, 14 Apr 2016 02:31:59 -0700, Sergio Spina wrote:
>
> > I'm running a python3 program that requires html5lib but I receive the
> > error No module named 'html5lib'.
> >
I would know what is the way to implement in ReST a link bookmark like in this
example:
>
>
>
> This text stand for an example of text containing
> a bookmarked target bookmark.
>
> So let's go all together to visit the bookmarked target
> clicking on this link.
>
>
>
The string that is the
Il giorno domenica 17 aprile 2016 12:04:38 UTC+2, Sergio Spina ha scritto:
> I would know what is the way to implement in ReST a link bookmark like in
> this example:
>
> >
> >
> >
> > This text stand for an example of text containing
> > a bookmarked t
Il giorno domenica 17 aprile 2016 12:14:57 UTC+2, Sergio Spina ha scritto:
> Il giorno domenica 17 aprile 2016 12:04:38 UTC+2, Sergio Spina ha scritto:
> > I would know what is the way to implement in ReST a link bookmark like in
> > this example:
> >
> > >
>
In the following ipython session:
> Python 3.5.1+ (default, Feb 24 2016, 11:28:57)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 2.3.0 -- An enhanced Interactive Python.
>
> In [1]: import re
>
> In [2]: patt = r""" # the match pattern is:
> ...: .+ #
Il giorno domenica 8 maggio 2016 18:16:56 UTC+2, Peter Otten ha scritto:
> Sergio Spina wrote:
>
> > In the following ipython session:
> >
> >> Python 3.5.1+ (default, Feb 24 2016, 11:28:57)
> >> Type "copyright", "credits" or "
>From the "restructuredtext markup specification":
>Anonymous hyperlink targets consist of an explicit markup
>start (".. "), two underscores, a colon, whitespace, and a
>link block; there is no reference name:
>
>.. __: anonymous-hyperlink-target-link-block
>
>An alternate
Il giorno sabato 28 maggio 2016 14:37:21 UTC+2, Ned Batchelder ha scritto:
> On Saturday, May 28, 2016 at 8:28:35 AM UTC-4, Sergio Spina wrote:
> > From the "restructuredtext markup specification":
> >
> > >Anonymous hyperlink targets consist of an explicit
ss3())
What is seems to happen is that only the last class I register it is the
only one being exported. How can I register all the classes? Thanks.
--
Sergio Rua
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
> class MyCombinedClass(MyClass1, MyClass2, MyClass3):
> pass
>
> Server.register_instance(MyCombinedClass())
That was easy :) Thanks a lot.
--
Sergio Rua
--
http://mail.python.org/mailman/listinfo/python-list
El sábado, 31 de agosto de 2013 16:39:08 UTC+2, Roy Smith escribió:
> In article <3479e08e-d435-492b-b2a0-a1c18678f...@googlegroups.com>,
>
> sergio7...@gmail.com wrote:
>
>
>
> > key="4545453030303743303134462035343733373432363420323031332D30382D33312031343A33353A3035"
>
> > key="4545453030
El sábado, 31 de agosto de 2013 16:48:53 UTC+2, Sergio Sanchez escribió:
> El sábado, 31 de agosto de 2013 16:39:08 UTC+2, Roy Smith escribió:
>
> > In article <3479e08e-d435-492b-b2a0-a1c18678f...@googlegroups.com>,
>
> >
>
&
second failure, I went to the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.5\PythonPath
and added my folder there. Still nothing on sys.path , and my imports fail.
Any suggestions for adding my path to sys.path permanently? I'm
running out of ideas
Thanks,
Sergio
--
http://mail.python.org/mailman/listinfo/python-list
Thanks!
It worked straightforward, and it's easier than messing with the
enviromental variables or the registry.
BTW, I'm still wondering how did Autohotkey got included in sys.path
(there are no other .pht files on my PC)
Regards,
Sergio
On 9/3/07, olivier <[EMAIL PROTECTED]
py). If I do any of this
print getattr(spam, 'omelet')(100)
print getattr('','omelet')(100)
print getattr('omelet')(100)
It wont work. Any ideas?
Thanks,
Sergio
--
http://mail.python.org/mailman/listinfo/python-list
Alex, Gabriel,
Thanks for the reply. Works great!
On 9/3/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Mon, 03 Sep 2007 20:13:43 -0300, Sergio Correia
> <[EMAIL PROTECTED]> escribi�:
>
> > # Module spam.py
> >
> > import eggs
> >
> > pr
ts get compounded when strange stuff starts to happen:
>>> class Eggs(object):
def __init__(self):
self.x = 1
>>> type(Eggs)
Type 'type'? What is that supposed to mean?
Hope this makes any sense ;),
Sergio
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the replies, very instructive!
On 9/7/07, Steve Holden <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Fri, 07 Sep 2007 01:30:00 -0500, Sergio Correia wrote:
> >> Hi, I'm kinda new to Python (that means, I'm a total noob here), but
>
ss), so no parsing is necessary
Best,
Sergio
On 3/6/07, Cousin Stanley <[EMAIL PROTECTED]> wrote:
>
> > I have a PC behind a firewall, and I'm trying to programmatically
> > determine the IP address visible from outside the firewall.
> >
>
> Steven
>
def _myfunction(self):
...
...
spam = self._myfunction()
...
I'm new to python (and couldn't find anything about this in PEP 8).
What would you suggest me?
Thanks
Sergio
--
http://mail.python.org/mailman/listinfo/python-list
I also found out I can't use `unittest` with nested functions :-(
Thank you all for the responses,
Best,
Sergio
On 7 Mar 2007 14:57:54 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Diez B. Roggisch:
> > If it really has no other use as in this class, put it as an
&
uot;(TM)
?
Any ideas?
Thanks,
Sergio
PS: Why does `sum` works only with numbers?
--
http://mail.python.org/mailman/listinfo/python-list
function.
Thanks a lot!
Sergio
On 3/7/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Wed, 07 Mar 2007 21:14:43 -0300, Sergio Correia
> <[EMAIL PROTECTED]> escribió:
>
> > I'm looking for an easy way to flatten a two level list like this
>
> Try google.
O_o
List comprehensions never cease to amaze me.
Thanks,
On 3/7/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Wed, 07 Mar 2007 21:41:16 -0300, Sergio Correia
> <[EMAIL PROTECTED]> escribió:
>
> > I forgot to say: I've already checked the discussions a
uch file or directory: 'configuration.txt'
My last resort is to hard code the path for that file, but it's ugly,
and I want to know if I'm missing something. Am I?
Thanks a lot,
Sergio
--
http://mail.python.org/mailman/listinfo/python-list
Larry, Gabriel
Thanks for the replies. Both ways work great.
Sergio
On 4/4/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Wed, 04 Apr 2007 20:14:37 -0300, Larry Bates <[EMAIL PROTECTED]>
> escribió:
>
> > Sergio Correia wrote:
> >> I have a program in
I think the -print- command, as used in IDLE, is not thread-safe. I
was bitten by an issue like that today, and the problem ended up being
the -print- command I used.
On the cmd line, it works per-fect-ly.. but IDLE seems to be the culprit.
A possible answer seems to be to write a wrapper for prin
1.2.1, Python 2.5.1, and Tk 8.4. Does anyone has any
idea of why is this happening?
Thanks,
Sergio
Example code ---> http://pastebin.com/f21868e26
import time
import Queue
import threading
class Worker(threading.Thread):
def __init__(self, inQueue, **kwds):
threading.Thread.__ini
Just a few notes:
1) get_countries_list
What is the purpose of that function? Besides a few errors (an
argument named list, no value returned), it seems you just want to
remove duplicates from a list called countries. You can do that
transforming the list to a 'set'.
new_countries = list( set(c
s much more useful than you think. Why? because
you can just iterate across your document, adding the values you get
to the adequate object property. That is, instead of using size or
pop, use the variables you are interested in.
Best, and good luck with python,
Sergio
On Nov 16, 2007 5:15 PM, <
yproject a package. Now, if your modules are kinda
small you can just dump them in /myproject, but if what you are doing
is fairly complex, it's better to move each module to its own folder.
> Does anyone have any "best practices" as to how to manage your code?
I want
x27;".join(row) + "'"
base = " ( Insert NBUSER.Grochamber Values %s, )"
writer.writerow([base % data])
infile.close()
outfile.close()
The above lines works like your program, writing exactly what you asked.
Again, all lists are iterable, you don't need to
As a side note, I find much easier to drop a PTH file than messing
with pythonpath. If you are not familiar with PTH files, what I do is
this
1) Go to "C:\Program Files\Python25\Lib\site-packages" or whatever is
appropiate in your case.
2) Create a text file, name it something like "MyProjects.PTH
-list/2006-January/362138.html
HTH, Sergio
PS: Note the "try..." in my reply. I've never done this, so I'm not
sure it's going to work. Wiser people in the list will probably give
you better replies.
On Nov 22, 2007 11:30 PM, Sorin Schwimmer <[EMAIL PROTECTED]> wro
3) we need to remove all whitespace.. tab, new lines, etc. (Maybe
breaks should be considered as new lines in the new text?)
The link above solve several of this issues, it can serve as a good
starting point.
Best,
Sergio
On Nov 24, 2007 12:42 AM, Just Another Victim of the Ambient Morality
&l
Bluebird:
If you are using python 2.5, relative imports are no longer an issue:
http://docs.python.org/whatsnew/pep-328.html
That problem solved, what you sometimes want is to change the version
of your package. I just change the text in the PTH file, to point to
another version, and voilá (no ne
Although I'm a python fan; for that kind of stuff, I use autohotkey (
http://www.autohotkey.com/download/ )
Best,
Sergio
On Dec 1, 2007 3:30 AM, farsheed <[EMAIL PROTECTED]> wrote:
> I have a big problem. I have a list of files that my script find and
> list them in a little g
ry:
>>> print s.replace(';', '\;')
Or
>>> x = s.replace(';', '\;')
>>> print x
Best,
Sergio
--
http://mail.python.org/mailman/listinfo/python-list
in IDLE.
HTH,
Sergio
On Dec 5, 2007 5:07 PM, <[EMAIL PROTECTED]> wrote:
> On Dec 5, 10:37 am, "Andreas Tawn" <[EMAIL PROTECTED]> wrote:
> > > > On Dec 5, 6:00 am, "Andreas Tawn" <[EMAIL PROTECTED]> wrote:
> > > > > I'm try
> import sys, xml, urllib
>
> dummy = [sys.stdout.write(city + ': ' + str(num) + '\n') for city, num in
> set([[(a, o.count(a)) for a in p] for o, p in [2*tuple([[city for city in
> ((xml.dom.minidom.parseString(urllib.urlopen('
> http://api.etsy.com/feeds/xml_user_details.php?id='
> + str(id)).rea
Both of you are correct.
>>> x = set([1,2,3])
>>> y = set([4,5])
>>> x |= y
>>> x
set([1, 2, 3, 4, 5])
On Jan 15, 2008 11:07 AM, Skip Montanaro <[EMAIL PROTECTED]> wrote:
> > > Why is that? Doesn't the |= operator essentially map to an update() call?
> >
> > No, according to 3.7 Set Types, s |
t).
I agree with him, rewrite the logic. IMO, the objects should be the
key, THEY are the ones that should be joined. You should run the chef
and waiter as daemons, and just do something like
orders.join()
dishes.join()
And when the chefs finishes with the orders and the waiter finishes
servin
is this some kind of joke?
if you get no answers, then the answer is no
On Jan 30, 2008 7:40 PM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote:
> I do not understand why no one has answered the following question:
>
> Has anybody worked with Gene Expression Programming
>
>
> David Blubaugh
>
>
Try contacting "Ryan O'Neil ryanjoneil at gmail.com". He is the author
of pygep http://code.google.com/p/pygep/ , and is probably working
here: http://www.gepsoft.com/
If you don't get an answer, it means that THEY found him first.
This message will self destruct in ... range(3, 0, -1) ...
On Jan
So in this case it is REALLY better to ask for permission rather than
forgiveness?
On Jan 30, 2008 10:30 PM, Ben Finney <[EMAIL PROTECTED]> wrote:
> MRAB <[EMAIL PROTECTED]> writes:
>
> > On Jan 31, 12:57 am, Asun Friere <[EMAIL PROTECTED]> wrote:
> > > Ouch!! If on the other hand 'females' is pop
See this:
http://www.regular-expressions.info/python.html
(the Search and Replace part)
You are referring to the group as "(?P=id)", when you should be using
r"\g".
HTH,
Sergio
On Jan 30, 2008 10:01 PM, Astan Chee <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a htm
I don't get this thread. At all. I want my 15 minutes back.
(OTOH, some of your replies were quite funny or interesting, including
- as usual - Gabriel and Steve's)
On Feb 19, 2008 11:29 PM, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2008-02-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
Searched on google and couldn't find anything :S
On Mon, Apr 21, 2008 at 11:28 AM, <[EMAIL PROTECTED]> wrote:
> Just saw at amazon.com reference to the following book that might be
> available later this year:
>
> Financial Modeling with Python [IMPORT] (Hardcover)
> by Shayne Fletcher (Author
python. Here's an
example:
Window "myWindow" {
title="Hello world";
Button "myButton" {
label="I'm a button";
onClick=exit
}
}
print(myWindow.myButton.label)
Of course it doesn't need to be 100%
On Fri, 2007-06-15 at 11:41 +, Amol wrote:
> Hi, I want to learn Python in less than a month which resources should
> I use. I prefer to read books . Please give me a list of *recognized*
> resources. Thank You all
>
Books :
Learning Python 2nd Edition (ISBN 0-596-00281-5) or above
Python in
Hi,
Can someone explain me, what is wrong with this site ?
python linkExtractor3.py http://www.noticiasdeaveiro.pt > test
HTMLParser.HTMLParseError: EOF in middle of construct, at line 1173,
column 1
at line 1173 of test file is perfectly normal .
I like to know what I have to clean up before p
5), col9 VARCHAR(255), col10
VARCHAR(255), col11 VARCHAR(255), col12 VARCHAR(255), col13
VARCHAR(255), col14 VARCHAR(255))' table2
in mysql:
load data infile '/home/sergio/pesquisa/table2.txt' into table table2
FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMIN
Hi,
I have this statement cursor.execute("SELECT * from session_attribute WHERE
sid=%s", ( user ))
and I'm receiving this error :
TypeError: not all arguments converted during string formatting
What is wrong ?
--
Sergio Roberto Charpinel Jr.
--
http://mail.python.org/mailman/
Thank you very much.
2009/8/30 Cameron Simpson
> On 29Aug2009 17:27, Sergio Charpinel Jr.
> wrote:
> | Hi,
> | I have this statement cursor.execute("SELECT * from session_attribute
> WHERE
> | sid=%s", ( user ))
> | and I'm receiving this error :
> |
>
69 matches
Mail list logo