Re: Anonymous hyperlinks in restructuredtext

2016-05-28 Thread Sergio Spina
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

Anonymous hyperlinks in restructuredtext

2016-05-28 Thread Sergio Spina
>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

Re: Help for a complex RE

2016-05-08 Thread Sergio Spina
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 "

Help for a complex RE

2016-05-08 Thread Sergio Spina
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: > ...: .+ #

Re: ReST: link bookmark

2016-04-19 Thread Sergio Spina
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: > > > > > >

Re: ReST: link bookmark

2016-04-17 Thread Sergio Spina
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

ReST: link bookmark

2016-04-17 Thread Sergio Spina
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

Re: python3 - No module named 'html5lib'

2016-04-15 Thread Sergio Spina
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'. > >

python3 - No module named 'html5lib'

2016-04-14 Thread Sergio Spina
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

Python declarative

2014-01-15 Thread Sergio Tortosa Benedito
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%

Re: HMAC encription issue

2013-08-31 Thread Sergio Sanchez
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>, > > > > &

Re: HMAC encription issue

2013-08-31 Thread Sergio Sanchez
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

Re: using identifiers before they are defined

2012-06-12 Thread Julio Sergio
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

Re: using identifiers before they are defined

2012-06-12 Thread Julio Sergio
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

using identifiers before they are defined

2012-06-12 Thread Julio Sergio
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

About a list comprehension to transform an input list

2012-06-08 Thread Julio Sergio
nction. Do you have any comments on this? Thanks, --Sergio. -- http://mail.python.org/mailman/listinfo/python-list

Re: Interprocess comunication

2012-06-07 Thread Julio Sergio
]) ->>> fi.close() ->>> l = fo.readlines() ->>> l ['uno\n', 'dos\n', 'tres\n'] --Sergio -- http://mail.python.org/mailman/listinfo/python-list

Re: Interprocess comunication

2012-06-07 Thread Julio Sergio
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

Interprocess comunication

2012-06-07 Thread Julio Sergio
>> 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

I couldn't use the sign funcion inside of another function

2012-04-23 Thread Julio Sergio
, 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

how update MultipartPostHandler pypi

2011-06-04 Thread sergio
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

Re: Sqlite format string

2009-08-30 Thread Sergio Charpinel Jr.
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 : > | >

Sqlite format string

2009-08-29 Thread Sergio Charpinel Jr.
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/

Re: Financial Modeling with Python by Shayne Fletcher, Christopher Gardner

2008-04-22 Thread Sergio Correia
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

Re: The big shots

2008-02-19 Thread Sergio Correia
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: > >

Fwd: small problem with re.sub

2008-01-30 Thread Sergio Correia
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

Re: Removing Pubic Hair Methods

2008-01-30 Thread Sergio Correia
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

Re: Has Anyone Worked with Gene Expression Programming ???????????????????????????

2008-01-30 Thread Sergio Correia
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

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-01-30 Thread Sergio Correia
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 > >

Re: convivenza

2008-01-20 Thread Sergio
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

Re: I don't understand what is happening in this threading code

2008-01-18 Thread Sergio Correia
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

Re: Why this apparent assymetry in set operations?

2008-01-15 Thread Sergio Correia
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 |

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread Sergio Correia
> 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

Re: Timeout test hangs IDLE

2007-12-05 Thread Sergio Correia
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

Re: Escaping the semicolon?

2007-12-04 Thread Sergio Correia
ry: >>> print s.replace(';', '\;') Or >>> x = s.replace(';', '\;') >>> print x Best, Sergio -- http://mail.python.org/mailman/listinfo/python-list

Re: "Show this file in explorer"

2007-12-01 Thread Sergio Correia
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

Re: Code Management

2007-11-26 Thread Sergio Correia
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

Re: How do I convert escaped HTML into a string?

2007-11-23 Thread Sergio Correia
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

Re: Function stopping a function

2007-11-22 Thread Sergio Correia
-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

Re: Code Management

2007-11-20 Thread Sergio Correia
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

Fwd: Formatting question.

2007-11-20 Thread Sergio Correia
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

Re: Code Management

2007-11-20 Thread Sergio Correia
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 &#x

Re: Fwd: Sorting Countries by Region

2007-11-16 Thread Sergio Correia
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, <

Fwd: Sorting Countries by Region

2007-11-16 Thread Sergio Correia
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

Re: Simple threading example freezes IDLE?

2007-09-26 Thread Sergio Correia
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

Re: Simple threading example freezes IDLE?

2007-09-26 Thread Sergio Correia
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

Re: Why 'class spam(object)' instead of class spam(Object)' ?

2007-09-08 Thread Sergio Correia
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 >

Why 'class spam(object)' instead of class spam(Object)' ?

2007-09-06 Thread Sergio Correia
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

Re: Can you use -getattr- to get a function in the current module?

2007-09-03 Thread Sergio Correia
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

Can you use -getattr- to get a function in the current module?

2007-09-03 Thread Sergio Correia
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

Re: PYTHONPATH not working on Windows XP (?)

2007-09-03 Thread Sergio Correia
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]

PYTHONPATH not working on Windows XP (?)

2007-09-02 Thread Sergio Correia
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

Re: urllib interpretation of URL with ".."

2007-06-27 Thread sergio
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

Re: urllib interpretation of URL with ".."

2007-06-26 Thread sergio
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="

Re: stftime %z time conversion character

2007-06-20 Thread sergio
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

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-20 Thread sergio
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

Re: csv search and print

2007-06-18 Thread Sergio Monteiro Basto
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

HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-18 Thread Sergio Monteiro Basto
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

Re: Want to learn Python

2007-06-15 Thread Sergio Monteiro Basto
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

Re: How to open a txt file from the same folder as my module (w/out changing the working dir)

2007-04-04 Thread Sergio Correia
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

How to open a txt file from the same folder as my module (w/out changing the working dir)

2007-04-04 Thread Sergio Correia
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

Re: Flatten a two-level list --> one liner?

2007-03-07 Thread Sergio Correia
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

Re: Flatten a two-level list --> one liner?

2007-03-07 Thread Sergio Correia
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.

Flatten a two-level list --> one liner?

2007-03-07 Thread Sergio Correia
uot;(TM) ? Any ideas? Thanks, Sergio PS: Why does `sum` works only with numbers? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best place for a function?

2007-03-07 Thread Sergio Correia
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 &

Best place for a function?

2007-03-07 Thread Sergio Correia
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

Re: Getting external IP address

2007-03-06 Thread Sergio Correia
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 >

Re: xmlrcp register classes

2005-09-05 Thread Sergio Rua
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

xmlrcp register classes

2005-09-05 Thread Sergio Rua
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