Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Python UI - Getting Label to show to left of QLineEdit
Post: RE: Python UI - Getting Label to show to left of Q...

Disregard. Found a few mistakes within my code and got it to run successfully. Thanks for viewing. **tongue**
ijosefson Homework 1 2,887 Nov-11-2017, 01:54 AM
    Thread: Python UI - Getting Label to show to left of QLineEdit
Post: Python UI - Getting Label to show to left of QLine...

I would like the QLineEdit field to follow the label. Right now the label lives in the upper left hand corner of the dialogue box. """ Import block """ from PyQt4 import QtCore from PyQt4 import...
ijosefson Homework 1 2,887 Nov-10-2017, 10:45 PM
    Thread: Command line inputs not printing to Log File
Post: Command line inputs not printing to Log File

Requirement: print out the command line prompts the user enters into a log file. Problem: line 38, the prompts don't seem to write to the log file. Code: #! /usr/bin/env python3 import sys import os...
ijosefson Homework 1 3,356 Oct-19-2017, 03:15 AM
    Thread: trouble importing class definition from one .py into another
Post: RE: trouble importing class definition from one .p...

It started working for me as well. Not sure why, I didn't change anything **think**
ijosefson Homework 3 3,363 Oct-16-2017, 05:14 AM
    Thread: logic comparater based on dictionary values
Post: RE: logic comparater based on dictionary values

if __name__ == "__main__": a = {"10-01-2014":(10, 11.25), "10-02-2014":(11, 12.25), "10-03-2014":(12, 13.25)} if (v1 in a()) < 0: print('Value is negative!') else: print...
ijosefson Homework 3 3,239 Oct-16-2017, 04:50 AM
    Thread: logic comparater based on dictionary values
Post: logic comparater based on dictionary values

I have the following 'dictionary': a = {"one":(10, 11.25), "two":(11, 12.25), "three":(12, 13.25)} I would like to build an 'if statement' based on on the first value of each pair (i.e. in this examp...
ijosefson Homework 3 3,239 Oct-16-2017, 03:56 AM
    Thread: trouble importing class definition from one .py into another
Post: trouble importing class definition from one .py in...

Problem: I'm having issues calling classes in a program. I created a program named example.py which has the following code: class ExampleBase: """ This is the ExampleBase class """ ...
ijosefson Homework 3 3,363 Oct-16-2017, 02:38 AM
    Thread: Presenting data from a dictionary in a basic table
Post: RE: Presenting data from a dictionary in a basic t...

Thanks @Larzo60+! That did the trick. Any idea on how to print the dictionary keys and values in columns inside the __str__ method? With the way my code is written now the output I get is: Keys ...
ijosefson Homework 3 3,318 Oct-16-2017, 01:44 AM
    Thread: Presenting data from a dictionary in a basic table
Post: Presenting data from a dictionary in a basic table

Requirement: present keys and values from a dictionary w/ headers via a __str__ method. Also present an additional value calculated in an earlier method ('total_STK'). Error being encountered now| A...
ijosefson Homework 3 3,318 Oct-15-2017, 11:18 PM
    Thread: Summing product of tuples inside a dictionary
Post: RE: Summing product of tuples inside a dictionary

Ok, got it to work. Thank you!!
ijosefson Homework 7 4,299 Oct-15-2017, 09:50 PM
    Thread: Summing product of tuples inside a dictionary
Post: RE: Summing product of tuples inside a dictionary

Traceback: line 36 AttributeError: 'ExampleBase' object has no attribute 'compute_value'
ijosefson Homework 7 4,299 Oct-15-2017, 09:19 PM
    Thread: Summing product of tuples inside a dictionary
Post: RE: Summing product of tuples inside a dictionary

@buran thanks! that totally works! I've simplified the code and added your summation scheme. I believe I have a syntax error now? class ExampleBase: def __init__(self, company_name="N/A", stock_...
ijosefson Homework 7 4,299 Oct-15-2017, 09:11 PM
    Thread: Summing product of tuples inside a dictionary
Post: Summing product of tuples inside a dictionary

I'm having trouble figuring out how to implement this. I have a dictionary with keyed touples. I would like to multiply the 2 touples and sum for every dictionary key. I've created two classes. The f...
ijosefson Homework 7 4,299 Oct-15-2017, 07:48 PM
    Thread: List not passing between methods inside a class definition
Post: RE: List not passing between methods inside a clas...

Thanks all!!
ijosefson Homework 5 4,444 Oct-15-2017, 07:15 PM
    Thread: List not passing between methods inside a class definition
Post: RE: List not passing between methods inside a clas...

Thanks for the reply! I've updated the code per your recommendations :) class try1: def __init__(self, a=None): self.a = a print(a) return def add(self, b): ...
ijosefson Homework 5 4,444 Oct-14-2017, 10:55 PM
    Thread: List not passing between methods inside a class definition
Post: List not passing between methods inside a class de...

I am trying to create a simple class that inputs a list then appends to the list with a function called "add" which is also defined in the same class. I keep getting this error: 'list' object has no ...
ijosefson Homework 5 4,444 Oct-14-2017, 10:35 PM

User Panel Messages

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