15,190 Topics

Member Avatar for
Member Avatar for jamseyjames

How would you go about extracting part of a key from a dictionary. I have a text file that lists about 1000 birthdays Ex. 1/2/1980 I want to extract just the year portion from the dictionary and then run a count against each year. I have no problems with any …

Member Avatar for richieking
0
82
Member Avatar for Simplicity.

My code tries to solve an optimization problem constrained to hyperbolic PDE by matching a numerical solution to a desired one. The basic idea is that: I've initial condition "U" as input which is being updated by this line: U = Initialize(Update_Design_Parameter(U)). I expect that updated U will affect all …

Member Avatar for Gribouillis
0
163
Member Avatar for silence02

Hello all. I am new to programming, taking my first class in college. Im enjoying it a lot so far, and much of the info on daniweb has been a huge help. Due to some unforeseen circumstances, I had to miss class and am now having some troubles with a …

Member Avatar for silence02
0
3K
Member Avatar for kinto

Hello, I have some code that passes arguments between functions, though I am failing to understand why my code isn't working. This is the relevant section of my Dijkstra's algorithm code: [CODE]def network(): f = open ('network.txt', 'r') network = [[int(node) for node in line.split(',')] for line in f.readlines()] print …

Member Avatar for kinto
0
3K
Member Avatar for kinto

Hello, I am having some trouble in working out the distance of each node from the starting node in my Dijkstra Algorithm code. Here is my code with the section i'm stuck on in bold: [CODE]infinity = 1000000 invalid_node = -1 startNode = 0 class Node: distFromSource = infinity previous …

Member Avatar for woooee
0
167
Member Avatar for laroca

Ok, so I pretty much have my program up and running, but it's not the best looking program aesthetically, and I am trying to do a couple of things to make it look better, and none of them are working. Here is what I want to do. 1) change the …

Member Avatar for woooee
0
257
Member Avatar for Torien7

Hey everyone. I would really appreciate some help. I'm currently building a program in Python 2.6 for an introductory Comp Sci class. The program is supposed to use functions to read a text file from a URL, parse the data into tokens, and use the data to calculate a sort …

Member Avatar for Torien7
0
240
Member Avatar for cloudspade

Hey !can somebody help me how to create a incremental search(numerical method) program using python!

Member Avatar for Zeref
0
102
Member Avatar for etypaldo

Hey, I am doing a 'Helicopter'-style game for a project where the player holds the spacebar for the main sprite to go up, releases to go down. Objects come from the right side of the screen at random y-cords moving until they hit 0 on the x-cord. The player must …

Member Avatar for Clotoss
0
366
Member Avatar for amanmazleigh

Hello everyone I've been trying to figure out how to make a joystick move a servo by using Arduino board, its software and Python with pygame module. But I can't just get the servo to move. I really wish someone can help me. This is actually part of my final …

Member Avatar for krigsmaskin
0
986
Member Avatar for doomas10

Hello, I have a txt file which contains data in this format: [CODE]cross-sectional study 21225114.txt prospective cross-sectional study 21225178.txt cross-sectional study 21225178.txt retrospective cohort 21225558.txt retrospective cohort study 21225558.txt cohort study 21225558.txt[/CODE] This shows what type of study each of the txt files have. Problem is some have more that …

Member Avatar for doomas10
0
187
Member Avatar for stefh

Hi pythoners! :) My question is very simple (the answer too, i hope): how to display files in a TreeCtrl? I've tried to use it, according to an example i've found on the web, but it displays only folder, subfolders. No files... I'll show you the portion of code i …

Member Avatar for stefh
0
174
Member Avatar for Rockpile

Hi there, I know there are some changes between Python 2x and 3x, and I know this is probably due to the changes with how 3x handles unicode and binary but I dont know how to make it work properly in 3x. In 3x my code returns the value I …

Member Avatar for TrustyTony
0
283
Member Avatar for Thropian

I'm writing a program in python,tkinter and I need the text on the button to update... is there a simple way to do this?

Member Avatar for Thropian
0
656
Member Avatar for andreasu

A simple streaming server-client pair with non-blocking user input can easily be coded in Python by using the 'select' module that provides a straightforward interface to the Unix select() system call. For Windows users however this is not an option as the acceptance of three empty sequences in the conventional …

0
589
Member Avatar for runge_kutta

Hello, I am having trouble using ctypes to call a Dll function. In short, the function accepts a pointer to an array of structures....like: [CODE] int arrayFiller( USHORT sensorID, void *pRecord, int recordSize ); [/CODE] I have generated a pythonified version of the function by importing the Dll etc. We …

Member Avatar for runge_kutta
0
4K
Member Avatar for rssk

hi all... create a loop for D link switch for both UPL and NMS ports..... can anyone plz explain about Dlink thanks in advance....

Member Avatar for rssk
0
79
Member Avatar for Behseini

Hi I am running a simple application which has three Radio Button and I have two problem with that as following: 1- First of all, two of the radio buttons [R2(Blue) and R3(Green)] are automatically selected when I run the code!(As you can see in attached screen shot). I tried …

Member Avatar for Behseini
0
5K
Member Avatar for dos_killer

im trying to replicate the screen contens in my application .. i need a certain area of the screen to be drawn in my app...although this code works fine, its very very slow...takes more than 20 seconds with inferior quality and around 30-40 with best quality... is there a quicker …

Member Avatar for vegaseat
0
242
Member Avatar for Peacer

[CODE]a = [[[0] for col in range(4)] for row in range(4)][/CODE] I do that code and it runs fine, and then I manipulate that list with code I have later and it runs fine at a reasonable speed. But if I put this code in a module. Module ListToFillUp.py [CODE]def …

Member Avatar for Gribouillis
0
194
Member Avatar for stefh

Hi :-) do you know how to move up one line in the terminal? Explanation with an example: [CODE]#!/usr/bin/env python # -*- coding: utf-8 -*- from time import sleep def test(): print "begin" i = 1 s = "#" while i < 5: print s sleep(1) i += 1 s …

Member Avatar for stefh
0
7K
Member Avatar for Dogge3

I want to create a function wich prints all numbers over 1000000. So the user can input for example 500 and that dosent print but if you input 1005000 it prints. My code far is. v = [600,6300330,47, 1000001] for x in v if x >1000000: print x

Member Avatar for woooee
0
66
Member Avatar for eva yang

Hi,there, I need to definea function make_tree(preorder, inorder). This function returns the Node which is the root of a binary tree with the pre-order and in-order traversals given as lists of values in the parameters. If either preorder or inorder is empty, the other must also be empty, and the …

Member Avatar for bron92
0
186
Member Avatar for toritza

Hello. I am have a problem while trying to write to a file some sorted lines . my initial file is somthing like this name2,number2;name3,number3;name1,number1 when i run this code ord = open("Be.csv", 'r') order = ord.read().split(";") order = sorted(order) for sort in order: print sort ord.close() f=open("Odd.csv","w") f.write(sort) f.close() …

Member Avatar for toritza
0
180
Member Avatar for BirdaoGwra

Hi, Here is my code. [CODE]# class DefaultTamplate import wx import Image BUFFERED = 1 class FourByTwo(wx.Window): def __init__(self, parent, id=-1, image="JPEGImage", size=wx.DefaultSize): wx.Window.__init__(self, parent, id, image, size=size) self.SetBackgroundColour("white") self.W = 384 self.H = 272 self.photo = image # wx.Image("Test.jpg", wx.BITMAP_TYPE_JPEG) self.FrameSize = 96 self.SetVirtualSize((self.W, self.H)) if BUFFERED: self._Buffer = …

Member Avatar for BirdaoGwra
0
294
Member Avatar for Ghostenshell

Keep getting Attribute Errors with my code any suggestions? There are two files attatched [code] from string12 import * from root import * def main(): tree1 = raw_input("enter numbers: ") print buildParseTree(tree1) def buildParseTree(fpexp): fplist = fpexp.split() pStack = Stack() eTree = BinaryTree('') pStack.push(eTree) currentTree = eTree for i in …

Member Avatar for Gribouillis
0
118
Member Avatar for nidhisajan

Can somebody help me with coding in Python for Hindi characters??.I specifically wanted code for counnting unique words ina hindi doc and frequency of unique words... Please help...........

Member Avatar for TrustyTony
0
26
Member Avatar for jamseyjames

so i am trying to write a code that takes is a function for defining Amino Acids. This function takes in a sequence and translates it into mRNA (DNA= ATCGATCG, mRNA= AUCGAUCG) i have no problem with this. The one problem I am having seems like the simplest part of …

Member Avatar for Gribouillis
0
106
Member Avatar for yamiyuka

I am working on a text based game for my class. Its not required, but I want to have a health system. I'm trying global health, but I keep getting an error. I want to make it so you have a base health of 100. After the battle it will …

Member Avatar for yamiyuka
0
593
Member Avatar for fsl4faisal

i want to implement multicast using python can anyone tell me how can i get information on socket programming in python?

Member Avatar for woooee
0
159

The End.