15,190 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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(): … | |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
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) … | |
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, … | |
![]() | ''' 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 … |
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=' ') … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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: … | |
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 … | |
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 … | |
Does Anyone know how to add context menu in win explorer on [B]files[/B]? And how do they work? Do they call a command and put the full filename after the command as arguments? | |
Hi Everyone, I have a problem displaying a dicom image properly on PIL(Python Image Library) I have used the code in the following link [URL="http://code.google.com/p/pydicom/wiki/ViewingImages"]http://code.google.com/p/pydicom/wiki/ViewingImages[/URL] but it shows some blur thing and not shows the correct image when i open the same image in dicombrowser it displays clear image but … | |
How do you keep a wx frame from not responding while the code is running in the background? ie a search or other demanding function. | |
All, First, thanks for reading! I'm very new to python, and I'm trying to do something that seemingly feels impossible. I'm using Python 3.x to write a script. This script, so far, only runs Windows "net use" command and gets back drive mapping info. The problem is that I need … |
The End.