Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Running tests in a sibling directory to code
Post: RE: Running tests in a sibling directory to code

use source as top level package: don't use package_dir, look for packages in the project root dir (packages=find_packages() without explicitly stating where More info on packages remapping can be fo...
MckJohan General Coding Help 1 2,698 Nov-07-2019, 11:28 PM
    Thread: Keyword can't be an expression
Post: RE: Keyword can't be an expression

you forgot to post your AthleteList function.
MckJohan General Coding Help 2 2,839 Nov-06-2019, 11:32 PM
    Thread: Execute .sql file in python
Post: RE: Execute .sql file in python

hmmm... been awhile working with MySQL, can't remember exactly when did they support OVER() clause. I hope the API already implemented.
MckJohan General Coding Help 3 14,255 Nov-05-2019, 08:55 AM
    Thread: Details of attachment files in a msg file such as file names save into a python list
Post: RE: Details of attachment files in a msg file such...

use other method for i in msg.Attachments: print(i)
MckJohan General Coding Help 2 5,687 Nov-05-2019, 06:22 AM
    Thread: csv reader
Post: RE: csv reader

please visit this link. ALL ABOUT CSV IN PYTHON this all what you need from basic to advance:
MckJohan General Coding Help 3 5,329 Nov-05-2019, 05:48 AM
    Thread: How do I map a list of values to specified colors?
Post: RE: How do I map a list of values to specified col...

is this what you are looking for? >>> import numpy as np >>> delta = 0.025 >>> x = y = np.arange(-3.0, 3.0, delta) >>> x array([-3.0000000e+00, -2.9750000e+00, -2....
MckJohan General Coding Help 4 2,555 Nov-05-2019, 05:41 AM
    Thread: File encryption
Post: RE: File encryption

good lord. we need crystal ball to understand this. :D
MckJohan General Coding Help 5 2,852 Nov-05-2019, 05:34 AM
    Thread: cv2 show image
Post: RE: cv2 show image

i think he forgot to add the + filename which coming from filename = "opencv_frame_{}.png".format(img_counter)
MckJohan General Coding Help 4 10,074 Nov-04-2019, 11:41 PM
    Thread: KeyError -read multiple lines
Post: RE: KeyError -read multiple lines

can you investigate below code. especially the value of ps, and the content on it. probably add some couple of print statement. KeyError should not be difficult to find out. # creating PorterSte...
MckJohan General Coding Help 2 3,443 Nov-04-2019, 11:37 PM
    Thread: Python learning strategy
Post: RE: Python learning strategy

master the fundamentals, like Iterative Loop Statement, Boolean Logic, Statements Blocks, Conditional Statement and etc... then followed by various operations like Operations on Generic Containers Op...
MckJohan General Coding Help 6 3,221 Nov-04-2019, 01:35 AM
    Thread: Polymorphism not working with a call to a abstract method
Post: RE: Polymorphism not working with a call to a abst...

can you explain a little bit more on the problem? from LDA class, the Process function is calling writeAccumulator which doesn't have implementation. do you want python to search the implementation ...
MckJohan General Coding Help 3 2,315 Nov-04-2019, 01:24 AM
    Thread: combining lists in a dictionary
Post: RE: combining lists in a dictionary

just straightly pass the dict to sum function. 2nd arguments is just optional to add the result. hope this will help. >>> dict = {'a':[1,2,3,4,5], 'b':[5,10,15,20]} >>> sum(dict['a'...
MckJohan General Coding Help 9 3,431 Nov-03-2019, 11:53 PM
    Thread: For loop not working
Post: RE: For loop not working

it's because you put the return statement directly in your for loop. instead of storing the value and continue loop. not sure what you exactly trying to do, but i'm guessing you wanted to return the e...
MckJohan General Coding Help 4 2,801 Nov-03-2019, 11:43 PM
    Thread: Why isn't this code working?
Post: RE: Why isn't this code working?

its not working because, find() method returns the lowest index of the substring if it is found in given string. If its is not found then it returns -1. >>> x='012345horwitz678910' >>&...
MckJohan General Coding Help 2 1,756 Nov-03-2019, 11:30 PM
    Thread: class AttributeError:
Post: RE: class AttributeError:

portOptical_details['interface'] = cli_interface(portOptical_details['portID'])
MckJohan General Coding Help 2 1,760 Nov-02-2019, 08:04 AM
    Thread: refactoring
Post: RE: refactoring

The Zen of Python: Readability counts. just kidding. :D
MckJohan Homework 8 3,475 Nov-02-2019, 07:53 AM
    Thread: sum of number's caracters
Post: RE: sum of number's caracters

you can use python built-in command. sum(map(int, str(x)))Point to study. builtin function map, str, and study about Python iterable.
MckJohan Homework 7 2,612 Nov-02-2019, 06:26 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020