Tools for refactoring/obfuscation

2012-03-06 Thread Javier
I am looking for an automated tool for refactoring/obfuscation. Something that changes names of functions, variables, or which would merge all the functions of various modules in a single module. The closest I have seen is http://bicyclerepair.sourceforge.net/ Does somebody know of something that

Re: Tools for refactoring/obfuscation

2012-03-28 Thread Javier
me know if you use some scripting tool. And, as somebody pointed in this thread obfuscating or refactoring the code are very different things but they can be done with the same tools. Javier Vladimir Ignatov wrote: > Hi, > > (sorry for replying to the old topic) > > On Tue, Ma

Re: Tools for refactoring/obfuscation

2012-04-02 Thread Javier
/pyfuscate/0.1 Lie Ryan wrote: > On 03/29/2012 03:04 AM, Javier wrote: >> Yes, in general I follow clear guidelines for writing code. I just use >> modules with functions in the same directory and clear use of name >> spaces. I almost never use classes. I wonder if

Re: Creating a directory structure and modifying files automatically in Python

2012-05-06 Thread Javier
>Learn how to use a database. Creating and managing a > big collection of directories to handle small data items is the > wrong approach to data storage. > >John Nagle Or not... Using directories may be a way to do rapid prototyp

Re: usenet reading

2012-05-26 Thread Javier
news.aioe.org nntp.aioe.org http://www.aioe.org/ Aioe.org hosts a public news server, an USENET site that is intentionally kept open for all IP addresses without requiring any kind of authentication both for reading and posting.Each IP address is authorized to post 25 messages per day... --

Re: Eigensolver for Large Sparse Matrices in Python

2011-06-09 Thread Javier
Hi, I think you can also use scipy.sparse.linalg.eigen.arpack in addition to scipy.sparse.linalg.eigen.lobpcg Also, from my experience with this routines I can tell you that they don't like to be asked a small number of eigenvalues. Contrary to common sense I have found these routines to prefer

Re: i want to learn pyqt ,but i have no c++ knowlage. is it ok????

2011-06-10 Thread Javier
?? wrote: > i want to learn pyqt ,but i have no c++ knowlage. is it ok It should be ok. I would recoomend this book: "Rapid GUI Programming with Python and Qt" (Prentice Hall Open Source Software Development) Mark Summerfield (Author) -- http://mail.python.org/mailman/listinfo/pyth

Re: How to make statements running in strictly sequential fashion like in an interactive shell

2011-08-19 Thread Javier
Never used it, but I think you can try this: Pexpect - a Pure Python Expect-like module Pexpect is a pure Python Expect-like module. Pexpect makes Python... www.noah.org/python/pexpect/ lzlu123 wrote: > I have an instrument that has a RS232 type serial comm port and I need > to connect to an

Re: List spam

2011-08-19 Thread Javier
You will lose a lot of people asking/answering interesting stuff, and maybe eventually the list will die. Me (like many people with little free time) seldom post in blogs/forums/mailing lists where I need to register. gene heskett wrote: > That is asking the user to take considerable effort and

Re: Extending dict (dict's) to allow for multidimensional dictionary

2011-03-06 Thread Javier
Looks a good idea. I use this kind of "recursive dicts" to represent tree like datastruct in python. Like: car["ford"]["taurus"]["price"]=... car["toyota"]["corolla"]["mpg"]=... car["toyota"]["corolla"]["price"]=... It would be good if it could be combined with class2dict (converting dict elem

Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-04-27 Thread Javier
It would be nice if it could automatically generate the python code for 'clizing a function', i.e., from the example in https://clize.readthedocs.org/en/latest/ def hello_world(name=None, no_capitalize=False): ... being able to do clize.generate_py_code(hello_world) which would return somet

Re: Send data to asyncio coroutine

2015-07-28 Thread Javier
El martes, 21 de julio de 2015, 15:42:47 (UTC+2), Ian escribió: > On Tue, Jul 21, 2015 at 5:31 AM, wrote: > > Hello, I'm trying to understand and link asyncio with ordinary coroutines. > > Now I just want to understand how to do this on asyncio: > > > > > > def foo(): > > data = yield 8 > >

Re: Send data to asyncio coroutine

2015-07-28 Thread Javier
El martes, 28 de julio de 2015, 23:18:11 (UTC+2), Javier escribió: > El martes, 21 de julio de 2015, 15:42:47 (UTC+2), Ian escribió: > > On Tue, Jul 21, 2015 at 5:31 AM, wrote: > > > Hello, I'm trying to understand and link asyncio with ordinary > > > coroutine

Re: Send data to asyncio coroutine

2015-07-29 Thread Javier
El miércoles, 29 de julio de 2015, 1:07:22 (UTC+2), Ian escribió: > On Tue, Jul 28, 2015 at 1:17 PM, Javier wrote: > > Hello again. I have been investigating a bit your example. I don't > > understand why I can't write something like this: > > > > &

Re: Send data to asyncio coroutine

2015-08-01 Thread Javier
El martes, 21 de julio de 2015, 13:31:56 (UTC+2), Javier escribió: > Hello, I'm trying to understand and link asyncio with ordinary coroutines. > Now I just want to understand how to do this on asyncio: > > > def foo(): > data = yield 8 > print(data) >

Re: Send data to asyncio coroutine

2015-08-01 Thread Javier
El sábado, 1 de agosto de 2015, 19:19:00 (UTC+2), Marko Rauhamaa escribió: > Javier : > > > Asyncio is a crazy headache! I realized that I can't use asyncio tcp > > servers with pickle! Asyncio is good as a concept but bad in real > > life. > > > > I th

Re: Send data to asyncio coroutine

2015-08-01 Thread Javier
El sábado, 1 de agosto de 2015, 18:45:17 (UTC+2), Mark Lawrence escribió: > On 01/08/2015 17:07, Javier wrote: > > > > Asyncio is a crazy headache! I realized that I can't use asyncio tcp > > servers with pickle! Asyncio is good as a concept but bad in real life. &g

Re: Send data to asyncio coroutine

2015-08-01 Thread Javier
El sábado, 1 de agosto de 2015, 20:46:49 (UTC+2), Mark Lawrence escribió: > On 01/08/2015 19:38, Marko Rauhamaa wrote: > > Javier : > > > >> El sábado, 1 de agosto de 2015, 18:45:17 (UTC+2), Mark Lawrence escribió: > >>> clearly you know better than the Pyt

Re: Send data to asyncio coroutine

2015-08-01 Thread Javier
El sábado, 1 de agosto de 2015, 21:15:07 (UTC+2), Marko Rauhamaa escribió: > Javier : > > > My intention now is to use the asyncio.StreamReader passed as argument > > to the asyncio.start_server callback to read objects serialized with > > pickle. The problems are that

monospaced font in MS Windows with wxpython

2015-09-11 Thread Javier
I am trying to use a monospaced font (preferably small) in MS Windows with wxpython. I have tried txtctrl.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas')) but no success, I still get a proportional font. -- https://mail.python.org/mailman/listinfo/python-list

Re: monospaced font in MS Windows with wxpython

2015-09-11 Thread Javier
The font I posted before was actually monospaced. I was just putting the definition in the wrong place All solved now. Sorry for the noise. > txtctrl.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, > u'Consolas')) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 is killing Python

2014-07-16 Thread Javier
> I don't see anyone taking the Python 2 source code and backporting a > bunch of Python 3 features (and/or adding a bunch of their own > features) and creating the Python 2.8 that > http://blog.startifact.com/guido_no.jpg rejects. What split is > actually occurring, or going to occur? I think anyo

Re: Multiple python versions, one dev environment???

2014-07-17 Thread Javier
Are you using arch linux. I deal with multiple interpreters putting fake executables in /usr/local/bin for everything: (python, sphinx, virtualenv, pydoc, idle, python-config...) selecting 2 or 3. You can do the same for selecting 2.3, 2.5, 2.7. What the scripts do is to detect whether it is

Re: Multiple python versions, one dev environment???

2014-07-17 Thread Javier
v=== #!/bin/bash script=`readlink -f -- "$1"` case "$script" in /usr/bin*) exec virtualenv3 "$@" ;; esac exec virtualenv${PYVERSION} "$@" Joep van Delft wrote: > Hello Javier! > > Thanks, those

Re: Why do class methods always need 'self' as the first parameter?

2011-08-31 Thread Javier Collado
is part of the zen of python: <> http://www.python.org/dev/peps/pep-0020/ Regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Javier Bezos
t of Python are slices -- mine are always off by 1). I always write explicitly ends as #end, so that I can reorganice the code easily if necessary. Maybe in the future, when Ruby matures, I could change my mind, but currently Python is still my favourite scri

Re: Grouping code by indentation - feature or ******?

2005-03-27 Thread Javier Bezos
syntax. MetaFont explains this by saying that the index doesn't refer to a character but to a position between characters, which when traslated to Python would mean: s t r i n g ^ ^ ^ ^ ^ ^ ^ 0 1 2 3 4 5 6 so that [1:2] is "t". Javier

Re: Grouping code by indentation - feature or ******?

2005-03-27 Thread Javier Bezos
Tutorial tells us exactly the same... Ah! I've just forgotten that... Javier ___ Javier Bezos | Mem. A multilingual system for LaTeX jbezos at wanadoo dot es | http://mem-latex.sourceforge.net .

Re: Grouping code by indentation - feature or ******?

2005-03-28 Thread Javier Bezos
x to avoid it in some expressions you will find problems in another expressions where otherwise it wouldn't be present (counting from the end with negatives values is particularly funny). The same applies if the first element is 1 instead of 0, for example. Then, why not to leave

Re: Grouping code by indentation - feature or ******?

2005-03-30 Thread Javier Bezos
le mathematical terms (in other words, it's an integral part of the algorithms), I cannot find a way to explain the e+1 in cases 2 and 3 (and the inconsistency with e-t+1 in case 2 vs. s+t in case 1) except the Python syntax. Javier _

Re: Grouping code by indentation - feature or ******?

2005-04-01 Thread Javier Bezos
ssage. This thread began when some people thought that I had to be convinced about how wonderful slices are, after I said _incidentally_ I didn't like Python slices (and then I had to explain in turn why I don't like them). Perhaps you should ask those people, not me. Javier ____

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Javier Bezos
t.) Recently there was a short (sub)thread about that. One of my messages (against half-open slices) is, for example http://groups-beta.google.com/group/comp.lang.python/msg/5532dd50b57853b1 Javier ___ Javier Bezos| TeX y ti

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Javier Bezos
> >>> print str[:i]+str[i:] > asdfjkl; Actually, this has no relation with the half-open slices but with the fact that if i goes beyond the limit of the string then Python, wisely, doesn't raise an error but instead return the string until the en

Re: CSV to matrix array

2013-04-12 Thread Javier Miranda
you can fill in the details. Anyway, I think this will give > you a list of lists, and perhaps you can convert that to a numpy array, if > you really need one of those. > > > -- > DaveA > -- > http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list> > -- Javier Miranda Mobile: +52 333 129 20 70 -- http://mail.python.org/mailman/listinfo/python-list

PersistenceDict Question

2006-09-24 Thread Javier Subervi
y", and it appears that it is not in my version of Python. I went ahead and added it, then rebooted my server since I couldn't figure out how to restart Python (please tell me how to do that). But my Zope still threw the same error. How do I deal with this?TIA,Javier 2 Do you Yahoo!

AttributeError Question

2006-09-24 Thread Javier Subervi
Hi;I'm new to troubleshooting scripts. This came up when trying to load a Zope product:    * Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__  __traceback_info__: field.Vocabulary(here)    * Module Python _expression_ "field.Vocabulary(here)", line 1, in <_expression_>    * Modu

Problem Coordinating Python and OpenLDAP

2006-09-26 Thread Javier Subervi
Hi;I'm on FreeBSD 6.1. In order to integrate Python into LDAP I have to intstall an interpreter called py-ldap2 (in my case). I installed it from the ports but when I go to my python interpreter and enter "import ldap" it tells me the module can't be found. What am I doing wrong? I got this at the

Upgrading Problems

2006-09-30 Thread Javier Subervi
Hi;I have python 2.3.5 and I'd like to upgrade to 2.5.0. I've tried installing from FreeBSD ports and the oldfashioned way from source code, with the "configure && make && make install" dance, and still when I call up my python interpreter it tells me I'm in 2.3.5! Why? I didn't do "altinstall"! Wh

Working w/ Yield

2006-12-14 Thread Javier Subervi
return the path? Or, how do I call the demo after executing the yield? TIA, Javier Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index-- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-15 Thread Javier Bezos
readability for someone who speaks German > but not English. Agreed. I always use English names (more or less :-)), but this is not the PEP is about. Javier -- http://www.texytipografia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Javier Bezos
shows a list of them with similar shapes. IIRC, there is a similar tool on Macs. Of course, I'm not saying this allows to enter kanji in a easy and fast way, but certainly it's not impossible at all, even if you don't know the pronunciation. Javier ---

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Javier Bezos
o debug a program written in English. > (I don't know what it means, just copied over some words > from a japanese news site, A Japanese speaking Korean, it seems. :-) Javier -- http://www.texytipografia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Javier Bezos
on of Python code some time ago. This was a technical issue which has been solved, and no doubt my laziness (I didn't switch to Unicode) won't prevent non-ASCII identifiers be properly showed in general. Javier - http://www.texytipografia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Javier Bezos
I can promise there are Korean groups and there are no problems at all in using Hangul (the Korean writing). Javier - http://www.texytipografia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Javier Bezos
x27;s fine). Otherwise it would a mess, as you said. Javier - http://www.texytipografia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-16 Thread Javier Bezos
of a century after we know concepts >> are much better than low level programming and >> explicit computations -- if we have an array >> a = b..e, then the length of a should be a.length() >> (or a.length(b,e)), and it is independent of > Hi Javier, > You seem to have

Re: Is there a GUI for informing a user of missing dependencies?

2009-05-12 Thread Javier Collado
Hello, I'm not an expert, but if you use setuptools for your application, then a 'install_requires' argument would do the job. For more information, please take a look at: http://peak.telecommunity.com/DevCenter/setuptools Best regards, Javier 2009/5/12 Jason : > I

Re: Global variables from a class

2009-05-29 Thread Javier Collado
Hello, First thing is a class variable (one for every instance) and second one an instance variable (one per instance). For further information, please take a look at: http://diveintopython.org/object_oriented_framework/class_attributes.html Best regards, Javier 2009/5/29 Kless : >

Re: Global variables from a class

2009-05-29 Thread Javier Collado
You're right. I agree on that it's important to use proper words. Thanks for the correction. Best regards, Javier 2009/5/29 Steven D'Aprano : > On Fri, 29 May 2009 12:04:53 +0200, Javier Collado wrote: > >> Hello, >> >> First thing is a class variable

Re: PYTHONPATH and multiple python versions

2009-06-05 Thread Javier Collado
Hello, I think that virtualenv could also do the job. Best regards, Javier 2009/6/5 Red Forks : > maybe a shell script to switch PYTHONPATH, like: > start-python-2.5 > start-python-2.4 ... > On Fri, Jun 5, 2009 at 4:56 PM, David Cournapeau wrote: >> >> Hi, >

Re: When to use mechanize and Windmill library during WebScraping ?

2009-12-12 Thread Javier Collado
above, then you can move to windmill or some other tool that executes JavaScript code before trying to get the desired data. Best regards, Javier 2009/12/11 Raji Seetharaman : > Hi > > For 'Webscraping with Python' mechanize or urllib2 and windmill or selenium > librarie

Re: Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Javier Collado
Hello, I think that's exactly what the cpaste magic function does. Type 'cpaste?' in your IPython session for more information. Best regards, Javier 2010/1/14 Reckoner : > > Hi, > > I am studying some examples in a tutorial where there are a lot of > leading

Re: Symbols as parameters?

2010-01-21 Thread Javier Collado
Hello, I'd say that isn't totally incorrect to use strings instead of symbols. Please note that in other programming languages symbols, atoms and the like are in fact immutable strings, which is what python provides by default. Best regards, Javier 2010/1/21 Alf P. Steinbach :

Re: subprocess troubles

2010-01-21 Thread Javier Collado
Hello, If you set shell=False, then I think that arg2 should be separated into two different parts. Also, arg3 could be set just to pattern (no need to add extra spaces or using str function). Best regards, Javier 2010/1/21 Tomas Pelka : > Hey all, > > have a problem with follow

Re: Sikuli: the coolest Python project I have yet seen...

2010-01-25 Thread Javier Collado
Hello, I think the site is under maintenance. I tried a couple of hours ago and it worked fine. As an alternative, I found that this link also worked: http://www.sikuli.org/ Unfortunately, it seems it's not working right now. Best regards, Javier 2010/1/25 Virgil Stokes : > On 25-

Re: Python or Ant

2010-01-26 Thread Javier Collado
Hello, One tool that I really like is doit: http://python-doit.sourceforge.net/ If you need to execute jobs remotely, you may like to take a look at STAF: http://staf.sourceforge.net/index.php Best regards, Javier 2010/1/26 Chris Rebert : > On Tue, Jan 26, 2010 at 10:58 AM,   wrote: &g

Re: scraping with urllib2

2010-01-27 Thread Javier Collado
Hello, To accept cookies, use the HTTPCookieProcessor as explained here: http://www.nomadjourney.com/2009/03/automatic-site-login-using-python-urllib2/ Best regards, Javier 2010/1/27 Andre Engels : > On Wed, Jan 27, 2010 at 6:26 AM, Patrick wrote: >> I'm trying to scrape the

Re: Help parsing a page with python

2010-01-27 Thread Javier Collado
Hello, A test case for Windmill might also be used to extract the information that you're looking for. Best regards, Javier 2010/1/27 mierdatutis mi : > Those videos are generated by javascript. > There is some parser with python for javascript??? > > Thanks a lot! >

Re: Help parsing a page with python

2010-01-27 Thread Javier Collado
Hello, You can find some advice here: http://www.packtpub.com/article/web-scraping-with-python-part-2 Best regards, Javier 2010/1/27 mierdatutis mi : > Hello again, > > What test case for Windmill? Can you say me the link, please? > > Many thanks > > 2010/1/27 Javier

Re: Where to find pexpect

2009-10-13 Thread Javier Collado
Hello, Google is your friend: http://sourceforge.net/projects/pexpect/ http://sourceforge.net/projects/pexpect/files/pexpect/Release%202.3/pexpect-2.3.tar.gz/download Best regards, Javier 2009/10/13 Antoon Pardon : > I have been looking for pexpect. The links I find like >

Re: the usage of 'yield' keyword

2009-10-14 Thread Javier Collado
Hello, I think that the best information available on the subject is the following: http://www.dabeaz.com/generators/ http://www.dabeaz.com/coroutines/ Best regards, Javier 2009/10/14 Peng Yu : > http://docs.python.org/reference/simple_stmts.html#grammar-token-yield_stmt > > The ex

Re: Frameworks

2009-10-19 Thread Javier Santana
juno http://github.com/breily/juno it's very easy, uses sqlalchemy as ORM and jinja2 (others can be used if you want) for templates. On Mon, Oct 19, 2009 at 10:24 AM, Bruno Desthuilliers wrote: > flebber a écrit : >> >> Hi >> >> I have been searching through the vast array of python frameworks >

Re: substituting list comprehensions for map()

2009-11-02 Thread Javier Collado
Hello, I'll do the following: [op1+op2 for op1,op2 in zip(operandlist1, operandlist2)] Best regards, Javier 2009/11/2 Jon P. : > I'd like to do: > > resultlist = operandlist1 + operandlist2 > > where for example > > operandlist1=[1,2,3,4,5] > operandlist2=[

Re: How to specify Python version in script?

2009-11-11 Thread Javier Collado
Hello, If you are working on linux, you can change the shebang line from: #!/usr/bin/python to: #!/usr/bin/python2.6 Best regards, Javier P.S. If you just want to avoid python 3 while running the latest python 2.x version, this should also work: #!/usr/bin/python2 2009/11/11 Benjamin

Re: python and http POST

2010-02-12 Thread Javier Collado
r your requests. For that BeautifulSoup is good solution (with some Firebug help to visually locate what you're looking for). Best regards, Javier P.S. Some examples here: http://www.packtpub.com/article/web-scraping-with-python http://www.packtpub.com/article/web-scraping-with-pyth

Re: Are there in Python some static web site generating tools like webgen, nanoc or webby in Ruby ?

2010-03-09 Thread Javier Collado
d hyde. Best regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

associative array

2010-03-31 Thread Javier Montoya
Dear all, I'm a newbie in python and would be acknowledge if somebody could shed some light on associative arrays. More precisely, I would like to create a multi-dimensional associative array. I have for example a list of students which are identified uniquely by their student IDs. Additionally, f

Re: associative array

2010-04-01 Thread Javier Montoya
On Mar 31, 7:36 pm, Gary Herron wrote: > JavierMontoyawrote: > > Dear all, > > > I'm a newbie in python and would be acknowledge if somebody could shed > > some light on associative arrays. > > More precisely, I would like to create a multi-dimensional associative > > array. I have for example a l

Re: Parsing markup.

2010-11-25 Thread Javier Collado
>>> s.findAll('i') [italic] >>> s.findAll('p') [This is a paragraph with bold and italic elements in it, It can be made up of multiple lines separated by pagagraph tags.] Best regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.isfile and wildcard for directory name

2010-12-30 Thread Javier Collado
for file in os.listdir('.'): if fnmatch.fnmatch(file, '*.txt'): print file ----- Regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: parse html rendered by js

2011-02-12 Thread Javier Collado
rds, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: fast regex

2010-05-06 Thread Javier Collado
than the standard library in python. Unfortunately, it's implemented in C++ and there isn't an official python wrapper for it. However, you can find a wrapper that can be useful for you here: http://github.com/facebook/pyre2 Best regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

remove elements incrementally from a list

2010-05-19 Thread Javier Montoya
Dear all, I've a list of float numbers and I would like to delete incrementally a set of elements in a given range of indexes, sth. like: for j in range(beginIndex, endIndex+1): print ("remove [%d] => val: %g" % (j, myList[j])) del myList[j] However, since I'm iterating over the same list,

Re: remove elements incrementally from a list

2010-05-19 Thread Javier Montoya
On May 19, 4:06 pm, Steven D'Aprano wrote: > On Wed, 19 May 2010 03:53:44 -0700, Javier Montoya wrote: > > Dear all, > > > I've a list of float numbers and I would like to delete incrementally a > > set of elements in a given range of indexes, sth. like: > &g

numpy arrays to python compatible arrays

2010-06-10 Thread Javier Montoya
Dear all, I'm new to python and have been working with the numpy package. I have some numpy float arrays (obtained from np.fromfile and np.cov functions) and would like to convert them to simple python arrays. I was wondering which is the best way to do that? Is there any function to do that? Bes

Re: numpy arrays to python compatible arrays

2010-06-12 Thread Javier Montoya
On Jun 11, 12:29 am, Martin wrote: > On Jun 10, 9:02 pm, Philip Semanchuk wrote: > > > > > On Jun 10, 2010, at 9:58 AM,JavierMontoyawrote: > > > > Dear all, > > > > I'm new to python and have been working with the numpy package. I have > > > some numpy float arrays (obtained from np.fromfile and

non-uniform distribution

2010-06-12 Thread Javier Montoya
Dear all, I need to generate a vector of random float numbers between [0,1] such that their sum equals 1 and that are distributed non-uniformly. Is there any python function that generates such a vector? Best wishes -- http://mail.python.org/mailman/listinfo/python-list

Re: non-uniform distribution

2010-06-12 Thread Javier Montoya
On Jun 12, 1:08 pm, Etienne Rousee wrote: > Le 12/06/2010 12:05, Javier Montoya a écrit : > > > I need to generate a vector of random float numbers between [0,1] such > > that their sum equals 1 and that are distributed non-uniformly. > > Is there any python function that

Re: non-uniform distribution

2010-06-12 Thread Javier Montoya
On Jun 12, 1:08 pm, Etienne Rousee wrote: > Le 12/06/2010 12:05, Javier Montoya a écrit : > > > I need to generate a vector of random float numbers between [0,1] such > > that their sum equals 1 and that are distributed non-uniformly. > > Is there any python function that

Re: non-uniform distribution

2010-06-12 Thread Javier Montoya
On Jun 12, 2:09 pm, Steven D'Aprano wrote: > On Sat, 12 Jun 2010 03:05:43 -0700, Javier Montoya wrote: > > Dear all, > > > I need to generate a vector of random float numbers between [0,1] such > > that their sum equals 1 and that are distributed non-uniformly. Is

Re: non-uniform distribution

2010-06-12 Thread Javier Montoya
On Jun 12, 3:21 pm, Ian wrote: > On 12/06/10 11:05, Javier Montoya wrote:> Dear all, > > > I need to generate a vector of random float numbers between [0,1] such > > that their sum equals 1 and that are distributed non-uniformly. > > Is there any python function t

re.sub unexpected behaviour

2010-07-06 Thread Javier Collado
nt string, instead of a function, the strange behaviour cannot be reproduced: re.sub(r'123', '123', '123') '123' re.sub('123', '123', '123\n') '123\n' Is there any explanation for this? If I'm skipping something when using a replacement function with re.sub, please let me know. Best regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub unexpected behaviour

2010-07-06 Thread Javier Collado
Thanks for your answers. They helped me to realize that I was mistakenly using match.string (the whole string) when I should be using math.group(0) (the whole match). Best regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: Start the interactive shell within an application

2009-06-09 Thread Javier Collado
Take a look either at code.interact or at IPython.ipapi.launch_new_instance. Basically, the only thing that you have to provide is a dictionary object that contains the namespace that you would like to have in your shell once it's launched. Best regards, Javier 2009/6/9 eGlyph : >

Re: getop or optparse with option with spaces?

2009-06-10 Thread Javier Collado
Hello, It's strange behaviour. Have you tried argparse (http://code.google.com/p/argparse/)? I've been using it for long time without any problem like that? Best regards, Javier 2009/6/10 David Shapiro : > Hello, > > I have been trying to find an example of how to dea

Re: Question about None

2009-06-12 Thread Javier Collado
Hello, This should work for you: In [1]: import types In [2]: isinstance(None, types.NoneType) Out[2]: True Best regards, Javier 2009/6/12 Paul LaFollette : > Kind people, > > Using Python 3.0 on a Gatesware machine (XP). > I am building a class in which I want to constra

Re: Question about None

2009-06-12 Thread Javier Collado
Hello, You're right, types.NoneType is not available in python 3.0, I wasn't aware of that change. Thanks for pointing it out. Best regards, Javier 2009/6/12 Jeff McNeil : > On Jun 12, 10:05 am, Paul LaFollette > wrote: >> Kind people, >> >> Using Pyt

Re: Calling subprocess with arguments

2009-06-19 Thread Javier Collado
Hello, The problem might be that, aside from creating the Popen object, to get the command run you need to call 'communicate' (other options, not used with the Popen object directly, are 'call' or 'waitpid' as explained in the documentation). Did you do that? Best

Making code run in both source tree and installation path

2009-06-29 Thread Javier Collado
aybe using buildout. What would you say it's the best/more elegant option to solve this problem? Best regards, Javier -- http://mail.python.org/mailman/listinfo/python-list

Re: packaging apps

2009-06-30 Thread Javier Collado
thon-build-system Best regards, Javier 2009/6/30 Ronn Ross : > I have a simple application that has a glade file and a .py file. How would > I package that into an installer for Windows, Mac, and a deb file? Can > anyone point me in the right direction? > > -- > http://mail

Re: Config files with different types

2009-07-03 Thread Javier Collado
]: yaml.load("""name: person name ...: age: 25 ...: is_programmer: true""") Out[2]: {'age': 25, 'is_programmer': True, 'name': 'person name'} Best regards, Javier 2009/7/2 Zach Hobesh : > Hi all, > > I've w

string.Template issue

2009-07-30 Thread Javier Collado
#x27;t be there) and that the line above should be: cls.pattern = _re.compile(pattern, _re.VERBOSE) and the default value for idpattern: [_a-zA-Z][_a-zA-Z0-9]* Do you agree on this? Is there any reason for the IGNORECASE option to be passed to re.compile? Best regards, Javier -- http://mai

Re: Non-blocking read with popen subprocess

2009-07-31 Thread Javier Collado
rovides a method for nonblocking reads, so I think that you should consider to take a look at it: http://pexpect.sourceforge.net/pexpect.html#spawn-read_nonblocking Best regards, Javier 2009/7/31 Dhanesh : > Hi , > > I am trying to use subprocess popen on a windows command line > e

Re: OptionParser How to: prog [options] [arguments]

2009-08-14 Thread Javier Collado
at it. Best regards, Javier 2009/8/14 Steven Woody : > Hi, > I am using OptionParser, but I've not managed figure out a way to support > what I wanted command line format "prog [options] [arguments]". > E.g., "svn ls -r123 http://hello.world".   Can I do t

Re: lambda functions

2009-08-31 Thread Javier Collado
Hello, This page has some advice about how to avoid some of the lambda functions limitations: http://p-nand-q.com/python/stupid_lambda_tricks.html In particular, it suggests to use map function instead of for loops. Best regards, Javier 2009/8/31 Pierre : > Hello, > > I would lik

Re: Distributing Python-programs to Ubuntu users

2009-09-25 Thread Javier Collado
f the project development has already started, probably it won't be useful for you. Best regards, Javier 2009/9/25 Olof Bjarnason : > Hi! > > I write small games in Python/PyGame. I want to find a way to make a > downloadable package/installer/script to put on my webpage, especia

Connecting Google News

2017-07-16 Thread Javier Bezos
Protection', '1; mode=block'), ('X-Frame-Options', 'SAMEORIGIN'), ('X-Content-Type-Options', 'nosniff'), ('Set-Cookie', 'NID=107=qwH7N2hB12zVGfFzrAC2CZZNhrnNAVLEmTvDvuSzzw6mSlta9D2RDZVP9t5gEcq_WJjZQjDSWklJ7LElSnAZnHsiF4CXOwvGDs2tjrXfP41LE-6LafdA86GO3sWYnfWs;Domain=.google.com;Path=/;Expires=Fri, ' '12-Jan-2018 16:37:48 GMT;HttpOnly'), ('Alt-Svc', 'quic=":443"; ma=2592000; v="39,38,37,36,35"')] --- `read()` is empty string ('' or b''). `status` is 302. `reason` is `Found`. Javier -- https://mail.python.org/mailman/listinfo/python-list

Re: Connecting Google News

2017-07-16 Thread Javier Bezos
care of that yourself. I didn't notice the bar just before ?ned ! I don't know how many times I've compared the URLs without realizing it was added. Silly me! Thank you Javier -- https://mail.python.org/mailman/listinfo/python-list

Re: Connecting Google News

2017-07-16 Thread Javier Bezos
Peter, http.request("GET","/news/headlines?ned=es_mx&hl=es" , Thank you. It works, too. Javier -- https://mail.python.org/mailman/listinfo/python-list

Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Javier Guerra Giraldez
ainly sad news. i'm bad at remembering who did what; but i don't have to check the list to remember him as a very positive presence. thanks for sharing. -- Javier -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >