On Sunday, May 11, 2014 11:51:59 AM UTC+5:30, Marko Rauhamaa wrote:
> Rustom Mody :
>
>
>
> > On Saturday, May 10, 2014 2:39:31 PM UTC+5:30, Steven D'Aprano wrote:
>
> >>
>
> >> Personally, I don't imagine that there ever could be a language where
> >> variables were first class values *exact
On Sat, 10 May 2014 22:42:13 -0700, Ethan Furman wrote:
> On 05/10/2014 10:22 PM, Chris Angelico wrote:
>> It's that declaration that creates the variable, not changing locals().
>
> A Python variable is a name bound to a value (and values, of course, are
> objects). If you don't have both piece
On 5/10/14 6:35 PM, Chris Angelico wrote:
Instead, what we have is a world in which Python can be used to write
closed-source software, LibreOffice Writer will happily open a
Microsoft Word document, Samba communicates with Windows computers,
libc can be linked to non-free binaries, etc, etc, et
Rustom Mody :
> On Saturday, May 10, 2014 2:39:31 PM UTC+5:30, Steven D'Aprano wrote:
>>
>> Personally, I don't imagine that there ever could be a language where
>> variables were first class values *exactly* the same as ints,
>> strings, floats etc.
>
> [...]
>
> What you mean by *exactly* the s
On Sunday, May 11, 2014 12:57:34 AM UTC+5:30, subhaba...@gmail.com wrote:
> Dear Room,
>
>
>
> I was trying to go through a code given in
> http://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm[ Forward
> Backward is an algorithm of Machine Learning-I am not talking on that
>
> I am
On 5/10/14 8:42 AM, Roy Smith wrote:
Ars Technica article a couple of days ago, about Fortran, and what is
likely to replace it:
http://tinyurl.com/mr54p96
uhm, yeeah!
'Julia' is going to give everyone a not so small run for competition;
justifiably so, not just against FORTRAN.
Julia is
[ I think you meant for this to go to python-list, not python-dev.
Sending this to python-list. ]
On Sun, May 11, 2014 at 3:27 PM, Ethan Furman wrote:
> Seriously though, error messages are chosen to provide a simple and clear
> description that will help the user track down what went wrong, not
On 05/10/2014 10:22 PM, Chris Angelico wrote:
It's that declaration that creates the variable, not
changing locals().
A Python variable is a name bound to a value (and values, of course, are objects). If you don't have both pieces, you
don't have a Python variable.
--
~Ethan~
--
https://mai
[accidentally went off-list; sorry]
On 05/10/2014 02:03 PM, Devin Jeanpierre wrote:
spam is referring to a local variable that has not been bound. This is
not an implementation detail.
The implementation detail is that in cpython there is a spot already reserved for what will be the 'spam' va
On 5/10/14 11:16 PM, Nelson Crosby wrote:
I also believe in this more 'BSD-like' view, but from a business
point of view. No one is going to invest in a business that can't
guarantee against piracy, and such a business is much less likely
to receive profit (see Ardour).
Don't get me wrong - I lo
On Saturday, May 10, 2014 2:39:31 PM UTC+5:30, Steven D'Aprano wrote:
>
> Personally, I don't imagine that there ever could be a language where
> variables were first class values *exactly* the same as ints, strings,
> floats etc. Otherwise, how could you tell the difference between a
> functio
On Sun, May 11, 2014 at 3:11 PM, Steven D'Aprano
wrote:
> Nonsense. Look at the original examples again, more closely. Here they
> are again, this time with comments:
>
> def test():
> if False: spam = None # Dead code, never executed.
> d = locals()
> d['spam'] = 23 # Not a normal a
On Sun, 11 May 2014 13:30:03 +1000, Chris Angelico wrote:
> On Sun, May 11, 2014 at 1:17 PM, Steven D'Aprano
> wrote:
>> But that is an implementation detail. IronPython and Jython use an
>> ordinary dict for local variable namespaces, just like globals.
>> Consider this example from Jython:
>>
>
On Sunday, May 11, 2014 9:46:06 AM UTC+5:30, Nelson Crosby wrote:
> I also believe in this more 'BSD-like' view, but from a business point of
> view. No one is going to invest in a business that can't guarantee against
> piracy, and such a business is much less likely to receive profit (see
> Ar
I also believe in this more 'BSD-like' view, but from a business point of view.
No one is going to invest in a business that can't guarantee against piracy,
and such a business is much less likely to receive profit (see Ardour).
Don't get me wrong - I love free software. It's seriously awesome t
On Sun, May 11, 2014 at 1:17 PM, Steven D'Aprano
wrote:
> But that is an implementation detail. IronPython and Jython use an
> ordinary dict for local variable namespaces, just like globals. Consider
> this example from Jython:
>
spam =
def modify(namespace):
> ... namespace['sp
On Sat, 10 May 2014 14:03:11 -0700, Devin Jeanpierre wrote:
> On Sat, May 10, 2014 at 12:10 PM, Ethan Furman
> wrote:
>> On 05/10/2014 02:32 AM, Chris Angelico wrote:
>>>
>>>
>>> Tell me, what may this function do in a compliant Python?
>>>
>>> def demo():
>>> ret = spam
>>> spam = 23
>
On Sun, 11 May 2014 09:18:34 +1000, Chris Angelico wrote:
> On Sun, May 11, 2014 at 5:10 AM, Ethan Furman
> wrote:
>> And if you don't like that argument (although it is a perfectly sound
>> and correct argument), think of the module name space:
>>
>>
>> ret = spam
>> spam = 23
>>
>> will net you
On 05/10/2014 07:23 PM, Chris Angelico wrote:
There is a broad
convention that spaces in file names get protected with quotes, though
(for instance, tab completion will put quotes around them), so it's
not complete chaos.
"Complete chaos" is a pretty good description, especially since MS
dec
On Sun, May 11, 2014 at 11:28 AM, Ethan Furman wrote:
> Well, with function variables they have to exist *when you use them*. ;)
>
> This seems like more of a scoping issue than a "can we create variables in
> Python" issue.
>
> I am curious, though, what other python's do with respect to function
On 05/10/2014 04:18 PM, Chris Angelico wrote:
On Sun, May 11, 2014 at 5:10 AM, Ethan Furman wrote:
And if you don't like that argument (although it is a perfectly sound and
correct argument), think of the module name space:
ret = spam
spam = 23
will net you a simple NameError, because spam h
On Sun, May 11, 2014 at 6:14 AM, Mark H Harris wrote:
> Proprietary code and systems will not survive the 21st century, you can be
> sure of that. 'We' can never allow another Microsoft to rule again; not
> google, nor canonical, nor oracle, nor anyone else. 'We' must have net
> neutrality, and so
On Sun, May 11, 2014 at 5:10 AM, Ethan Furman wrote:
> And if you don't like that argument (although it is a perfectly sound and
> correct argument), think of the module name space:
>
>
> ret = spam
> spam = 23
>
> will net you a simple NameError, because spam has not yet been created.
What about
On Sun, May 11, 2014 at 4:39 AM, Terry Reedy wrote:
>> Since you have a space in the name, you'll need quotes:
>>
>>
>> cd "c:\Beautiful Soup"
>
>
> Not for Win 7, at least
>
> C:\Users\Terry>cd \program files
>
> C:\Program Files>
Huh, good to know.
Unfortunately, Windows leaves command-line pa
On Saturday, 10 May 2014 22:10:14 UTC+10, Peter Otten wrote:
> flebber wrote:
>
>
>
> > I am using xmltodict.
>
> >
>
> > This is how I have accessed and loaded my file.
>
> >
>
> > import xmltodict
>
> > document = open("/home/sayth/Scripts/va_benefits/20140508GOSF0.xml", "r")
>
> > re
On Sat, May 10, 2014 at 12:10 PM, Ethan Furman wrote:
> On 05/10/2014 02:32 AM, Chris Angelico wrote:
>>
>>
>> Tell me, what may this function do in a compliant Python?
>>
>> def demo():
>> ret = spam
>> spam = 23
>> return ret
>>
>> In CPython, that'll raise UnboundLocalError, beca
On 2014-05-10 20:27, subhabangal...@gmail.com wrote:
Dear Room,
I was trying to go through a code given in
http://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm[ Forward
Backward is an algorithm of Machine Learning-I am not talking on that
I am just trying to figure out a query on it
On 5/10/2014 3:22 PM, MRAB wrote:
UnboundLocalError is like NameError,
More specifically,
>>> isinstance(UnboundLocalError(), NameError)
True
This means that 'except NameError:' clauses written before the
UnboundLocalError subclass was added still work and do not necessarily
need to be modi
On 5/10/14 12:07 PM, esaw...@gmail.com wrote:
4. In the long run, would it be better to use UNIX instead of Windows, if
I were to use Python for all of my research?
I concur with Chris and Stefan. The *nix model is faster, cleaner, and
more secure. I prefer gnu/linux, but mac os/x is al
On 5/10/2014 3:10 PM, Ethan Furman wrote:
On 05/10/2014 02:32 AM, Chris Angelico wrote:
Tell me, what may this function do in a compliant Python?
def demo():
ret = spam
spam = 23
return ret
In CPython, that'll raise UnboundLocalError,
Note:
>>> issubclass(UnboundLocalError, N
On Saturday, May 10, 2014 1:07:33 PM UTC-4, esa...@gmail.com wrote:
> Hi All--
>
>
>
> Let me state at the start that I am new to Python. I am moving away from
> Fortran and Matlab to Python and I use all different types of numerical and
> statistical recipes in my work. I have been reading ab
On Saturday, May 10, 2014 1:07:33 PM UTC-4, esa...@gmail.com wrote:
> Hi All--
>
>
>
> Let me state at the start that I am new to Python. I am moving away from
> Fortran and Matlab to Python and I use all different types of numerical and
> statistical recipes in my work. I have been reading ab
On 05/10/2014 12:22 PM, MRAB wrote:
UnboundLocalError is like NameError, except that Python knows that the
name is local because somewhere in the function you're binding to that
name and you haven't said that it's global or nonlocal. Having a
different exception for that case makes it clearer to
On 05/10/2014 02:05 AM, Rustom Mody wrote:
On Saturday, May 10, 2014 1:18:27 PM UTC+5:30, Steven D'Aprano wrote:
Python assignment doesn't copy values.
Maybe our values differ?
Obviously they do. Yours are irrelevant for Python. They could be, and probably are, useful when comparing and
Dear Room,
I was trying to go through a code given in
http://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm[ Forward
Backward is an algorithm of Machine Learning-I am not talking on that
I am just trying to figure out a query on its Python coding.]
I came across the following codes.
On 2014-05-10 20:10, Ethan Furman wrote:
On 05/10/2014 02:32 AM, Chris Angelico wrote:
Tell me, what may this function do in a compliant Python?
def demo():
ret = spam
spam = 23
return ret
In CPython, that'll raise UnboundLocalError, because the local
variable 'spam' does alrea
On 05/10/2014 02:32 AM, Chris Angelico wrote:
Tell me, what may this function do in a compliant Python?
def demo():
ret = spam
spam = 23
return ret
In CPython, that'll raise UnboundLocalError, because the local
variable 'spam' does already exist, and currently has no value (no
o
On 5/10/2014 1:03 PM, Chris Angelico wrote:
On Sun, May 11, 2014 at 2:58 AM, Simon Evans wrote:
"Open up the command line prompt and navigate to the folder where you have
unzipped the folder as follows:
cd Beautiful Soup
python setup python install "
This would be the operating system comman
On 5/10/2014 9:42 AM, Roy Smith wrote:
In article ,
Dennis Lee Bieber wrote:
Obsolete and Legacy? Fortran still receives regular standards updates
(currently 2008, with the next revision due in 2015).
Ars Technica article a couple of days ago, about Fortran, and what is
likely to
esaw...@gmail.com, 10.05.2014 19:07:
> Let me state at the start that I am new to Python. I am moving away from
> Fortran and Matlab to Python and I use all different types of numerical and
> statistical recipes in my work. I have been reading about NumPy and SciPy and
> could not find any defin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 10.5.2014 19:07, esaw...@gmail.com wrote:
> Hi All--
>
> Let me state at the start that I am new to Python. I am moving away
> from Fortran and Matlab to Python and I use all different types of
> numerical and statistical recipes in my work. I have
On Sun, May 11, 2014 at 3:07 AM, wrote:
> 4. In the long run, would it be better to use UNIX instead of Windows,
> if I were to use Python for all of my research?
Yes. Absolutely yes. But that's because it's better to run Unix than
Windows regardless of all other considerations. :)
As a g
Hi All--
Let me state at the start that I am new to Python. I am moving away from
Fortran and Matlab to Python and I use all different types of numerical and
statistical recipes in my work. I have been reading about NumPy and SciPy and
could not find any definitive answers to my questions, belo
On Sun, May 11, 2014 at 2:58 AM, Simon Evans wrote:
> "Open up the command line prompt and navigate to the folder where you have
> unzipped the folder as follows:
> cd Beautiful Soup
> python setup python install "
This would be the operating system command line, not Python's
interactive mode. S
I am new to Python, but my main interest is to use it to Webscrape. I have
downloaded Beautiful Soup, and have followed the instruction in the 'Getting
Started with Beautiful Soup' book, but my Python installations keep returning
errors, so I can't get started. I have unzipped Beautiful Soup to
In article <874n0xvd85@dpt-info.u-strasbg.fr>,
Alain Ketterlin wrote:
>alb...@spenarnc.xs4all.nl (Albert van der Horst) writes:
>
>[...]
>> Now on some matrices the assert triggers, meaning that nom is zero.
>> How can that ever happen? mon start out as 1. and gets multiplied
>
>[several time
alb...@spenarnc.xs4all.nl (Albert van der Horst) writes:
[...]
> Now on some matrices the assert triggers, meaning that nom is zero.
> How can that ever happen? mon start out as 1. and gets multiplied
[several times]
> with a number that is asserted to be not zero.
Finite precision. Try: 1.*1e-
On 05/10/2014 08:24 AM, Albert van der Horst wrote:
I have the following code for calculating the determinant of
a matrix. It works inasfar that it gives the same result as an
octave program on a same matrix.
/
def determinant( ma
What happens if you run the same matrix through Octave? By any chance, is nom
just really, really small?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Albert van der Horst wrote:
> I have the following code for calculating the determinant of
> a matrix. It works inasfar that it gives the same result as an
> octave program on a same matrix.
>
> /
>
> def determinant( mat ):
>
I have the following code for calculating the determinant of
a matrix. It works inasfar that it gives the same result as an
octave program on a same matrix.
/
def determinant( mat ):
''' Return the determinant of the n by n matr
On Sat, May 10, 2014 at 7:39 AM, Preethi wrote:
> future==0.9.0
It looks like that library is out of date. The current version looks
to be 0.12.0, and it also looks like this bug was fixed in the 0.12.0
release. I'd upgrade your version if at all possible.
--
Jerry
--
https://mail.python.org
In article ,
Dennis Lee Bieber wrote:
> On 08 May 2014 16:04:51 GMT, Steven D'Aprano
> declaimed the following:
>
> >Personally, I think that trying to be general and talk about "many other
> >languages" is a failing strategy. Better to be concrete: C, Pascal,
> >Algol, Fortran, VB (I think)
flebber wrote:
> I am using xmltodict.
>
> This is how I have accessed and loaded my file.
>
> import xmltodict
> document = open("/home/sayth/Scripts/va_benefits/20140508GOSF0.xml", "r")
> read_doc = document.read()
> xml_doc = xmltodict.parse(read_doc)
>
> The start of the file I am trying to
On Sat, 10 May 2014 04:39:05 -0700, Preethi wrote:
> Hi,
>
> I am new to python. I am getting an error "AttributeError: type object
> 'Decimal' has no attribute 'from_float'" when I run the following in
> python prompt:
>
from future.builtins import int, round
I get an error when I try th
Hi,
I am new to python. I am getting an error "AttributeError: type object
'Decimal' has no attribute 'from_float'" when I run the following in python
prompt:
>>> from future.builtins import int, round
>>> int(round(5))
Traceback (most recent call last):
File "", line 1, in
File
"/usr/lib
I am using xmltodict.
This is how I have accessed and loaded my file.
import xmltodict
document = open("/home/sayth/Scripts/va_benefits/20140508GOSF0.xml", "r")
read_doc = document.read()
xml_doc = xmltodict.parse(read_doc)
The start of the file I am trying to get data out of is.
http://"; /
On Sat, 10 May 2014 11:18:59 +0300, Marko Rauhamaa wrote:
> In Python,
>
>x is a variable, a memory slot that can be assigned to,
If your intention was to prove Ben Finney right, then you've done a
masterful job of it. Python variables ARE NOT MEMORY SLOTS.
(Not even local variables
On Sat, May 10, 2014 at 7:09 PM, Steven D'Aprano
wrote:
> On Sat, 10 May 2014 17:21:56 +1000, Chris Angelico wrote:
>
> No offence Chris, but I think this demonstrates that learning C causes
> brain damage and prevents clear logical thinking :-P
>
> You're not passing a variable to a function. You
On Saturday, May 10, 2014 1:18:27 PM UTC+5:30, Steven D'Aprano wrote:
> Python assignment doesn't copy values.
Maybe our values differ ?
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 10 May 2014 17:21:56 +1000, Chris Angelico wrote:
> On Sat, May 10, 2014 at 4:15 PM, Steven D'Aprano
> wrote:
>> On Sat, 10 May 2014 12:33:28 +1000, Chris Angelico wrote:
>>> 1) Passing them as parameters. You can pass a pointer to a variable,
>>> which is effectively the same as passing
On 10/05/2014 08:11, wxjmfa...@gmail.com wrote:
Anyway, as Python may fail as soon as one uses an
EM DASH or an EM DASH, I think it's not worth the
effort to spend to much time with it.
Nope -- seems all right to me. (Hopefully helping the OP out as well as
rebutting a rather foolish assertion
Chris Angelico :
> On Sat, May 10, 2014 at 5:48 PM, Steven D'Aprano
> wrote:
>>> https://en.wikipedia.org/wiki/Assignment_(computer_science)
>>>
>>> Go ahead, start an edit war at that page over its use of "variable". :)
>>> Right there it talks about copying values into variables. So if Python
>
eckhle...@gmail.com wrote:
> On Saturday, May 10, 2014 10:30:06 AM UTC+8, MRAB wrote:
>> On 2014-05-10 02:22, I wrote:
>>
>> > I'm migrating from Perl to Python and unable to identify the equivalent
>> > of key of key concept. The following codes run well,
>>
>> > import csv
>>
>> > attr = {}
>
Chris Angelico :
> On Sat, May 10, 2014 at 3:58 PM, Gregory Ewing
> wrote:
>> Steven D'Aprano wrote:
>>>
>>> some_function(x, y+1)[key].attribute[num](arg)[spam or eggs] = 42
>>>
>>> I'm pretty sure that it isn't common to call the LHS of that assignment a
>>> variable.
>
> [...]
> https://en.wik
Marko Rauhamaa writes:
> To me, a variable is a variable is a variable.
That works only in Python.
Elsewhere, the sentence would be interpreted either as "a variable is
True" or as "a variable is False" depending on whether a distinction
without a difference is deemed helpful.
--
https://mail.p
On Sat, May 10, 2014 at 5:48 PM, Steven D'Aprano
wrote:
>> https://en.wikipedia.org/wiki/Assignment_(computer_science)
>>
>> Go ahead, start an edit war at that page over its use of "variable". :)
>> Right there it talks about copying values into variables. So if Python
>> has no variables, then e
hello guys.
i tryng to create a form builder application with a database backend.
like wufoo.com
im stuck,how do i use jquery to create dynamic forms,and how is the database
designed for the actual forms and the data gathered using those forms i'd like
to use rdbms preferebly postgres.
regards
Chris Angelico :
> On Sat, May 10, 2014 at 8:34 AM, Marko Rauhamaa wrote:
>> Right, Python's variables aren't like variables in C. Rather,
>> Python's variables are like CPU registers. They cannot hold typed or
>> structured objects and you can't pass references to them.
>
> Are you thinking that
On 05/09/2014 06:11 PM, Steven D'Aprano wrote:
On Fri, 09 May 2014 17:34:17 -0500, Mark H Harris wrote:
On 5/7/14 8:27 PM, Steven D'Aprano wrote:
Why are new Python coders 'always' confused by this question of
variable (name value) vs. {name: object} model of Python?
"Always"? I don'
On Sat, 10 May 2014 17:10:29 +1000, Chris Angelico wrote:
> On Sat, May 10, 2014 at 3:58 PM, Gregory Ewing
> wrote:
>> Steven D'Aprano wrote:
>>>
>>> some_function(x, y+1)[key].attribute[num](arg)[spam or eggs] = 42
>>>
>>> I'm pretty sure that it isn't common to call the LHS of that
>>> assignme
On Sat, May 10, 2014 at 4:15 PM, Steven D'Aprano
wrote:
> On Sat, 10 May 2014 12:33:28 +1000, Chris Angelico wrote:
>> 1) Passing them as parameters. You can pass a pointer to a variable,
>> which is effectively the same as passing a variable to a function.
>
> No it is not. It is nothing like pas
Le samedi 10 mai 2014 06:22:00 UTC+2, Rustom Mody a écrit :
> On Saturday, May 10, 2014 1:21:04 AM UTC+5:30, scott...@gmail.com wrote:
>
> > Hi,
>
> >
>
> >
>
> >
>
> > here is a snippet of code that opens a file (fn contains the path\name)
> > and first tried to replace all endash, emdas
On Sat, May 10, 2014 at 3:58 PM, Gregory Ewing
wrote:
> Steven D'Aprano wrote:
>>
>> some_function(x, y+1)[key].attribute[num](arg)[spam or eggs] = 42
>>
>> I'm pretty sure that it isn't common to call the LHS of that assignment a
>> variable.
>
>
> A better way of putting it might be "something i
On 2014-05-10 03:28:29 +, eckhle...@gmail.com said:
While it is fine for a small dataset, I need a more generic way to do so.
I don't get how the dataset size affects the generality of the solution here.
From your first message:
attr = {}
with open('test.txt','rb') as tsvin:
tsvin
75 matches
Mail list logo