Christopher McGrath wrote:
> I am trying to run a simple python web script in a browser with apache. I
> have apache installed and running perfectly. I installed Ruby and Perl
> I had Python 3.6 installed before and tried to test with these
> I also tried with #!Q:\LifeForce\Python36-32\python.e
Hi All,
I know
> sum([1,2,3]) returns 6.
But sum with [] 'empty list' as second parameter returns as below.
> sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]
Can any one please explain this logic ? I searched in google but could not
find the suitable answer.
Thanks in advance.
Thanks,
On 01/08/17 07:06, ramakrishna reddy wrote:
>> sum([1,2,3]) returns 6.
>
> But sum with [] 'empty list' as second parameter returns as below.
>
>> sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]
An interesting question, I wasn't aware that you could
add lists with sum.
However, the resu
ramakrishna reddy wrote:
> Hi All,
>
> I know
>
>> sum([1,2,3]) returns 6.
>
> But sum with [] 'empty list' as second parameter returns as below.
>
>> sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]
> Can any one please explain this logic ? I searched in google but could not
> find the
Hi All
I am getting an error in python. Its a flask app that I am doing
I am getting the error
TypeError: utf_8_decode() argument 1 must be string or buffer, not long
at this point in the code
ship_schedules = ShipSchedule.query.all()
The schema definition is like that I gave below, there is
On 08/01/2017 05:13 AM, rakesh sharma wrote:
> Hi All
>
>
> I am getting an error in python. Its a flask app that I am doing
>
> I am getting the error
>
> TypeError: utf_8_decode() argument 1 must be string or buffer, not long
>
> at this point in the code
>
> ship_schedules = ShipSchedule.q
Yes indeed geany is a nice editor. I used it when i was beginning and even
wrote a post about it, Feel free to check it !
https://abdurrahmaanjanhangeer.wordpress.com/2016/11/02/python-getting-rid-of-identation-errors-quickly-checking-for-errors-and-the-use-of-editors/
On Tue, Aug 1, 2017 at 9:43
nice explanation .. thanks
this cleared my doubt
>>> k = [20]
>>> for i in [[1,2,3],[3,4,5]]:
... k += i
...
>>> k
[20, 1, 2, 3, 3, 4, 5]
On Tue, Aug 1, 2017 at 1:35 AM, Alan Gauld via Tutor
wrote:
> On 01/08/17 07:06, ramakrishna reddy wrote:
>
> >> sum([1,2,3]) returns 6.
> >
> > But sum
i guess it adds / sort of concatenates the list
On Tue, Aug 1, 2017 at 10:06 AM, ramakrishna reddy
wrote:
> Hi All,
>
> I know
>
> > sum([1,2,3]) returns 6.
>
> But sum with [] 'empty list' as second parameter returns as below.
>
> > sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]
> Can a
On 01/08/17 12:13, rakesh sharma wrote:
> I am getting the error
>
> TypeError: utf_8_decode() argument 1 must be string or buffer, not long
That's not too helpful out of context, can you show us more
of the error trace? Can you show us the method that generates
it? Do you have any indication ab
I have a friend who is a talented shell script writer. He is a linux guru since
several years.
He asked me if "if __name__=='main':" is state of the art if you want
to translate a shell script to python.
I started to stutter and did not know how to reply.
I use Python since several years and I
On Tue, Aug 1, 2017 at 9:54 AM, Thomas Güttler
wrote:
> I have a friend who is a talented shell script writer. He is a linux guru
> since
> several years.
>
> He asked me if "if __name__=='main':" is state of the art if you want
> to translate a shell script to python.
>
> I started to stutter and
On 1 August 2017 at 16:54, Thomas Güttler wrote:
> I have a friend who is a talented shell script writer. He is a linux guru
> since
> several years.
>
> He asked me if "if __name__=='main':" is state of the art if you want
> to translate a shell script to python.
>
> I started to stutter and did
On 01/08/17 15:54, Thomas Güttler wrote:
> He asked me if "if __name__=='main':" is state of the art if you want
> to translate a shell script to python.
It all depends what you plan to do with the script.
If you literally just want to translate a shell script such
that it will always be executed
I'm following an online tutorial about threading. This is the code I've
used so far:
import socket
import threading
from queue import Queue
print_lock = threading.Lock()
target = 'pythonprogramming.net'
def portscan(port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
Hi Daniel,
My responses below.
On Tue, Aug 01, 2017 at 02:48:19PM -0400, Daniel Bosah wrote:
> I'm following an online tutorial about threading. This is the code I've
> used so far:
Can you give us a link to the tutorial?
[...]
> def portscan(port):
> s = socket.socket(socket.AF_INET, socke
On Mon, Jul 31, 2017 at 11:06:18PM -0700, ramakrishna reddy wrote:
> > sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]
[] + [1,2,3] + [3,4,5]
returns [1, 2, 3, 3, 4, 5].
--
Steve
___
Tutor maillist - Tutor@python.org
To unsubscribe or chang
Daniel Bosah writes:
> I'm following an online tutorial about threading.
Can you point to it so we can understand your specific situation?
> I don't know what a Daemon is
The package ‘python-daemon’ is a library to build your program as a
daemon https://pypi.org/project/python-daemon/>.
The r
I had typed help(pow) in the interpreter and got:
py3: help(pow)
Help on built-in function pow in module builtins:
pow(x, y, z=None, /)
Equivalent to x**y (with two arguments) or x**y % z (with three arguments)
Some types, such as ints, are able to use a more efficient algorithm when
On Tue, Aug 01, 2017 at 04:54:40PM +0200, Thomas Güttler wrote:
[...]
> I use Python since several years and I use console_script in entry_points
> of setup.py.
What's console_script in entry_points of setup.py?
In particular, what does that have to do with writing an executable
script?
setup
boB Stepp writes:
> A quick scan of some of my Python books does not turn up the use of
> "/" as a function argument.
The appearance of this in Python's documentation and dfunction signature
descriptions, without a clear description of what it means, is
troubling.
The best I can find is this in
On Tue, Aug 01, 2017 at 08:06:58PM -0500, boB Stepp wrote:
> pow(x, y, z=None, /)
> Equivalent to x**y (with two arguments) or x**y % z (with three arguments)
It means that the arguments are positional-only, the names "x", "y" and
"z" are for documentation purposes only. You cannot write:
p
Steven D'Aprano writes:
> On Tue, Aug 01, 2017 at 04:54:40PM +0200, Thomas Güttler wrote:
>
> [...]
> > I use Python since several years and I use console_script in
> > entry_points of setup.py.
>
> What's console_script in entry_points of setup.py?
It is an advanced feature in Setuptools, that
Steven D'Aprano writes:
> Its quite new. Up until recently, the documentation didn't distinguish
> between function parameters which can take optional keywords and those
> that can't.
Where does the documentation describe this distinction? How is the
reader, coming across a link to documentation
On Tue, Aug 1, 2017 at 8:25 PM, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> Its quite new. Up until recently, the documentation didn't distinguish
>> between function parameters which can take optional keywords and those
>> that can't.
>
> Where does the documentation describe this distincti
On Wed, Aug 02, 2017 at 11:25:34AM +1000, Ben Finney wrote:
> Steven D'Aprano writes:
>
> > Its quite new. Up until recently, the documentation didn't distinguish
> > between function parameters which can take optional keywords and those
> > that can't.
>
> Where does the documentation describe
On Wed, Aug 02, 2017 at 11:22:00AM +1000, Ben Finney wrote:
> Steven D'Aprano writes:
>
> > On Tue, Aug 01, 2017 at 04:54:40PM +0200, Thomas Güttler wrote:
> >
> > [...]
> > > I use Python since several years and I use console_script in
> > > entry_points of setup.py.
> >
> > What's console_scrip
On Tue, Aug 01, 2017 at 09:05:02PM -0400, dbosah wrote:
> Also here's the link to the tutorial
> https://youtu.be/WrtebUkUssc
That is clearly marked as "Python 3 Programming Tutorial". Why are you
using Python 2? When you have a problem, you won't know if the problem
is with your code, or a diff
On Tue, Aug 01, 2017 at 09:03:30PM -0400, dbosah wrote:
> It usually says that it's an error.
Sorry, my crystal ball is at the shop being repaired and I don't know
what "an error" means or how to fix it.
Please COPY AND PASTE the full text of the error, starting with the
line "Traceback" and e
Steven D'Aprano writes:
> On Tue, Aug 01, 2017 at 09:03:30PM -0400, dbosah wrote:
(I am not seeing your replies in this forum, dbosah. Please address your
replies to the mailing list – not to an individual – if you want the
discussion to continue.)
> > And I'm still confused by the definition o
30 matches
Mail list logo