On 03.06.15 02:56, Chris Angelico wrote:
On Wed, Jun 3, 2015 at 7:27 AM, fl wrote:
I just see the tutorial says Python can return value in function, it does
not say multiple data results return situation. In C, it is possible.
How about Python on a multiple data return requirement?
Technicall
can you please stick to the point.take your differences else
where.please.stay on target...some of us are learning... its annoying and
tiring to have to read the insults and innuendo
--
https://mail.python.org/mailman/listinfo/python-list
On 04Jun2015 07:09, Cecil Westerhof wrote:
Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson:
On 02Jun2015 18:13, Cecil Westerhof wrote:
I am thinking about using ipython3 instead of bash. When I want to
find a file I can do the following:
!find ~ -iname '*python*.pdf'
but is there a
Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson:
> On 02Jun2015 18:13, Cecil Westerhof wrote:
>> I am thinking about using ipython3 instead of bash. When I want to
>> find a file I can do the following:
>> !find ~ -iname '*python*.pdf'
>> but is there a python way?
>
> That succinct? No
Op Thursday 4 Jun 2015 01:15 CEST schreef Ethan Furman:
> On 06/03/2015 01:37 PM, Mark Lawrence wrote:
>> On 03/06/2015 19:28, Ethan Furman wrote:
>>> On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
>>>
I kept the except. I like to see the message that went wrong. ;-)
>>>
>>> That's fine, but
On 03Jun2015 19:59, M2 wrote:
On Wednesday, June 3, 2015 at 7:38:22 PM UTC-5, Cameron Simpson wrote:
I would be passing only "line" to proc, not "f" at all.
Suggestion: move your main code into its own function. That will make all the
variables in it "local". Your proc function is presently re
On Wed, Jun 3, 2015, at 17:56, Mark Lawrence wrote:
> Now does Python pass by value or by reference? Happily sits back and
> waits for 10**6 emails to arrive as this is discussed for the 10**6th
> time.
Python's in that same awkward space as Java, where it technically passes
by value, but the va
On 02Jun2015 18:13, Cecil Westerhof wrote:
I am thinking about using ipython3 instead of bash. When I want to
find a file I can do the following:
!find ~ -iname '*python*.pdf'
but is there a python way?
That succinct? Not out of the box, but something can easily be built on top of
the os.w
On Wednesday, June 3, 2015 at 7:38:22 PM UTC-5, Cameron Simpson wrote:
> On 03Jun2015 17:04, M2 wrote:
> >On Wednesday, June 3, 2015 at 6:56:47 PM UTC-5, sohca...@gmail.com wrote:
> >> On Wednesday, June 3, 2015 at 4:45:52 PM UTC-7, M2 wrote:
> >> > On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5,
On Thursday, June 4, 2015 at 7:24:19 AM UTC+5:30, Ned Batchelder wrote:
> On Wednesday, June 3, 2015 at 5:50:24 PM UTC-4, Mark Lawrence wrote:
> > On 03/06/2015 22:22, Rustom Mody wrote:
> > > On Wednesday, June 3, 2015 at 4:27:39 AM UTC+5:30, Dr. Bigcock wrote:
> > >> We can make Python like LISP:
On Wednesday, June 3, 2015 at 5:50:24 PM UTC-4, Mark Lawrence wrote:
> On 03/06/2015 22:22, Rustom Mody wrote:
> > On Wednesday, June 3, 2015 at 4:27:39 AM UTC+5:30, Dr. Bigcock wrote:
> >> We can make Python like LISP:
> >>
> >> 1. Make EVERYTHING the same kind of thing (call it "object").
> >> 2
On Thu, Jun 4, 2015 at 11:30 AM, Dennis Lee Bieber
wrote:
> On Wed, 3 Jun 2015 15:28:56 -0700 (PDT), sohcahto...@gmail.com declaimed
> the following:
>
>>
>>People actually argue that Python passes by value? This is easily proven
>>wrong by passing a mutable object to a function and changing it
On 03Jun2015 17:04, M2 wrote:
On Wednesday, June 3, 2015 at 6:56:47 PM UTC-5, sohca...@gmail.com wrote:
On Wednesday, June 3, 2015 at 4:45:52 PM UTC-7, M2 wrote:
> On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5, Waffle wrote:
> > You think "(f)" makes a tuple, but it does not.
> > the parentesi
On Wednesday, June 3, 2015 at 6:56:47 PM UTC-5, sohca...@gmail.com wrote:
> On Wednesday, June 3, 2015 at 4:45:52 PM UTC-7, M2 wrote:
> > On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5, Waffle wrote:
> > > You think "(f)" makes a tuple, but it does not.
> > > the parentesis is not the tuple constru
On Wednesday, June 3, 2015 at 4:45:52 PM UTC-7, M2 wrote:
> On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5, Waffle wrote:
> > You think "(f)" makes a tuple, but it does not.
> > the parentesis is not the tuple constructor, the comma is
> > try:
> > t=thread.start_new_thread(proc,(f,))
>
> Thanks f
On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5, Waffle wrote:
> You think "(f)" makes a tuple, but it does not.
> the parentesis is not the tuple constructor, the comma is
> try:
> t=thread.start_new_thread(proc,(f,))
Thanks for the pointer waffle.
The program executes now but still not the way I
On 06/03/2015 01:37 PM, Mark Lawrence wrote:
On 03/06/2015 19:28, Ethan Furman wrote:
On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
I kept the except. I like to see the message that went wrong. ;-)
That's fine, but then add a `raise` after you print the error so you can
see the reason that
On 03/06/2015 22:49, Mark Lawrence wrote:
On 03/06/2015 22:33, BartC wrote:
On 03/06/2015 21:58, Mark Lawrence wrote:
Not so hypothetical in my case as I have to implement a lot of this
stuff.
I'm also quite interested in how Python does things. If it's a good idea
I'll copy it, if not I'll tr
On Wed, Jun 3, 2015 at 3:08 PM, Rustom Mody wrote:
> On Tuesday, June 2, 2015 at 7:50:58 PM UTC+5:30, Ian wrote:
>> On Tue, Jun 2, 2015 at 6:35 AM, Rustom Mody wrote:
>> > For that matter even this works
>> > But I am not sure whats happening or that I like it
>> >
>> [x[-2:] for x in lines
You think "(f)" makes a tuple, but it does not.
the parentesis is not the tuple constructor, the comma is
try:
t=thread.start_new_thread(proc,(f,))
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, June 3, 2015 at 2:57:00 PM UTC-7, Mark Lawrence wrote:
> On 03/06/2015 22:35, Chris Angelico wrote:
> > On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel
> >
> > wrote:
> >> Am 03.06.2015 um 01:56 schrieb Chris Angelico:
> >>
> >>> and it's pretty convenient. In C, the nearest equivalen
On Thu, Jun 4, 2015 at 6:07 AM, wrote:
> On Wed, Jun 3, 2015, at 09:32, Chris Angelico wrote:
>> Write an editor that opens a file and holds it open until the user's
>> done with it. Have something that lets you shell out for whatever
>> reason. Then trigger the shell-out, and instantly SIGSTOP t
On Wednesday, June 3, 2015 at 4:01:13 PM UTC-5, Sam Raker wrote:
> proc(f) isn't a callable, it's whatever it returns. IIRC, you need to do
> something like 'start_new_thread(proc, (f,))'
If I execute something like
t=thread.start_new_thread(proc,(f))
I get:
Traceback (most recent call last):
On Thu, Jun 4, 2015 at 2:15 AM, Cecil Westerhof wrote:
>> And I'd also skip the bare except clause. If you get any sort of
>> exception, whether it's a bug, a failure from libturpial, a network
>> error, or anything else, your code will just terminate with a bland
>> and useless message. Much bett
On 03/06/2015 22:35, Chris Angelico wrote:
On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel
wrote:
Am 03.06.2015 um 01:56 schrieb Chris Angelico:
and it's pretty convenient. In C, the nearest equivalent is passing a
number of pointers as parameters, and having the function fill out
values. Pyth
On 03/06/2015 22:22, Rustom Mody wrote:
On Wednesday, June 3, 2015 at 4:27:39 AM UTC+5:30, Dr. Bigcock wrote:
We can make Python like LISP:
1. Make EVERYTHING the same kind of thing (call it "object").
2. Let's make a lot of meta functions like super, instead of judicious use of
interpreter
On 03/06/2015 22:33, BartC wrote:
On 03/06/2015 21:58, Mark Lawrence wrote:
Not so hypothetical in my case as I have to implement a lot of this stuff.
I'm also quite interested in how Python does things. If it's a good idea
I'll copy it, if not I'll try and avoid it!
Which implementation, cPy
On 03/06/2015 22:08, Rustom Mody wrote:
On Tuesday, June 2, 2015 at 7:50:58 PM UTC+5:30, Ian wrote:
On Tue, Jun 2, 2015 at 6:35 AM, Rustom Mody wrote:
For that matter even this works
But I am not sure whats happening or that I like it
[x[-2:] for x in lines]
['12', '42', '49', '56', '25',
On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel
wrote:
> Am 03.06.2015 um 01:56 schrieb Chris Angelico:
>
>> and it's pretty convenient. In C, the nearest equivalent is passing a
>> number of pointers as parameters, and having the function fill out
>> values. Python's model is a lot closer to what
On 03/06/2015 21:58, Mark Lawrence wrote:
On 03/06/2015 19:59, BartC wrote:
Does anyone need to understand CPython for anything?
No you (plural) don't. If people were to spend more time writing code
and less time on hypothetical claptrap the amount of noise on this list
would probably be r
On Wednesday, June 3, 2015 at 4:27:39 AM UTC+5:30, Dr. Bigcock wrote:
> We can make Python like LISP:
>
> 1. Make EVERYTHING the same kind of thing (call it "object").
> 2. Let's make a lot of meta functions like super, instead of judicious use
> of interpreter impositions.
> 3. Forget *practic
random...@fastmail.us:
> On Wed, Jun 3, 2015, at 10:43, Marko Rauhamaa wrote:
>> However, the child process needs to be prepared for os.close() to
>> block indefinitely because of an NFS problem or because SO_LINGER has
>> been specified by the parent, for example. Setting the close-on-exec
>> fla
On Tuesday, June 2, 2015 at 7:50:58 PM UTC+5:30, Ian wrote:
> On Tue, Jun 2, 2015 at 6:35 AM, Rustom Mody wrote:
> > For that matter even this works
> > But I am not sure whats happening or that I like it
> >
> [x[-2:] for x in lines]
> > ['12', '42', '49', '56', '25', '36', '49', '64', '81'
On 2015-06-03 21:41, Mohan Mohta wrote:
Hello
I am trying to create multiple thread through the below program but I am
getting an error
#! /usr/bin/python
import os
import subprocess
import thread
import threading
from thread import start_new_thread
def proc(f) :
com1="ssh -B "
On 03/06/2015 19:59, BartC wrote:
Does anyone need to understand CPython for anything?
No you (plural) don't. If people were to spend more time writing code
and less time on hypothetical claptrap the amount of noise on this list
would probably be reduced by 99%.
Then knock out those who
Hello
I am trying to create multiple thread through the below program but I am
getting an error
#! /usr/bin/python
import os
import subprocess
import thread
import threading
from thread import start_new_thread
def proc(f) :
com1="ssh -B "
com2=line.strip('\n')
com3= " un
On 03/06/2015 19:28, Ethan Furman wrote:
On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
I kept the except. I like to see the message that went wrong. ;-)
That's fine, but then add a `raise` after you print the error so you can
see the reason that message failed.
--
~Ethan~
Why bother in th
On Wed, Jun 3, 2015, at 10:43, Marko Rauhamaa wrote:
> However, the child process needs to be prepared for os.close() to block
> indefinitely because of an NFS problem or because SO_LINGER has been
> specified by the parent, for example. Setting the close-on-exec flag
> doesn't help there.
Out of
On Wed, Jun 3, 2015, at 09:32, Chris Angelico wrote:
> Write an editor that opens a file and holds it open until the user's
> done with it. Have something that lets you shell out for whatever
> reason. Then trigger the shell-out, and instantly SIGSTOP the child
> process, before it does its work -
On 06/03/2015 11:22 AM, John McKenzie wrote:
Hello.
Very new to Python and looking for some basic help.
Would like a set-up where something happens when a key is pressed. Not
propose a question, have the user type something, then hit return, then
something happens, but just the R key is p
On 06/03/2015 11:22 AM, John McKenzie wrote:
Hello.
Very new to Python and looking for some basic help.
Would like a set-up where something happens when a key is pressed. Not
propose a question, have the user type something, then hit return, then
something happens, but just the R key is p
On 03/06/2015 17:29, Mark Lawrence wrote:
On 03/06/2015 17:00, BartC wrote:
On 03/06/2015 13:08, Marko Rauhamaa wrote:
BartC :
To 'variable' and 'type', you might need to add 'value' to make it more
complete.
'Value' and 'object' are indeed synonymous as long as you keep in mind
that:
Tkinter runs on raspberry pi.
Get it installed, and then run this program.
from Tkinter import *
root = Tk()
prompt = 'Press any key. Remember to keep your mouse in the cyan box. '
lab = Label(root, text=prompt, width=len(prompt), bg='cyan')
lab.pack()
def key(event):
msg = 'event.char is %r
On 06/03/2015 09:15 AM, Cecil Westerhof wrote:
I kept the except. I like to see the message that went wrong. ;-)
That's fine, but then add a `raise` after you print the error so you can see
the reason that message failed.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Hello.
Very new to Python and looking for some basic help.
Would like a set-up where something happens when a key is pressed. Not
propose a question, have the user type something, then hit return, then
something happens, but just the R key is pressed, something happens, then
something else
On 2015-06-03 17:15, Cecil Westerhof wrote:
Op Wednesday 3 Jun 2015 15:29 CEST schreef Chris Angelico:
On Wed, Jun 3, 2015 at 10:27 PM, Cecil Westerhof wrote:
def send_message(account_id, message, max_tries,
terminate_program): error_msg = 'Something went wrong with: ' +
message not_send = Tr
On 03/06/2015 17:36, Michael Torrie wrote:
On 06/03/2015 10:00 AM, BartC wrote:
The others all give True in all cases. It seems that older Python
versions have a purer object model.
No. It's just an under-the-hood optimization that the interpreter is
making. It's an implementation detail tha
On 6/3/2015 12:00 PM, BartC wrote:
That's a different matter. However, you appear to be wrong.
print (-12 is -12)
gives True. As does ("abc" is "abc"). I assume constructions for
immutable values will do the same (([10,20,30] is [10,20,30]) gives
False because the constructs are mutable, altho
On Wednesday, June 3, 2015 at 8:21:43 AM UTC-7, Mark Lawrence wrote:
> right = not right
>
> Isn't that just beautiful?
A few weeks ago, we were discussing the fact that, in Python 2, True = False,
and False = True, were both legal statements in Python. I remarked: "every
politician's dream!"
On 6/3/2015 6:20 AM, BartC wrote:
But, it is mostly just jargon. If you go back to using 'variable' and
'type', then it becomes a bit easier:
* A variable is an instance of some type.
That is clear enough in itself, but be aware that many people use
'variable' as a synonym for typeless names
Are you looking for Knuth's paper Structured Programming with Goto Statements?
http://c2.com/cgi/wiki?StructuredProgrammingWithGoToStatements
I don't remember a theorem in there, but I haven't read it for decades,
so ...
Laura
--
https://mail.python.org/mailman/listinfo/python-list
Op Wednesday 3 Jun 2015 15:29 CEST schreef Chris Angelico:
> On Wed, Jun 3, 2015 at 10:27 PM, Cecil Westerhof wrote:
>> def send_message(account_id, message, max_tries,
>> terminate_program): error_msg = 'Something went wrong with: ' +
>> message not_send = True tries = 0 while not_send: try:
>>
On 06/03/2015 10:00 AM, BartC wrote:
> The others all give True in all cases. It seems that older Python
> versions have a purer object model.
No. It's just an under-the-hood optimization that the interpreter is
making. It's an implementation detail that you should never rely on.
It says nothin
On 03/06/2015 17:00, BartC wrote:
On 03/06/2015 13:08, Marko Rauhamaa wrote:
BartC :
To 'variable' and 'type', you might need to add 'value' to make it more
complete.
'Value' and 'object' are indeed synonymous as long as you keep in mind
that:
>>> -12 == -12
True
>>> -12 is -
In a message of Wed, 03 Jun 2015 15:17:16 +0530, Amit Goutham writes:
>Hi All,
>I am trying to search on the Internet if i can call a Python Script from an
>SQL Procedure.
>All the information found on Internet is about connecting to a database
>from Python through a Python script.But, i want the o
On 03/06/2015 13:08, Marko Rauhamaa wrote:
BartC :
To 'variable' and 'type', you might need to add 'value' to make it more
complete.
'Value' and 'object' are indeed synonymous as long as you keep in mind
that:
>>> -12 == -12
True
>>> -12 is -12
False
IOW, the literal exp
I wanted a piece of code to write alternatively to the left and right
sides of a deque. I remembered a stackoverflow question about toggling
with an excellent answer from Raymond Hettinger. So I now have this.
right = not right
Isn't that just beautiful?
--
My fellow Pythonistas, ask not wh
alister :
> I meant the program that is supplying your app with file handles
> willy- nilly without caring what happens to them
You seem to be advocating a strategy whereby the application keeps close
track of all file descriptors and closes them individually as needed.
Thing is, processes can b
Marko Rauhamaa :
> So the strategy you proposed is the right one: have the child process
> ignore any possible errors from os.close(). The parent will have an
> opportunity to deal with them.
>
> And now Linux is back in the good graces, only the man page is
> misleading.
However, the child proce
On Tuesday, June 2, 2015 at 4:56:57 PM UTC+5:30, acdr wrote:
> Hi,
>
> Currently, in various places in my code, I have the equivalent of:
>
> for x in it:
> if complicated_calculation_1():
> cleanup()
> break
> complicated_calculation_2()
> if complicated_calculation_3
Le vendredi 29 août 2014 10:35:29 UTC+2, Frank Liou a écrit :
> and body is "b'" .is empty
>
> i'm so confused.don't know it work or not
Hi, you should read() before you close() the connection.
conn = http.client.HTTPConnection('android.googleapis.com')
conn.request('POST', '/gcm/send', jqs
Am 03.06.2015 um 01:56 schrieb Chris Angelico:
and it's pretty convenient. In C, the nearest equivalent is passing a
number of pointers as parameters, and having the function fill out
values. Python's model is a lot closer to what you're saying than C's
model is :)
At least, C functions can re
On Wed, Jun 3, 2015 at 2:57 AM, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> On Wednesday 03 June 2015 08:33, Marko Rauhamaa wrote:
>>> In Python, classes are little more than constructor functions.
>>
>> [...]
>>
>> Classes give you an inheritance hierarchy.
>
> That's encapsulated in the const
Marko Rauhamaa :
> random...@fastmail.us:
>
>> Why does the child process need to report the error at all? The parent
>> process will find out naturally when *it* tries to close the same file
>> descriptor.
>
> That's not how it goes.
>
> File descriptors are reference counted in the Linux kernel.
On Wed, Jun 3, 2015 at 11:21 PM, wrote:
> On Wed, Jun 3, 2015, at 09:08, Marko Rauhamaa wrote:
>> random...@fastmail.us:
>>
>> > Why does the child process need to report the error at all? The parent
>> > process will find out naturally when *it* tries to close the same file
>> > descriptor.
>>
>
On Wed, Jun 3, 2015 at 10:27 PM, Cecil Westerhof wrote:
> def send_message(account_id, message, max_tries, terminate_program):
> error_msg = 'Something went wrong with: ' + message
> not_send= True
> tries = 0
> while not_send:
> try:
>
Hello guys,
After i read
http://python-history.blogspot.com/2009/02/first-class-everything.html .
where Guidos says "One of my goals for Python was to make it so that all
objects were "first class." By this, I meant that I wanted all objects that
could be named in the language (e.g., integers
On Wed, Jun 3, 2015, at 09:08, Marko Rauhamaa wrote:
> random...@fastmail.us:
>
> > Why does the child process need to report the error at all? The parent
> > process will find out naturally when *it* tries to close the same file
> > descriptor.
>
> That's not how it goes.
>
> File descriptors a
random...@fastmail.us writes:
> On Wed, Jun 3, 2015, at 03:11, Alain Ketterlin wrote:
>> Thank you, I know this. What I mean is: what are the reasons that you
>> cannot access your file descriptors one by one? To me closing a range of
>> descriptors has absolutely no meaning, simply because ranges
random...@fastmail.us:
> Why does the child process need to report the error at all? The parent
> process will find out naturally when *it* tries to close the same file
> descriptor.
That's not how it goes.
File descriptors are reference counted in the Linux kernel. Closes are
no-ops except for
On 03/06/2015 13:08, BartC wrote:
Come on, we're trying to keep this simple.
If we really want to keep it simple, we can take this starting point:
http://en.wikipedia.org/wiki/Object_(computer_science)
If we agree with the Wikipedia definition:
``In the class-based object-oriented programmi
Hi Sreenathan Nair:
import os, sys,
import connectlibs as ssh
s = ssh.connect("xxx.xx.xx.xxx", "Admin", "Admin")
channel = s.invoke_shell()
channel.send("net use F: xyz.xy.xc.xa\\dir\n")
>>>32
channel.send("net use\n")
>>>7
channel.recv(500)
'Last login: Tue Jun 2 23:52:29 2015 from
xxx.xx.
On Wed, 03 Jun 2015 15:27:19 +0300, Marko Rauhamaa wrote:
> alister :
>
>> from the scenario Marco is reporting I get the impression that he is
>> having to interact with a system that is fundamentally flawed from the
>> ground up.
>
> Well, yes. It's called linux, but it's not all bad. I just t
On Wed, Jun 3, 2015, at 08:25, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
> > How does the child process know what action didn't complete? What
> > error message are you going to display to the user?
>
> You definitely must not use sys.stderr from the child process nor are
> you allowed to exit
I am using libturpial to post messages on Twitter. Sometimes I get a
libturpial.exceptions.ServiceOverCapacity.
It is a good idea to try it again then. For this I wrote the following
function:
def send_message(account_id, message, max_tries, terminate_program):
error_msg = 'Something
alister :
> from the scenario Marco is reporting I get the impression that he is
> having to interact with a system that is fundamentally flawed from the
> ground up.
Well, yes. It's called linux, but it's not all bad. I just think that
man page was being sanctimonious.
Marko
--
https://mail.p
Steven D'Aprano :
> How does the child process know what action didn't complete? What
> error message are you going to display to the user?
>
> "Error when closing file descriptor 123456"
>
> What action do you think the user can take on seeing this error
> message?
Besides, even if you wanted to
On Wed, Jun 3, 2015, at 03:11, Alain Ketterlin wrote:
> Thank you, I know this. What I mean is: what are the reasons that you
> cannot access your file descriptors one by one? To me closing a range of
> descriptors has absolutely no meaning, simply because ranges have no
> meaning for file descript
On Wed, 03 Jun 2015 22:07:47 +1000, Steven D'Aprano wrote:
> On Wed, 3 Jun 2015 07:38 pm, alister wrote:
>
>> On Wed, 03 Jun 2015 10:41:44 +0300, Marko Rauhamaa wrote:
> [...]
>>> Here's the deal: the child process is saddled with file descriptors it
>>> never wanted in the first place. It can't
On Wed, Jun 3, 2015 at 9:08 PM, BartC wrote:
> On 03/06/2015 11:38, Chris Angelico wrote:
>>
>> On Wed, Jun 3, 2015 at 8:20 PM, BartC wrote:
>>>
>>> I have a lot of trouble with this stuff too, as my ideas are decidedly
>>> old-fashioned. (Also I'm developing a language with some OO aspects
>>> w
Thanks very much for all the answers given to my question. They help me to
think about the problem pythonically.
Best regards
David
> -Original Message-
> From: Python-list [mailto:python-list-
> bounces+david.aldrich=emea.nec@python.org] On Behalf Of Peter
> Otten
> Sent: 03 June 2
BartC :
> To 'variable' and 'type', you might need to add 'value' to make it more
> complete.
'Value' and 'object' are indeed synonymous as long as you keep in mind
that:
>>> -12 == -12
True
>>> -12 is -12
False
IOW, the literal expression -12 happens to construct a fresh
value/
On Wed, 3 Jun 2015 07:38 pm, alister wrote:
> On Wed, 03 Jun 2015 10:41:44 +0300, Marko Rauhamaa wrote:
[...]
>> Here's the deal: the child process is saddled with file descriptors it
>> never wanted in the first place. It can't decline them. Now you're
>> saying it can't even dispose of them.
>>
On 03/06/2015 11:20, BartC wrote:
'genfield' is a field (attribute) that can't be resolved, but the
possibilities have been reduced to a small, finite set which is
resolved at load-time (in Python, the attribute could be anything, and
you don't even know at runtime what it might be until you ac
On 03/06/2015 11:38, Chris Angelico wrote:
On Wed, Jun 3, 2015 at 8:20 PM, BartC wrote:
I have a lot of trouble with this stuff too, as my ideas are decidedly
old-fashioned. (Also I'm developing a language with some OO aspects without
ever having used OO!)
But, it is mostly just jargon. If you
David Aldrich wrote:
> Hi
>
> I have written a Python utility that performs a certain activity on some
> predefined sets of files. Here is the outline of what I have written:
>
> # File Set A
> pathA = 'pathA'
> fileListA = ['fileA1.txt', 'fileA2.txt']
>
> # File Set B
> pathB = 'pathB'
> file
On Wed, Jun 3, 2015 at 8:20 PM, BartC wrote:
> I have a lot of trouble with this stuff too, as my ideas are decidedly
> old-fashioned. (Also I'm developing a language with some OO aspects without
> ever having used OO!)
>
> But, it is mostly just jargon. If you go back to using 'variable' and
> 't
Amit Goutham writes:
> Hi All,
> I am trying to search on the Internet if i can call a Python Script from an
> SQL Procedure.
> All the information found on Internet is about connecting to a database
> from Python through a Python script.But, i want the other way round.
>
> Any Help will be appre
On 03/06/2015 05:16, Eddilbert Macharia wrote:
On Tuesday, June 2, 2015 at 2:27:31 PM UTC+3, Steven D'Aprano wrote:
Eddilbert, have you programmed in any other languages? It would help you
understand if you have.
Sadly yes i have worked with java, and that is what is causing me so much
grie
Hi All,
I am trying to search on the Internet if i can call a Python Script from an
SQL Procedure.
All the information found on Internet is about connecting to a database
from Python through a Python script.But, i want the other way round.
Any Help will be appreciated
--
Thanks and Regards,
Amit
On Wed, 03 Jun 2015 10:41:44 +0300, Marko Rauhamaa wrote:
> Alain Ketterlin :
>
>> Marko Rauhamaa writes:
>>> Maybe close() will fail for ever.
>>
>> Your program has to deal with this, something is going wrong, it can't
>> just close and go on.
>
> Here's the deal: the child process is saddled
2015-06-03 10:19 GMT+02:00 David Aldrich :
> Hi
>
>
>
> I have written a Python utility that performs a certain activity on some
> predefined sets of files. Here is the outline of what I have written:
>
>
>
> # File Set A
>
> pathA = ‘pathA’
>
> fileListA = [‘fileA1.txt’, ‘fileA2.txt’]
>
>
>
> # F
On 03Jun2015 08:19, David Aldrich wrote:
I have written a Python utility that performs a certain activity on some
predefined sets of files. Here is the outline of what I have written:
# File Set A
pathA = 'pathA'
fileListA = ['fileA1.txt', 'fileA2.txt']
# File Set B
pathB = 'pathB'
fileListB
2015-06-03 10:19 GMT+02:00 David Aldrich :
> Hi
>
>
>
> I have written a Python utility that performs a certain activity on some
> predefined sets of files. Here is the outline of what I have written:
>
>
>
> # File Set A
>
> pathA = ‘pathA’
>
> fileListA = [‘fileA1.txt’, ‘fileA2.txt’]
>
>
>
> # F
Hi
I have written a Python utility that performs a certain activity on some
predefined sets of files. Here is the outline of what I have written:
# File Set A
pathA = 'pathA'
fileListA = ['fileA1.txt', 'fileA2.txt']
# File Set B
pathB = 'pathB'
fileListB = ['fileB1.txt', 'fileB2.txt', 'fileB3.
Steven D'Aprano :
> On Wednesday 03 June 2015 08:33, Marko Rauhamaa wrote:
>> In Python, classes are little more than constructor functions.
>
> [...]
>
> Classes give you an inheritance hierarchy.
That's encapsulated in the constructor. From the class user's point of
view, it doesn't matter if t
On Wednesday 03 June 2015 05:31, Jon Ribbens wrote:
> On 2015-06-02, Dr. Bigcock wrote:
>> On Tuesday, June 2, 2015 at 1:49:03 PM UTC-5, Jon Ribbens wrote:
>>> On 2015-06-02, Dr. Bigcock wrote:
>>> > It doesn't really do anything. No one uses integers as objects.
>>> > (Any dissenters?)
>>>
>>
On Wednesday 03 June 2015 08:33, Marko Rauhamaa wrote:
> Grant Edwards :
>
>> On 2015-06-02, Ian Kelly wrote:
>>> Accepting for the sake of argument that "something to be subclassed"
>>> is a reasonable definition of object,
>>
>> Huh? You can't subclass an object. You can subclass a Class.
>
On Wednesday 03 June 2015 06:42, Joonas Liik wrote:
> my_dict = {1: 'D', 2: 'B', 3: 'A', 4: 'E', 5: 'B'}
>
> # dict.items() returns an iterator that returns pairs of (key, value)
> # pairs the key argument to sorted tells sorted what to sort by,
> operator.itemgetter is a factory function , itemg
On Wednesday 03 June 2015 08:49, Dr. Bigcock wrote:
> You need classes for objects. Anything else, and you're confusing
> yourself.
Not quite.
https://en.wikipedia.org/wiki/Prototype-based_programming
--
Steve
--
https://mail.python.org/mailman/listinfo/python-list
1 - 100 of 107 matches
Mail list logo