15,179 Topics

Member Avatar for
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
540
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
473
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
Member Avatar for vegaseat

Because of their demand only nature, generators are ideal for finding the combinations of larger sequences. This code applies a Python generator to find the combinations of the sequence. Since permutations are a special case of combinations for all the items in a sequence, I have expanded the result to …

Member Avatar for Stefan_3
1
431
Member Avatar for MartinIT2type

Hello, I'm pretty new to Python, and I've been making simple projects to practice in. The issue I've run into though is I'm creating a GUI (Using Tkinter with Python 2.6) to take a text input and bring out "Name". What I want to do though is keep that "Name" …

Member Avatar for jules1234567
0
8K
Member Avatar for Chrome 142

Hi, I am trying to make my "Save All" button to save whatever is selected from the option menu or dropdown to that particular file. So if I have "animation" selected from the option menu it saves to the animation file 'ji.txt','r+'. Or if I have "compositing" selected from the …

Member Avatar for Chrome 142
-1
403
Member Avatar for b6huss

Hi, I am extremely new to python, and I am completely stuck regarding filtering the contents of a list. I have a list of the first thirty elements, and i have been told to identify any beginning with the letter 's' and any that are four letters long. I have …

Member Avatar for snippsat
0
400
Member Avatar for krystosan

Does anyone have idea how to fetch a file split into defined number of ranges using the requests module instead of urllib2 ?

Member Avatar for snippsat
0
124
Member Avatar for awahqn

Hi, I have a code in perl that does some mail things and I would like to translate it to perl can someone help me please? I dont know perl so i want it in python so i can edit it. here is the code: #!/usr/bin/perl -w # USAGE : …

Member Avatar for TrustyTony
0
214

The End.