Re: empty clause of for loops

2016-03-19 Thread André Roberge
On Wednesday, 16 March 2016 07:23:48 UTC-3, Sven R. Kunze wrote: > Hi, > > a colleague of mine (I write this mail because I am on the list) has the > following issue: > > > for x in my_iterable: > # do > empty: > # do something else > > > What's the most Pythonic way of doing

Re: [Still off-top] Physics [was Requests author discusses MentalHealthError exception]

2016-03-04 Thread André Roberge
egative mass). The (magnitude of the) binding energy is DEFINED as the difference between the (energy equivalent) sums of the individual masses of the consistuents and that of the bound state. === Now, could we forget about Physics and go back to discussions related to Python? André Roberge > > -- > Oscar -- https://mail.python.org/mailman/listinfo/python-list

Re: variable vs. object

2015-11-29 Thread André Roberge
On Sunday, 29 November 2015 22:06:58 UTC-4, fl wrote: > Hi, > > I read several parts on line about Python that everything in Python is an > object. Yes, it is a key difference with other languages. Then, I read a page > it says variables: global and local variable at: > >

Re: python PEP suggestion

2015-11-08 Thread André Roberge
On Sunday, 8 November 2015 11:35:32 UTC-4, Dan Strohl wrote: > All, > > I wanted to run the following thought past the list as a possible PEP > enhancement suggestion to see if it feels like something that is worth > proposing. I know it is not in the PEP format at this point, I can, and >

Re: Can anybody explain the '-' in a 2-D creation code?

2015-06-25 Thread André Roberge
On Thursday, 25 June 2015 22:07:42 UTC-3, fl wrote: Hi, I read Ned's tutorial on Python. It is very interesting. On its last example, I cannot understand the '_' in: board=[[0]*8 for _ in range(8)] I know '_' is the precious answer, but it is still unclear what it is in the

Re: An object is an instance (or not)?

2015-01-27 Thread André Roberge
On Tuesday, 27 January 2015 17:43:38 UTC-4, Mario Figueiredo wrote: In article a771f6f2-9aa3-44ca-9f87-88a984c7c...@googlegroups.com, andre.robe...@gmail.com says... It is appropriate to refer to an instance as an object. It might not be appropriate to refer to an object as an

Re: An object is an instance (or not)?

2015-01-27 Thread André Roberge
On Tuesday, 27 January 2015 16:12:47 UTC-4, Mario Figueiredo wrote: This is a follow up from a previous discussion in which it is argued that the following code produces the correct error message terminology, considering that in Python an object is also an instance. class Sub:

Re: An object is an instance (or not)?

2015-01-27 Thread André Roberge
On Tuesday, 27 January 2015 17:06:50 UTC-4, Mario Figueiredo wrote: In article 80a9f882-6b13-45a7-b514-8c47b3a4c...@googlegroups.com, andre.robe...@gmail.com says... You keep writing an object is not an instance, making statements such as the terminology keeps indicating that in Python

Re: How to wow someone new to Python

2015-01-21 Thread André Roberge
On Friday, 16 January 2015 11:04:20 UTC-4, Chris Angelico wrote: Scenario: You're introducing someone to Python for the first time. S/he may have some previous programming experience, or may be new to the whole idea of giving a computer instructions. You have a couple of minutes to show off

Re: How to wow someone new to Python

2015-01-21 Thread André Roberge
On Wednesday, 21 January 2015 15:06:33 UTC-4, Chris Angelico wrote: On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong wrote: On 21-1-2015 18:59, Steve Hayes wrote: 3. When I started to look at it, I found that strings could be any length and were not limited to swomething arbitrary,

Re: How to run a python script with functions

2015-01-20 Thread André Roberge
On Tuesday, 20 January 2015 17:11:58 UTC-4, faiz@gmail.com wrote: Hi I have a file with a python scripts that has many functions in it. To run the script I did the following: 1. $ python (to initiate python, using the python command) 2. import file_name (without .py) 3.

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-13 Thread André Roberge
a datetime object automatically. André On Saturday, January 10, 2015 at 1:02:30 AM UTC, André Roberge wrote: On Friday, 9 January 2015 19:09:15 UTC-4, stephen...@gmail.com wrote: On Wednesday, December 31, 2014 at 4:24:50 PM UTC-6, André Roberge wrote: EasyGUI_Qt version 0.9 has been

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-09 Thread André Roberge
On Friday, 9 January 2015 19:09:15 UTC-4, stephen...@gmail.com wrote: On Wednesday, December 31, 2014 at 4:24:50 PM UTC-6, André Roberge wrote: EasyGUI_Qt version 0.9 has been released. This is the first announcement about EasyGUI_Qt on this list. Like the original EasyGUI (which used

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-09 Thread André Roberge
On Friday, 9 January 2015 19:09:15 UTC-4, stephen...@gmail.com wrote: Very nice, thanks. One issue is the format returned for the calendar selection. For today, the string returned is Fri Jan 9 2015. My script needs to convert the date to a datetime.date, and having the month returned as

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-03 Thread André Roberge
On Saturday, 3 January 2015 04:52:21 UTC-4, wxjm...@gmail.com wrote: Le vendredi 2 janvier 2015 20:11:25 UTC+1, André Roberge a écrit : On Friday, 2 January 2015 06:29:37 UTC-4, wxjm...@gmail.com wrote: Le mercredi 31 décembre 2014 23:24:50 UTC+1, André Roberge a écrit : EasyGUI_Qt

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-02 Thread André Roberge
On Friday, 2 January 2015 15:22:22 UTC-4, Emil Oppeln-Bronikowski wrote: On Fri, Jan 02, 2015 at 11:11:05AM -0800, André Roberge wrote: Sorry if this was asked before: have you tried building a portable version using py2exe/Nuitka/etc? I always hit a wall when it comes to building against

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-02 Thread André Roberge
On Friday, 2 January 2015 06:29:37 UTC-4, wxjm...@gmail.com wrote: Le mercredi 31 décembre 2014 23:24:50 UTC+1, André Roberge a écrit : EasyGUI_Qt version 0.9 has been released. This is the first announcement about EasyGUI_Qt on this list. snip I toyed and I spent a couple of hours

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-02 Thread André Roberge
On Friday, 2 January 2015 16:22:21 UTC-4, Emil Oppeln-Bronikowski wrote: On Fri, Jan 02, 2015 at 11:53:26AM -0800, André Roberge wrote: How could it then be used? Maybe I failed to explain myself fully. What I meant to say is building a distribution-ready program that utilizes your

[ANN] EasyGUI_Qt version 0.9

2014-12-31 Thread André Roberge
unicode problems ...) using Python 2.7. More information can be found at http://easygui-qt.readthedocs.org/en/latest/index.html Feedback is most welcome, including reporting bugs to https://github.com/aroberge/easygui_qt/issues Happy 2015 everyone, André Roberge -- https://mail.python.org/mailman

Re: problems with Methods in Python 3.4.2

2014-12-18 Thread André Roberge
On Thursday, 18 December 2014 13:28:33 UTC-4, Marcus Lütolf wrote: Hello Dears, 1)I am trying to do this: dir(_builtins_) You need two underscore characters on each sides: dir(__builtins__) I am getting this: Traceback (most recent call last): File pyshell#0, line 1, in module

Puzzled by FiPy's use of ==

2012-03-26 Thread André Roberge
In FiPy (a finite volume PDE solver), equations are magically set up as eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) and solved via eqX.solve(...) How can eqX be anything than True or False?... This must be via a redefinition of == but I can't see how that is done. I did look at

Re: Puzzled by FiPy's use of ==

2012-03-26 Thread André Roberge
On Monday, 26 March 2012 09:16:07 UTC-3, Robert Kern wrote: On 3/26/12 12:47 PM, André Roberge wrote: In FiPy (a finite volume PDE solver), equations are magically set up as eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) and solved via eqX.solve(...) How can eqX

Re: IDLE won't wrap lines of text

2011-02-20 Thread André Roberge
On Sunday, February 20, 2011 10:51:38 PM UTC-4, Dick Moores wrote: On Sun, Feb 20, 2011 at 18:32, Rhodri James rho...@wildebst.demon.co.uk wrote: On Mon, 21 Feb 2011 01:41:12 -, Richard D. Moores rdmo...@gmail.com wrote: On Sun, Feb 20, 2011 at 16:31, Rhodri James

Re: floating point woes

2011-02-15 Thread André Roberge
On Tuesday, February 15, 2011 7:49:34 PM UTC-4, Hans-Peter Jansen wrote: Hi, while I usually cope with the woes of floating point issues, this is one, that I didn't expect: round(2.385, 2) 2.3799 Doesn't the docs say, it's rounded up for this case? The problem is

Re: Arrays/List, filters, Pytho, Ruby

2011-02-11 Thread André Roberge
On Friday, February 11, 2011 5:24:15 PM UTC-4, LL.Snark wrote: Hi, I'm looking for a pythonic way to translate this short Ruby code : t=[6,7,8,6,7,9,8,4,3,6,7] i=t.index {|x| xt.first} If you don't know Ruby, the second line means : What is the index, in array t, of the first element x

Re: Print docstrings to shell

2011-02-01 Thread André Roberge
On Tuesday, February 1, 2011 8:11:51 PM UTC-4, Gnarlodious wrote: Can I run a script in bash and print out its docstrings to the bash shell? I tried this at the end: print(help(__file__)) Runnig the script: python ~/Sites/Sectrum/Harmonics.py but all it spit out was: no Python

Re: Print docstrings to shell

2011-02-01 Thread André Roberge
On Tuesday, February 1, 2011 9:05:28 PM UTC-4, Gnarlodious wrote: On Feb 1, 5:30 pm, André Roberge andre@gmail.com wrote: test.py== import pydoc '''this is a test''' class A(object):         '''docstring'''         pass print(pydoc.help(__file__[:-3

Re: Print docstrings to shell

2011-02-01 Thread André Roberge
On Tuesday, February 1, 2011 9:21:48 PM UTC-4, André Roberge wrote: SNIP === import pydoc import os import sys '''this is a test''' class A(object): '''docstring''' pass _path, _file_name = os.path.split(__file__) _module_name = _file_name[:-3] sys.path.append

Re: Wheel-reinvention with Python

2005-07-31 Thread André Roberge
Paul McNett wrote: [snip] Terry Hancock [EMAIL PROTECTED] writes: I know I'm diving into this conversation late, and I haven't read the whole thread, but has someone yet mentioned the anygui project? This has stalled, but it was IMHO a good idea. Well, it appears to be more than stalled! From

Re: print ending with comma

2005-07-19 Thread André Roberge
[EMAIL PROTECTED] wrote: [snip] A \n character is written at the end, unless the print statement ends with a comma. What it doesn't say is that if the print statement does end with a comma, a trailing space is printed. -- But this isn't exactly correct either. If you run this program:

BUG-FIX: RUR-PLE 0.9.0.1

2005-06-01 Thread André Roberge
RUR is a Python Learning Environment, based after Pattis's Karel the robot. More details can be found at http://rur-ple.sourceforge.net Version 0.9.0.1 is a bug-fix. Version 0.9 relied on the presence of a unicode version of wxPython (version 2.6 preferred). Version 0.9.0.1 should work with

Re: ANN: new release of RUR-PLE available

2005-05-20 Thread André Roberge
Michael Hoffman wrote: André Roberge wrote: Version 0.8.6a is now available. You might see a bit more interest if you briefly explain what RUR-PLE is, and where to find it. Oops.. sorry about that. RUR - a Python Learning Environment. Its purpose is to provide an environment where

Re: Advice needed on __del__

2005-05-10 Thread André Roberge
stasz wrote: On Mon, 09 May 2005 22:49:06 -0300, André Roberge wrote: Scott David Daniels wrote: André Roberge wrote: ... Each time I refresh the screen, I could force that call, then check to see if Evil has been destroyed by Python, which would give me the information I need to destroy

Re: Advice needed on __del__

2005-05-10 Thread André Roberge
Fredrik Lundh wrote: André Roberge wrote: If I need to have the user call Evil.destroy() as Evil is getting out of scope, it would miss the whole point of teaching about the natural way scope and namespace work. well, if you insist on using finalizers to keep track of what's in the current

Advice needed on __del__

2005-05-09 Thread André Roberge
Suppose I have two classes: 'Jekyll' and 'Hyde' that are related in a particular way. When I create a Jekyll object, a Hyde one gets automatically created (and displayed on a screen). drum roll to announce Python script === Nice = Jekyll()# Nice_twin, a Hyde object, gets created.

Re: Advice needed on __del__

2005-05-09 Thread André Roberge
Fredrik Lundh wrote: André Roberge wrote: This morning I had the following thought: I can, when I create a Jekyll object, update an outside_list. If, somehow, I could update that list when a Jekyll object disappears (perhaps by using __del__, which I have never touched) Python makes

Re: Advice needed on __del__

2005-05-09 Thread André Roberge
Scott David Daniels wrote: André Roberge wrote: ... Each time I refresh the screen, I could force that call, then check to see if Evil has been destroyed by Python, which would give me the information I need to destroy Evil_twin behind the scene myself - which is what I am really after

[ANN] new version of rur-ple (0.8.5)

2005-05-09 Thread André Roberge
Version 0.8.5 of rur-ple has been released. The web site has completely changed; it includes over 35 pages. http://rur-ple.sourceforge.net/ -- Learning to program computer should be fun, for adults and children alike. RUR-PLE is an environment designed to help

Re: Python features

2005-05-08 Thread André Roberge
[EMAIL PROTECTED] wrote: To which degree python language support features of following langauage categories? Imperative, Object Oriented, Scriptig or Functional. Sounds like a homework assignment to me How about your do some research on your own, like the following: google for

Question about Pycon 2005 (Python Visual Sandbox)

2005-05-08 Thread André Roberge
Hi all, I was wondering if the session: Intuition and Python Programming - the Python Visual Sandbox did occur, of if it was canceled. To this day, there is still no sign of a corresponding paper on http://www.python.org/pycon/2005/papers/ nor did I see any report about it. Just curious,

ANN: RUR-PLE version 0.8

2005-05-06 Thread André Roberge
/showfiles.php?group_id=125834 RUR-PLE has been inspired from GvR (Guido van Robot), also available on sourceforge. RUR-PLE can be though of as GvR++. The relatively large size of the download is due to the many graphical elements included with the lessons. André Roberge -- http

Re: New Python regex Doc

2005-05-05 Thread André Roberge
alex23 wrote: Xah Lee wrote: 99% of programers really don't need to give a flying fuck about the history of a language. Ironically, I'm pretty confident that the same percentage of readers on this group feel _exactly the same way_ about your 'improvements'. -alex23 I take it that

Better way to do parsing?

2005-05-04 Thread André Roberge
Hi all, I posted the following on the python tutor list 3 days ago ... and haven't heard a peep from anyone - which is highly unusual on that list. [Apologies for the slightly longer post due to code with tests cases included at the end .] I have created a severely

python and Tile Studio

2005-04-23 Thread André Roberge
Has anyone used Python with Tile Studio to create games? http://tilestudio.sourceforge.net/ André -- http://mail.python.org/mailman/listinfo/python-list

Using Ming on Windows

2005-04-23 Thread André Roberge
I tried to install Ming (http://sourceforge.net/projects/ming/) on Windows to use with Python *but* I can't [/don't know how to] use make to install it. Does anyone know where I could find a ready-made compiled version for Windows to just put in my site-packages directory. Any help would be

Re: Using Ming on Windows

2005-04-23 Thread André Roberge
Colin J. Williams wrote: Jack Diederich wrote: On Sat, Apr 23, 2005 at 05:13:29PM -0300, Andr? Roberge wrote: I tried to install Ming (http://sourceforge.net/projects/ming/) on Windows to use with Python *but* I can't [/don't know how to] use make to install it. I installed MinGW on a Windows XP

Troll? was: Re: goto statement

2005-04-20 Thread André Roberge
Maxim Kasimov wrote: by the way, goto statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or some other similar language. Writing in

Re: Using something other than ';' to separate statements

2005-03-30 Thread André Roberge
Jaime Wyant wrote: [snip] After goofing around with this idea, I've realized you can't be very expressive with a bunch of python statements strung together. My biggest problem is that I can't figure out (i don't think you can), how to do conditionals that are strung together: # This won't work if

Re: How to pass parameter when importing a module?

2005-03-20 Thread André Roberge
Bo Peng wrote: Dear list, What I would like to do is something like: In myModule.py ( a wrapper module for different versions of the module), if lib == 'standard': from myModule_std import * elsif lib == 'optimized' from myModule_op import * but I do not know how to pass variable lib

Re: How to turn a variable name into a string?

2005-03-11 Thread André Roberge
[EMAIL PROTECTED] wrote: lots of good answers there, and quickly, too! I can see that I need to explain a bit further what I'm up to. I have a number of variables (environmental variables, actually), most of which will have a value. But some may not have been found by os.environ.get(), so I set

Simple (newbie) regular expression question

2005-01-21 Thread André Roberge
Sorry for the simple question, but I find regular expressions rather intimidating. And I've never needed them before ... How would I go about to 'define' a regular expression that would identify strings like __alphanumerical__ as in __init__ (Just to spell things out, as I have seen underscores

Re: Simple (newbie) regular expression question

2005-01-21 Thread André Roberge
John Machin wrote: André Roberge wrote: Sorry for the simple question, but I find regular expressions rather intimidating. And I've never needed them before ... How would I go about to 'define' a regular expression that would identify strings like __alphanumerical__ as in __init__ (Just to spell