[Tutor] Visual Studio issue when pip installing mysql-python

2017-11-08 Thread Mike Nickey
Hi all,

I understand that this might be out of the scope of this list but I am
hopeful that someone has some insight on it so I can move forward with this
project. This is a hail mary attempt to get this resolved.

The issue that I am seeing is that I have a script that works well locally.
I am trying to get this to work on a virtual machine (Windows Server
2012R).
I the goal of this is to have the virtual machine run this automatically
for us.

When I am installing the dependancies for this script I am running into an
issue with :
pip install mysql-python

The full Traceback is rather long but I can post it if needed.

building '_mysql' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe
/c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1)
-D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C
6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c
/Fobuild\temp.win-amd64-3.4\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file:
'config-win.h': No such file or directory
error: command '"c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\BIN\amd64\cl.exe"' failed with exit status 2

Any ideas on how to resolve this?
I've already asked to have a linux virtual machine spun up for us but I'd
love to hear what you think.

-- 
~MEN
Portfolio 
Schedule a meeting  with me!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] SQLAlchemy

2015-01-26 Thread Mike Nickey
Hey folks,

I'm working my way through Thinkful with python and I'm trying to get a
setup working. Part of this setup is using SQLAlchemy.
While I understand this is a python tutor list, would it be OK to ask
questions like 'how do I change my SQLAlchemy URL to include a user name'
here?

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Off topic - Ruby similar list?

2014-07-09 Thread Mike Nickey
Just curious if there's a similar list like this one for Ruby-ists.
Anyone know of one or two?
TIA

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 112, Issue 29

2013-06-09 Thread Mike Nickey
Thank you Alan,
I appreciate your help.

The issue that I'm having is that split() doesn't seem to meet the need.
The words such as isn't comes back as isn't rather then isn and t.


On Sun, Jun 9, 2013 at 3:00 AM, tutor-requ...@python.org wrote:

 Send Tutor mailing list submissions to
 tutor@python.org

 To subscribe or unsubscribe via the World Wide Web, visit
 http://mail.python.org/mailman/listinfo/tutor
 or, via email, send a message with subject or body 'help' to
 tutor-requ...@python.org

 You can reach the person managing the list at
 tutor-ow...@python.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Tutor digest...


 Today's Topics:

1. Re: Splitting on punctuation (Alan Gauld)


 --

 Message: 1
 Date: Sun, 09 Jun 2013 06:48:13 +0100
 From: Alan Gauld alan.ga...@btinternet.com
 To: tutor@python.org
 Subject: Re: [Tutor] Splitting on punctuation
 Message-ID: kp14uo$773$2...@ger.gmane.org
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 On 09/06/13 00:44, Mike Nickey wrote:

  One of the tasks is to split on punctuation passed yet I'm having a bit
  more trouble then I expected.

 You do realize that split() can do that for you?
 Its not limited to splitting on whitespace?



 --
 Alan G
 Author of the Learn to Program web site
 http://www.alan-g.me.uk/



 --

 Subject: Digest Footer

 ___
 Tutor maillist  -  Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor


 --

 End of Tutor Digest, Vol 112, Issue 29
 **




-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Splitting on punctuation

2013-06-08 Thread Mike Nickey
Hey guys,

I'm working on a web-project simply to bruh up on skills and build new
ones.
One of the tasks is to split on punctuation passed yet I'm having a bit
more trouble then I expected.

Give the input of which isn't that surprising I guess.,,'.) where the
first part passed is the string and the second part is the punctuation to
split on, I'm having difficulty converting the punctuation to a split
parameter.

As you'll see I have tried various attempts at replace, strip and split but
I can't seem to get it just right.

Currently I have the following:
import string
def tokenize_query(query, punctuation):
# informational and to be removed
print 'Query passed: ', query
print 'Punctuation passed:' , punctuation
print '---'
punc = punctuation
query = query.replace(punc, )
words = query.split()
for item in words:
item = item.replace(punc,' ')
#item = item.rstrip(punctuation)
#item = item.replace(punctuation,)
print item
 tokenize_query(Dynamic programming string processing algorithms,)
print
tokenize_query(The quick! bro'wn fox! runs slowly$,,$')
print
tokenize_query(which isn't that surprising I guess.,,'.)

The output I get is:
Query passed:  which isn't that surprising I guess.
Punctuation passed: ,'.
---
which
isn't
that
surprising
I
guess.

What I should have is:
Query passed:  which isn't that surprising I guess.
Punctuation passed: ,'.
---
which
isn
t
that
surprising
I
guess

Any suggestions? and thanks in advance.

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python version 2.7 or 3.0

2013-03-12 Thread Mike Nickey
Hey all,

I'm used to python 2.7 but I'm seeing and hearing a lot about 3.0 and
wanted to ask a few questions.
I'm seeing on StackOverflow that 2.7 is the standard for those that have
libraries that haven't been ported to 3.1.2 yet. Does this mean that 2.7 is
dead or dying? Is this just a well managed marketing campaign?

If these can be simplified into layman's terms I'd really appreciate your
advice  input.

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Creating a dictionary on user filter

2012-07-19 Thread Mike Nickey
Hi All,

I have a few lists that I'm trying to put into a dictionary based on
which list the user wants to use as a filter. If the user selects 1
the the dictionary would be created using the first list as the keys
and the secondary items as the values. If the user selects 2, the
dictionary would be created with the second list as the keys, and the
remaining as the values. I think using dict(zip(firstList,
(secondList, thirdList))) is the way to go but I'm having trouble with
the placement of the items.

What I have is this:
firstList = ['a', 'b', 'c']
secondList = [1,2,3]
thirdList = [1.20, 1.23, 2.54]

What I am looking for is something like this for output:
{'a': [1, 1.20], 'b': [2, 1.23], 'c': [3, 2.54]}

What I'm now thinking is that I need to loop over each item in the
list and update the dictionary such as:
for x in range(a):
compilation = dict(zip(a[x], (b[x], c[x])))

Any help is appreciated.

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 100, Issue 58

2012-06-25 Thread Mike Nickey
 The problem with this code is that it only gets the first word beginning
 with x and the others remaisn on the original list, sorted at the end. I've
 tested on terminal many parts of the code and it whas fine, but when I run
 it complete, it does not work.

 Following is the solution of the problem. I can understand it, I just
 can't understand why my code does not work.

 #
 def front_x(words):
   x_list = []
   other_list = []
   for w in words:
     if w.startswith('x'):
       x_list.append(w)
     else:
       other_list.append(w)
   return sorted(x_list) + sorted(other_list)
 ##

I did the same exercise so maybe I can assist here. From what I see, the line...
if w.startswith('x'): seems to be ineffective.
Try using the operator that checks for equality such as
if w[0] == 'x':
This will check the first of each word for 'x' and move it to the proper list.
You should be able to figure it out from here.

Good luck!

 To download all the exercises, access:
 http://code.google.com/edu/languages/google-python-class/google-python-exercises.zip


 Thank y'all.




 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://mail.python.org/pipermail/tutor/attachments/20120625/9059f044/attachment.html

 --

 ___
 Tutor maillist  -  Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor


 End of Tutor Digest, Vol 100, Issue 58
 **



-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Sorting tuples

2012-06-20 Thread Mike Nickey
Hey all,

I'm working through the google classes to increase my python
understanding and I'm stuck on sorting tuples.
What is being asked is to sort tuples based on the second element of
the tuple in ascending order.

Given a list of non-empty tuples, return a list sorted in increasing
order by the last element in each tuple.
e.g. [(1, 7), (1, 3), (3, 4, 5), (2, 2)] yields [(2, 2), (1, 3), (3,
4, 5), (1, 7)]

What I have is
def sort_last(tuples):
# +++your code here+++
print sorted(tuples, key=lamda tuples: tuples[-1])
return

I'm stuck and don't really understand what lamda is. From various
web-boards I have seen that sorting on -1 should give me the last
element o each sub-list.  Can anyone assist?

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Sorting tuples

2012-06-20 Thread Mike Nickey
While i'm still not sure what lamda is or represents, I've found a solution.
Thank you all for your assistance, past, present and future. :)

This seems to work:
def sort_last(tuples):
return sorted(tuples, key=myDef)

def myDef(s):
return s[-1]


On Wed, Jun 20, 2012 at 4:05 PM, Mike Nickey mnic...@gmail.com wrote:
 Hey all,

 I'm working through the google classes to increase my python
 understanding and I'm stuck on sorting tuples.
 What is being asked is to sort tuples based on the second element of
 the tuple in ascending order.

 Given a list of non-empty tuples, return a list sorted in increasing
 order by the last element in each tuple.
 e.g. [(1, 7), (1, 3), (3, 4, 5), (2, 2)] yields [(2, 2), (1, 3), (3,
 4, 5), (1, 7)]

 What I have is
 def sort_last(tuples):
    # +++your code here+++
    print sorted(tuples, key=lamda tuples: tuples[-1])
    return

 I'm stuck and don't really understand what lamda is. From various
 web-boards I have seen that sorting on -1 should give me the last
 element o each sub-list.  Can anyone assist?

 --
 ~MEN



-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] getpass

2012-06-15 Thread Mike Nickey
Hey all,

I'm working on a bit of code here and I'm having an issue with
getpass. In the documentation, it says it hides the text entered

Prompt the user for a password without echoing. --
http://www.python.org/doc//current/library/getpass.html

However when I run it in Eclipse, the password is clear as day.

Here is a snippet of the code that I am working with. Any assistance
would be greatly appreciated.
=
...
print 'Connected to Gmail' + '\n'
try:
gmail_user = str(raw_input('Enter your email: ')).lower().strip()
gmail_pwd = getpass.getpass('Enter your email password: ').strip()
smtpserver.login(gmail_user, gmail_pwd)

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Finding palindromes in a list

2012-06-08 Thread Mike Nickey
I'm trying to write a bit of code that will run through a text file
and find the item or word string that is the same forward as it is
when it is revered...a palindrome. I'm having a bit of issue looping
through the wordList[] that I have created.

If you have any comments or suggestions I'd really appreciate the assistance.

Code:
def getFile():
fname = raw_input('Enter location and filename: ')
print

#attempt the open the file for reading
try:
fobj = open(fname, 'r')
except IOError, e:
print *** file open error:, e
else:
#display contents to the screen
for eachLine in fobj:
# create list here
str(eachLine).strip().split()
wordList.append(eachLine)
fobj.close()

def compareElements(wordList):
for item in wordList():
if item == item.reversed():
print item
else:
next(item)

wordList = []
getFile()
print
print Printing new Word list!!!
print wordList[:]
print \nComparing Word List!!!
compareElements(wordList)

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Finding palindromes in a list

2012-06-08 Thread Mike Nickey
Thanks guys,

Those have helped. Now a new issue comes up. The list 'palindrome' is
not being populated.  I know that there is a few in the list.  I think
this is in the compareElements def. While I'm familiar with the
.append() call I don't know why it's not populating the palindrome
list.

Thanks again for all the assistance.


CODE:
def getFile():
fname = raw_input('Enter location and filename: ')
print

#attempt the open the file for reading
try:
fobj = open(fname, 'r')
except IOError, e:
print *** file open error:, e
else:
#display contents to the screen
for eachLine in fobj:
# create list here
eachLine.strip().split()
wordList.append(eachLine)
fobj.close()

def compareElements(wordList):
for item in wordList:
if item == item[::-1]:  #wordList[item] ==
wordList[item].reverse():
print item
palindromes.append(item)

wordList = []
palindromes = []
getFile()
print \nPrinting new Word list!!!
print wordList[:]
print \nComparing Word List!!!
compareElements(wordList)
print \nPrinting palindromes
print palindromes[:]
print \nDone!!!


On Fri, Jun 8, 2012 at 6:38 PM, Dave Angel d...@davea.name wrote:
 On 06/08/2012 09:01 PM, Marc Tompkins wrote:
 On Fri, Jun 8, 2012 at 5:10 PM, Mike Nickey mnic...@gmail.com wrote:

 def compareElements(wordList):
    for item in wordList():
        if item == item.reversed():
            print item
        else:
            next(item)


 reversed() is not a string method.  To reverse a string, try something like
 this:

 if item == item[::-1]




 Also next(item) is useless and probably an error.  You do not need an
 else clause there.  the for loop takes care of those details.



 --

 DaveA




-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GameTracker help

2012-02-25 Thread Mike Nickey
Hey all,

I'm trying to wok on a game tracker for my friends. What I have here
partly works but there are areas that I want to change and some areas
that are just not working for me.

The areas that I am having difficulty with are the def pointsNeeded
and oppPointsNeeded.
What is strange to me is that I had pointsNeeded almost exactly as
oppPointsNeeded and only pointsNeeded worked.

I'd like to change this to one function since it does the same thing.
I've tried using a dictionary but that does not seem to be working
well either.

Any advice would be great.
Thanks in advance.

CODE
#===
# Get users name -- DONE
# Get Users opponent name DONE
# Get user opponents APA number --DONE
# get users APA number -- DONE
# Determine if this is 8-ball or 9-ball -- DONE
# create number of points needed to win for 9-ball
# create number of games needed to win for 8-ball
# Get Users skill level -- DONE
# get users current opponent skill level -- DONE
# get number of innings played
# number of defenses played
# record who won and lost
#===
import __builtin__
import string

pointDictionary = {1:14, 2:19, 3:25, 4:31, 5:38, 6:46, 7:55, 8:65, 9:75}

def getUserName():
return raw_input(Enter your name: )

def getUserOppName():
return raw_input (Enter your opponents name: )

def getUserNumber():
UserID = raw_input(Enter your APA ID number: )
while (str.isdigit(UserID)==False):
UserID = raw_input(That is not a proper ID. Please re-enter
your APA number: )
return UserID

def getUserOppNumber():
OppUserID = raw_input(Enter your opponents APA ID number: )
while (str.isdigit(OppUserID)==False):
UserID = raw_input(That is not a proper ID. Please re-enter
your opponents APA number: )
return OppUserID

def getGameType():
temp = 0
while temp == 0:
GameType = raw_input(Are you playing 8-ball or 9-ball? )
if GameType == 8:
print Good luck and don't get an early 8
GameType = 8
temp = 1
elif GameType == 9:
print Good luck! Let's hope you sink the stripe on the break!
GameType = 9
temp = 1
else:
print That's not a valid entry, Please try again.: 
return int(GameType)

def CheckRange8Ball(GameType, min=1, max=8):
if not min = GameType = max:
raise ValueError('Value out of range')

def getUserSkillLvl(GameType):
if GameType == 8:
UserSkillLvl = prompt = Enter your current 8-ball skill level: 
elif GameType == 9:
UserSkillLvl = prompt = Enter your current 9-ball level:

UserSkillLvl = raw_input(prompt)
UserSkillLvl = int(UserSkillLvl)

if GameType == 9:
temp = 0
while temp == 0:
if ((UserSkillLvl = 9) and (UserSkillLvl =1)):
print Thank You
temp = 1
break
elif ((UserSkillLvl 9) or (UserSkillLvl  1)):
while temp == 0:
UserSkillLvl = raw_input(Please re-enter your
9-ball skill level)
return UserSkillLvl

if GameType == 8:
temp = 0
while temp == 0:
if ((UserSkillLvl = 8) and (UserSkillLvl =1)):
print thank you
temp = 1
break
elif (UserSkillLvl 8) or (UserSkillLvl  1):
while temp == 0:
UserSkillLvl = raw_input(Please re-enter your
skill level: )
return UserSkillLvl

def getUserOppSkillLvl():
UserOppSkillLvl = raw_input(Enter your opponents current skill level: )
while (str.isdigit(UserOppSkillLvl)==False):
UserOppSkillLvl = raw_input(That is not a proper Skill Level. \
Please enter a number between 1 and 9 for 9-ball or 1 and 8
for 8-ball: )
UserOppSkillLvl = int(UserOppSkillLvl)
return UserOppSkillLvl

def getPointsNeeded():
if (GameType == 9):
for UserSkillLvl in range (0, len(pointDictionary)):
pointsNeeded = pointDictionary(UserSkillLvl)
return pointsNeeded

def getOppPointsNeeded():
if (GameType == 9):
if (UserOppSkillLvl == 9):
oppPointsNeeded = 75
elif (UserOppSkillLvl == 8):
oppPointsNeeded = 65
elif (UserOppSkillLvl == 7):
oppPointsNeeded = 55
elif(UserOppSkillLvl == 6):
oppPointsNeeded = 46
elif (UserOppSkillLvl == 5):
oppPointsNeeded = 38
elif (UserOppSkillLvl == 4):
oppPointsNeeded = 31
elif (UserOppSkillLvl == 3):
oppPointsNeeded = 25
elif (UserOppSkillLvl == 2):
oppPointsNeeded = 19
elif (UserOppSkillLvl == 1):
oppPointsNeeded = 14
return oppPointsNeeded

UserName = getUserName()
UserOppName = getUserOppName()
UserID = getUserNumber()
OppUserID = 

Re: [Tutor] GameTracker help

2012-02-25 Thread Mike Nickey
I think I found the issue. It seems that the UserOppSkillLvl wasn't
passing the integer version of this variable back.
Changing line 97 from
return UserOppSkillLvl
to
return int(UserOppSkillLvl)
 seems to have helped.

Any suggestions on how to implement the UserSkillLvl section so it's
not redundant code?

On Sat, Feb 25, 2012 at 02:07, Mike Nickey mnic...@gmail.com wrote:
 Hey all,

 I'm trying to wok on a game tracker for my friends. What I have here
 partly works but there are areas that I want to change and some areas
 that are just not working for me.

 The areas that I am having difficulty with are the def pointsNeeded
 and oppPointsNeeded.
 What is strange to me is that I had pointsNeeded almost exactly as
 oppPointsNeeded and only pointsNeeded worked.

 I'd like to change this to one function since it does the same thing.
 I've tried using a dictionary but that does not seem to be working
 well either.

 Any advice would be great.
 Thanks in advance.

 CODE
 #===
 # Get users name -- DONE
 # Get Users opponent name DONE
 # Get user opponents APA number --DONE
 # get users APA number -- DONE
 # Determine if this is 8-ball or 9-ball -- DONE
 # create number of points needed to win for 9-ball
 # create number of games needed to win for 8-ball
 # Get Users skill level -- DONE
 # get users current opponent skill level -- DONE
 # get number of innings played
 # number of defenses played
 # record who won and lost
 #===
 import __builtin__
 import string

 pointDictionary = {1:14, 2:19, 3:25, 4:31, 5:38, 6:46, 7:55, 8:65, 9:75}

 def getUserName():
    return raw_input(Enter your name: )

 def getUserOppName():
    return raw_input (Enter your opponents name: )

 def getUserNumber():
    UserID = raw_input(Enter your APA ID number: )
    while (str.isdigit(UserID)==False):
        UserID = raw_input(That is not a proper ID. Please re-enter
 your APA number: )
    return UserID

 def getUserOppNumber():
    OppUserID = raw_input(Enter your opponents APA ID number: )
    while (str.isdigit(OppUserID)==False):
        UserID = raw_input(That is not a proper ID. Please re-enter
 your opponents APA number: )
    return OppUserID

 def getGameType():
    temp = 0
    while temp == 0:
        GameType = raw_input(Are you playing 8-ball or 9-ball? )
        if GameType == 8:
            print Good luck and don't get an early 8
            GameType = 8
            temp = 1
        elif GameType == 9:
            print Good luck! Let's hope you sink the stripe on the break!
            GameType = 9
            temp = 1
        else:
            print That's not a valid entry, Please try again.: 
    return int(GameType)

 def CheckRange8Ball(GameType, min=1, max=8):
    if not min = GameType = max:
        raise ValueError('Value out of range')

 def getUserSkillLvl(GameType):
    if GameType == 8:
        UserSkillLvl = prompt = Enter your current 8-ball skill level: 
    elif GameType == 9:
        UserSkillLvl = prompt = Enter your current 9-ball level:

    UserSkillLvl = raw_input(prompt)
    UserSkillLvl = int(UserSkillLvl)

    if GameType == 9:
        temp = 0
        while temp == 0:
            if ((UserSkillLvl = 9) and (UserSkillLvl =1)):
                print Thank You
                temp = 1
                break
            elif ((UserSkillLvl 9) or (UserSkillLvl  1)):
                while temp == 0:
                    UserSkillLvl = raw_input(Please re-enter your
 9-ball skill level)
                    return UserSkillLvl

    if GameType == 8:
        temp = 0
        while temp == 0:
            if ((UserSkillLvl = 8) and (UserSkillLvl =1)):
                print thank you
                temp = 1
                break
            elif (UserSkillLvl 8) or (UserSkillLvl  1):
                while temp == 0:
                    UserSkillLvl = raw_input(Please re-enter your
 skill level: )
    return UserSkillLvl

 def getUserOppSkillLvl():
    UserOppSkillLvl = raw_input(Enter your opponents current skill level: )
    while (str.isdigit(UserOppSkillLvl)==False):
        UserOppSkillLvl = raw_input(That is not a proper Skill Level. \
        Please enter a number between 1 and 9 for 9-ball or 1 and 8
 for 8-ball: )
        UserOppSkillLvl = int(UserOppSkillLvl)
    return UserOppSkillLvl

 def getPointsNeeded():
    if (GameType == 9):
        for UserSkillLvl in range (0, len(pointDictionary)):
            pointsNeeded = pointDictionary(UserSkillLvl)
    return pointsNeeded

 def getOppPointsNeeded():
    if (GameType == 9):
        if (UserOppSkillLvl == 9):
            oppPointsNeeded = 75
        elif (UserOppSkillLvl == 8):
            oppPointsNeeded = 65
        elif (UserOppSkillLvl == 7):
            oppPointsNeeded = 55
        elif(UserOppSkillLvl == 6):
            oppPointsNeeded = 46
        elif (UserOppSkillLvl == 5

[Tutor] Creating Android Apps w/ Python

2011-11-02 Thread Mike Nickey
I'm currently taking a class on Android Development.
The instructor says that the code needed has to be done through Java.
Isn't there any way to create these same apps with Python?
I read on the Android Dev site that MonkeyRunner can assist but does
anyone else have any experience on how well this works or if Python is
only really supported through MonkeyRunner?

I am hoping that there is a Python ADK that will allow creation of
apps with Python but I haven't seen one and wanted to see what you
know is out there.
Thanks in advance.

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Finding if a passed variable is within to set parameters

2011-10-10 Thread Mike Nickey
Hey all,

I'm trying to write a def that has a check to see if the entered information is 
within a pre-determined valid set.
Below is what I have so far but it doesn't seem to be working properly.
What I want is to have the user be able to enter 1 through 8 and have the 
information pass fine but anything else would cause the user to repeat the 
process. 
I'm using a while loop to try to do this. The only other thing I can think of 
to do is incorporate a list and see if I can check the list to complete this.

Any assistance would be greatly appreciated.

def getUserSkillLvl(GameType): #GameType is an in of 8 or 9 passed to this def 
based on previous input
temp = 0
while temp == 0:
if GameType == 8:
UserSkillLvl = raw_input(Enter your current skill level: )
int(UserSkillLvl)
if ((UserSkillLvl = 8) and (UserSkillLvl =1)):
print thank you
temp = 1
break
elif (UserSkillLvl 8) or (UserSkillLvl  1):
while temp == 0:
UserSkillLvl = raw_input(Please re-enter your skill level: )
return UserSkillLvl

Best,

Mike Nickey
mnic...@gmail.com

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] declaring a blank interger

2011-10-05 Thread Mike Nickey
Hey all,

I'm sorry for such a silly question but I want to declare a blank integer for 
x.  What I have is a base for a program that I'm working on for fun. Yes, for 
fun. 
The long term goal is to create a way to log items that are currently being 
done via pencil  paper and make this easier for me and my team.

What I am running into though is how can I declare a variable to use that is 
blank at start but then gets populated later on.
Here is what I have so far.

Thanks in advance

import string

#Variable declarations
UserName = string
integer x

def getUserName():
UserName = raw_input(Enter your name: )
return UserName

def getUserNumber(x):
x = input(Enter a number:) #This will be the users unique ID number
return x


getUserName()
getUserNumber(x)

print UserName, x

Best,

Mike Nickey
mnic...@gmail.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Accessing Specific Dictionary items

2011-08-01 Thread Mike Nickey
Hi all,

I'm trying to access and use specific items within a dictionary that
is returned but am having issues in doing so.
[{'city': 'Sunnyvale', 'region_name': 'CA', 'area_code': 408,
'metro_code': 'Santa Clara, CA', 'country_name': 'United States'}]

How can I populate a list of many different returns so that I have a
list that contains all the cities and in line with the item that is
referenced.

The first step is to populate the list unsorted as it needs to be in
correlation to the item that it came from.
Thanks for your help.

-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Accessing Specific Dictionary items

2011-08-01 Thread Mike Nickey
The input being used is through pygeoip.
Using this I am pulling the data by IP and from what I am reading this
populates as a dictionary.

Here is some of the output that I can show currently
[{'city': 'Buena Park', 'region_name': 'CA', 'area_code': 714},
{'city': 'Wallingford', 'region_name': 'CT', 'area_code': 203},
{'city': 'Schenectady', 'region_name': 'NY', 'area_code': 518},
{'city': 'Athens', 'region_name': '35'}]

I'd like to have an output similar to this:
'Buena Park', 'Wallingford', 'Schenectady','Athens' pulled by the
city keys that are used in the returns. I think the easiest way to
approach this would be simply to use the .append and populate a list
but I don't know how to pull an item by key value from the dictionary
returns.

I hope this helps clear some confusion and thanks in advance.


On Mon, Aug 1, 2011 at 15:14, ian douglas ian.doug...@iandouglas.com wrote:
 On 08/01/2011 03:05 PM, Mike Nickey wrote:

 Hi all,

 I'm trying to access and use specific items within a dictionary that
 is returned but am having issues in doing so.
 [{'city': 'Sunnyvale', 'region_name': 'CA', 'area_code': 408,
 'metro_code': 'Santa Clara, CA', 'country_name': 'United States'}]

 How can I populate a list of many different returns so that I have a
 list that contains all the cities and in line with the item that is
 referenced.

 The first step is to populate the list unsorted as it needs to be in
 correlation to the item that it came from.
 Thanks for your help.



 Could you give us examples of what you want the list to look like? It will
 help us direct you to an answer.




-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Accessing Specific Dictionary items

2011-08-01 Thread Mike Nickey
Thank you all, I have found the assistance needed and the guidance
here was wonderful.

I needed to add a line in the middle that did a temporary storage for
me before trying to append this to the list. It might not be the most
elegant solution but it works.

On Mon, Aug 1, 2011 at 17:28,  eire1...@gmail.com wrote:
 Dictionaries are objects and you access their attributes through keys.

 So, let's say I had a dict: d = {'city':'plattsburgh'}

 I would thus access the attribute by doing this

 d['city']

 You can store that value to a variable

 Or you can append to a list directly.

 l = []

 for d in yourdict:
     l.append(d['city'])


 Sent from my Verizon Wireless BlackBerry

 -Original Message-
 From: Mike Nickey mnic...@gmail.com
 Sender: tutor-bounces+eire1130=gmail@python.org
 Date: Mon, 1 Aug 2011 15:26:32
 To: ian douglasian.doug...@iandouglas.com
 Cc: tutor@python.org
 Subject: Re: [Tutor] Accessing Specific Dictionary items

 The input being used is through pygeoip.
 Using this I am pulling the data by IP and from what I am reading this
 populates as a dictionary.

 Here is some of the output that I can show currently
 [{'city': 'Buena Park', 'region_name': 'CA', 'area_code': 714},
 {'city': 'Wallingford', 'region_name': 'CT', 'area_code': 203},
 {'city': 'Schenectady', 'region_name': 'NY', 'area_code': 518},
 {'city': 'Athens', 'region_name': '35'}]

 I'd like to have an output similar to this:
 'Buena Park', 'Wallingford', 'Schenectady','Athens' pulled by the
 city keys that are used in the returns. I think the easiest way to
 approach this would be simply to use the .append and populate a list
 but I don't know how to pull an item by key value from the dictionary
 returns.

 I hope this helps clear some confusion and thanks in advance.


 On Mon, Aug 1, 2011 at 15:14, ian douglas ian.doug...@iandouglas.com wrote:
 On 08/01/2011 03:05 PM, Mike Nickey wrote:

 Hi all,

 I'm trying to access and use specific items within a dictionary that
 is returned but am having issues in doing so.
 [{'city': 'Sunnyvale', 'region_name': 'CA', 'area_code': 408,
 'metro_code': 'Santa Clara, CA', 'country_name': 'United States'}]

 How can I populate a list of many different returns so that I have a
 list that contains all the cities and in line with the item that is
 referenced.

 The first step is to populate the list unsorted as it needs to be in
 correlation to the item that it came from.
 Thanks for your help.



 Could you give us examples of what you want the list to look like? It will
 help us direct you to an answer.




 --
 ~MEN
 ___
 Tutor maillist  -  Tutor@python.org
 To unsubscribe or change subscription options:
 http://mail.python.org/mailman/listinfo/tutor




-- 
~MEN
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor