15,194 Topics

Member Avatar for
Member Avatar for Gh0st93

I was running a game I wrote in python with pygame on my Mac 10.6 machine and I notice this Warning. "Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz." So does anyone …

Member Avatar for Gh0st93
0
172
Member Avatar for leazell

I am trying to create a simple recursive prime number function. I am not sure why this is not working. I originally was using remainder division but changed it to integer division. **** if n ==0: # This runs infinitely, The recursive call does not seem to roll down. Output …

Member Avatar for Thisisnotanid
0
6K
Member Avatar for Simplicity.

I'm working on a python code to solve a PDE (Partial Differential Equation) backward in time (i.e. from t = T to t = 0.0). The code is made up of two functions: the first function ([COLOR="Red"]def Solve_for_U_values_at_Time_T()[/COLOR]) solves a PDE (PDE1) forward in time, and returns an array of …

Member Avatar for Simplicity.
0
245
Member Avatar for Syphilis

Greetings! So if I wanted to open a PE executable file whilst on Windows and add a text resource to it, how could I do that in Python? I've asked this question before on another website and got the answer 'using the pefile module' however it has poor documentation and …

0
65
Member Avatar for felix001

Im pretty new to python and am trying to right a small script.... [CODE]#!/usr/bin/python import csv import string itemlist = [] reader = csv.reader(open("statement.csv", "rb")) for row in reader: item = row[4] itemlist.append(item) itemlist = list(set(itemlist))[/CODE] Every time I run it though I get the error : [CODE]Traceback (most recent …

Member Avatar for shibby
0
2K
Member Avatar for Thisisnotanid

Hi everyone. I was trying to solve Pb 35 on Project Euler ([url]http://projecteuler.net/index.php?section=problems&id=35[/url]). It essentially asks to write a program to list all circular primes under 1e6. I wrote the program and it works well for the most part. However, in the end it seems not to be able to …

Member Avatar for Thisisnotanid
0
2K
Member Avatar for mcenley

Hi friends, I am trying to write a program for drawing a Koch curve in Python. The Pseduocode is given as follows and the hint is to use recursion: [I] To draw and Koch curve with length 'x' all you have to do is: 1. Draw Koch curve with length …

Member Avatar for vegaseat
0
3K
Member Avatar for radc

I am new to wx.Python and I am stack. Is it possible to put wx.Check into wx.StaticBox?? I have found some examples with Radiobuttons inside wx.StaticBox. In short window displays an wx.ListCtrl box on the left, and some check boxes and wx.StaticText arranges into wx.StaticBox on the right. But the …

Member Avatar for richieking
0
658
Member Avatar for TrustyTony

With this code you can explore the functions of math module interactively seeing the docstrings automatically for each function. EDIT: The docstring was unfortunately from old code, this version copes with values like 'e' and multiple parameter functions.

Member Avatar for TrustyTony
0
220
Member Avatar for matthewl

I am attempting to read the access log for squid and store the last position read so it does not have to reread the file. I am running into many problems with my current code for it. I was wondering if you can help me write a more efficient code …

Member Avatar for richieking
0
164
Member Avatar for LogicallyInsane

I always had stumbled on this topic, but, well, yeah. I want to learn how to combine if statements. I made a thread like this long ago, but I don't want to necropost. So, As an example, what exactly would I do if I had something like this? [code=python]def add_n(): …

Member Avatar for LogicallyInsane
0
152
Member Avatar for twohot

I'm looking for ways to create variables in python3 as needed. E.g book1 = book(name1) # book is a class book2 = book(name2) book3 = book(name3) book4 = book(name4) book5 = book(name5) : : : V book-n = book(name-n) I have the names of the book in a list but …

Member Avatar for twohot
0
260
Member Avatar for dos_killer

hey ... im a new member of this community i have started developing python scripts for my phone i made a voice messenger for laptop using pyaudio in python and using sockets to transfer data [CODE] self.pin=pyaudio.PyAudio() streamin=self.pin.open(format=self.format, channels=self.channels, rate=self.rate, output = True, frames_per_buffer = chunk) global wf while 1: …

Member Avatar for dos_killer
0
161
Member Avatar for dos_killer

hey .. i intend to make a bittorent client of my own .. preferably in python ( although im also open to java or C ) .. i have worked in making a download manager but never with p2p connections... i need advice for beginning...as in which modules would help …

Member Avatar for Schol-R-LEA
0
278
Member Avatar for frankvw

Hi, Firstly, I am quite new to python so hopefully this could be quick answer for any kind sole who give help. I am trying to connect the data files created from one piece of equipment to another process that require similar, but not the same, data .txt files. The …

Member Avatar for frankvw
0
103
Member Avatar for novice20

telnetlib is helping me to connect to remote host and do the user login. but, when i try doing the super user login, it hangs ............... .............. ............... User="abc" Password="abc" Superuser_id="yyy" su_passwd="xxx" #-- establish a telnet connection to all the remote hosts in the list except the host running script …

Member Avatar for Simplified
0
174
Member Avatar for LogicallyInsane

Um, I'm actually KrazyKitsune, I'll use that account after I manage to recover my password. So I'm having trouble with RS NOR latches. I did this: [code=python]s = int(raw_input("set Set value: ")) r = int(raw_input("set Reset value: ")) qi = not (s or q) q = not (r or qi) …

Member Avatar for LogicallyInsane
0
93
Member Avatar for evertron

I get an error with this code and I dont know why I thought that sum was part of the array calss and it does come up when I put the "." after the array. This is the error I get. Traceback (most recent call last): File "F:/Python_Stuff/CSC143-901/score-array.py", line 22, …

Member Avatar for TrustyTony
0
113
Member Avatar for R3ap3R

''' Hi there, I am totally new to this site as well as Python. Luckily Python is a not too hard programming language to start with. I am trying to create a Caesar Cipher with ROT13 program that encodes user text ('a' - 'z' and 'A' - 'Z') to 13 …

Member Avatar for richieking
0
910
Member Avatar for novice20

hi, I just came accross the csv module to deals with csv files in python. suppose my csv file has two rows: 1,2,3,4 5,6,7,8 and i want to access each item at a time, i.e., 1 followed by 2 and so on....what can be done? [B]import csv reader= csv.reader(open('filename.csv','r'),delimiter=' ') …

Member Avatar for richieking
0
265
Member Avatar for dpd069

I am looking for a little assistance in slicing a (1050,1) array of temperatures. I have 2 temperature ranges T1-T2 and T2-T3 that i want to slice from the array using boolean slicing. How do I go about this? Dan

Member Avatar for Thisisnotanid
-1
85
Member Avatar for nosehat

Hi All-- I am working with zip archives, using the [URL="http://docs.python.org/library/zipfile.html"]zipfile module[/URL] to extract all the files with certain file extensions from each zip. In these zip archives the files I'm after all have their own path information, but I would like to extract the files I want into one …

Member Avatar for nosehat
0
166
Member Avatar for richieking

This is one of the easiest steps to view and convert dcm image useing the [B][COLOR="Red"]snake(python)[/COLOR][/B] There are 3 modules involved. 1. Search for [B]pydicom[/B] and install 2. Search for [B]matplotlib[/B] and install 3. Search for [B]pylab[/B] and install. If you are on ubuntu destro, Installing matplotlib via the repo …

Member Avatar for richieking
0
4K
Member Avatar for deepakgupta2186

I want to sort this dictionary through its keys.I am adding two lists into one dictionary...[CODE]list1=[] list2=[] dict1={} dict2={} n=input("Enter the number of contacts : ") for i in range(0,n): name1=raw_input("Enter your name: ") num=input("Enter your phone number: ") list1.extend([name1]) list2.extend([num]) dict1=dict(zip(list1,list2))#to convert two list into dictionary keys=dict1.keys() keys.sort() for …

Member Avatar for TrustyTony
0
177
Member Avatar for kuchi

Previously I used to work in java programming and now I got to switch to Python web programming. In java, to develop a web project and run the project, we use jboss server to deploy application, run the server (run.bat), and run the project. But in python I think the …

Member Avatar for snippsat
0
132
Member Avatar for Syphilis

Greetings kind shrew! So I'm needing to add a text resource to a PE executable file for Windows. However I'm unsure on how to do such. I did find a module called 'pefile' but this was of no help as it's functions did not include adding resources to files. I …

Member Avatar for mece
0
1K
Member Avatar for Brickmack

I was wondering if anyone knew of a way to scan for key presses in Python. It doesn't need to detect WHAT key is being pressed, just that one is being pressed. Also it needs to work with the console.

Member Avatar for richieking
0
270
Member Avatar for flebber

Hi I was reading the thread [URL="http://www.daniweb.com/forums/thread12326.html"]http://www.daniweb.com/forums/thread12326.html[/URL] which is about getting user input from a user in python. So I thought I would write something to tst it since I haven't used python in a while so I wrote a basic program to calculate netpay. [CODE]hours = raw_input("Enter Hours Worked: …

Member Avatar for snippsat
0
2K
Member Avatar for mece

I wrote a GUI tool that will display stats and refresh the stats when a refresh button is pushed. Now I would like to add a feature for the stats to auto refresh every five minutes. Is it possible to have the UI updated without binding an event handler? Thanks …

Member Avatar for mece
0
2K
Member Avatar for rotexhawk

Alright.. Seems I wasn't able to fully explain my problem.. Below is the full error printout. I tried debugging it and I still don't know why guessed[index] = (letter) gives me an error. I don't want to use the append method because it will put the new letter at the …

Member Avatar for rotexhawk
0
359

The End.