15,185 Topics
| |
I am trying to add new data to my mysql database using tkinter in python. Does anyone have any best practices for doing this? I have tried thus far to no avail. thanks in advance for any help. | |
| Hi, this program of mine can plot timestamp & irradiance but how can i plot another line of data for temperature? This is my txt data: TimeStamp,Irradiance,Temperature 21/7/2014 0:00,0.66,26.2 21/7/2014 0:00,0.71,23.4 21/7/2014 0:00,0.65,25.4 21/7/2014 0:00,0.67,25.3 21/7/2014 0:01,0.58,30.5 21/7/2014 0:01,0.54,26.7 21/7/2014 0:01,0.63,25.5 21/7/2014 0:01,0.65,26.9 21/7/2014 0:02,0.64,22.2 and this is a snippet … |
| Hi, How can i find the maximum/minimum of a data every 24 hours. My Python delimited txt file has over 2 days worth of data This is a snippet of how my txt file data look like: TimeStamp,Irradiance,AMB_Temp 21/7/2014 0:00,5.6,25.6 21/7/2014 0:01,4.6,24.6 21/7/2014 0:02,5.6,22.6 21/7/2014 0:03,4.7,25.6 21/7/2014 0:04,5.3,24.6 21/7/2014 0:05,5.2,25.6 … |
| In my python class, we are using python 3.4.1 And we are typing in the programs from the book. Well, I've typed it in correctly and the output still doesn't align the decimal points. Can anyone help? It would be greatly appreciated. Here's the program code: # This program displays … |
| Hi, is there a simple way to convert the xls file to txt file to fit my program's code. import matplotlib.pyplot as plt x = [] y = [] t = [] fig = plt.figure() rect = fig.patch rect.set_facecolor('#31312e') **readFile = open('data.xls', 'r') sepFile = readFile.read().split('\n') readFile.close()** for idx, plotPair … |
This script of mine is storing a blank file with no .html or .py extension on my FTP server, I think it has to do with the fact that I have the file already opened in the later code, any help? Essentially this script is going to let me edit … | |
I asked that in another thread, but it got lost: [QUOTE]When do you use root.quit() and when do you use root.destroy() to exit a Tkinter program?[/QUOTE] Also, can you intercept an exit when you use the little x in the title bar, just to affirm that you really want to … | |
| Hi Guys, I'm Using Python 2.7.3 This is my txt file: TimeStamp,Irradiance 21/7/2014 0:00,0.66 21/7/2014 0:00,0.71 21/7/2014 0:00,0.65 21/7/2014 0:00,0.67 21/7/2014 0:01,0.58 21/7/2014 0:01,0.54 21/7/2014 0:01,0.63 21/7/2014 0:01,0.65 21/7/2014 0:02,0.64 21/7/2014 0:02,0.63 21/7/2014 0:02,0.63 21/7/2014 0:02,0.64 . . . . 22/7/2014 23:57,0.53 22/7/2014 23:58,0.69 22/7/2014 23:58,0.61 22/7/2014 23:58,0.65 22/7/2014 23:58,0.59 … |
I have this code. Its not the entire code because its a Blender addon with many lines that are unrelated to sockets so I give here only the part that deals with the sockets which I kept isolated from the rest of the program. def create_thread(): global threadSocket,listening threadSocket = … | |
| Hi Guys, I'm using Python 2.7.3, How can I ask the user to enter "from datetime" & "to datetime" then plot the graph For eg. when user from datetime: 21/7/2014 0:00 to datetime: 22/7/2014 23:57 from datetime import datetime import matplotlib.pyplot as plt import matplotlib.dates as mdates x = [] … |
Let's say I have a 10X10 array that is a multiplication table, multiplied times some arbitrary integer constant. For this example, pretend that constant is 5. So the first row would be 5, 10, ..., 45, 50; the second row would be 10, 20, ..., 90, 100; etc. When doing … | |
Im working on a code that loops through a folder break up the file names in it into specific parts and then reads off sertain parts of the broken name and writes it to a csv sile. The files ser formated as follows test_PAQT_B2H.csv, test_PAQT_B4.csv, and test_PINI_B1H.csv. when it jsut … | |
Hi all, I need your help, I'm working on my python script to get the list of channels and programs when I pulled the data from sqlite3 database. I'm using the variable of channel_per_page to get the range from 0 to 7 for channels that I want to pull the … | |
| hi guys below is my attempted code, how can i plot date and time(x-axis) versus a value (y-axis) import matplotlib.pyplot as plt from datetime import time, datetime x = [] y = [] t = [] fig = plt.figure() rect = fig.patch rect.set_facecolor('#31312e') readFile = open('data.txt', 'r') sepFile = readFile.read().split('\n') … |
Hi all I need your help, I'm working on my python script to fetch the list of channels from the sqlite3 database. I'm fetching 7 channels to set each channel in each label control 4010, 4011, 4012, 4013, 4014, 4015 and 4016. When I fetch the list of channels to … | |
Hello I need to add a zero in front of a number if it is 3 or less so that it has 4 digits total. I only need this for row 6 or row 5 to be python specifc. I need this to write to the same csv file. AFI12001 … | |
| I have to do a project based on the Internet of Things. It's a project that seems simple. But I need to control multiple devices through software and need help in the control part of of RS232. I have a board with Linux Mint and is the ttyUSB0 port I … |
I'm trying to prefill webforms in iframes using Requests. If that can't be done, does anyone have a script I can use that works with webbrowser? I like that it calls the default web browser in just about any system, which is great for my Android applications. I've tried using … | |
Dear all, Currently I am facing the problem on getting the resources for getting Tkinter and pygame to work together. Sadly, I do not have any leads til now(Which worries me alot!! :( ) so I hope the people here can point me to the correct direction. So basically I … | |
This snippet defines a function [icode]mousepos()[/icode] which gets the mouse position on the screen. The package python-xlib is required. | |
Hello I need to add a zero in front of a number if it is 3 or less so that it has 4 digits total. I only need this for row 6 or row 5 to be python specifc. I need this to write to the same csv file. AFI12001 … | |
| I asked this question on StackOverflow and they just linked me to other questions that I already read and tried. I have been trying to create a zip file using zipfile in Python, but it keeps zipping all folders that are included in the absolute path. I just want to … |
Just looking for a push in the right direction. I am overwhelmed by the choice with python at the moment. What are the best tools for managing consitent ETL operations with data in XML and CSV formats to database, graphs and in future a web app. for example should I … | |
My code is the following: import cgi data = cgi.FieldStorage() productdescription = data.getvalue('product_description') listprice = data.getvalue('list_price') discountpercent = data.getvalue('discount_percent') def calc(discountpercent): if discountpercent > 100: raise ValueError("Percentage discount cannot exceed 100%") elif discountpercent < 100: percent = float(discountpercent) / 100 discount = float(listprice) * percent return discount else: raise ValueError("Invalid … | |
I want to make a game that requires the arrow keys to be pressed. How do I detect if a key has been pressed? | |
builtins.UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 14: invalid continuation byte I'm getting the following error that pops up not in my script but in the codecs.py file. I've used code exactly like this in another program and it worked just fine. Any ideas? Script below. #/usr/bin/env python3 … | |
i am using cartridge-mezzanine for site but now it not saved order when i goes in complete.html it shows a "page not found error" because it can't access in order object in shop/views.py in def complete(request, template="shop/complete.html"): try: order = Order.objects.from_request(request) except Order.DoesNotExist: raise Http404 items = order.items.all() how i … | |
I'm trying to make a calculator of a sort in python that works on a local web server. I have the localhost all set up and all. import cgi data = cgi.FieldStorage() product_description = data.getvalue('product_description') list_price = data.getvalue('list_price') discount_percent = data.getvalue('discount_percent') total = data.getvalue('total') def total_price(): data.getvalue('total') - discount return … | |
This program takes a text string and creates a list of words. Any attached punctuation marks are removed and the words are converted to lower case for sorting. Now you can generate a dictionary of the words and their frequencies. The result is displayed using a sorted list of dictionary … | |
The Fibonacci series of numbers was used by Leonardo of Pisa, a.k.a. Fibonacci (around the year 1200), to describe the growth of a rabbit population. The series has been noted to appear in biological settings, such as the branching patterns of leaves in grasses and flowers. We take a look … |
The End.