14,946 Topics

Member Avatar for
Member Avatar for Gribouillis

A feature of the doctest module can be useful when people copy and paste their idle window in the python forum: the ability to transform an example from the python interpreter into python code without the prompts [icode]>>>, ...[/icode] and the output messages. The script below permits to use this …

Member Avatar for Gribouillis
3
889
Member Avatar for JubalBarca

So, I'm writing a smallish adventure game in Python, which operates by means of commands being typed into a tkinter textbox, hitting enter or pressing a button to submit said commands, then there being a readout box that gives the results of whatever the action was. Now, what I'd like …

Member Avatar for woooee
0
3K
Member Avatar for UCHIHAOTOBI

I read the book -natural language processing with Python. and I did exactly what the author said, downloaded all packages after installation of the NLTK. then just input"from nltk.book import *" SUPPOSE: >>> from nltk.book import * *** Introductory Examples for the NLTK Book *** Loading text1, ..., text9 and …

Member Avatar for Gribouillis
0
1K
Member Avatar for abaddon2031

I am trying to do a search for sub-folders in a directory that conaint numbers. The format could be a date range for example: 1-1, 01-1, 1-01, 01-01. The first number will only go up to 12 and the second one will go as high as 31 and im trying …

Member Avatar for Gribouillis
0
448
Member Avatar for Ravi_exact

Hi, I've created new signal , where i specify list and object datatype. dataChanged = QtCore.Signal(list, object) But list and object datatype don't convey properly that what will be in list and in the object. So it would be good if we could declare something like this, dataChanged = QtCore.Signal(lst_employees, …

Member Avatar for Gribouillis
0
298
Member Avatar for mohan raj91

I want to print the string. In my code i am not getting the right string. line="\\python\001tag\file.txt" str=re.search(r"\[(0-9)+]",line) (dont use raw_string here) print str.group() This gives nothing. I want to extract 001 from there. Note: I dont want to use rawstring.because here user is getting the path from other resource. …

Member Avatar for Gribouillis
0
458
Member Avatar for vegaseat
Member Avatar for lrh9

There is a security technique known as code signing. It basically generates a certificate for your code. This certificate first certifies the author of the code. Second, it has a value generated from the code. This value is unique to that code. If any changes are made to the code, …

Member Avatar for jamercee
0
6K
Member Avatar for Needhelp2

Hi all, I have a large txt file (3 Million lines). Like to use python , to parse the file , so it can be managed by excel. I am very new with Programming and python, like to learn it. Thanks for your support... input file format: .. ... ... …

Member Avatar for Needhelp2
0
3K
Member Avatar for abaddon2031

I have a python code that reads a specific folder for specific files. Once it finds a file that matches the re.split peramiters that it is given it then writes the data to a csv file. The issue is that for every file that it loops through and writes it …

Member Avatar for abaddon2031
0
2K
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
342
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
236
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
190
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
357
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
145
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
370
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
314
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

The End.