Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

what is the use of "@aNewDecorator" and "@wraps(aFunc)" in this decorators and how can i get my output?

from functools import wraps def aNewDecorator(aFunc):     @wraps(aFunc)     def wrapTheFunction():         print("Iam doing some boring work before executing aFunc().")       &...

Python TypeError: object of type 'NoneType' has no len()

I was unable to find what is wrong in the following code, The error msg is "object of type 'NoneType' has no len()"   My Code ------> A=[31,22,14,15] def merge(list1,list2): output=[] i=0 j=0...

Python Bigquery Connection Using Google BigQuery API Key and InsertQuery?

Hello everyone, I need help to insert data into bigquery using python. I am trying to make connection using bigquery API key using this method. service= build('bigquery', 'v2', developerKey='XXXXXXXXXXXXXXXXX') print service I am not ...

How to Resolve Python Looping Function Error?

I am running a script that runs once and stops. How do I loop it infinitely?   import time outpins =  [ 4,  5,  6, 12, 13, 17 ] inpins =  [ 18, 22, 23, 24, 25, 26 ] import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM)...

How Can I Listen to Events About the USB Port

Can anyone suggest me a library to listen to events on the usb port eg i want to know when a memory is connected?

Weasyprint only gives me empty pdfs when I'm trying to print newsarticles

#!/usr/bin/python3.5 from weasyprint import HTML url = "http://ekstrabladet.dk/112/nye-oplysninger-i-30-aar-gammel-mordgaade/6579176" HTML(url).write_pdf("test.pd") The problem is that the final pdf has only part of the webpage. I...

on odoo: how shall I build a page which can show an continuous updated picture?

I wan to build a page which is opened when some page label was clicked and the page show a picture which is continuous updated by continuous latest data as shown by below picture: it receives many points of data within 1 minute and I want ...

How to support persistent connections

I am fairly new to using python and servers most of what I know I have learnt from youtube. 1.I am trying to make a persistent connection but am not sure where I am going wrong 2. I also want to be able to send large files using chunked transf...

How to find covariance Matrix?

I am very new to python, in fact this is my first code in python. I am attempting to find the covariance matrix for 4 rows of data with each element having a decreasing weight datewise   I have performed the calculations on excel al...

Making a Bar Graph on Rstudio with markdown

So I am using this data on Rstudio with markdown, but it reads that there is an error on the top line: Can you tell me how to fix this chunk of code so that it properly displays a barplot with the data from the link given? ```{r} ADHD_data ...

Import modules

I downloaded a python package, and installed it using pip command in Windows PowerShell. I cut-pasted site-package folder to the PATH where python is installed. But still when I import the module in python shell, it says that the module is not fo...

Looking for a mentor that is proficient in Python

I just started college and would like to know if someone is willing to be a mentor. I just started my freshman year at college and the teacher is starting to ask us to code already. I would like to meet someone that would be able to answer questi...

Can You Recommend Python Tutorials For Complete Beginners?

Hello Ladies & Gentlemen,  I would like to learn Python. Only latest version as of Jan 2017. I have a couple of question that I'm looking answer from you: Q1. What are your top best Python (latest version) programming tutoria...

Access Models.py from external py script

Hi, I am trying to integrate my existing code into django. How do i access models.py from my external code.I tried putting it in the same apps directory it did not work. Is there a way ?  My Case: I have a web parsing code that takes data...

its a basic question on how to calculate tax using python

Country X calculates tax for its citizens using a graduated scale rate as shown below: Yearly Income: 0 - 1000 Tax Rate: 0% Yearly Income: 1,001 - 10,000 Tax Rate: 10% Yearly Income: 10,001 - 20,200 Tax Rate: ...

How to Send a word to translation site from within a Python script?

Hi! How can I send, from within a Python script, a word to translation site and fetch the results?

Creating a backspace button on my calculator python tkinter GUI

Hello, i'm very new to python and  i would like to fix the "C" button so that it clears the last number on the display. For example 321 would become 32, i have tried a lot of things but i can't seem to get it to work, i wou...

How would I set the dict[value] to correspond to its dict[key] where the value itself is a dictionary?

How would I set the dict[value] to correspond to its dict[key]  where the value itself is a dictionary ?  I have a csv file where I am trying to count row[3] then connect it with row[0]      row[0]     &nb...

How to Write a Python program that Stores App Information in A Text File?

Write a Python program that reads in from a text file. You should briefly prepare a textfile containing information about items sold in a bakery. The information like type of buns,cookies, cakes and more with the price lists should be i...

Merging Panda Dataframes

I have two dataframes. One is user(UserID, Name) and other one is rating (srcUserId, dstUserId, RatingValue). I have to merge these two dataframes such that in place of srcUserId I get the name of the user corresponding to userid from user d...

How to change itertools.product parameters while running

Hi, I'm new in Python, so excuse me if the question may be too simple for someone. I have the following code: from itertools import product for a,b in product(range(0,10), range(a,10)): print (a,b) but it does not work, a m...

Wrong count of concatenated words from the python script

I have written a python script b making use of trie data structure to show the longest concatenated word and second longest concatenated word from a words list attached. However, I am getting a wrong count of concatenated words. Can anyone please...

How do I debug this code of the 'TypeError: 'int' object is not callable' error in Python?

Hey guys! I want to write a program that finds the sum of cubed terms. i.e. 1**3 + 2**3 + n**3 I wrote down the following code:        // n = input('Give the value of n.') n = int (n) s = ((n(n+1))/2)**2 print ('Sum...
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: