On 02/04/2014 06:38 PM, Some Developer wrote:
I'm currently trying to download emails from an IMAP server using Python. I can
download the emails just fine but I'm having an issue when it comes to splitting
the relevant headers. Basically I'm using the following to fetch the headers of
an email m
On Tue, Feb 4, 2014 at 11:31 AM, Thomas Maher
wrote:
> Thank you for helping me. I used a similar code, but with an if statement.
> if list1 in list2:
> return len(list2[-1])
>
> This is the code they sent me this morning.
>
> def len_of_innerlist(list2):
> for ele in list2:
> if isinstance(e
The question as stated is fairly artificial and a bit nonsensical.
Let me explain that statement, because it's a strong one.
If we know the exact shape for list1 and list2 are, we can answer this
question directly, without loops.
len(list1[-1])
"Take the last element of the list1, and grab i
I'm currently trying to download emails from an IMAP server using
Python. I can download the emails just fine but I'm having an issue when
it comes to splitting the relevant headers. Basically I'm using the
following to fetch the headers of an email message:
typ, msg_header_content = self.m.fe
On 04/02/14 15:01, Peter Otten wrote:
Alan Gauld wrote:
This led me to wonder if there is a way to get unsigned type
behaviour in Python?
I think you have to apply a mask:
-2 & 0xff
254
Ah! obvious when you see it! :-)
And I'm applying masks all over the place but didn't
think of using
Alan Gauld wrote:
> I'm playing with some bit twiddling code at present and started
> to get some unexpected results which i eventually realized
> were down to Python ints acting like signed ints in C (but
> with a 'flexible' sign bit!)
>
> This led me to wonder if there is a way to get unsigned
I'm playing with some bit twiddling code at present and started
to get some unexpected results which i eventually realized
were down to Python ints acting like signed ints in C (but
with a 'flexible' sign bit!)
This led me to wonder if there is a way to get unsigned type
behaviour in Python?
Thi
Gabriele Brambilla wrote:
> ok.
> the problem is that my "errors" are not always the same and sometimes they
> are only differences in the results displayed (with the same starting data
> and no random variables used between).
Sometimes randomness lurks where you don't expect it. Are there any di
ok.
the problem is that my "errors" are not always the same and sometimes they
are only differences in the results displayed (with the same starting data
and no random variables used between).
so it's difficult for me to understand where the error is (and to give you
a piece of code that can run).
Danny Yoo Wrote in message:
> (Sorry if you get this message twice: I think I accidently mis-sent
> the message to the wrong address, so to make sure, I'm sending to what
> I think is the right address this time.)
>
> ---
>
> Hi Premanshu,
[deleting useful advice]
Welcome to the list.
When
Ian D Wrote in message:
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
When making an amendment to a post, please reply to that post;
don't start a new
Ian D wrote:
> Are:
>
> <=
> ==
> !=
>
> simple conditionals statements, conditionals, comparison operators,
> conditional expressions or what?
[comparison] operators:
http://docs.python.org/3.3/reference/lexical_analysis.html#operators
a <= b # expression (something is evaluated; ideally t
josh Malone Wrote in message:
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
First thing is to figure your goal. "Model" might mean anything
from "figur
Hi
Are:
<=
==
!=
simple conditionals statements, conditionals, comparison operators, conditional
expressions or what?
I am looking at a few different pages and am unsure what I should be calling
these expressions.
http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ifstatements.html#s
Thomas Maher wrote:
> I am teaching my students Python the second semester using
> www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some
> help. I am having a problem with the Lists-Set 1 exercise 18. The
> problem is below. I have put in several codes and the output is 5,
Dayo wrote:
> I wrote this script (http://bpaste.net/show/175284/) to help me
> automate some rsync backups, and whenever I run the script for large
> syncs, it just freezes after a while, and then I have to Ctrl+C it. I
Maybe you are just lacking patience ;)
> can find any clues in both source
On 04/02/14 09:10, Dayo wrote:
I wrote this script (http://bpaste.net/show/175284/) to help me
automate some rsync backups, and whenever I run the script for large
syncs, it just freezes after a while, and then I have to Ctrl+C it.
You have quite a few prints in there so you should have some
On 04/02/14 09:01, Ian D wrote:
I used to use 2.7 and the input was pretty when inputting a numeric
value, it would just get cast to an int.
Just to be picky it would get converted to an int not cast
as an int.
casting and converting are two very different things.
casting means treat a bit pa
Siobhan Wojcik wrote:
> Hello,
>
> I've been having an issue with a program that I'm writing. The program
> works until it has to compute something:
>
> def carPmt():
> cost = requestInteger("How much does the car cost?")
> downPmt = requestInteger("If there is a down payment, how much?")
>
I am teaching my students Python the second semester using www.LearnStreet.com
( http://www.learnstreet.com/ ). I am in need of some help. I am having a
problem with the Lists-Set 1 exercise 18. The problem is below. I have put in
several codes and the output is 5, which is the right answer.
Hello,
I've been having an issue with a program that I'm writing. The program
works until it has to compute something:
def carPmt():
cost = requestInteger("How much does the car cost?")
downPmt = requestInteger("If there is a down payment, how much?")
tradeIn = requestInteger("If there is a
Hi, I'm very new to programming and python is my first language. I'm
currently enrolled in a class at Oregon State University where we are
taught to program in python. I'm stuck on one problem and i know what i
want to do... i just have no idea how to write the program. The question is
as follows
Ian D wrote:
> Hello
>
> I used to use 2.7 and the input was pretty when inputting a numeric value,
> it would just get cast to an int.
>
> Seems that 3.3 I have to cast each input so :
> float(num1 = input("Enter a number")
You mean
num1 = float(input("Enter a number"))
> Is this just t
Hi
I wrote this script (http://bpaste.net/show/175284/) to help me
automate some rsync backups, and whenever I run the script for large
syncs, it just freezes after a while, and then I have to Ctrl+C it. I
can find any clues in both source and target /var/log/* files. Any idea
how I can find out
num1 = float(input("enter a number "))
I meant
not
float(num1 = input("Enter a number"))
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org
Hello
I used to use 2.7 and the input was pretty when inputting a numeric value, it
would just get cast to an int.
Seems that 3.3 I have to cast each input so :
float(num1 = input("Enter a number")
Is this just they way it is now? Is there a way to get back to just typing:
num1 = input("Ent
26 matches
Mail list logo