Chris Angelico :
> Definitely agree with this. Having a way to declare that a name is
> "truly constant" would be extremely handy;
I don't think it would be all that handy. I'm afraid all this type
hinting will turn Python into a poor man's Java.
> Maybe, but I honestly don't miss 'switch' all t
On Fri, Mar 11, 2016 at 11:24 PM, Veek. M wrote:
> Ian Kelly wrote:
>
>> On Fri, Mar 11, 2016 at 10:59 PM, Veek. M wrote:
>>> Also, what's this bit:
>>> self.default = default if default else type()
>>
>> If the default parameter has a truthy value, it gets set to
>> self.default. Otherwise, the
On Sat, Mar 12, 2016 at 5:24 PM, Veek. M wrote:
>> Also, what's this bit:
>> self.default = default if default else type()
> But type() just gives me:
> TypeError: type() takes 1 or 3 arguments
> on py2,3
Check out the context of the original line of code and see what it's
doing. It isn't the sam
Ian Kelly wrote:
> On Fri, Mar 11, 2016 at 10:59 PM, Veek. M wrote:
>> A property uses the @property decorator and has @foo.setter
>> @foo.deleter.
>>
>> A descriptor follows the descriptor protocol and implements the
>> __get__ __set__ __delete__ methods.
>>
>> But they both do essentially the s
Veek. M wrote:
> A property uses the @property decorator and has @foo.setter
> @foo.deleter.
>
> A descriptor follows the descriptor protocol and implements the
> __get__ __set__ __delete__ methods.
>
> But they both do essentially the same thing, allow us to do:
> foo = 10
> del foo
> x = foo
>
On Fri, Mar 11, 2016 at 10:59 PM, Veek. M wrote:
> A property uses the @property decorator and has @foo.setter
> @foo.deleter.
>
> A descriptor follows the descriptor protocol and implements the __get__
> __set__ __delete__ methods.
>
> But they both do essentially the same thing, allow us to do:
On Sat, Mar 12, 2016 at 4:59 PM, Veek. M wrote:
> A property uses the @property decorator and has @foo.setter
> @foo.deleter.
>
> A descriptor follows the descriptor protocol and implements the __get__
> __set__ __delete__ methods.
>
> But they both do essentially the same thing, allow us to do:
>
On Sat, 12 Mar 2016 12:10 pm, Dennis Lee Bieber wrote:
> On Fri, 11 Mar 2016 22:24:45 +, BartC declaimed the
> following:
>
>>On 11/03/2016 21:59, Mark Lawrence wrote:
>>> On 11/03/2016 18:57, BartC wrote:
>>
>>> def test():
>>> s=""
>>> for i in range(1000):
>>> s+="*
A property uses the @property decorator and has @foo.setter
@foo.deleter.
A descriptor follows the descriptor protocol and implements the __get__
__set__ __delete__ methods.
But they both do essentially the same thing, allow us to do:
foo = 10
del foo
x = foo
So why do we have two ways of doin
On Saturday, March 12, 2016 at 7:50:43 AM UTC+5:30, Chris Angelico wrote:
> On Sat, Mar 12, 2016 at 12:16 PM, BartC wrote:
> > You'd be surprised how much any kind of program relies on adhoc integer
> > operations. It doesn't need to work with large int arrays for them to be
> > important. (Look a
Hello,
I am running the following versions of software:
Python 3.5
psycopg2==2.6.1
Postgres 9.4.5
I have 2 tables. Table User has UserId (serial PK), LastName, FirstName,
Gender, DateOfBirth, and DateEnrolled. Table UserProfile has UserProfileId
(serial, PK), UserId (FK), DateEntered, FaveNumb
On Friday, March 11, 2016 at 9:48:22 AM UTC-6, Ian wrote:
> On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson wrote:
> > Many times, i would have preferred to define my module space
> > across multiple files, multiple files that could share state
> > without resorting to the yoga-style "import contorti
On Friday, March 11, 2016 at 9:48:22 AM UTC-6, Ian wrote:
> On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson
> The honorable Rick Johnson wrote:
> > Many times, i would have preferred to define my module space
> > across multiple files, multiple files that could share state
> > without resorting to th
On Sat, Mar 12, 2016 at 12:16 PM, BartC wrote:
> On 11/03/2016 21:36, Chris Angelico wrote:
>>
>> constants, and can then perform all the other optimizations you
>> describe (since functions are themselves immutable, all you need is an
>> identity check on the function object itself, and everythin
On 11/03/2016 21:36, Chris Angelico wrote:
On Sat, Mar 12, 2016 at 5:57 AM, BartC wrote:
Functions are dynamic. That is, you don't know the F in F() is actually a
function, even if it was defined a few lines previously, because it could have
been rebound to something else. That means a runt
On 03/11/2016 03:24 PM, BartC wrote:
> On 11/03/2016 21:59, Mark Lawrence wrote:
>> On 11/03/2016 18:57, BartC wrote:
>
>> def test():
>> s=""
>> for i in range(1000):
>> s+="*"
>> print (len(s))
>>
>> test()
>
>> The minor snag that you might like to correct with your
(NOTE: My apologies to the group if this same message was sent twice. From my
end, it appears to have been lost, so i'm sending again. Thanks)
On Thursday, March 10, 2016 at 1:36:48 PM UTC-6, Mark Lawrence wrote:
> On 10/03/2016 14:57, Dan Strohl via Python-list wrote:
> >> I've been studying Obj
Rick Johnson wrote:
I have witnessed the mayhem that occurs when a language does
not mandate module encapsulation (Ruby, i'm looking directly
at you), and while i agree with the Python designers
that modules must *ALWAYS* be mandatory, i am not convinced
that module space should be so strictl
On Friday, March 11, 2016 at 3:28:40 AM UTC-6, Steven D'Aprano wrote:
> That's one theory. Another theory is: no they shouldn't, all attributes
> should be public. That most accurately models actual physical objects and
> maximizes the usefulness of the attribute.
>
> People over-use private, and
On 3/11/2016 2:37 PM, Tim Golden wrote:
On 11/03/2016 19:24, Giga Image wrote:
On Soruceforge, Python for Windows Extension, I noticed that they
already haven a installer for Python 3.6.
Where do I find Python 3.6 installer for Win64. I couldn't find it on
Python.org/download page.
The pywin3
On 3/11/2016 7:12 PM, Martin A. Brown wrote:
Aside from your csv question today, many of your questions could be
answered by reading through the manual documenting the standard
datatypes (note, I am assuming you are using Python 3).
are you accusing me of being lazy?
if that's your accusatio
Good afternoon Fillmore,
> So, now I need to split a string in a way that the first element
> goes into a string and the others in a list:
>
> while($line = ) {
>
>my ($s,@values) = split /\t/,$line;
>
> I am trying with:
>
> for line in sys.stdin:
>s,values = line.strip().split("\t")
>
On Friday, March 11, 2016 at 3:42:36 PM UTC-8, Fillmore wrote:
> So, now I need to split a string in a way that the first element goes
> into a string and the others in a list:
>
> while($line = ) {
>
> my ($s,@values) = split /\t/,$line;
>
> I am trying with:
>
> for line in sys.stdin:
On Thursday, March 10, 2016 at 1:36:48 PM UTC-6, Mark Lawrence wrote:
> On 10/03/2016 14:57, Dan Strohl via Python-list wrote:
> >> I've been studying Object Oriented Theory using Java. Theoretically, all
> >> attributes should be private, meaning no one except the methods itself can
> >> access th
On Sat, 12 Mar 2016 09:53 am, Larry Martell wrote:
> Many years ago (c. 1985) I was at a job interview and the interviewer
> asked me what the first thing I would do when I am presented with a new
> problem that I had to code up. I gave all sorts of answers like 'do a top
> down analysis of the pr
So, now I need to split a string in a way that the first element goes
into a string and the others in a list:
while($line = ) {
my ($s,@values) = split /\t/,$line;
I am trying with:
for line in sys.stdin:
s,values = line.strip().split("\t")
print(s)
but no luck:
ValueError: t
On Fri, Mar 11, 2016 at 4:18 PM, Fillmore wrote:
>
> Playing with ArgumentParser. I can't find a way to override the -h and
> --help options so that it provides my custom help message.
>
> -h, --help show this help message and exit
>
> Here is what I am trying:
>
> parser = argparse.Argu
On 3/11/2016 6:26 PM, Larry Martell wrote:
am I missing something obvious?
https://docs.python.org/2/library/argparse.html#usage
you rock!
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 11, 2016 at 6:18 PM, Fillmore wrote:
>
>
> Playing with ArgumentParser. I can't find a way to override the -h and --help
> options so that it provides my custom help message.
>
> -h, --help show this help message and exit
>
> Here is what I am trying:
>
> parser = argparse.A
On Mar 11, 2016 6:20 PM, "Fillmore" wrote:
>
>
> Playing with ArgumentParser. I can't find a way to override the -h and
--help options so that it provides my custom help message.
>
> -h, --help show this help message and exit
>
> Here is what I am trying:
>
> parser = argparse.ArgumentPa
Playing with ArgumentParser. I can't find a way to override the -h and
--help options so that it provides my custom help message.
-h, --help show this help message and exit
Here is what I am trying:
parser = argparse.ArgumentParser("csresolver.py",add_help=False)
parser.add_argumen
On Fri, Mar 11, 2016 at 4:49 AM, Steven D'Aprano
wrote:
> On Fri, 11 Mar 2016 02:28 pm, rubengoods...@yahoo.com wrote:
>
> > I am having trouble installing the Python software.
>
> Make sure your computer is turned on. I can't tell you how many times I've
> tried to install Python, and I type com
On 11/03/2016 22:24, BartC wrote:
On 11/03/2016 21:59, Mark Lawrence wrote:
On 11/03/2016 18:57, BartC wrote:
def test():
s=""
for i in range(1000):
s+="*"
print (len(s))
test()
The minor snag that you might like to correct with your microbenchmark,
which any e
On 2016-03-11, Charles T. Smith wrote:
> On Fri, 11 Mar 2016 22:00:41 +, Grant Edwards wrote:
>
>> Since they behave differently, perhaps the question ought to be "which
>> does what you want to do?"
>
> For parsed msgs, I had this:
>
> elif hasattr (msg.msgBody, 'request'):
>
>
On 11/03/2016 21:59, Mark Lawrence wrote:
On 11/03/2016 18:57, BartC wrote:
def test():
s=""
for i in range(1000):
s+="*"
print (len(s))
test()
The minor snag that you might like to correct with your microbenchmark,
which any experienced Python programmer knows,
On Fri, 11 Mar 2016 22:00:41 +, Grant Edwards wrote:
> Since they behave differently, perhaps the question ought to be "which
> does what you want to do?"
For parsed msgs, I had this:
elif hasattr (msg.msgBody, 'request'):
It occurred to me that this was less abstruse:
On 11/03/2016 22:00, Grant Edwards wrote:
On 2016-03-11, Charles T. Smith wrote:
From the performance point of view, which is better:
- hasattr()
- x in y
Dunno, is red an even or odd color? How many pancakes does it take to
cover a doghouse?
"x" in "asdf"
False
"x" in "xyz"
True
On 2016-03-11, Charles T. Smith wrote:
> From the performance point of view, which is better:
> - hasattr()
> - x in y
Dunno, is red an even or odd color? How many pancakes does it take to
cover a doghouse?
>>> "x" in "asdf"
False
>>> "x" in "xyz"
True
>>> "asdf".hasattr("x")
Traceback (most
On 11/03/2016 21:53, Charles T. Smith wrote:
On Fri, 11 Mar 2016 21:44:27 +, Charles T. Smith wrote:
From the performance point of view, which is better: - hasattr()
- x in y
TIA
cts
I just realized that "in" won't look back through the class hierarchy...
that clearly makes them not in
On Sat, Mar 12, 2016 at 8:53 AM, Charles T. Smith
wrote:
> On Fri, 11 Mar 2016 21:44:27 +, Charles T. Smith wrote:
>
>> From the performance point of view, which is better: - hasattr()
>> - x in y
>>
>> TIA
>> cts
>
>
> I just realized that "in" won't look back through the class hierarchy...
>
On Fri, 11 Mar 2016 21:44:27 +, Charles T. Smith wrote:
> From the performance point of view, which is better: - hasattr()
> - x in y
>
> TIA
> cts
I just realized that "in" won't look back through the class hierarchy...
that clearly makes them not interchangable, but given we're only
inter
On 11/03/2016 18:57, BartC wrote:
Anyway, I've listed some of the stumbling blocks I think that Python has
in making it bit faster: http://pastebin.com/WfUfK3bc
The String Append Benchmark
This is a microbenchmark, but makes use of a technique I use extensively
(creating a file for example
On Sat, Mar 12, 2016 at 8:44 AM, Charles T. Smith
wrote:
> From the performance point of view, which is better:
> - hasattr()
> - x in y
>
Mu. They do completely different things.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
>From the performance point of view, which is better:
- hasattr()
- x in y
TIA
cts
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Mar 12, 2016 at 5:57 AM, BartC wrote:
> Anyway, I've listed some of the stumbling blocks I think that Python has in
> making it bit faster: http://pastebin.com/WfUfK3bc
>
Much easier to discuss text that's inline, so I'm taking this out of pastebin.
> Functions are dynamic. That is, you
On 3/11/2016 2:41 PM, Fillmore wrote:
I have a TSV file containing a few strings like this (double quotes are
part of the string):
A big thank you to everyone who helped with this and with other
questions. My porting of one of my Perl scripts to Python is over now
that the two scripts produ
On 3/11/2016 4:15 PM, Mark Lawrence wrote:
https://docs.python.org/3/library/csv.html#csv.Dialect.doublequote
thanks, but my TSV is not using any particular dialect as far as I
understand...
Thank you, anyway
--
https://mail.python.org/mailman/listinfo/python-list
On 3/11/2016 4:14 PM, MRAB wrote:
>>> import csv
>>> s = '"Please preserve my doublequotes"\ttext1\ttext2'
>>> reader = csv.reader([s], delimiter='\t', quotechar=None)
>>> for row in reader:
... print(row[0])
...
"Please preserve my doublequotes"
>>>
This worked! thank you MRAB
--
Good afternoon Fillmore,
import csv
s = '"Please preserve my doublequotes"\ttext1\ttext2'
reader = csv.reader([s], delimiter='\t')
> How do I instruct the reader to preserve my doublequotes?
Change the quoting used by the dialect on the csv reader instance:
reader = csv.reader
On 11/03/2016 19:41, Fillmore wrote:
I have a TSV file containing a few strings like this (double quotes are
part of the string):
'"pragma: CacheHandler=08616B7E907744E026C9F044250EA55844CCFD52"'
After Python and the CVS module has read the file and re-printed the
value, the string has become:
On 2016-03-11 20:49, Fillmore wrote:
On 3/11/2016 2:41 PM, Fillmore wrote:
Is there some directive I can give CVS reader to tell it to stop
screwing with my text?
OK, I think I reproduced my problem at the REPL:
>>> import csv
>>> s = '"Please preserve my doublequotes"\ttext1\ttext2'
>>
Fillmore writes:
> Possibly, but I am having a hard time letting it know that it should
> leave each and every char alone
You're using the wrong module, then. To use the ‘csv’ module is to have
the sequence of characters parsed to extract component values, which
cannot also “leave each and every
On 11/03/2016 20:32, Fillmore wrote:
myReader = csv.reader(csvfile, delimiter='\t',quotechar='')
From reading that the quotechar is null. You have a single quote and
single quote with nothing in the middle.
Try this:
myReader = csv.reader(csvfile, delimiter='\t',quotechar="'")
i.e doublequ
On 3/11/2016 2:41 PM, Fillmore wrote:
Is there some directive I can give CVS reader to tell it to stop
screwing with my text?
OK, I think I reproduced my problem at the REPL:
>>> import csv
>>> s = '"Please preserve my doublequotes"\ttext1\ttext2'
>>> reader = csv.reader([s], delimiter='\t')
>
On 3/11/2016 3:05 PM, Joel Goldstick wrote:
Enter the python shell. Import csv
then type help(csv)
It is highly configurable
Possibly, but I am having a hard time letting it know that it should
leave each and every char alone, ignore quoting and just handle strings
as strings. I tried pl
On Fri, Mar 11, 2016 at 2:41 PM, Fillmore
wrote:
>
> I have a TSV file containing a few strings like this (double quotes are
> part of the string):
>
> '"pragma: CacheHandler=08616B7E907744E026C9F044250EA55844CCFD52"'
>
> After Python and the CVS module has read the file and re-printed the
> valu
Fillmore writes:
> On 3/11/2016 2:23 PM, MRAB wrote:
> > Python 3 (Unicode) strings have an .isprintable method:
> >
> > mystring.isprintable()
>
> my strings are UTF-8. Will it work there too?
You need to always be clear on the difference between text (the Python 3
‘str’ type) versus bytes.
It
On Friday, March 11, 2016 at 11:38:09 AM UTC-8, Tim Golden wrote:
> On 11/03/2016 19:24, Giga Image wrote:
> > On Soruceforge, Python for Windows Extension, I noticed that they
> > already haven a installer for Python 3.6.
> >
> > Where do I find Python 3.6 installer for Win64. I couldn't find it o
I have a TSV file containing a few strings like this (double quotes are
part of the string):
'"pragma: CacheHandler=08616B7E907744E026C9F044250EA55844CCFD52"'
After Python and the CVS module has read the file and re-printed the
value, the string has become:
'pragma: CacheHandler=08616B7E90
On 3/11/2016 2:23 PM, MRAB wrote:
On 2016-03-11 00:07, Fillmore wrote:
Here's another handy Perl regex which I am not sure how to translate to
Python.
I use it to avoid processing lines that contain funny chars...
if ($string =~ /[^[:print:]]/) {next OUTER;}
:)
Python 3 (Unicode) strings h
On 11/03/2016 19:24, Giga Image wrote:
On Soruceforge, Python for Windows Extension, I noticed that they
already haven a installer for Python 3.6.
Where do I find Python 3.6 installer for Win64. I couldn't find it on
Python.org/download page.
The pywin32 crew are always ahead of the game: they
On Soruceforge, Python for Windows Extension, I noticed that they already haven
a installer for Python 3.6.
Where do I find Python 3.6 installer for Win64. I couldn't find it on
Python.org/download page.
Thanks!
--
https://mail.python.org/mailman/listinfo/python-list
On 2016-03-11 00:07, Fillmore wrote:
Here's another handy Perl regex which I am not sure how to translate to
Python.
I use it to avoid processing lines that contain funny chars...
if ($string =~ /[^[:print:]]/) {next OUTER;}
:)
Python 3 (Unicode) strings have an .isprintable method:
mystri
On 11/03/2016 05:29, Steven D'Aprano wrote:
On Fri, 11 Mar 2016 06:26 am, Mark Lawrence wrote:
No mention of speed anywhere, but then what does that silly old Tim
Peters know about anything?
The truth is, most people don't -- most Python code uses very little of the
dynamic features that ge
On Fri, Mar 11, 2016 at 9:34 AM, Wolfgang Maier
wrote:
> On 11.03.2016 15:23, Fillmore wrote:
>>
>> On 03/11/2016 07:13 AM, Wolfgang Maier wrote:
>>>
>>> One lesson for Perl regex users is that in Python many things can be
>>> solved without regexes.
>>> How about defining:
>>>
>>> printable = {ch
On 03/10/2016 02:41 PM, Ben Mezger wrote:
Hi all,
I've been studying Object Oriented Theory using Java. Theoretically, all
attributes should be private, meaning no one except the methods itself
can access the attribute;
public class Foo {
private int bar;
...
Normally in Java, we wou
On 11.03.2016 15:23, Fillmore wrote:
On 03/11/2016 07:13 AM, Wolfgang Maier wrote:
One lesson for Perl regex users is that in Python many things can be
solved without regexes.
How about defining:
printable = {chr(n) for n in range(32, 127)}
then using:
if (set(my_string) - set(printable)):
On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson
wrote:
> Many times, i would have preferred to define my module space
> across multiple files, multiple files that could share state
> without resorting to the yoga-style "import contortions",
> and/or the dreaded "circular import nightmares" that plag
Fillmore wrote:
> On 03/11/2016 07:13 AM, Wolfgang Maier wrote:
>> One lesson for Perl regex users is that in Python many things can be
>> solved without regexes. How about defining:
>>
>> printable = {chr(n) for n in range(32, 127)}
>>
>> then using:
>>
>> if (set(my_string) - set(printable)):
>>
On Fri, Mar 11, 2016 at 2:29 AM, dieter wrote:
> If you are really interested to enforce Java encapsulation policies
> (access to attributes via "getter/setter" only), you will need
> to use your own "metaclass".
>
> The "metaclass" has a similar relation to a class as a class to
> an instance: i.
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> [...]
>
> How is the best way to decode such reply from server?
>https://docs.python.org/3/library/struct.html#examples
Thank Marko will take alook i
On 03/11/2016 07:13 AM, Wolfgang Maier wrote:
One lesson for Perl regex users is that in Python many things can be solved
without regexes.
How about defining:
printable = {chr(n) for n in range(32, 127)}
then using:
if (set(my_string) - set(printable)):
break
seems computationally heav
Joaquin Alzola :
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> [...]
>
> How is the best way to decode such reply from server?
https://docs.python.org/3/library/struct.html#examples
Marko
--
On 2016.03.11 07:17, Joaquin Alzola wrote:
> HI Guys
>
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> From python function --> data = s.recv(2048)
>
> b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x0
HI Guys
I received this from a socket connection. This is the received data:
Adding more info --> the response is a mixture of hex numbers + ascii
>From python function --> data = s.recv(2048)
b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x00\x00p2E\xe1+\xe8xG\x00\x00\x01\x08@\x00\x00\x0bmmm\x00\x00\
Wolfgang Maier :
> On 11.03.2016 13:13, Wolfgang Maier wrote:
>> One lesson for Perl regex users is that in Python many things can be
>> solved without regexes. How about defining:
>>
>> printable = {chr(n) for n in range(32, 127)}
>>
>> then using:
>>
>> if (set(my_string) - set(printable)):
>>
Hi,
On Fri, Mar 11, 2016 at 6:10 AM, Swetha Reddy wrote:
> Hi, i just downloaded the python software. when i search for it in my
> downloads, a folder called python 3.5.1 ( 32 bit ) Setup is seen. But when
> i try to open it, it has only three options : Modify, Repair and uninstall.
> there are n
On 11.03.2016 13:13, Wolfgang Maier wrote:
One lesson for Perl regex users is that in Python many things can be
solved without regexes. How about defining:
printable = {chr(n) for n in range(32, 127)}
then using:
if (set(my_string) - set(printable)):
break
Err, I meant:
if (set(my_str
One lesson for Perl regex users is that in Python many things can be
solved without regexes. How about defining:
printable = {chr(n) for n in range(32, 127)}
then using:
if (set(my_string) - set(printable)):
break
On 11.03.2016 01:07, Fillmore wrote:
Here's another handy Perl regex wh
On Friday, March 11, 2016 at 10:21:35 AM UTC+5:30, Larry Hudson wrote:
> On 03/09/2016 11:54 PM, Rustom Mody wrote:
> [...]
> > In between these two extremes we have many possibilities
> > - ibus/gchar etc
> > - compose key
> > - alternate keyboard layouts
> >
> > Using all these levels judiciously
On 11/03/2016 11:10, Swetha Reddy wrote:
Hi, i just downloaded the python software. when i search for it in my
downloads, a folder called python 3.5.1 ( 32 bit ) Setup is seen. But when
i try to open it, it has only three options : Modify, Repair and uninstall.
there are no other files of python
varun...@gmail.com wrote:
> Hello everyone,
>
> I recently came across a package called matrix2latex which simplifies the
> creation of very large tables. So, I saved my data in .mat format using
> the '-v7.3' extension so that they can be read by python.
>
> Now, when I try to read these files,
Hi, i just downloaded the python software. when i search for it in my
downloads, a folder called python 3.5.1 ( 32 bit ) Setup is seen. But when
i try to open it, it has only three options : Modify, Repair and uninstall.
there are no other files of python in my computer except this. Where can i
get
On 03/10/2016 07:59 PM, Neal Becker wrote:
sohcahto...@gmail.com wrote:
On Thursday, March 10, 2016 at 10:33:47 AM UTC-8, Neal Becker wrote:
Is there a way to ensure resource cleanup with a construct such as:
x = load (open ('my file', 'rb))
Is there a way to ensure this file gets closed?
Alan Bawden writes:
> Fillmore writes:
>
>> On 3/10/2016 7:08 PM, INADA Naoki wrote:
> ...
>> I don't like it. It makes Python not so good for command-line utilities
>>
>
> You can easily restore the standard Unix command-line-friendly behavior
> by doing:
>
> import signal
> signal.signal(
On Fri, 11 Mar 2016 02:28 pm, rubengoods...@yahoo.com wrote:
> I am having trouble installing the Python software.
Make sure your computer is turned on. I can't tell you how many times I've
tried to install Python, and I type commands and click icons and nothing
happens. It's really frustrating w
varun...@gmail.com writes:
> I recently came across a package called matrix2latex which simplifies the
> creation of very large tables. So, I saved my data in .mat format using the
> '-v7.3' extension so that they can be read by python.
>
> Now, when I try to read these files, I'm having some pr
On Fri, 11 Mar 2016 12:41 am, Ben Mezger wrote:
> Hi all,
>
> I've been studying Object Oriented Theory using Java. Theoretically, all
> attributes should be private, meaning no one except the methods itself
> can access the attribute;
(Note: in the following, when I say "encapsulation", I am ac
On Fri, Mar 11, 2016 at 8:09 PM, Charles T. Smith
wrote:
> "Python deals with variables the other way around.
>They are local, if not otherwise declared.
>...
> def f():
> print(s)
> s = "I love Paris in the summer!"
> f()
> ...
> As there is no local variable
Ben Mezger writes:
> I've been studying Object Oriented Theory using Java. Theoretically, all
> attributes should be private, meaning no one except the methods itself
> can access the attribute;
>
> public class Foo {
> private int bar;
> ...
>
> Normally in Java, we would write getters a
Charles T. Smith wrote:
> On Fri, 11 Mar 2016 19:29:20 +1100, Chris Angelico wrote:
>
>> Usefully? Never.
>>
>> Simple question - simple answer :)
>>
>> ChrisA
>
>
> Right, that was the expected answer as well. I just ran into that in
> legacy code, checked out the documentation and couldn't
On Fri, Mar 11, 2016 at 2:13 AM, Charles T. Smith
wrote:
> When might a "global" statement be used in the outermost level of a module?
You wouldn't need this in a normal module, because locals and globals
are the same. It may be useful if you're using exec with separate
locals and globals, and ne
Paul Rubin writes:
> Jussi Piitulainen writes:
>> return ModeIO(f.read())
>
> These suggestions involving f.read() assume the file contents are small
> enough to reasonably slurp into memory. That's unlike the original
> where "load" receives a stream and might process it piecewise.
If y
On Fri, 11 Mar 2016 08:31:22 +, Mark Lawrence wrote:
> Never. Hopefully this
> http://www.python-course.eu/python3_global_vs_local_variables.php can
> explain it better than I can :)
The article is good, I'm glad to have confirmed what I have so empirical
stumbled over.
... Irrespective of t
c...@isbd.net writes:
> I have a (fairly simple) Python program that scans through a
> 'catchall' E-Mail address for things that *might* be for me. It sends
> anything that could be for me to my main E-Mail and discards the rest.
>
> However I *occasionally* get an error from it as follows:-
>
>
HI Guys
I received this from a socket connection. This is the received data:
>From python function --> data = s.recv(2048)
b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x00\x00p2E\xe1+\xe8xG\x00\x00\x01\x08@\x00\x00\x0bmmm\x00\x00\x00\x01(@\x00\x00\x16mmm.xx.com\x00\x00\x00\x00\x01\x0c@\x00\x00\x0
On Fri, 11 Mar 2016 19:29:20 +1100, Chris Angelico wrote:
> Usefully? Never.
>
> Simple question - simple answer :)
>
> ChrisA
Right, that was the expected answer as well. I just ran into that in
legacy code, checked out the documentation and couldn't really make that
out. So I figured I bet
On 03/10/2016 04:26 PM, Fillmore wrote:
On 3/10/2016 7:08 PM, INADA Naoki wrote:
No. I see it usually.
Python's zen says:
Errors should never pass silently.
Unless explicitly silenced.
When failed to write to stdout, Python should raise Exception.
You can silence explicitly when it's
On 11/03/2016 08:13, Charles T. Smith wrote:
When might a "global" statement be used in the outermost level of a module?
Never. Hopefully this
http://www.python-course.eu/python3_global_vs_local_variables.php can
explain it better than I can :)
(whereby, I assume a module is equivalent to
On Fri, Mar 11, 2016 at 7:13 PM, Charles T. Smith
wrote:
> When might a "global" statement be used in the outermost level of a module?
>
> (whereby, I assume a module is equivalent to a python file, correct?)
>
Usefully? Never.
Simple question - simple answer :)
ChrisA
--
https://mail.python.o
1 - 100 of 103 matches
Mail list logo