15,185 Topics
| |
I am working in an older version of Python (2.6, I believe). I cannot update to the latest version because it is not currently compatible with the other program I need the code to run with so, unfortunately, the "decimal" module is not available to me (as far as I … | |
Hello python gurus! I dabble in python casually, and I've just recently begun to use classes. For the most part they've proven very helpful, but this error has me stumped: [CODE]creature.health=creature.health-2*creature.metabolsim/resolution AttributeError: predator instance has no attribute 'metabolsim'[/CODE] Here's the full code of the program (it's designed to run a … | |
Hello, kind citizens of DaniWeb! I beg your assistance in the solution of my problem! I was trying to create a simple audio player using Tkinter and pygame, pygame being the best library that included audio playback I could find (by the way, DO NOT USE SNACK!!). Anyway, I was … | |
I am working with a CSV file with multiple rows, which I need to be able to access individual data elements from a row so I can assign them to variables and send them to the other program I am working with in a loop, going through each individual row. … | |
I'm trying to embed python script in c in windows. [CODE] #include <Python.h> int main(int argc, char *argv[]) { Py_Initialize(); PyRun_SimpleString("from time import time,ctime\n" "print 'Today is',ctime(time())\n"); Py_Finalize(); return 0; } [/CODE] from the python documentation. I'm compiling with Microsoft's lcc. I'm getting following errors. Error c:\lcc\examples\python\pyembed.c 7 undefined reference … | |
this prints all five iterations. cani make it only print the last iteration? [CODE]key1 = [' ','a','b','c','0','1','2','3'] out = '' inpt = raw_input('enter text:') for i in inpt: if i in key1: out = out + key1[key1.index(i)+3] print out[/CODE] | |
I am newbie in Python and given a task from my boss to do this : 1. Grab streaming(real time) data from twitter using PyCurl connection and output in JSON 2. Parsing using NLTK and Regular Expression 3. Save it to database file(MySQL) Note : i took the data from … | |
Hi any idea of how to parse a file like this. The problem that I found reading a line a putting into a list that it does not respect the blanks, I need to parse first 9 positions, then 8 positions then 8 positions, then 7, then 7 then 7 … | |
Hello I need to rename a folder within / inside a ZIP file, preferably without extract it and compress it off-course. How can I do this (only with free help stuff if needed) ? Thanks | |
I'm frustrated by the nature of time.sleep(), which prevents the script from doing anything else during the allotted time period. For example, I have: [CODE]while True: checkSomething() time.sleep(0.1) print 'hello'[/CODE] In this case, "hello" is never printed. I really want to check something every few milliseconds, but I also need … | |
Ive written a small program to convert celcuis o Fahrenheit and vice versa. The script as it stands works : [CODE]#!/usr/bin/python import sys def convert(t,fc): if t == "c": print (fc * 9) / 5 + 32,"Degress Fahrenheit" elif t == "f": print (fc - 32) / 9 * 5,"Degress … | |
i searched the internet and found no scripts for dynamic text (user input, process and output) for blender game engine. id appreciate any help. i can only make the user type in the game but could not get it to be saved in a global variable which i will use … | |
Hi, I'm new to Python, I'm practicing queries sqlite3 database, I will present what I have so far. until now I have not seen an example of how to reflect queries a database using wxPython I hope I help, do not write very good English. frame.py import wx import sqlite3 … | |
I am just learning python. I am switching from visual basic so this is a bit new to me. I am trying to write a loop for a super small script. It is below I am trying to understand the def f() how to loop that short code over and … | |
[B][LIST=1] [*]it's very exciting to be alive in this age of technological revolution and deep spiritual awakening. for me, to be fulfilled means to be fully engaged expanding your knowledge and wisdom and giving back to the society while you remain happy and true to your mission. i would like … | |
I have two text files containing multiple lines of text from a datalogger, and I need to compare the two files and save the difference into a third text file. ie.... text1: 10/13/01, 21:34:23, 4324 10/14/01, 09:12:32, 3423 10/15/01, 04:45:54, 7834 text2: 10/12/01, 43:34:34, 6453 10/13/01, 21:34:23, 4324 10/14/01, 09:12:32, … | |
for the past ten years i have tried without much success to program in c, c++, java and c# .net. my major problem has been inconsistency and lack of focus and direction. now, i want to start all over again with Python as my language of choice. what must i … | |
Hi all, I'm running a python program that takes to long to run - several days on a normal machine. To make things faster, I have decided to use a cluster of giant computers to run this code. Does anyone know how to use Message Passing Interface (MPI) in python … | |
Trying to build a simple python script on my mac, but the mac is 64 bit and apparently does not want to play nice. Does anyone know of any workarounds or if I am missing something? command i am running is python setup.py py2app -A output is: error: argv-emulation is … | |
Hi Friends, I want to learn web application development. I have good experience in C programming language and no other language. Can you please suggest me where to start with? I have already dived into Python a bit, so I searched the net for some good framework and got Django. … | |
Hi, I have a thousands of IP addresses, repeating randomly in my database and I wish to print each IP address along with the number of times they are repeated. For example, 162.10.2.1 162.10.2.1 162.10.2.1 192.34.1.10 172.11.2.9 192.34.1.10 192.34.1.10 Output: 162.10.2.1 - 3 192.34.1.10 - 3 172.11.2.9 - 1 I … | |
Hi All Please some one Help me find out why this code doesn't work: [code=python]codes=['zlib', 'zip', 'base64', 'hex', 'utf-8'] def encoder(str, i): return str.encode(codes[i]) def decoder(str, i): return str.decode(codes[i]) en = encoder('Some string here', 2) print en[/code] | |
[CODE]title = 'Pmw.NoteBook demonstration' # Import Pmw from this directory tree. import sys sys.path[:0] = ['../../..'] import Tkinter import Pmw class Demo: def __init__(self, parent): # Create and pack the NoteBook. notebook = Pmw.NoteBook(parent) notebook.pack(fill = 'both', expand = 1, padx = 10, pady = 10) # Add the "Appearance" … | |
Hello everyone! I've started developing a little application for one of my friends, which he will use at work to measure his hours working + the time he has breaks. I wanna do this in python cause, I just started with this language and wanna get more fimiliar with it. … | |
This does not look very efficient with transponation, sort and transponation back, so I am happy to hear about better alternatives. | |
Hello, I have to append 30 Excel 2007 files, each with 6700 columns, into one. The problem is that in these files the columns are not in the same order(the column names are the same in all the files). Im having Python27 with openpyxl, Win7, MS Office 2007, MS SQL … | |
Another task from C++ forum is trivial in Python even taking handicap of not using Counter. | |
I'M working my way through a python book and I've just come to a section on python web programming. Here's what it's had me to do. Create a folder called "public_html" in my home directory "developer", note that this is in linux system. Inside that folder create a file called … | |
My not OO version of timer for work and pause time (but it does use attributes for functions, which are objects, to avoid global declarations in functions). | |
Hey there, i would like to do a rank of the averages, but when i click in the button ranking, it says that global name 'media1' is not defined. can someone help me please? thanks in [CODE]# -*- coding: cp1252 -*- import wx class duff(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,wx.ID_ANY,'Duffan Formula', size=(400,370)) … |
The End.