15,185 Topics

Member Avatar for
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
160
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
151
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
256
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
160
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
275
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
101
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
171
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
92
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
111
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
906
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
263
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
83
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
176
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
131
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
353
Member Avatar for ultimatebuster

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?

Member Avatar for ckoy
0
112
Member Avatar for python_user

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 …

Member Avatar for python_user
0
2K
Member Avatar for ihatehippies

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.

Member Avatar for ihatehippies
0
908
Member Avatar for nutrion

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 …

Member Avatar for ckoy
0
289
Member Avatar for MUFC4life

Hi i was just wondering if anybody could help me with this code. #! /usr/bin/env python # -*- coding: UTF-8 -*- [CODE]import turtle def initialize ( color = "blue" , smallest = 1.0 ) : turtle.clear ( ) turtle.up ( ) turtle.goto ( -100.0 , 100.0 ) turtle.setheading ( 0 …

Member Avatar for TrustyTony
0
290
Member Avatar for kiddo39

I'm having trouble getting my python scripts to insert into a mysql database. I'm able to do other commands successfully such as adding or dropping tables, selecting items from tables but inserting into tables isn't working. I can manually insert but the script won't do it. I have an entry …

Member Avatar for richieking
0
127
Member Avatar for justaguy101

This is not necessarily a Python or wxPython related question. Let's say i have GUI made with wxPython. How does one implement changing language of the GUI(menu names, help strings etc.) in a correct way. Thanks.

Member Avatar for richieking
0
261
Member Avatar for Thisisnotanid

Hi everyone, I'm new to Daniweb and programming in general. I wrote a program to implement Euler's sieve, and it seems to work for small primes. But, it incorrectly lists certain numbers as primes for larger ranges. For example, for n = 400, it lists 391 as prime. I've gone …

Member Avatar for Thisisnotanid
0
138
Member Avatar for Tcll

KK so I have 2 py files... 1 being the main, and the other, the plugin I have a list var in the main, that I'd like to append data to from the plugin how do I do it?? the data to append: (from plugin) ' ('template', '*.tmp') ' the …

Member Avatar for Tcll
0
604

The End.