Re: Python boilerplate

2016-03-20 Thread Fernando Felix do Nascimento Junior
@all I released version 1.0.0 with a tiny glossary and explanation of each file in the boilerplate. @Chris I made the boilerplate with intent that everyone can understand, download and use quickly. So, I didn't put extra dependence like cookiecutter (that depends jinja, that depends markupsaf

Python boilerplate

2016-03-19 Thread Fernando Felix do Nascimento Junior
ge.py ## Structure Structure of the project in tree format. ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── MANIFEST.in ├── module_name.py ├── README.md ├── requirements │ ├── dev.txt │ └── prod.txt ├── requirements.txt ├── setup.cfg ├── setup.py ├── tests.py └── tox.ini Fernando Felix --

Re: "x == None" vs "x is None"

2016-01-19 Thread fernando junior
> I have seen at several places "x == None" and "x is None" within > if-statements. > What is the difference? > Which term should I prefer and why? > > > -- > Ullrich Horlacher Server und Virtualisierung > Rechenzentrum IZUS/TIK E-Mail: horlac...@tik.uni-stuttgart.de > Uni

Observer pattern implementation in Python based on jQuery

2016-01-14 Thread fernando junior
Hi, I made an observer/pubsub pattern implementation in Python based on jQuery. It's available in https://github.com/fernandojunior/python-pattern-observer. Take a look! :) Fernando Felix https://br.linkedin.com/in/fernandofnjr -- https://mail.python.org/mailman/listinfo/python-list

First Brazilian programming MOOC with 10.000 enrolled

2014-02-25 Thread Fernando Masanori Ashikaga
Python for Zombies [1] is the first MOOC in portuguese to teach programming. Today we have 10.000 enrolled in 1013 cities from Brazil. We started five months ago. The website is a Django application. [1] http://pycursos.com/python-para-zumbis/ -- https://mail.python.org/mailman/listinfo/python-

Python for Myo Control Armband

2014-02-03 Thread Fernando Masanori Ashikaga
Does anyone know if there is already a Python library for Myo [1] Gesture Control Armband? There are other gesture controls with Python libraries? Thanks in advance [1] https://www.thalmic.com/en/myo/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python getters and setters

2013-08-17 Thread Fernando Saldanha
The debate got more interesting than I expected. Without taking sides, I would like to add that perhaps my "length" example was misleading: length is easy to calculate. The information could be hard to extract from the data, either because complex calculations are involved, or because it is not

Python getters and setters

2013-08-17 Thread Fernando Saldanha
I am new to Python. I understand that it is "unpythonic" to write getters and setters, and that property() can be used if necessary. This deals with the case of attributes, but there are other kinds of information available within a class. Suppose my class contains an attribute called "data" t

Re: Check for the type of arguments

2013-08-17 Thread Fernando Saldanha
Thanks for the insightful answers. PTVS is Python Tools for Visual Studio. -- http://mail.python.org/mailman/listinfo/python-list

Check for the type of arguments

2013-08-17 Thread Fernando Saldanha
I am new to Python, with some experience in Java, C++ and R. Writing in other languages I usually check the type and values of function arguments. In the Python code examples I have seen this is rarely done. Questions: 1) Is this because it would be "unpythonic" or just because the examples ar

how to use property?

2012-09-17 Thread Fernando Jiménez
Hi guys! I'm noob in python and I would know how to correctly use the property. I have read some things about it but I do not quite understand. I found this: class C(object): def __init__(self): self._x = None @property def x(self): """I'm the 'x' property."""

A sad day for the scientific Python community. John Hunter, creator of matplotlib: 1968-2012.

2012-08-29 Thread Fernando Perez
the ICU and worked to ensure that those last hours were as comfortable as possible for John; her generous actions helped us through a very difficult moment. It is now time to close this already too long message... John, thanks for everything you gave all of us, and for the privilege of knowin

[ANN] IPython 0.13 is officially out!

2012-06-30 Thread Fernando Perez
. Many thanks to all who contributed! Fernando, on behalf of the IPython development team. http://ipython.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python education survey

2011-12-20 Thread Fernando Perez
On Mon, 19 Dec 2011 19:51:00 -0800, Raymond Hettinger wrote: > Do you use IDLE when teaching Python? If not, what is the tool of > choice? I'm obviously biased (I started IPython years ago), but I've done a lot of teaching and I still do like the combination of IPython plus an editor. Sometime

Re: IPython 0.12 is out!

2011-12-19 Thread Fernando Perez
On Mon, 19 Dec 2011 20:00:03 -0800, alex23 wrote: > You read the installation instructions and did a 'python setup.py > install' as it states, yes? > > Installed that way for Python 2.7.2 under Win64 with no issues > whatsoever. Glad to hear that. Obviously since I announced it here I'll try to

[ANN] IPython 0.12 is out!

2011-12-19 Thread Fernando Perez
ixed on master, but since the final 0.12 files have been uploaded to github and PyPI, we'll let them be. As usual, if you find any other problem, please file a ticket --or even better, a pull request fixing it-- on our github issues site (https:// github.com/ipython/ipython/issues/). Many

[ANN] IPython 0.11 is officially out

2011-07-31 Thread Fernando Perez
ures: http://stronginference.com/weblog/2011/7/15/innovations-in-ipython.html As usual, if you find any problem, please file a ticket --or even better, a pull request fixing it-- on our github issues site (https://github.com/ipython/ipython/issues/). Many thanks to all who contributed! Fernando,

saving a TIFF

2010-02-15 Thread fernando sedano
I'm trying to save an image created from two arrays (I'm using numpy and PIL): n=(b4a-b3a)/(b4a+b3a); ndvi = Image.fromarray(n) ndvi.save("F:\Fire_scar_mapping\ILS3\ndvi_test","TIFF") ...but I get the following error message: IOError: [Errno 22] invalid mode ('wb') or filename: 'F:\\Fir

Trouble with subprocess.Popen()

2009-04-04 Thread Fernando
Hi, I'm having a very strange issue with subprocess.Popen. I'm using it to call several times an external exe and keep the output in a list. Every time you call this external exe, it will return a different string. However, if I call it several times using Popen, it will always return the SAME s

Re: logging and daemons

2009-02-16 Thread Fernando M. Maresca
On Mon, Feb 16, 2009 at 10:11:51AM -0800, Scott David Daniels wrote: > Fernando M. Maresca wrote: > On Mon, Feb 16, 2009 at 05:07:45AM -0800, Garrett Cooper wrote: >>> You can actually set sys.std[err|out] to your ?file? descriptor of >>> choice in python >&

Re: logging and daemons

2009-02-16 Thread Fernando M. Maresca
ing logging in this manner? Cheers, -- Fernando signature.asc Description: Digital signature -- http://mail.python.org/mailman/listinfo/python-list

logging and daemons

2009-02-16 Thread Fernando M. Maresca
y uncached exception info that may go to stderr/stdout to show up in the logfiles. Any ideas? Thanks a lot, -- Fernando signature.asc Description: Digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 3.0 final

2008-12-05 Thread Fernando H. Sanches
On Dec 4, 5:45 pm, Andreas Waldenburger <[EMAIL PROTECTED]> wrote: > On Thu, 4 Dec 2008 11:52:38 -0600 [EMAIL PROTECTED] wrote: > > > > >     >>> As you have probably guessed: nothing changed here. > >     >>> Also see:http://www.python.org/dev/peps/pep-0666/ > > >     >> What? Do you mean it's pos

Re: Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

2008-12-01 Thread Fernando H. Sanches
At first I also disliked print's new syntax, but later I realised it could be useful. However, I agree that the parentheses are annoying. Not because of the parens theirselves, but because of the Shift key. Why programmers stilll can't have special keyboards with parens keys that doesn't need pre

Re: from package import * without overwriting similarly named functions?

2008-10-25 Thread Fernando H. Sanches
Also, remember that since the latter functions will always overwrite the first, you can just reverse the order of the imports: from package2 import * from package1 import * This should preserve the functions of package1 over the other ones. -- http://mail.python.org/mailman/listinfo/python-list

Re: Avoiding redirects with urllib

2008-06-15 Thread Fernando Rodriguez
Hello Fernando, I hope that's of some help! I think you may want to delve deeper into FancyURLopener... The problem is that I'm using a subclass of FancyOpener and it doesn't raise those exceptions. Ok, forget it, I should have read the "fine" manual. O:-)

Re: Avoiding redirects with urllib

2008-06-15 Thread Fernando Rodriguez
Hello [EMAIL PROTECTED], import urllib url_opener = urllib.URLopener() # create URLopener #You could also work with urllib.FancyURLopener try: data = url_opener.open("http://www.somedomain.com/index.html";) # open index.html except IOError, error_code: if error_code[0] == "http error": if erro

Avoiding redirects with urllib

2008-06-14 Thread Fernando Rodriguez
Hi, I'musing urllib to download pages from a site. How can I detect if a given url is being redirected somewhere else? I want to avoid this, is it possible? Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Error when calling superclass __init__ method

2008-05-18 Thread Maese Fernando
Hi, I'm getting an odd error while trying to call the __init__ method of a super class: BaseField.__init__(self) TypeError: unbound method __init__() must be called with BaseField instance as first argument (got nothing instead) This is the code: class BaseField(object): def _addFieldsTo

Re: Strange behavior of __get__ in a descriptor in IPython

2007-11-07 Thread Fernando Perez
Jakub Hegenbart wrote: > Hi, > > I'm studying the descriptor protocol and its usage from the following > document: > > http://users.rcn.com/python/download/Descriptor.htm > > There is some sample code: > > http://users.rcn.com/python/download/Descriptor.htm#descriptor-example > > that behaves

Re: Confused about closures and scoping rules

2007-11-06 Thread Fernando Perez
Diez B. Roggisch wrote: > It's a FAQ. The reason is that the created closures don't capture the > _value_, but the _name_. Plus of course the locals()-dictionary outside > the function a to perform the lookup of that name. Which has the value > bound to it in the last iteration. > > Common cure

Confused about closures and scoping rules

2007-11-06 Thread Fernando Perez
Hi all, consider the following small example: """ Small test to try to understand a strange subtlety with closures """ def outer(nmax): aa = [] for n in range(nmax): def a(y): return (y,n) print 'Closure and cell id:',id(a.func_closure),\ id(a.

Re: Yet another comparison of Python Web Frameworks

2007-10-12 Thread Fernando Perez
Massimo Di Pierro wrote: > happy to hear that. > you may want take a loot at http://mdp.cti.depaul.edu/vqcd > It is mostly python stuff and will post the code soon. Ah, memories :) I'm not working on QCD anymore, but I did write a bunch of code a while back to script Mayavi (the old one, not the

Re: Yet another comparison of Python Web Frameworks

2007-10-12 Thread Fernando Perez
Massimo Di Pierro wrote: > P.S. Michele Simionato. I have heard your name before? Is it possible > we have met in Pisa in 1990-1996? I am also a Quantum Field Theorist > and there is not many of us. More than you think, it seems. Some of us were even using python to process Lattice QCD computati

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-10 Thread Fernando Perez
Ferenczi Viktor wrote: > Properties are very useful, since ordinary attribute access can be > transparently replaced with properties if the developer needs to add code > when it's set or needs to calculate it's value whenever it is read. > > As an additional benefit this could allow developers t

Re: Registering a python function in C

2007-09-03 Thread fernando
> Is Maya a different python build than what is contained at python.org? > If so, I suggest you get your C program to work with the latest python > build > from python.org. Then see if you can get it to work with the Maya > version. Ok, did that. If I write a normal C++ program and use the pytho

Re: Registering a python function in C

2007-08-31 Thread fernando
Thanks for the responses. To be more specific, this code is part of a Maya plugin. The funcion MFnPlugin::registerUI takes a pointer to a PyObject which is the function that will set up the UI for that plugin. The code Matimus posted seems to me exactly like what I need to do, except that maya give

Registering a python function in C

2007-08-30 Thread fernando
Could someone post an example on how to register a python function as a callback in a C function? It expects a pointer to PyObject... how do I expose that? Basically, the signature of the function is foo(PyObject* obj), where obj is the callback function... It's not exactly extending or embedding,

Re: Bug in execfile?

2007-08-02 Thread Fernando Perez
Ian Clark wrote: > Fernando Perez wrote: >> Hi all, >> >> (snip) >> >> I'm really, really puzzled by this. From reading the execfile() docs, I had >> the hunch to change the call to: >> >> execfile(fname,{}) >> >> and

Bug in execfile?

2007-08-02 Thread Fernando Perez
Hi all, I'm finding the following behavior truly puzzling, but before I post a bug report on the site, I'd rather be corrected if I'm just missing somethin obvious. Consider the following trivial script: # Simple script that imports something from the stdlib from math import sin, pi wav = lambd

Re: Plotting Images

2007-07-31 Thread Fernando Perez
Pei-Yu CHAO wrote: > Hi ALL: > > I have only been switched from matlab to python few > months ago. I having trouble of plotting images from a > matrix size of 8x1 (unfortunately that is the size > of my data.) > > for example, > x = rand(8,1) > inshow(x) > Read the docstrings, they

[ANN] IPython 0.8.0 is out

2007-04-10 Thread Fernando Perez
Hi all, The IPython team is happy to release version 0.8.0, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? 1. An interactive shell superior to Python's default. IPython has many fea

Re: ipython env

2007-04-05 Thread Fernando Perez
Larry Bates wrote: > Greg Donald wrote: >> Anyone know what's up with environment variables when using ipython? [...] > In Cpython you get this with: > > import os > os.environ['EDITOR'] Yup, same in ipython :) Just to clarify, env is just a convenience function in ipython that simply does thi

Re: Rational numbers

2007-02-28 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > On Feb 25, 3:09 pm, Fernando Perez <[EMAIL PROTECTED]> wrote: >> Alex, have you had a look at SAGE? >> >> http://modular.math.washington.edu/sage/ >> >> it uses GMP extensively, so they've had to patch it to work aroun

Re: Rational numbers

2007-02-25 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > gmpy itself is or should be pretty trivial to build on any platform > (and I'll always happily accept any fixes that make it better on any > specific platform, since it's easy to make them conditional so they'll > apply to that platform only), but the underlying GMP is

Re: pylab, integral of sinc function

2007-02-22 Thread Fernando Perez
Schüle Daniel wrote: > Hello, > > In [19]: def simple_integral(func,a,b,dx = 0.001): > : return sum(map(lambda x:dx*x, func(arange(a,b,dx > : > > In [20]: simple_integral(sin, 0, 2*pi) > Out[20]: -7.5484213527594133e-08 > > ok, can be thought as zero > > In [21]: simple

Re: Maybe a little bug of ipython 0.7.3 ?

2007-01-08 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > I'm new to ipython, and i found it a very cool product. Glad you like it, though in the future I recommend you post on the ipython list. I very rarely scan c.l.py these days, unfortunately. > $ ipython > Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-08 Thread Fernando Perez
sturlamolden wrote: > Following up on my previous post, there is a simple Python MPI wrapper > that can be used to exploit multiple processors for scientific > computing. It only works for Numeric, but an adaptaion to NumPy should > be easy (there is only one small C file in the source): > > http

Re: switching to numpy and failing, a user story

2006-10-07 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > After using numeric for almost ten years, I decided to attempt to > switch a large codebase (python and C++) to using numpy. Here's are > some comments about how that went. > > - The code to automatically switch python stuff over just kind of > works. But it was a 90% s

Re: Interact with system command prompt

2006-09-20 Thread Fernando Perez
billie wrote: > Uhm... It seems that IPython got some problems: > http://ipython.scipy.org/doc/manual/node12.html > > In details: > >>Note that this does not make IPython a full-fledged system shell. In >>particular, it has >no job control, so if you type Ctrl-Z (under Unix), >>you'll suspend py

Re: Scientific computing and data visualization.

2006-09-06 Thread Fernando Perez
Matteo wrote: > One hurdle to overcome is transferring array data from Numeric/Numpy > into VTK. I have a sort of ad-hoc method to do that (mainly for volume > data). If anyone knows of any elegant solution, or a module to ease the > pain, I'd like to hear about it. https://svn.enthought.com/enth

Re: unit testing failure makes no sense

2006-09-05 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > I have some unit testing code in one of my modules that appears to > run without an error, but the unit test fails anyhow. Have a look at > the output below -- the TestResult seems to have no errors and no > failures, yet I get a system exit. unittest.main() ALWAYS rais

Re: Matplotlib eps export

2006-07-04 Thread Fernando Perez
Martin Manns wrote: > Hi, > > When I use matplotlib for a scatter plot with both dots and connecting > lines, the exported eps file is huge, if the distances between many points > are small. I think of this as a bug, since no preview tiff is included in > the generated eps and a variety of text p

IPython 0.7.2 is out.

2006-06-06 Thread Fernando Perez
Hi all, The IPython team is happy to release version 0.7.2, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? 1. An interactive shell superior to Python's default. IPython has many fea

Re: Is the standard output thread-safe?

2006-03-09 Thread Fernando Rodríguez
Hello Fredrik, > Fernando Rodríguez wrote: > >> Is the standard output thread-safe? Can I use print from several >> threads without having to use a mutex? >> > if you use sys.stdout.write on the standard sys.stdout stream, each > write operation is "atomic&quo

Blocking a thread for x seconds

2006-03-09 Thread Fernando Rodríguez
Hi, I have a class that descends from threading.Thread. One method should block the thread during x seconds and then call another method. How can I do this? -- http://mail.python.org/mailman/listinfo/python-list

Is the standard output thread-safe?

2006-03-09 Thread Fernando Rodríguez
Hi, Is the standard output thread-safe? Can I use print from several threads without having to use a mutex? Thanks -- http://mail.python.org/mailman/listinfo/python-list

What version of python is running a script

2006-03-07 Thread Fernando Rodríguez
Hi, How can my script tell which version of python is running it? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Start a python interactive shell from python.

2006-01-26 Thread Fernando Perez
Bo Peng wrote: > > I think I find what I need: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355319 That's a nice, lightweight one. Note that if you want to have all the bells and whistles of ipython (and you have ipython already), then a simple if __name__ == '__namin__': f

[ANN] IPython 0.7.1 is out.

2006-01-23 Thread Fernando Perez
You can get path objects conveniently through %sc, and !!, e.g.: sc files=ls for p in files.paths: # or files.p print p,p.mtime - Fix '%run -d' with Python 2.4 (pdb changed in Python 2.4). - Various other small fixes and enhancement

Re: OpenGL

2006-01-23 Thread Fernando Perez
Mike C. Fletcher wrote: > OpenGL-ctypes is designed with a fairly well abstracted array-handling > API. Basically any array type can be registered with handlers that let > you tell the system how to do basic operations; get an array's size, > shape, data-type, convert to a given data-format, bui

Re: how do "real" python programmers work?

2006-01-18 Thread Fernando Perez
bblais wrote: > Hello, > > Let me start by saying that I am coming from a background using Matlab > (or Octave), and C++. I am going to outline the basic nuts-and-bolts > of how I work in these languages, and ask for some help to find out how > the same thing is done in Python. I am not sure wh

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-15 Thread Fernando Perez
R. Bernstein wrote: > Fernando Perez <[EMAIL PROTECTED]> writes: >> R. Bernstein wrote: > ... >> > However the frame information for exec or execfile looks like this: >> > File "", line 1, in ? >> >> That comes from how the code

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-14 Thread Fernando Perez
R. Bernstein wrote: > In doing the extension to the python debugger which I have here: > http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 > I came across one little thing that it would be nice to get done better. > > I notice on stack traces and tracebacks, an exec

Re: New Python.org website ?

2006-01-14 Thread Fernando Perez
Tim Chase wrote: >> http://beta.python.org > > In both Mozilla-suite (1.7) and FireFox (1.5), the links on the > left (the grey-backgrounded all-caps with the ">>" at the right) > all intrude into the body text. They're all the same length: Just as an FYI, I see the same problem under Linux, us

[ANN] IPython 0.7.0

2006-01-10 Thread Fernando Perez
s. The changelog has full details. Enjoy, and as usual please report any problems on the IPython lists. Regards, Fernando. -- http://mail.python.org/mailman/listinfo/python-list

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-09 Thread Fernando Perez
R. Bernstein wrote: > Fernando Perez <[EMAIL PROTECTED]> suggests: >> You may want to try out ipython (the current release candidate from >> http://ipython.scipy.org/dist/testing/, which has many improvements on this >> front). The %pdb magic will trigger automat

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-05 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > I hope some of the other problems with it get > addressed some day: > - There is no way (I know of) to start a python script > from the command line with the debugger active; > I always have to modify the source to insert a > pdb.set_trace(). I would like somethi

Re: PYTHONDOCS

2005-12-31 Thread Fernando Perez
J. D. Leach wrote: > OK, I'm stupid. I have been unable to discern (even Googled) a way to set > the PYTHONDOCS variable to point to where the HTML files are. What to do? I > need to know the process and where theses variables are stored. It's an environment variable. In my case: PYTHONDOCS=/us

Re: Question about the 'code' module

2005-12-29 Thread Fernando Perez
Thomas Heller wrote: > I'm using the code module to implement an interactive interpreter > console in a GUI application, the interpreter running in a separate > thread. To provide clean shutdown of the application, I have to make > sure that objects used in the interpreter thread are deleted when

Re: Zope vs Php

2005-11-17 Thread Fernando Lujan
on inheritance >>hierarchy. >> In this article you will have a great overview about Zope and Zope 3. http://www.zopemag.com/Issue010/Section_Articles/article_WhyZope3.html Fernando Lujan -- http://mail.python.org/mailman/listinfo/python-list

Re: need an example of Python numarray to C++ and back again, Boost / SWIG?

2005-11-10 Thread Fernando Perez
PL wrote: > I looked at Stefan's post - but he remarks that "Unfortunately, Blitz > jealously guards its data (restricted pointers), so that it is not so > easy to do the conversion in the other direction. If anyone knows an > answer to this problem, I'd be glad to hear it" > > I've previously l

Re: exceptions, internals (introspection?)

2005-11-10 Thread Fernando Perez
ej wrote: > I have often wondered how to get at other internals, such as the name of > the current function, file, line number I am in? The arguments to the > current function, etc. I browsed through the table of contents of both the > Library Reference & Language Reference. I see section 18

Re: Command-line tool able to take multiple commands at one time?

2005-11-10 Thread Fernando Perez
Peter A.Schott wrote: > Per subject - I realize I can copy/paste a line at a time into an interactive > session when I'm trying to debug, but was wondering if there is any tool out > there that allows me to copy sections of working Python scripts to paste into > my interactive console and let thos

Re: need an example of Python numarray to C++ and back again, Boost / SWIG?

2005-11-09 Thread Fernando Perez
PL wrote: > I want to pass a 2D array from Python to C++, manipulate it in C++ (for > example, add 1 to each element) and pass it back to Python. > > With these building blocks I will be able to figure out all the rest of > what I need to do for my project. I am very familiar with Python, but >

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-14 Thread Fernando Perez
> Kenneth McDonald a écrit : >> For unfortunate reasons, I'm considering switching back to Win XP (from >> OS X) as my "main" system. Windows has so many annoyances that I can >> only compare it to driving in the Bay Area at rush hour (OS X is like >> driving in Portland at rush hour--not as bad

Re: array subset could be improved? -repost ;)

2005-10-14 Thread Fernando Perez
Jim O'D wrote: > Hi all > > I have an array a=array([2,3,-1]). > > I want to extract an array with all the elements of a that are less than 0. Numeric is currently changing into the new scipy core. If you are willing to play with beta code, get it here: http://numeric.scipy.org if not, wait

Re: working with VERY large 'float' and 'complex' types

2005-09-14 Thread Fernando Perez
Todd Steury wrote: > Greetings Python'ers: > > I'm just an amature who occasionally uses Python for complex mathematical > models. The current model I'm working with occasionally generates really > large numbers that are either "float" or "complex" types. These numbers are > so large that I eithe

Re: Detailed traceback

2005-09-13 Thread Fernando Perez
Echo wrote: > I have been working on handling unhanded exceptions and making a > detailed print out of the traceback after the exception. I found that > traceback.extract_tb worked nice and was quite simple. > > During my searching around I found out that it might be possible to > get the variabl

Re: Creating BibTex files with XdkBibTeX

2005-09-12 Thread Fernando Perez
Rob Cowie wrote: > I'm looking for a module that is able to create valid BibTex documents. > I'm currently using string substitution to create the content, but it > is not validated in any way. > > The only BibTex creation module available in Python (that I can find) > is XdkBibTeX > (http://arti

Re: job scheduling framework?

2005-09-08 Thread Fernando Perez
Larry Bates wrote: > Google turned up these links that might be of interest: > > http://www.foretec.com/python/workshops/1998-11/demosession/hoegl/ > http://www.webwareforpython.org/Webware/TaskKit/Docs/QuickStart.html > http://www.slac.stanford.edu/BFROOT/www/Computing/Distributed/Bookkeeping/SJ

Re: Precise timings ?

2005-08-30 Thread Fernando Perez
Madhusudan Singh wrote: > Madhusudan Singh wrote: > >> Hi >> >> I am using time.clock() to get the current time of the processor in >> seconds. For my application, I need really high resolution but currently >> seem to be limited to 0.01 second. Is there a way to specify the >> resolution (say 1

Re: Traceback Questions

2005-08-19 Thread Fernando Perez
ncf wrote: > I'm just beginning with tracebacks, building off of what I see in > asyncore's compact_traceback code, in order to hopefully store all the > values from the location in which the exception occured. > > I'm actually trying to make this into a python bug report system for my > current

Re: interpreter frame

2005-08-11 Thread Fernando Perez
Peter Hansen wrote: > Leo wrote: >> Good try, but that doesn't seem to work either. Maybe I should have >> emphasized that what I really want is the line of code, as opposed to >> the entire frame. > > Ah, it wasn't clear from your first post that you were specifically > interested in a line you

Re: Syntax error after upgrading to Python 2.4

2005-08-06 Thread Fernando
> I don't see the problem yet. I certainly do not see anything that should > have been affected by the upgrade (was it from 2.3 on XP also?) Yes. > After checking for nonprinting chars, I would shuffle the param-default > lines to try to determine which is really at fault. Good luck, or wait fo

Re: Dabo in 30 seconds?

2005-08-03 Thread Fernando Perez
Paul McNett wrote: > I've done things like this in the past, in my own Visual Foxpro > framework. In that situation, I had enough control over the deployment > to also ship a small smtp client, and automatically email the error > without requiring any interaction at all. Clients were impressed whe

Re: Dabo in 30 seconds?

2005-08-02 Thread Fernando Perez
Paul McNett wrote: > Fernando Perez wrote: >> If you are interested, just get ipython and grab the files for this, it's >> all >> BSD licensed. You can also browse the SVN repo here if you want to look at >> the code: >> >> http://ipython.scipy.org/s

Re: Dabo in 30 seconds?

2005-08-02 Thread Fernando Perez
* Oops, IPython crashed. We do our best to make it stable, but... A crash report was automatically generated with the following information: - A verbatim copy of the traceback above this text. - A copy of your input history during this session. - Data on your current IPython configuration.

python SMTP server

2005-07-30 Thread Fernando M.
Hi, i made a test with smtplib module a few days ago, for sending mails, and i was wondering if there's another module for running an SMTP server, so i could make a standalone script for sending mails without using an external SMTP server. I've been searching but i'm not sure if there are modules f

Re: A Module on Time & Date

2005-07-27 Thread Fernando Perez
Robert Maas, see http://tinyurl.com/uh3t wrote: >> From: Robert Kern <[EMAIL PROTECTED]> >> As you can see in the datetime documentation, the module was introduced >> in Python 2.3. I recommend updating your Python installation. > > What do you mean "your"?? I don't have any Python installation o

Re: PEP on path module for standard library

2005-07-21 Thread Fernando Perez
Peter Hansen wrote: > Michael Hoffman wrote: >> For the PEP, do any of you have arguments for or against including path? >> Code samples that are much easier or more difficult with this class >> would also be most helpful. > > I believe the strongest argument for "path" can be made for how it > i

Re: goto

2005-07-19 Thread Fernando Perez
Steven Bethard wrote: > Fernando Perez wrote: >> Steven Bethard wrote: >> >>>Download the goto module: >>> http://www.entrian.com/goto/ >>>And you can use goto to your heart's content. And to the horror of all >>>your friends/cowork

Re: goto

2005-07-18 Thread Fernando Perez
Steven Bethard wrote: > Hayri ERDENER wrote: >> what is the equivalent of C languages' goto statement in python? > > Download the goto module: > http://www.entrian.com/goto/ > And you can use goto to your heart's content. And to the horror of all > your friends/coworkers. ;) > > STeVe Tha

Re: PyX, matplotlib, 3D & LaTeX

2005-07-08 Thread Fernando Perez
Francisco Borges wrote: > I like PyX, use it a lot and would suggest it as a beter plotting > library than the ones at Scipy (for as long as you don't need on-screen > plotting). FWIW, the plotting support in scipy is essentially unmaintained and abandoned, since the advent of matplotlib. It has

Re: question about introspection using inspect module

2005-07-07 Thread Fernando Perez
Benjamin Rutt wrote: > Fernando Perez <[EMAIL PROTECTED]> writes: > >> I certainly don't want to discourage you from learning about python >> introspection, it's one of the most fun aspects of the language. But just >> as an FYI, the pydoc system alread

Re: question about introspection using inspect module

2005-07-07 Thread Fernando Perez
Benjamin Rutt wrote: > I'm trying to learn about introspection in Python. my ultimate goal > is to be able to build a module "text database" of all modules that > are in the sys.path, by discovering all candidate modules (I've > already done that), importing all of them, and then introspecting on

Re: whos -- a function listing objects

2005-06-17 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > That is nice. I didn't know iPython can do whos. Will try it. > > iPython seems to infinitely configurable. Hope it will not suck too > much of my time into it. It is. It probably will. It did to me :) At least, I hope it will have been time well spent. Best, f

Re: whos -- a function listing objects

2005-06-17 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > I have been a long time Matlab user. I Python, I miss Matlab's whos > command. you might want to look at ipython. whos, and a bit more come for free: planck[~]> ipython -pylab Python 2.3.4 (#1, Feb 2 2005, 12:11:53) Type "copyright", "credits" or "license" for more

Re: [Python-Dev] A bug in pyconfig.h under Linux?

2005-06-14 Thread Fernando Perez
Jeff Epler wrote: > [sent to python-list and poster] > > Did you follow the direction that Python.h be included before any system > header? > > This is mentioned at least in > http://docs.python.org/ext/simpleExample.html OK, I'll try to make it work this way. It's not totally trivial, b/c

Re: Writing func_closure?

2005-06-08 Thread Fernando Perez
Greg Ewing wrote: > As far as I know, there is currently no supported way > of directly creating or modifying cell objects from Python; > it can only be done by some obscure trickery. So the docs > are telling the truth here, in a way. :-) In a twisted, convoluted way :) But thanks for the clari

  1   2   >