15,185 Topics

Member Avatar for
Member Avatar for acurit1

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.

Member Avatar for Hiroshe
0
1K
Member Avatar for dumicom

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 …

Member Avatar for Gribouillis
0
345
Member Avatar for dumicom

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 …

-1
169
Member Avatar for Atomicquasar

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 …

Member Avatar for Gribouillis
0
332
Member Avatar for dumicom

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 …

Member Avatar for Gribouillis
0
2K
Member Avatar for Anthony_7

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 …

Member Avatar for Anthony_7
0
238
Member Avatar for sneekula

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 …

Member Avatar for entropicII
0
44K
Member Avatar for dumicom

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 …

Member Avatar for Gribouillis
0
2K
Member Avatar for thekilon

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 = …

Member Avatar for thekilon
0
2K
Member Avatar for dumicom

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 = [] …

Member Avatar for Gribouillis
0
1K
Member Avatar for toll_booth

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 …

0
191
Member Avatar for abaddon2031

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 …

Member Avatar for abaddon2031
0
358
Member Avatar for mark103

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 …

Member Avatar for slate
0
147
Member Avatar for dumicom

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') …

Member Avatar for dumicom
0
5K
Member Avatar for mark103

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 …

Member Avatar for woooee
0
2K
Member Avatar for ndombko1

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 …

Member Avatar for ndombko1
0
372
Member Avatar for Yamil_1

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 …

Member Avatar for Hiroshe
0
2K
Member Avatar for ben.juarez.773

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 …

Member Avatar for ben.juarez.773
0
316
Member Avatar for JonKho

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 …

Member Avatar for vegaseat
0
3K
Member Avatar for Gribouillis

This snippet defines a function [icode]mousepos()[/icode] which gets the mouse position on the screen. The package python-xlib is required.

Member Avatar for woooee
1
6K
Member Avatar for ndombko1

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 …

Member Avatar for Gribouillis
0
126
Member Avatar for A-M-G

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 …

Member Avatar for Gribouillis
0
5K
Member Avatar for flebber

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 …

Member Avatar for Yamil_1
0
658
Member Avatar for kxjakkk

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 …

Member Avatar for kxjakkk
0
273
Member Avatar for DragonMastur

I want to make a game that requires the arrow keys to be pressed. How do I detect if a key has been pressed?

Member Avatar for Gribouillis
0
542
Member Avatar for lewashby

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 …

Member Avatar for snippsat
0
817
Member Avatar for kartikdani

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 …

0
147
Member Avatar for kxjakkk

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 …

Member Avatar for snippsat
0
475
Member Avatar for vegaseat

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 …

Member Avatar for snippsat
2
1K
Member Avatar for vegaseat

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 …

Member Avatar for Stefan_3
1
2K

The End.