Colin Ross | 4 Aug 16:43 2015

Plotting asymmetric error bars for a single point in matplotlib

Hi all,

Goal: To plot asymmetric x error bars for a single point using errorbar. I
am interested in displaying the inter quartile range (IQR) for a data set.


import numpy as np
import matplotlib.pyplot as plt

y = 1.0
data = np.random.rand(100)

median = np.median(data)
upper_quartile = np.percentile(data, 75)
lower_quartile = np.percentile(data, 25)
IQR = upper_quartile - lower_quartile

plt.errorbar(median, y, xerr=[lower_quartile ,upper_quartile], fmt='k--')



Traceback (most recent call last):
  File "", line 15, in <module>
    plt.errorbar(median, y, xerr=[0.5,0.75], fmt='k--')
  File "/usr/lib/pymodules/python2.7/matplotlib/", line 2251, in
(Continue reading)

Quiles, Stephanie | 4 Aug 05:55 2015

palindrome using stack and queue

Hello ,

 i have to write a palindrome tester using a stack and a queue. You will need to handle strings that may have
upper/lower case letters and white space between the letters. We will not include punctuation marks in
our strings. Here’s an example: The user inputs otto, you read the string in, you print out something
like “otto is a palindrome.” The user inputs r a   DA    r, you output “r a    DA    r is a palindrome.”
here iw the code i originally had which worked: 
def main():
    my_str = input("Enter a string: ")
    my_str2 = [c for c in my_str.lower() if c.isalpha()]
    rev_str = reversed(my_str2)
    # check if the string is equal to its reverse
    if list(my_str2) == list(rev_str):
        print(my_str,"is a palindrome")
        print(my_str, "is not a palindrome")

if __name__ == '__main__':

But they want us to use a stack and a queue so how would i go about doing that? Here are the stack and queue

class Stack:
    """Top of the stack is at the end of the list"""
def __init__(self):
    self._items = []

(Continue reading)

Lulwa Bin Shuker | 4 Aug 06:21 2015


Dear Python tutor list ...

I'm currently learning Python through an online course but after learning
the basics of the language I need to apply what I learned on a real project
and start practicing it. How can I do that ?


Lulwa Bin Shuker
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

acolta | 3 Aug 22:55 2015

Python Certifications


I am new in python, so just curios if there are any good and appreciated python certification
programs/courses ?

Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Dima Kulik | 3 Aug 20:15 2015

for loop for long numbers

 Hi to all.
Can you help me plz.
I want to make a for loop with a huge numbers.
for example:

for i in range (0,9000000000):

but range and xrange cant operate with such big numbers. 
Can some on help me?


Dima Kulik
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:
Ali Moradi | 3 Aug 14:22 2015

How to show the listbox from sqlite and make it searchable?

hi, this is my code (

how can i show the two fields name "esperanto" and "english" in a listbox
positioned under the entry widget? i want the two fields to be beside
eachother like (abak/o     abacus)

and i want to make them searchable via the entry widget like a dictionary
app :)

thanks, i'm beginner so please modify my code.

and is there any good tutorial on using SQLite with tkinter and how to
desplay records on GUIs ?
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

matej taferner | 3 Aug 09:58 2015

question / decision tree

hi guys,

I am wondering if there is a python solution for the problem I am currently
dealing with.
I need to build a decision tree based questionnaire which helps users to
find the right answer.

As a final product of this decision tree "app" I need a clickable buttons
ready to be embedded into the website which will guide customer(s) to
desired answer(s).


Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Quiles, Stephanie | 3 Aug 05:04 2015

find pickle and retrieve saved data

 how do i go about being able to add a feature to search for individual entries that have been saved into that
dictionary or else tell me that the name I entered is not found? 

Here is the code that i have so far…

import pickle
def main():
    infile = open("emails.dat", "rb")
    emails = pickle.load(infile)
    name_search = input("Enter a name in the file for info: ")

    for name in emails:
        if name[0] == name_search:
            print("This is the info: ", info)
        return emails
        print("Entry not Found! Try again.")

thanks for all the help and suggestions this is really helping me in trying to figure this out! 

Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:
(Continue reading)

Clayton Kirkwood | 3 Aug 04:14 2015

Windows "feature" I don't understand

In a former life, I played the part of a system manager in a number of Unix
environments, which I really liked. Now, I am stuck using Windows and don't
get into the innards much. I ran into a problem in my program, which we have
been discussing, which is windows-caused. I originally set my directory in
my code to /users/Clayton/Pictures by memory that that was the name of the
directory in windows. My code worked using the directory. I then noticed
that my "real" directory as listed by windows explorer was /users/Clayton/My
Pictures. I changed it in my code and nothing works. /users/Clayton/Pictures
doesn't show up in explorer even tho I've set to display hidden files,
system files, etc. I dropped down into dos and lo and behold, Picture exists
but there is no My Pictures. That explains why pictures worked, but I don't
understand the discrepancy for the differences, why My Pictures doesn't
work, etc. My Pictures is not a link in explorer.

Any shed light would be greatly appreciated.



Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Nym City via Tutor | 3 Aug 01:13 2015

Writing back to same CSV in the next column

Below is my program where I am reading a list of IPs from a CSV file and running it through the socket module.
The result of the computation is stored in a variable named ResolvedAddresses. However, there are some
that are not resolved and for those there is an exception.
The task that I am trying to complete now is taking the output of the ResolvedAddresses and the content of the
exception and write is back out to the same CSV file where the data is originally imported from. Ideally, I
would like this new information to be in the column B and match with column A.
Thank you in advance. And please let me know if what I am trying to accomplish is not clear and I'll try to
explain it better.

Here is the code:

 Thank you.
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:
Clayton Kirkwood | 2 Aug 23:44 2015

scratching my head

Hey, been awhile, but I ran into os.walk and it fit what I needed to do for
an issue I've had for a long time: I have tons of pictures in my top
directory of pictures which are duplicated into properly named
subdirectories. Please see issues above my questions with large gaps below. 

#Program to find duplicated pictures in my picture directory tree
#Presumably, if the file exists in a subdirectory I can remove if from the
parent picture directory
#Clayton Kirkwood

import os
from os.path import join,  getsize

main_dir = "/users/Clayton/Pictures"
directory_file_list = {}
duplicate_files = 0
top_directory_file_list = 0

for dir_path, directories, files in os.walk(main_dir):
    for file in files:
#        print( " file = ", file)
#       if( ("(\.jpg|\.png|\.avi|\.mp4)$") not in file.lower() ):
#        if(  (".jpg" or ".png" or ".avi" or ".mp4" )  not in file.lower()
#why don't these work?, especially the last one. How am I to capture all
(Continue reading)