Problems with running Python in Npp

2021-09-08 Thread Ricardo
Hey Python and crew I'm having difficulties installing and running Python on my computer. I've seen plenty YouTube videos on how to set it up, but none of them have worked. Any help or guidance will be greatly appreciated. Sincerely, Ricardo Sent from [

Embedding threaded Python

2005-04-12 Thread Ricardo
If I embed Python in a C app and the Python code is threaded, but the C code isn't, do I need to call PyEval_InitThreads() ? - or do you only need to do that if the C code is threaded ? -- http://mail.python.org/mailman/listinfo/python-list

can't load an script from html...

2011-09-23 Thread Ricardo
Hi everyone I'm trying to use the cgi library to create a python script and loading it from a web page. I have already done the necessary imports, and the default commands to receive data from "html" are written too. The final version is something like this: #!/usr/bin/python import subprocess

Building Python 2.5.6 on Ubuntu Natty

2011-07-12 Thread Ricardo Bánffy
[sharedmods] Error 1 when I do "make test" and Compiling /opt/python2.5/lib/python2.5/zipfile.py ... make: *** [libinstall] Error 1 when I do "make install" Any ideas? -- Ricardo Bánffy http://www.dieblinkenlights.com http://twitter.com/rbanffy -- http://mail.python.org/mailman/listinfo/python-list

dbf remove fields.

2016-04-22 Thread Ricardo Aguilar
Hi there i try to remove to fields in dbf table, how I can remove two fields? I wanna to remove because I have this error "ValueError: could not convert string to float: " But I no need this field. How I can remove this fields o ignore this ValueError? Any advice. Ricar

Unicode conversion in 'print'

2005-01-13 Thread Ricardo Bugalho
t 'Test string: ', u'Olà mundo' UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 2: ordinal not in range(128) -- Ricardo -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode conversion in 'print'

2005-01-13 Thread Ricardo Bugalho
3:20 -0800, Serge Orlov wrote: > Sure. It uses the encoding of you console. Here is explanation why it uses > locale to get the encoding of console: > http://www.python.org/moin/PrintFails > -- Ricardo -- http://mail.python.org/mailman/listinfo/python-list

Re: simultaneous multiple requests to very simple database

2005-01-18 Thread Ricardo Bugalho
t; solutions that try to stretch themselves and the developers to fit other > application contexts. > Have you considerded SQLite/pySQLite ? -- Ricardo -- http://mail.python.org/mailman/listinfo/python-list

Uploading images to imageshack.us with Python

2005-08-21 Thread Ricardo Sanchez
Hello, I'm trying to upload images to http://imageshac.us via a Python script. I have looked at the POST request with HTTPLiveHeaders Firefox extension when I upload an image, but I can't figure what's wrong. (if I disable the cookies in the browser, it still works, so it's not that). When I tr

Re: Uploading images to imageshack.us with Python

2005-08-21 Thread Ricardo Sanchez
I forgot to add that I'm behind a proxy, but I think that is irrelevant. If you are not behind a proxy replace this line: print post_multipart('proxy-a.mains.nitech.ac.jp', 8080, 'http://imageshack.us/index.php', params, files) with print post_multipart('imageshack.us', 80, '/index.php', params

Re: Uploading images to imageshack.us with Python

2005-08-22 Thread Ricardo Sanchez
Ok, I solved it with the unvaluable help of a nice guy in the #python channel. It is a studid as it gets, replaced files = [('fileupload', 'b.jpg', open('b.jpg').read())] by files = [('fileupload', 'b.jpg', open('b.jpg', 'rb').read())] because binary files are not opened correctly in Windows X

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Ricardo Aráoz
El 12/11/13 01:46, Rick Johnson escribió: No, Python modules can be poked, prodded, and violated by any pervert who can spell the word "import". Attribute values can be reassigned and state can be externally manipulated resulting in all types of undefined behaviors -- Nice! My code, my respo

Fwd: Re: Wrapping around a list

2013-11-28 Thread Ricardo Aráoz
El 27/11/13 07:46, amjad...@gmail.com escribió: Hello, I am working on a problem (Bioinformatics domain) where all possible combinations of input string needs to be printed as sublist For example: Input string : "LEQN" Output= "[L","E","Q","N"]["LE","EQ","QN","NL"] ["LEQ","EQN","QNE","NLE"] ["

Tree library - multiple children

2013-12-12 Thread Ricardo Aráoz
I need to use a tree structure. Is there a good and known library? Doesn't have to be binary tree, I need to have multiple children per node. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Tree library - multiple children

2013-12-12 Thread Ricardo Aráoz
El 12/12/13 16:26, Neil Cerutti escribió: On 2013-12-12, Ricardo Aráoz wrote: I need to use a tree structure. Is there a good and known library? Doesn't have to be binary tree, I need to have multiple children per node. Have you tried nested lists? [[1, 2], [3, 4] Can represent

Re: Tree library - multiple children

2013-12-12 Thread Ricardo Aráoz
El 12/12/13 15:56, Terry Reedy escribió: On 12/12/2013 1:14 PM, Ricardo Aráoz wrote: I need to use a tree structure. Is there a good and known library? Search tools, both for the web and on pypi.python.org, are your friend. I thought it was obvious that I've already looked around

Re: Tree library - multiple children

2013-12-12 Thread Ricardo Aráoz
El 12/12/13 18:01, Mark Lawrence escribió: On 12/12/2013 18:56, Terry Reedy wrote: On 12/12/2013 1:14 PM, Ricardo Aráoz wrote: I need to use a tree structure. Is there a good and known library? Search tools, both for the web and on pypi.python.org, are your friend. stackoverflow is

Re: Tree library - multiple children

2013-12-13 Thread Ricardo Aráoz
El 13/12/13 18:05, bucha...@gmail.com escribió: I have this simple/stupid tree module: https://github.com/abuchanan/bolts/blob/master/bolts/tree.py Thanks, I'll check it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Editor for Python

2014-01-08 Thread Ricardo Aráoz
I use Spyder both in Windows as in Linux. Pretty good programing environment, lots of features, simple enough, works on both platforms and it's free. El 08/01/14 08:27, ayushpokha...@gmail.com escribió: On Friday, 23 November 2001 04:13:40 UTC+5:30, MANUEL FERNANDEZ PEREZ wrote: Hello, I'm

Re: Python IDE.

2014-11-23 Thread Ricardo Aráoz
Spyder El 20/11/14 a las 18:47, TP escibió: On Thu, Nov 20, 2014 at 11:29 AM, Irmen de Jong mailto:irmen.nos...@xs4all.nl>> wrote: PyCharm *is* free, if you fall in one of several categories. See http://www.jetbrains.com/pycharm/buy/license-matrix.jsp Even when you have to buy it

PyPI auth issues (Server response (401): basic auth failed)

2014-11-25 Thread Ricardo Bánffy
Hi folks. I must be doing something wrong, but I (and the clever folks at the #python channel) can't figure what. I'm doing a: python setup.py register -r pypitest And getting the following in return running register running egg_info writing Appengine_Fixture_Loader.egg-info/PKG-INFO writing t

Re: PyPI auth issues (Server response (401): basic auth failed)

2014-11-26 Thread Ricardo Bánffy
The second transcript was done without a .pypirc. That's why it asked for credentials. Can you post your .pypirc file (without password, of course) for comparison? On Wed, Nov 26, 2014, 05:04 dieter wrote: > Ricardo Bánffy writes: > > I must be doing something wrong, but I (

Re: Restart the interactive python shell like in IDLE

2013-09-30 Thread Ricardo Abreu
On Thursday, June 11, 2009 1:48:42 AM UTC+2, Chris Rebert wrote: > On Wed, Jun 10, 2009 at 12:01 PM, Matt Burson wrote: > > Is there a way to reproduce the behavior of IDLE's restart shell ability by > > using a function? I thought there would be since you can exit python by > > executing the simpl

Re: Multiprocessing: killing children when parent dies

2013-10-18 Thread Ricardo Aráoz
El 18/10/13 13:18, John Ladasky escribió: What a lovely thread title! And just in time for Halloween! :^) LOL Couldn't that be construed as "sexism"? Next we'll have a new long moronic thread about sexism and discrimination in mail subjects. Which will, as usual, leave a lot of satisfied eg

Re: Python-list Digest, Vol 96, Issue 137

2011-09-24 Thread Ricardo Mansilla
On Saturday 24 September 2011 01:48:29 you wrote: > Ricardo wrote: > > Hi everyone > > I'm trying to use the cgi library to create a python script and loading > > it from a web page. I have already done the necessary imports, and the > > default commands to receive

Re: Motion Tracking with Python

2011-09-30 Thread Ricardo Mansilla
On Thursday 29 September 2011 21:16:52 you wrote: > Hello, > I have a neat Python project I'd like to share. It does real-time motion > tracking, using the Python bindings to the OpenCV library: > > http://derek.simkowiak.net/motion-tracking-with-python/ > > There is a YouTube video showing the s

Tweepy: Invalid arguments at function call (tweepy.Stream())

2011-10-31 Thread Ricardo Mansilla
Hi i'm trying to fetch realtime data from twitter using tweepy.Stream(). So I have tried the following... After successfully authenticate using oauth: auth = tweepy.OAuthHandler(...) (it works fine, i have my access_token.key and secret) i did: streaming_api = tweepy.streaming.Stream(auth, Custom

Re: Tweepy: Invalid arguments at function call (tweepy.Stream()) (Terry Reedy)

2011-10-31 Thread Ricardo Mansilla
way, i already have their IRC direction and i think it would be easier to find support there. Thanks again. Ricardo Mansilla ps: sometimes i get lazy about writing the whole link to a precise direction which lacks of importance in my point; please, don't judge me for my exquisite way of keep t

Does py2app improves speed?

2011-11-23 Thread Ricardo Mansilla
Hi everyone.. My question is exactly as in the subject of This Mail. I have made a Python script which is to slow and i have heard (and common sense also suggest) that if you use some libraries to "frozen" the script the performance improves substantially. So I need to know; is This a myth or i

Re: Does py2app improves speed?

2011-11-24 Thread Ricardo Mansilla
Well, that's sad... I think Im gonna end getting back to C++ for This. But anyway, thanks a lot for the quick answer... Bye. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does py2app improves speed?

2011-11-24 Thread Ricardo Mansilla
do This? Probably i'm missing something here... On 24/11/2011, at 07:38, Dave Angel wrote: > On 11/24/2011 08:26 AM, Ricardo Mansilla wrote: >> Well, that's sad... I think Im gonna end getting back to C++ for This. But >> anyway, thanks a lot for the quick answer.

PyCon US 2012 sprints

2011-12-17 Thread Ricardo Bánffy
Hi folks. Next March I'm planning to attend PyCon US (for the first time) and stay for the sprints. I am not sure how they work, however. Are there any "first-timer guide to PyCon sprints"? -- Ricardo Bánffy http://www.dieblinkenlights.com http://twitter.com/rbanffy -- http://

Re: Question on for loop

2013-03-04 Thread Ricardo Aráoz
El 04/03/13 09:18, newtopython escribió: Hi all, I'm super new to python, just fyi. In the piece of code below, secretWord is a string and lettersGuessed is a list. I'm trying to find out if ALL the characters of secretWord are included in lettersGuessed, even if there are additional values i

Re: Determining if a file is locked in Windows

2006-10-20 Thread Ricardo Reyes
ld backup before renaming the new one, but rename to .bak.old or something like that. Good luck. Ricardo -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining if a file is locked in Windows

2006-10-20 Thread Ricardo Reyes
ld backup before renaming the new one, but rename to .bak.old or something like that. Good luck. Ricardo -- http://mail.python.org/mailman/listinfo/python-list

a 32 bit number to integer

2006-01-24 Thread Ricardo Quesada
Hi, In python 2.0, this number was an integer: 0x88776655 but in python 2.4 it is a long (every number > 0x7fff it is a long) in python 2.4, is there a way to convert that number to a integer (notice that it only occupies 32 bits) ? thanks, riq. -- http://mail.python.org/mailman

Re: What is the "functional" way of doing this?

2007-07-30 Thread Ricardo Aráoz
> On Jul 30, 4:39 pm, Paul Rubin wrote: >> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >>> Recursion is common in functional programming: >>> def f(n, l=None): >>> if l == None: >>> l = [] >>> if n > 0: >>> return f(n/26, l + [n%26]) >>> el

Re: What is the "functional" way of doing this?

2007-07-31 Thread Ricardo Aráoz
Considering I am a beginner I did a little test. Funny results too. The function I proposed (lists1.py) took 11.4529998302 seconds, while the other one (lists2.py) took 16.141324 seconds, thats about 40% more. They were run in IDLE from their own windows (F5). Of course my little test may me wr

Re: What is the "functional" way of doing this?

2007-07-31 Thread Ricardo Aráoz
Kept testing (just in case). There was this other version of lists2.py (see below). So I created lists3.py and lists4.py. The resulting times are lists1.py : 11.4529998302 lists2.py : 16.141324 lists3.py : 3.1713134 lists4.py : 20.983676 lists3.py is by

Re: Encryption recommendation

2007-07-31 Thread Ricardo Aráoz
Azazello wrote: > On Jul 31, 10:19 am, "JS" <[EMAIL PROTECTED]> wrote: >> Can someone help me find the proper way to do AES encryption/decryption >> using Python? >> >> Thanks! > > I did a quick look around the internet and found this seemingly good > link AES in general. Might be a good start. >

Re: What is the "functional" way of doing this?

2007-07-31 Thread Ricardo Aráoz
Steven D'Aprano wrote: > On Tue, 31 Jul 2007 09:01:42 -0300, Ricardo Aráoz wrote: > >> Considering I am a beginner I did a little test. Funny results too. The >> function I proposed (lists1.py) took 11.4529998302 seconds, while the >> other one (lists2.py) took 16.14

Re: Formatting Results so that They Can be Nicely Imported into a Spreadsheet.

2007-08-05 Thread Ricardo Aráoz
pace, and "if i.strip()" will take care of blank lines. Try it in your shell, play with "doc" and you'll see (I did try it without the first blank line, and with a lot of blank lines and it's ok). > > That's why I didn't use a list comprehension in that > one section, to cover the possibility of any number > (including none) of blank lines. It works, didn't make a thorough testing but the cases you suggest were tested. > > By blindly coding [1:] you run the risk of data loss, > and that's a poor example for the OP. It is not "blindly". I guarantee the first byte will ALLWAYS be a '\n', that's because I'm putting it there with "docOut += '\n' + ';'.join(k)" (check the '\n' added at the beginning of each cycle), and I need to strip the beginning '\n' which is not necessary. Cheers Ricardo -- http://mail.python.org/mailman/listinfo/python-list

Re: Something in the function tutorial confused me.

2007-08-07 Thread Ricardo Aráoz
Lee Fleming wrote: > Thanks for all the help, everyone. I guess I was confused with default > arguments that were mutable and immutable. I will continue to look > over these posts until I understand what is happening. > > I cannot believe the number of helpful responses I got! > Apparently he di

Re: Misleading wikipedia article on Python 3?

2007-08-09 Thread Ricardo Aráoz
Evan Klitzke wrote: > On 8/8/07, greg <[EMAIL PROTECTED]> wrote: >> Istvan Albert wrote: >>> A solution would be writing the code with a logging function to begin >>> with, alas many times that is out of one's hand. >> If the code has been written with calls to a builtin >> print function, the situ

Re: python 2.5 bug

2007-08-13 Thread Ricardo Aráoz
Dustan wrote: > On Aug 11, 12:32 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: >> 4. don't do something you don't fully understand (in this case >>installing Python 2.5 and uninstalling Python 2.4) > > If we were all limited by that rule, none of us would never have used > a computer in the fi

Re: Finding gurus (was Re: Something in the function tutorial confused me.)

2007-08-13 Thread Ricardo Aráoz
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: >> Because of this, a Google search for >> >> " " python >> >> may sometimes help; when you get 116,000 hits, as for "Steve Holden" >> python, that may be a reasonable indication that the poster is one of >> t

Hiding / encrypting source code

2007-08-17 Thread Ricardo Aráoz
Hi, I'm new to this python stuff so maybe I'm stating the obvious, or worse, maybe I'm completely off track. Not long ago someone was asking about a way to hide source code. I stumbled upon zipimport standard module. It seems it lets you get your imports from zip files. The docs say it is implicit

Re: IDE for Python

2007-08-21 Thread Ricardo Aráoz
king kikapu wrote: > On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]> > wrote: >> Hello list: >> >> I have tried various times to use an IDE for python put have always been >> disapointed. > > > I have also tried a lot of them (IDEs) in the last year. I was finally > happy with Eclip

Re: IDE for Python

2007-08-21 Thread Ricardo Aráoz
king kikapu wrote: > On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]> > wrote: >> Hello list: >> >> I have tried various times to use an IDE for python put have always been >> disapointed. > > > I have also tried a lot of them (IDEs) in the last year. I was finally > happy with Eclip

Re: introspection and functions

2007-08-23 Thread Ricardo Aráoz
Ayaz Ahmed Khan wrote: > "James Stroud" typed: >> py> def doit(a, b, c, x=14): >> ... pass >> ... >> py> doit.func_code.co_argcount >> 4 >> py> doit.func_code.co_varnames >> ('a', 'b', 'c', 'x') >> py> doit.func_defaults >> (14,) > > Neat. > How do you know the 14 corresponds to x ? -- http

Re: IDE for Python

2007-08-23 Thread Ricardo Aráoz
I V wrote: > On Tue, 21 Aug 2007 21:23:25 -0300, Ricardo Aráoz wrote: >> Do you know if for in-house development a GPL license applies? (Qt4 >> and/or Eric4). > > (I'm not sure if I've understood your question right) > > If you distribute an app that _us

Re: How can I use python for file processing

2007-08-26 Thread Ricardo Aráoz
Marc 'BlackJack' Rintsch wrote: > On Sun, 26 Aug 2007 06:05:11 +, [EMAIL PROTECTED] wrote: > >> I am trying to use python for file processing. >> Suppose I have a file like this: >> I want to build a Hashmap between the line "begin_QOS_statistics" and >> "end_QOS_statistics" >> and for each li

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Ricardo Aráoz
Stefan Niemann wrote: > Hi, > > sorry that I'm relatively new to Python. But the syntax and semantics of > Python already fascinate me, because I'm familiar with functional languages > like Haskell. > > Is there a pattern matching construct in Python like (head : tail), meaning > 'head' matche

Re: encoding problems

2007-08-29 Thread Ricardo Aráoz
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, tool69 wrote: > >> p2.content = """Ce poste possède des accents : é à ê è""" > > My guess is this is being encoded as a Latin-1 string, but when you try to > output it it goes through the ASCII encoder, which doesn't understand the > ac

Re: Haskell like (c:cs) syntax

2007-08-29 Thread Ricardo Aráoz
Marco Mariani wrote: > Ricardo Aráoz ha scritto: > >> L = ['one', 'two', 'three', 'four', 'five'] >> >> print L[0]# This would be 'head' >> print L[1:] # This would be 'tail' >> >&g

Re: copying files

2007-08-29 Thread Ricardo Aráoz
Brian McCann wrote: > Hi, > > with the code below I set a variable TEST_HOME to a path and the > variable m to a path > in my current dir. > I have a symbolic link setting m>lib > when I run the script I get no errors and the lib dir with its 20 files > does not get copied to /v01/test_home >

Re: copying files

2007-08-29 Thread Ricardo Aráoz
Brian McCann wrote: > Hi, > > with the code below I set a variable TEST_HOME to a path and the > variable m to a path > in my current dir. > I have a symbolic link setting m>lib > when I run the script I get no errors and the lib dir with its 20 files > does not get copied to /v01/test_home >

Re: copying files

2007-08-29 Thread Ricardo Aráoz
Brian McCann wrote: > > > <mailto:[EMAIL PROTECTED]> > Hi Ricardo, > > what do the + signs do? > Add the different strings. You had 'm' and 'TEST_HOME' inside a string, so they would be taken as characters and not variables. >>>

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Ricardo Aráoz
Russ wrote: > Paul Rubin wrote: >> Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >>> FWIW, the "Eiffel and SPARK Ada folks" also "brilliantly explained" >>> why one can not hope to "write reliable programs" without strict >>> static declarative type-checking. >> I don't know about Eiffel but at l

Re: list index()

2007-08-30 Thread Ricardo Aráoz
Alex Martelli wrote: > <[EMAIL PROTECTED]> wrote: >... >> In my case of have done os.listdir() on two directories. I want to see >> what files are in directory A that are not in directory B. > > So why would you care about WHERE, in the listdir of B, are to be found > the files that are in A b

Re: status of Programming by Contract (PEP 316)?

2007-08-31 Thread Ricardo Aráoz
Russ wrote: >> I've always wondered... Are the compilers (or interpreters), which take >> these programs to machine code, also formally proven correct? > > No, they are not formally proven correct (too complicated for that), > but I believe they are certified to a higher level than your "typical"

Re: status of Programming by Contract (PEP 316)?

2007-08-31 Thread Ricardo Aráoz
Neil Cerutti wrote: > On 2007-08-31, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >> Russ wrote: >>> Yes, thanks for reminding me about that. With SPARK Ada, it is >>> possible for some real (non-trivial) applications to formally >>> (i.e., mathematically) *pr

Re: list index() (OT)

2007-09-01 Thread Ricardo Aráoz
Paddy wrote: > On Sep 1, 7:57 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >> "Richie Hindle" wrote: >>> But - the word for someone who posts to the internet with the intention of >>> stirring up trouble derives from the word for what fishermen do, not from >>> the word for something that l

Re: status of Programming by Contract (PEP 316)?

2007-09-01 Thread Ricardo Aráoz
Hendrik van Rooyen wrote: > "Carl Banks" wrote: > >> This is starting to sound silly, people. Critical is a relative term, >> and one project's critical may be anothers mundane. Sure a flaw in your >> flagship product is a critical problem *for your company*, but are you >> really trying to

Re: list index() (OT)

2007-09-01 Thread Ricardo Aráoz
Steve Holden wrote: > Ricardo Aráoz wrote: >> Paddy wrote: >>> On Sep 1, 7:57 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >>>> "Richie Hindle" wrote: >>>>> But - the word for someone who posts to the internet with th

localizing a sort

2007-09-01 Thread Ricardo Aráoz
Hi, I've been working on sorting out some words. My locale is : >>> import locale >>> locale.getdefaultlocale() ('es_AR', 'cp1252') I do : >>> a = 'áéíóúäëïöüàèìòù' >>> print ''.join(sorted(a, cmp=lambda x,y: locale.strcoll(x,y))) aeiouàáäèéëìíïòóöùúü This is not what I am expecting. I was expec

Re: status of Programming by Contract (PEP 316)?

2007-09-01 Thread Ricardo Aráoz
Alex Martelli wrote: > Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >... >> We should remember that the level >> of security of a 'System' is the same as the level of security of it's >> weakest component, > > Not true (not even for security

Re: status of Programming by Contract (PEP 316)?

2007-09-02 Thread Ricardo Aráoz
Alex Martelli wrote: > Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >... >>>> We should remember that the level >>>> of security of a 'System' is the same as the level of security of it's >>>> weakest component, >... >

Re: localizing a sort

2007-09-02 Thread Ricardo Aráoz
Peter Otten wrote: > Am Sat, 01 Sep 2007 18:56:38 -0300 schrieb Ricardo Aráoz: > >> Hi, I've been working on sorting out some words. >> >> My locale is : >>>>> import locale >>>>> locale.getdefaultlocale() >> ('es_AR', &#

Re: localizing a sort

2007-09-02 Thread Ricardo Aráoz
Alex Martelli wrote: > Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >> Peter Otten wrote: >... >>>>>>> print ''.join(sorted(a, cmp=lambda x,y: locale.strcoll(x,y))) >>>> aeiouàáäèéëìíïòóöùúü >>> The lambda is superfluous. Just w

Re: advice about `correct' use of decorator

2007-09-03 Thread Ricardo Aráoz
Gabriel Genellina wrote: > En Wed, 29 Aug 2007 07:32:21 -0300, BJörn Lindqvist <[EMAIL PROTECTED]> > escribi�: > >> On 8/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >>> En Thu, 23 Aug 2007 09:20:21 -0300, BJörn Lindqvist <[EMAIL PROTECTED]> >>> escribi�: >>> def check_user_logged_in

Re: REGULAR EXPRESSION

2007-09-04 Thread Ricardo Aráoz
Steve Holden wrote: > AniNair wrote: >> hi.. I am trying to match '+ %&/-' etc using regular expression in >> expressions like 879+34343. I tried \W+ but it matches only in the >> beginning of the string Plz help Thanking you in advance... >> > Perhaps you could give a few example of strings tha

Re: REGULAR EXPRESSION

2007-09-05 Thread Ricardo Aráoz
AniNair wrote: > On Sep 5, 4:35 am, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >> Steve Holden wrote: >>> AniNair wrote: >>>> hi.. I am trying to match '+ %&/-' etc using regular expression in >>>> expressions like 879+34343. I tried \W+

Re: Looping through File Question

2007-09-06 Thread Ricardo Aráoz
John Machin wrote: > On Sep 5, 10:26 pm, planetmatt <[EMAIL PROTECTED]> wrote: >> On 5 Sep, 12:34, John Machin <[EMAIL PROTECTED]> wrote: >> >> >> >>> On Sep 5, 8:58 pm, planetmatt <[EMAIL PROTECTED]> wrote: I am a Python beginner. I am trying to loop through a CSV file which I can do.

Re: Text processing and file creation

2007-09-06 Thread Ricardo Aráoz
Shawn Milochik wrote: > On 9/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I have a text source file of about 20.000 lines. >> >From this file, I like to write the first 5 lines to a new file. Close >> that file, grab the next 5 lines write these to a new file... grabbing >> 5 lines and cre

Re: Finding specific date ranges

2007-09-07 Thread Ricardo Aráoz
Tim Golden wrote: > [EMAIL PROTECTED] wrote: >> Hi, >> >> I am working on a timesheet application in which I need to to find the >> first pay period in a month that is entirely contained in that month >> to calculate vacation time. Below are some example date ranges: >> >> >> December 31, 2006J

Re: why should I learn python

2007-09-07 Thread Ricardo Aráoz
Tom Brown wrote: > On Thursday 06 September 2007 15:44, Torsten Bronger wrote: >> Hallöchen! >> >> Tom Brown writes: >>> [...] Python has been by far the easiest to develop in. Some >>> people might say it is not "real programming" because it is so >>> easy. >> I can't believe this. Have you real

Re: How to determine the bool between the strings and ints?

2007-09-08 Thread Ricardo Aráoz
Zentrader wrote: > On Sep 7, 11:30 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Fri, 07 Sep 2007 18:49:12 +0200, Jorgen Bodde wrote: >>> As for why caring if they are bools or not, I write True and False to >>> the properties, the internal mechanism works like this so I need to >>>

Re: creating really big lists

2007-09-08 Thread Ricardo Aráoz
Dr Mephesto wrote: > On Sep 8, 3:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Fri, 07 Sep 2007 16:16:46 -0300, Dr Mephesto <[EMAIL PROTECTED]> >> escribi?: >> >>> hey, that defaultdict thing looks pretty cool... >>> whats the overhead like for using a dictionary in python? >> Diction

Re: How to determine the bool between the strings and ints?

2007-09-08 Thread Ricardo Aráoz
Steven D'Aprano wrote: ... .. . > You know, one or two examples was probably plenty. The other six or seven > didn't add anything to your post except length. > > Also, type testing by equality is generally not a good idea. For example: > > class HexInt(int): > """Like built-in ints, but prin

Re: Spell-checking Python source code

2007-09-08 Thread Ricardo Aráoz
John Zenger wrote: > To my horror, someone pointed out to me yesterday that a web app I > wrote has been prominently displaying a misspelled word. The word was > buried in my code. > > Is there a utility out there that will help spell-check literal > strings entered into Python source code? I do

Re: Spell-checking Python source code

2007-09-08 Thread Ricardo Aráoz
David wrote: >>> (I know that the better practice is to isolate user-displayed strings >>> from the code, but in this case that just didn't happen.) >>> >> Use the re module, identify the strings and write them to another file, >> then open the file with your spell checker. Program shouldn't be mor

include myVar

2007-09-08 Thread Ricardo Aráoz
Is there a way to import a module whose name is in a variable (read from a configuration file for example)? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: Modul (%) in python not like in C?

2007-09-09 Thread Ricardo Aráoz
John Machin wrote: > On Sep 10, 8:05 am, Lee Harr <[EMAIL PROTECTED]> wrote: Python will always yield a number x = m%n such that 0 <= x < n, but Turbo C will always yield a number such that if x = m%n -x = -m%n. That is, since 111 % 10 = 1, -111 % 10 = -1. The two values will alway

Mac OSX sqlite problem. Missing?

2007-09-10 Thread ricardo . turpino
Hi, I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a Macbook 1.83GHz. I though that the python sqlite library was installed by default as part of Mac Python 2.5, however, I still have a problem. Sqlite does not appear to be my system: >>> import sqlite Traceback (most recent ca

Re: Mac OSX sqlite problem. Missing?

2007-09-10 Thread ricardo . turpino
Diez B. Roggisch wrote: > > Are you by any chance using the python 2.3 when issuing that import > statement? > > Diez Unfortunately not :( ibook:~/project1$ python -V Python 2.5 ibook:~/project1$ python Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] o

Re: Python 3K or Python 2.9?

2007-09-14 Thread Ricardo Aráoz
Bruno Desthuilliers wrote: > TheFlyingDutchman a écrit : >> Well I'm with Bruce Eckel - there shouldn't be any argument for the >> object in the class method parameter list. > > def fun(obj, *args, **kw): ># generic code here that do something with obj > > import some_module > some_module.Som

Pseudo-Private Class Attributes

2007-09-18 Thread Ricardo Aráoz
That is self.__attributes Been reading about the reasons to introduce them and am a little concerned. As far as I understand it if you have a class that inherits from two other classes which have both the same name for an attribute then you will have a name clash because all instance attributes "w

Re: re question

2007-09-20 Thread Ricardo Aráoz
Dan Bar Dov wrote: > I'm trying to construct a regular expression to match valid IP address, > without leading zeroes (i.e > 1.2.3.4 , 254.10.0.0 , but not > 324.1.1.1, nor 010.10.10.1 ) > > This is what I come up with, and it does not work. >

Counting method calls

2007-09-21 Thread Ricardo Aráoz
Hi, I know I'm being dumb but, why does it not work? >>> class MyList(list): ... def __init__(self): ... self.calls = 0 ... def __getattr__(self, name): ... self.calls += 1 ... return list.__getattribute__(self, name) >>> a = MyList() >>> a [] >>> a.append(1) >>> a

Re: scope, modyfing outside object from inside the method

2007-09-24 Thread Ricardo Aráoz
Marcin Stępnicki wrote: > Hello. > > I thought I understand this, but apparently I don't :(. I'm missing > something very basic and fundamental here, so redirecting me to the > related documentation is welcomed as well as providing working code :). > > Trivial example which works as expected: >

Re: Delete values from a string using the index

2007-09-26 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do > that? > > Thanks. > del a[1] del a[-5] -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete values from a string using the index

2007-09-26 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do > that? > > Thanks. > If you want to do it all at once : del a[1:4:2] -- http://mail.python.org/mailman/listinfo/pyth

Re: Can you please give me some advice?

2007-09-30 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: >> Hello World in Ruby (and a few other >> languages):http://www.oreillynet.com/ruby/blog/2005/12/hello_world.html > >> Hello World in >> Python:http://python.about.com/od/gettingstarted/ss/helloworld.htm > > I know nothing of Ruby, but just the fact that in Ruby the He

Re: readline() - problem

2007-10-02 Thread Ricardo Aráoz
Paul Hankin wrote: > On Oct 2, 12:25 pm, [EMAIL PROTECTED] wrote: >> Hi! >> I'm a new user of python, and have problem. >> I have a plain ascii file: >> 11..1 >> 12..1 >> 11..1 >> I want to create a new file which contains only lines with '1' on 15th

Re: Convert on uppercase unaccentent unicode character

2007-10-05 Thread Ricardo Aráoz
Wildemar Wildenburger wrote: > Steve Holden wrote: >> Malheureusement, I see that absence of accented capitals is a modern >> phenomenon that is regarded as an impediment to the language mostly >> stemming from laziness of individual authors and inadequacy of low-end >> typesetting software. I h

Re: [Tutor] Top Programming Languages of 2013

2007-10-07 Thread Ricardo Aráoz
Alan Gauld wrote: > "Dick Moores" <[EMAIL PROTECTED]> wrote > >> >> > > Interesting, but I'm not sure what the criteria for "top" is. > Is it a measure of power, popularity, usage? > > Scary that HTML/CSS should be so high though > given its not a

Re: How to create a file on users XP desktop

2007-10-07 Thread Ricardo Aráoz
Matimus wrote: > On Oct 6, 8:31 pm, goldtech <[EMAIL PROTECTED]> wrote: >> Can anyone link me or explain the following: >> >> I open a file in a python script. I want the new file's location to be >> on the user's desktop in a Windows XP environment. fileHandle = open >> (., 'w' ) what I gues

Re: Really basic problem

2007-10-10 Thread Ricardo Aráoz
tomamil wrote: > i know this example is stupid and useless, but that's not the answer > to my question. > here it goes: > > status = 0.0 > for i in range(10): >status = status + 0.1 > >if status == 0.1: >print status >elif status == 0.2: >print status >elif status

Re: sorting data

2007-10-29 Thread Ricardo Aráoz
Beema shafreen wrote: > hi all, >I have problem to sort the data.. the file includes data as > follow. > file: > chrX:123343123123343182A_16_P41787782 > chrX:123343417123343476A_16_P03762840 > chrX:123343460123343519A_16_P41787783 > chrX:12334336

  1   2   >