15,190 Topics

Member Avatar for
Member Avatar for Prithiv_1

I have a code which add extra memcache instance at run time, but this makes my keys lost. I know there are several libraries available like consistent_hash, hash_ring but I am unable to use them in my code. I know there is ketama available but couldn't find python code sample …

Member Avatar for Prithiv_1
0
336
Member Avatar for jallen111

I am trying to work on this problem but am confused with how to approach it. I am trying to create a program in python that analyzes a text file and counts how many time various words are used within it. I understand what I need to do but am …

Member Avatar for rrashkin
0
244
Member Avatar for CodingCucumber

How to exit a program but keep the turtle window open? I have tried exit() but it doesn't keep the turtle window open

Member Avatar for Gribouillis
0
301
Member Avatar for dp121307

I have to write the an AVLTree in python, followed all the instructions and I feel I have it just right, only problem is I can't figure out how to display my tree. I have to use the test given below, as well as the 2 methods below in the …

0
194
Member Avatar for Lost&Found

Hi, I'm looking for a little help. I'm trying to create a script with the ability to take home page as an argument, printing a message to say something about the site and then validate whether or not this is a valid URL. I'm relatively new to Python and haven't …

Member Avatar for Gribouillis
0
308
Member Avatar for dean.ong.14

I know this is stupid but how do i add a quit button? from tkinter import * from tkinter.font import Font def button(frame, text, command=None): ft = Font(family=('Verdana'), size=14) return Button(frame, text=text, font=ft, width=3, command=command) def frame(frame, side=LEFT, bg="black"): f = Frame(frame, background=bg, padx=5, pady=5) f.pack(side=side, expand=YES, fill=BOTH) return f …

Member Avatar for dean.ong.14
0
196
Member Avatar for Jamie_2

from graphics import * def patchdrawer(): win = GraphWin("Patch drawer", 100, 100) for x in range(0, 5): for y in range(1, 6): p1 = Point(x * 20, (y - 1) * 20) p2 = Point((x + 1) * 20, y * 20) rectangle = Rectangle(p1, p2) if (x + y) …

Member Avatar for Jamie_2
0
651
Member Avatar for dean.ong.14

raceback (most recent call last): File "C:/Python32/n", line 1, in <module> from Tkinter import * # button text list cmdlst = ['7', '8', '9', '+', '%', '4', '5', '6', '-', '**', '1', '2', '3', '*', '//', '.', '0', 'CL', '/', '='] class MyButton(Button): backref = None def Click(self): # back …

Member Avatar for sneekula
0
758
Member Avatar for evaldas.blauzdziunas

Hello there i was typing a python code and got this error saying: 26 27 for eil in open("msgs.txt"): # nuskaito ir parodo visas zinutes => 28 date, person , msg = eil.split("#") 29 print(date+person+"<b>"+msg+"</b><br> <hr>") 30 date = '', person = '', msg = ' ', eil = '----\n', …

Member Avatar for evaldas.blauzdziunas
0
345
Member Avatar for manohar1111

hello sir, I have doubt that how to redirect the ouput text of a command (while working on unix cmd prompt) to a file using python.please help me with sample code.

Member Avatar for Gribouillis
0
187
Member Avatar for renierdbruyn

I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful. …

0
112
Member Avatar for renierdbruyn

I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful. …

0
108
Member Avatar for speen

Hello there? I am extremely new to python, and am trying to attend the lectures about hashing. Please cd you ceck the following code and error, and just tell me how to make it work. Please I am not that advanced user of python. I am very basic. def create(smallest, …

Member Avatar for speen
0
244
Member Avatar for lewashby

Is there a function that I can use to find out if a file is a block device? And another for a character device. I'm trying to create a funtion that will build a string the is exactly like the result you get from running ls -l for a slightly …

Member Avatar for woooee
0
539
Member Avatar for Gribouillis

This snippet prints a python list of strings in multicolumn format (similarly to linux `ls` command). It uses module prettytable, available in [pypi](https://pypi.python.org/pypi/PrettyTable).

Member Avatar for Gribouillis
3
2K
Member Avatar for chophouse

I'm having trouble calling a function I've written after importing the module containing it. The module is called funky.py. Here is the code for funky.py: from ftplib import FTP_TLS #### FUNCTION --- fileup() #### for sending file via FTP TLS ## ## arg1 .. destname > the filename to be …

Member Avatar for chophouse
0
17K
Member Avatar for AARTI SHRIVAS

i am just start to learnin python and i want to know some thing about it 1.is is used for web development 2.how can i run python program on my ubuntu os i have python installed on my system but not able to run i don't know how to run …

Member Avatar for snippsat
0
437
Member Avatar for venkaaaaat

hi, can you please help me with a sample python code to retrive data from command prompt which appears after execution of some commanad for eg: ./vershion.sh gives ouput as version: 7.0.0.9 type : NAS thanks in advance

Member Avatar for manohar1111
0
592
Member Avatar for 06njack

Hello all, I've been set a lab assignment and am really struggling to get to grips with it. The aim to to create a "grass-roots" program that doesn't make heavy use of built in functions. Namely "string.replace()" in this case! Any ideas as to why the below code doesn't work? …

Member Avatar for woooee
0
282
Member Avatar for Gribouillis

This snippet is reserved for users of the KDE linux desktop. It adds a *service menu* to kde applications such as dolphin and konqueror, to launch an ipython dashboard in a directory in one click. More specifically, save the text of this snippet as a file `~/.kde/share/kde4/services/ServiceMenus/opennotebook.desktop` (create the directory …

1
627
Member Avatar for booicu

Evening Community! Alright. As you can see I am "newbie" on the block. When I try approaching my professor for assistance she tells me to go to my book. But I digress. If I was able to use a while loop this would be more simplified. But our professor is …

Member Avatar for woooee
0
17K
Member Avatar for CodingCabbage

I used code originally by vegaseat what's wrong with code ** error : Traceback (most recent call last): File "C:/Users/Cameron/Computing Work/Year 13/F454 - Computing Project/Design/newthingnewthing.py", line 68, in <module> canvas.create_rectangle(x0, y0, x1, y1, fill="purple") AttributeError: 'NoneType' object has no attribute 'create_rectangle'** _______________________________________________ code: from tkinter import * data = [10, …

Member Avatar for CodingCabbage
0
3K
Member Avatar for CodingCabbage

is there a way of in a loop automatically setting different commands to different buttons as they are created (automatically created via loops) or is there a way of setting custom names to the buttons while they arecreated in a loop i want "buttonName" to be different and known for …

Member Avatar for vegaseat
0
241
Member Avatar for Astudent

So I have another problem(new project new code), with a rather lengthy code. The problem is I am getting tkinter errors left and right and I can't find why. The error I get is: File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "N:\dkaul\CLASS-VSFX160-01\sklock20\Python\blackjack\Black.py", line 212, in <module> …

Member Avatar for vegaseat
0
7K
Member Avatar for CodingCabbage

I'm trying to represent my data using a bar graph, the data being displayed is goodVotes, neutralVotes and badVotes on the x-axis for each of my pieces of data (records in an sqlite3 database). I wish the "bookName" of each record to be displayed on the x axis of the …

Member Avatar for vegaseat
0
282
Member Avatar for Prithiv_1

I am getting output as json string with the following code. But I require it as JSON dict without leading and trailing quotes. How can I do that? It seems to work if I uncomment line4 but not with raw input. def main(args): f = open(args[1], 'w') inp = raw_input("Enter …

Member Avatar for vegaseat
0
290
Member Avatar for Netcode

Am new to python and i need help dealing so i would go ahead and post the question and my little solution so far. **Question:** a Procedure which takes four parameters as follows; Dictionary File- the file name of a text file containing four letter words Start Word- a four …

Member Avatar for Netcode
0
294
Member Avatar for aditya369
Member Avatar for james.lu.75491856

THIS IS DANGEROOUS CODE, if it fails, it may prevent yu frome editing it. also, you can use the functions to do crazy stuff. Look at [this refrence](http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx) and change the `0x12` to what you want. (This one hold alt, so typing r will actibvate the menu that starts with …

Member Avatar for sneekula
-4
361
Member Avatar for turbo22

Ok, i've gotten pretty far on a code but keep getting an error. I know it's something simple but i just can't put my finger on it please help. import os import pickle class Student(object): def _init_(self): self._students = {} def addStudent(self, name): self._students[name] = [0, 0, 0] def editStuData(self): …

Member Avatar for BearofNH
0
1K

The End.