15,179 Topics

Member Avatar for
Member Avatar for Diellza

have problem with understand how to resolve error in my code. Here it comes: def counting_sort(some_list, max=100000): licznik = [0] * (max+1) for x in some_list: licznik[x] = licznik[x]+1 i=0 for x in range(max+1): for y in range(licznik[x]): some_list[i]=x i=i+1 return some_list.reverse() def gen(number, b=100000): some_list = [] return [some_list.append(random.randint(0, …

Member Avatar for Diellza
0
243
Member Avatar for 4m1nh4j1

I am using python multiprocessing lib and I would like to reload a list of processes every x time. In other words, when the configuration is modified, all processes should read it again. def get_config(self): from ConfigParser import SafeConfigParser .. return argv def sched(self, args, event): #schedule instruction: schedule.every(0.01).minutes.do(self.worker,args) while …

Member Avatar for vegaseat
0
2K
Member Avatar for cjohnweb

At work I am taking on some development stuff on the beaglebone black and I have to learn Python. I've had a blast so far!! So I'm trying to understand what some of the code is doing. I have a sample script that opens a port and listens for connections …

Member Avatar for Gribouillis
0
1K
Member Avatar for Ed_3

I have a task to create a GUI program that is a logger. This means it needs to be able to show a leaderboard, allow users to add personal information in a form (lots of input boxes), and allow the users to view their personal info. im using wxPython and …

Member Avatar for vegaseat
0
174
Member Avatar for joustwilliams

Hello, this is my first post in this forum. I recently decided to try my hand at programming with python. I'm completely new to programming so I thought I should try some simple projects to reinforce what I've learned so far. I saw a post from 3 years ago on …

Member Avatar for vegaseat
0
2K
Member Avatar for alina.nazchowdhury

Dear, All Viewers I need your help guys I need to convert the python Asterisk Gateway Interface (AGI) PHP or Java or Perl Asterisk Gateway Interface (AGI), Please if anyone know about it help me ASAP, I wait for your feedback guys. Thanks here is Code... asterisk.py code is below: …

0
192
Member Avatar for valestrom

My program is supposed to replace all sets of 4 spaces with a tab but it only seems to be editing the first line then skipping the rest of the lines. "work_string" is defined via another function which takes and saves an entire files input into one string. I just …

Member Avatar for valestrom
0
315
Member Avatar for vegaseat

Just the very basics on how to draw a rotated text using the Python GUI toolkit PySide (public PyQt). Please experiment and embellish.

Member Avatar for vegaseat
2
2K
Member Avatar for alexamicaa

I have no idea how to write in Python. Please help me with this! Best answer if you write the program! Central Limit Theorem I Goal Write a python program that will use your accept / reject Monte Carlo algorithm to demonstrate the central limit theorem. Recall: The central limit …

Member Avatar for sneekula
-3
488
Member Avatar for satyanani40
Member Avatar for silverdust

I have this as my major code #!/usr/bin/env python # # @author: Joseph Rex # @website: http://josephrex.me # @repository: http://github.com/bl4ckdu5t/registron # # # import sys, webbrowser from PyQt4 import QtGui, QtCore from ui_registron import Ui_MainWindow try: import pyttsx except ImportError: raise ImportError, "pyttsx module is required for speech features of …

Member Avatar for vegaseat
0
2K
Member Avatar for Ravi_exact

How to replace only 1d values in 2d array after filter using numpy in python without loop i.e in pythonic way. I want to filter only t2 rows and replace values in second column ( middle column ). example: `>>> x = np.array([['t1',10,20],['t2',11,22],['t2',12,23], ['t3',21,32]])` >>> x array([['t1', '10', '20'], ['t2', …

Member Avatar for sneekula
0
4K
Member Avatar for samuel1991

Hi all, my question is as follows: If I use the code as below: text = '中文' #Text is in Chinese, whereby text = 'chinese' with open('file.txt','w', encoding = 'UTF-8') as f: f.write(text) f.close() My file.txt on Windows notepad will show it as saved as UTF-8. However, if the text …

Member Avatar for samuel1991
0
652
Member Avatar for telmo96

Hey ya guys, it's my first topic on DaniWeb, sounds like a good place to find help with programming. :) Today I'm trying to compile a simple code made for PyQt4 using cx_Freeze, but I'm getting an error, I'll show you all the codes: [B]example.pyw[/B] [CODE]import sys from PyQt4 import …

Member Avatar for sneekula
0
3K
Member Avatar for Chtaylor5201

Can someone give me an idea on how to get started on this program? I have been having problems on this for a week and cannot get started. I understand this in visual logic but cannot get the total amound to print. Can anyone walk me through this or show …

Member Avatar for vegaseat
0
423
Member Avatar for sneekula

I have a tkinter program like the one below (for example) and want to create an executable file using module cx_freeze. I am using Python33 and Windows7. # Tk_circle2.py # draw a circle with given center (x,y) and radius # tkinter normally needs a specified square try: # Python2 import …

Member Avatar for vegaseat
0
2K
Member Avatar for fonzali

hi , last night I downloaded pyzo package on my ubuntu 14.04 system , I just do not know how to get it working . any help is appreciated

Member Avatar for fonzali
0
339
Member Avatar for psichoman5

I dont know how to convert a matrix of 10x10 into 4 matrices of 5x5, for example: [[10, 11, 12, 13, 14, 15, 16, 17, 18, 19], # matrix 10x10 [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35, 36, 37, 38, 39], …

Member Avatar for vegaseat
0
257
Member Avatar for fatalaccidents

Hello all, I was writing code that was supposed to spawn multiple jobs from a sqlite DB and my first idea was to implement the multiprocessing Pool function. I'm not sure if this question would be better suited somewhere related to shell scripting, but I'm not sure how to call …

Member Avatar for vegaseat
0
489
Member Avatar for Jack_9

Hello. I want to use sqlmap.py to analyze my website for sql injection attacks but the computer that I have to use I don't have admin access on so i'm using portable python but I need to pass the script a command line argument and I can't seem to do …

0
73
Member Avatar for Jack_9

Hello. I'm running injection tests on an SQL database and I found a good script to do so....But it takes command line parameters which I can't execute properly because the command would normally look somthing like this...... python sqlmap.py -u "url.com" --batch. But I can't seem to do that because …

Member Avatar for HiHe
0
3K
Member Avatar for Odyssey2001

Hello! I'm new to Python,so I'm sorry if it's a simple question. I have a text file where each line contains a path.Under some of the "final" subdirectories there are 1 or 2 lines that contain some values.The text file looks like this: folder1 folder1\folder2 folder1\folder2\folder3 'something1','something2' folder4 folder4\folder5 folder4\folder5\folder6 …

Member Avatar for Odyssey2001
0
231
Member Avatar for samuel1991

Hi all, actually I have a requirement to remove all non letter character. (Numbers, Punctuation, symbols, non printing characters etc.) string.punctuation does a good job, but it does NOT remove any non English punctuation (Like '。' which is a full stop in Chinese) So I come accross such code: import …

Member Avatar for Gribouillis
0
322
Member Avatar for Tcll

if this is in the wrong area, I'm sorry. :) I'm looking for a good alternative for python on linux/wine that's capable of this: http://lh3.ggpht.com/-cuRe_8IrRCw/VEYPPy8J-3I/AAAAAAAAH10/DnjCVyfCEEg/s1282/VS2010.png ^ the popup under my cursor I need that specific level of informative intellisense, which I can't seem to find in any other IDE. (most …

Member Avatar for Tcll
0
628
Member Avatar for bustamorg

I have been working on this program for a few days and have most of it working, the only issue that I am having is when a word has multiple iterations pf the same letter. I need the program to print out all the letters that are the same when …

Member Avatar for bustamorg
0
232
Member Avatar for Subin raj

You are given N integers that are arranged circularly. There are N ways to pick consecutive subsequences of length M (M < N). For any such subsequence we can find the “K”-value of that subsequence. “K”-value for a given subsequence is the Kth smallest number in that subsequence.

Member Avatar for slate
0
146
Member Avatar for Jack_9

Hello ladies and gentleman of Daniweb.com. I wanted to ask a question about publishing an application, or a program to put online. But all of my code is neatly organized (PY) modules which canc only urn if you have python installed and I don't want to make people install python …

Member Avatar for Jack_9
0
172
Member Avatar for mgold

I'd like to find an algorithm book that's either meant to be or good to use as a reference. By "reference" I mean that it contains all the basic algorithms (machine-learning algorithms especially) like QuickSort, Logistical Regression, Clustering. Preferably, including both the mathimicatical definition as well as psuedo code, or …

Member Avatar for StefanijaV93
0
450
Member Avatar for valestrom

Hey, I'm trying to figure out how to get this kind of program to work, it's supposed to be a UNIX style program in the sense that everything is command line driven. What I'm trying to get it to do is when the function is called it takes the input …

Member Avatar for Gribouillis
0
5K
Member Avatar for Jack_9

Hello! I'm very newbie when it comes to linux ive done some stuff with the desktop version but nothing with servers. I was wondering what installation to get and such in order to offer the best support for my python application.

Member Avatar for Jack_9
0
110

The End.