james campbell Wrote in message:
>
(Context lost because message was erroneously posted in html)
strings cannot be decoded, so there's naturally no such method.
Why not post a two line example of what you're trying, and
explain what you were expecting it to do.
--
DaveA
_
rahmad akbar Wrote in message:
Between invisible colors and a tiny font, your message is totally
incomprehensible to me. This is a text list, please post in text,
not html.
--
DaveA
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
On 08/02/14 16:36, Richard Cziva wrote:
I am trying to print out every function that is being called while my
Python program is running (own functions and library calls too). I can
not modify the Python programs I am trying to profile.
I don't know of any way of doing this exactly as you want
Hi All,
I am trying to print out every function that is being called while my
Python program is running (own functions and library calls too). I can
not modify the Python programs I am trying to profile.
Let me give an example. A program contains a function like this:
def foo(x):
y = math.
Hi All,
I am struggling with a "simple" problem: I would like to print out every
function that is being executed while my Python program is running. I can not
modify the Python programs that I would like to profile.
Let me give an example. A program contains a function and a call like this:
de
I have been currently trying to get a small piece of code to work, but keep
getting an error:
header_bin = header_hex.decode('hex')
AttributeError: 'str' object has no attribute 'decode'
The source of this code is from:
https://en.bitcoin.it/wiki/Block_hashing_algorithm
Here is the the code:
Sir I don't know nothing about programming but I have a great intrest
in it so that now a days I began to study python, many of my friends
and teachers suggest me it. But still I have no tutor, can you please
suggest me to study python using book or any good websit.
Thanks.
Abhinav Raj
>From Cal
On 09/02/14 13:36, Oscar Benjamin wrote:
We're talking about iteration so this is quite early in the course. At
this stage I want my students to understand that closing a file is an
explicit action that needs to occur. Later in the course I will teach
exception handling and explain that the abov
On 09/02/14 22:37, Altrius wrote:
I’m completely new to programming in general and everything I have read so far
has pointed me to Python.
Its still one of the best choices for learning.
Other languages are easier to get started with but then you can't go any
further. Python lets you keep on
On 02/09/2014 11:37 PM, Altrius wrote:
Hi,
I’m completely new to programming in general and everything I have read so far
has pointed me to Python. I’ll put this another way: All I know is that a
programming language is a medium for a human to tell a computer what to do.
After that I’m kinda
Altrius Wrote in message:
> Hi,
>
> Iâm completely new to programming in general and everything I have read so
> far has pointed me to Python. Iâll put this another way: All I know is that
> a programming language is a medium for a human to tell a computer what to do.
> After that Iâm k
On Sun, Feb 9, 2014 at 5:20 AM, Peter Otten <__pete...@web.de> wrote:
>
> The idea here is to wrap the iterable of records to be inserted in the Iter
> class which keeps track of the last accessed row.
You could also use a parameters iterator, e.g. `it = iter(to_db)`.
Then for an IntegrityError, l
Hi Altrius,
Welcome! You might start by looking at some of the learning resources at
python.org. As a beginner, you'll probably want to look at:
https://wiki.python.org/moin/BeginnersGuide
Feel free to ask questions here. Good luck!
___
Tutor mailli
On Feb 9, 2014 5:37 PM, "Altrius" wrote:
>
> Hi,
>
> I’m completely new to programming in general and everything I have read
so far has pointed me to Python. I’ll put this another way: All I know is
that a programming language is a medium for a human to tell a computer what
to do. After that I’m k
Hi,
I’m completely new to programming in general and everything I have read so far
has pointed me to Python. I’ll put this another way: All I know is that a
programming language is a medium for a human to tell a computer what to do.
After that I’m kinda lost. I was just hoping to get some input
Russel Winder Wrote in message:
> On Thu, 2014-02-06 at 18:06 -0500, Dave Angel wrote:
> [â¦]
>>
>> Code:
>> def fib2(n):
>> if n==1:
>> return 1
>>
>> elif n==2:
>> return 1
>> else:
>> return fib2(n-2) +fib2(n-1)
> [â¦]
>
> I suggest it
On Sun, Feb 09 2014,Peter Otten wrote:
> Sivaram Neelakantan wrote:
>
[snipped 32 lines]
>
> If nobody here comes up with a good way to find the offending record you
> could ask in a mailing list/newsgroup dedicated to sqlite (Please report
> back here if you do). If there is no "official" way
On 9 February 2014 13:28, Russel Winder wrote:
> On Mon, 2014-01-20 at 10:41 +, Oscar Benjamin wrote:
> [...]
>> f = open('myfile.txt')
>> for line in f:
>> print(line.upper())
>> f.close()
>
> I suggest we even see this as not good code due to the possibility of
> I/O exceptions:
>
>
On Mon, 2014-01-20 at 10:41 +, Oscar Benjamin wrote:
[…]
> f = open('myfile.txt')
> for line in f:
> print(line.upper())
> f.close()
I suggest we even see this as not good code due to the possibility of
I/O exceptions:
with open('myfile.txt') as f:
for line in f:
On Sun, Feb 09 2014,Steven D'Aprano wrote:
> On Sun, Feb 09, 2014 at 12:03:43PM +0530, Sivaram Neelakantan wrote:
>
[snipped 8 lines]
> When you get an error, and don't know how to interpret it, the first
> thing to do is to look at the exception and see what it says.
>
> try:
> # as above
On Thu, 2014-02-06 at 18:06 -0500, Dave Angel wrote:
[…]
>
> Code:
> def fib2(n):
> if n==1:
> return 1
>
> elif n==2:
> return 1
> else:
> return fib2(n-2) +fib2(n-1)
[…]
I suggest it also be pointed out that this form is algorithmical
Sivaram Neelakantan wrote:
>
> I've written this code that seems to work and I'd like to know how to get
> the record that causes the abort. Apparently 'executemany' doesn't
> support lastrow? And if it doesn't, any suggestions?
>
> --8<---cut here---start->
On Sun, Feb 09, 2014 at 12:03:43PM +0530, Sivaram Neelakantan wrote:
> try:
> sql = "insert into %s (%s) values(%s)" %(name, cl, cvv)
> conn.executemany(sql, to_db)
> dbh.commit()
> except sq.IntegrityError:
> print('Record already exists') # but which recor
23 matches
Mail list logo