15,175 Topics

Member Avatar for
Member Avatar for kouty

Hi my friends! Here is a wrong code, Wrong and I don't know why. My purpose is to make a **sieve of Erasthotene**. I make an unique function with many inner loops. But the execution **don't go cross the lines** I illustrate this with the help of printing the different …

0
201
Member Avatar for deonis

Hi Guys, I am trying to draw on PlotCanvas using wx.DC module. I have several problems with drawing on WXBufferedPaintDC, for some reason my DC text disappears after windows resizing and it looks that I draw my text in the wrong place. Any help appreciated. Here is my code: import …

Member Avatar for deonis
0
1K
Member Avatar for dadaas

Hi, i m new and i will sure seek for some help also i will try to help others as well with my for now limited knowledge of Python. So here is my problem: I m learnign and i want to learn how to scrape things. i did scrape some …

Member Avatar for dadaas
0
245
Member Avatar for johndumb77

Hey guys, I have this code at the end of my python game: root = Tk() root.title("Jack's Game") root.resizable(0,0) root.configure(bg="green") game = Board(root, width=8, height=8, letters=10) game.mainloop() And I also have a button somewhere above. I want to have function for the `command="xxx"`. What I want the function to do …

0
100
Member Avatar for mark103

I need some help with my code, I'm stored the list of elements in arrays and when I try to print the list of elements, it would print only one element where I have more than one. When I try this: pos_start = list() pos_top = list() pos_width = list() …

Member Avatar for woooee
0
279
Member Avatar for bunkus

Is there anybody having a code snippet for using the Bresenham circle algo and modifiying it in a way so that it actually draws arcs with specified start and end angle instead of complete circles? A Bresenham algo for a complete circle in Python would be like this: [CODE]import PIL.Image, …

Member Avatar for vegaseat
0
8K
Member Avatar for vegaseat

Just some interesting applications of the bitwise and (&), or (|) operators. You might find some other uses.

Member Avatar for vegaseat
0
278
Member Avatar for Raman_4

In the below python code, scrollbar for the panel is not working. I have added checkboxes under panel in the 2D for loop. Please help here def GenerateTree(self,event): v1=int(val1) v2=int(val2) print v1,v2 x=v1+v2 print x panel = wx.lib.scrolledpanel.ScrolledPanel(self,-1, size=(1100,1500), style=wx.RAISED_BORDER,pos=(10,145)) panel.SetupScrolling() UEarr=('UE1','UE2','UE3','UE4','UE5','UE6','UE7','UE8','UE9','UE10','UE11','UE12') LCarr=('LC3','LC4','LC5','LC6','LC7','LC8','LC9','LC10') y=0 i=0 j=0 k=0 for i in …

Member Avatar for vegaseat
0
239
Member Avatar for jeremywduncan

Exercise 11.1. Write a function that reads the words in words.txt and stores them as keys in a dictionary. It doesn’t matter what the values are. Then you can use the in operator as a fast way to check whether a string is in the dictionary. Trying to figure this …

Member Avatar for Mohammad_19
0
3K
Member Avatar for lapo3399

I'm new to Python, and as I was coding for Project Euler to develop my skills in this language, I needed a function for converting between two bases. I know that int() can convert anything to base 10, but before I looked for a Python module concerning this math, I …

Member Avatar for vegaseat
0
2K
Member Avatar for tony75

Hi I have this key How can I add \x between two number of hex as you see in my example. f0cbf260e0ca8ec2431089fb393a1c29513aaaa5847d13e8be84760968e64dc6 Change to “\xf0\xcb\xf2\x60\xe0\xca\x8e\xc2\x43\x10\x89\xfb\x39\x3a\x1c\x29\x51\x3a\xaa\xa5\x84\x7d\x13\xe8\xbe\x84\x76\x09\x68\xe6\x4d\xc6” I appreciate your help

Member Avatar for EMERSON_1
0
10K
Member Avatar for MustafaScript
Member Avatar for Seher_1

how to calculate term frequency,inverse document frequency(tf-idf) for own text files that consists of many terms.

Member Avatar for Gribouillis
0
164
Member Avatar for turntomyleft

One of my first programs was coded on paper tape. Another was via punched cards. I foresaw amazing stuff, e.g., artificial intelligence, models for weather, space travel, etc., but never imagined we would come this far in only 60 years. I now have a programmer son who wants me to …

Member Avatar for vegaseat
0
752
Member Avatar for BustACode
Member Avatar for DustinS

I made client & server programs in C# based on this example code. c# client program: IPHostEntry ip = Dns.GetHostEntry(tbServer.Text);//"MyComputer-MSI" string addr = ip.AddressList[0].ToString(); TcpClient clientSocket = new TcpClient(addr, 1234); At the last line above, I got the message: An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll Additional information: …

0
109
Member Avatar for vegaseat
Member Avatar for vegaseat
4
684
Member Avatar for Julie_2

7— File Data Statistics In this project, you will write a program to read a series of values from a file and calculate the following statistics: • A count of the number of values read from the file • The sum (total) of the values read from the file • …

Member Avatar for vegaseat
0
185
Member Avatar for haven_u

Could someone help me out with implemeting a simple http POST method that receive and data through a socket. I would like to know how to simply get values entered in a html form. Since data receive form the socket includes headers as well as the actual data of interest.It …

Member Avatar for snippsat
0
184
Member Avatar for python1

How can we save a text file we make using python in another directory?The default directory is always the directory in which , the program is ? is there any way to change this?Can this be done when we are creating the file (FILE=open(filename,"w")) thanks in advance

Member Avatar for Parikshit_1
0
44K
Member Avatar for BustACode

Allows multiple entries using raw_input. I often have to enter multiple items in my Python programs. I desired an easier way than using a loop(s). Today I discovered a way, and with a few mods made it happen.

1
696
Member Avatar for jamesjohnson25

The perl command is perl /opt/translation/moses/scripts/tokenizer/tokenizer.perl -l en < Eng-hin.translation.en > Input/tokenization/Eng-hin.translation.tok.en I want to execute the above perl command in python script ,Here the perl command is executed successfully in Popen() but no output file is created at location "Input/tokenization/Eng-hin.translation.tok.en". var = "-l en < Input/Corpus/"+inputfilename+" > Input/tokenization/Eng-hin.translation.tok.en" pipe …

Member Avatar for woooee
0
412
Member Avatar for snippsat

It's started (: Find some videos that are interesting,feel free to post link or discuses it here. I was looking most forward to David Beazley talks. Live coding with Concurrency as topic,doesn't get much better than this. [David Beazley - Python Concurrency From the Ground](https://www.youtube.com/watch?v=MCs5OvhV9S4) The main talk David Beazley …

Member Avatar for vegaseat
3
172
Member Avatar for vegaseat

Just an example of a persistent list class that could have interesting applications in data mining.

1
674
Member Avatar for jamesjohnson25

header : [u'ID', u'Hindi', u'Telugu'] 1 .[u'hhd1', u'\u0924\u093e\u091c\u093e\\JJ \u0938\u093e\u0901\u0938\u0947\u0902\\N_NN \u0914\u0930\\CC_CCD \u091a\u092e\u091a\u092e\u093e\u0924\u0947\\JJ \u0926\u093e\u0901\u0924\\N_NN \u0906\u092a\u0915\u0947\\PR_PRP \u0935\u094d\u092f\u0915\u094d\u0924\u093f\u0924\u094d\u0935\\N_NN \u0915\u094b\\PSP \u0928\u093f\u0916\u093e\u0930\u0924\u0947\\V_VM \u0939\u0948\u0902\\V_VAUX \u0964\\RD_PUNC', u'\u0c24\u0c3e\u0c1c\u0c3e\u0c36\u0c4d\u0c35\u0c3e\u0c38\\JJ \u0c2e\u0c30\u0c3f\u0c2f\u0c41\\CC_CCD \u0c2e\u0c3f\u0c32\u0c2e\u0c3f\u0c32\\JJ \u0c2e\u0c46\u0c30\u0c3f\u0c38\u0c47\\V_VM_VNF \u0c26\u0c66\u0c24\u0c3e\u0c32\u0c41\\N_NN \u0c2e\u0c40\\PR_PRP \u0c35\u0c4d\u0c2f\u0c15\u0c4d\u0c24\u0c3f\u0c24\u0c4d\u0c35\u0c3e\u0c28\u0c4d\u0c28\u0c3f\\N_NN \u0c35\u0c3f\u0c15\u0c38\u0c3f\u0c66\u0c2a\u0c1c\u0c47\u0c38\u0c4d\u0c24\u0c3e\u0c2f\u0c3f\\V_VM_VF .\\RD_PUNC'] Data explanation The first column is the id of the sentence The second column is the sentence in hindi language The third column …

Member Avatar for rubberman
0
264
Member Avatar for jamesjohnson25

How to seperate two languages(English,Hindi) in python This is my Sample data 1 . wikiner2013inflected 1-1 1.000 Sharaabi शराबी 2 . ted 1-1 1.0 politicians do not have permission to do what needs to be done. राजनीतिज्ञों के पास जो कार्य करना चाहिए, वह करने कि अनुमति नहीं है . …

Member Avatar for jamesjohnson25
0
439
Member Avatar for vegaseat

Sometimes it's easier to pick an image from the internet to display in your Python Tkinter GUI toolit program.

Member Avatar for vegaseat
1
5K
Member Avatar for vegaseat

Shows how to convert a comma separated value (csv) string to a list of records, and then do some data processing. The csv strings usually come from csv files created by spreadsheets.

Member Avatar for vegaseat
1
3K
Member Avatar for vegaseat

Let's assume you would have to design a 500 ml (about 1.1 pint) food/beverage container like a can and use the least amount of material. Here is a Python program that explains the steps to achieve this.

Member Avatar for vegaseat
2
1K
Member Avatar for MntungwaXT

Hey guys. I hope you are well. I a a newbie programer just started a few months ago. I need help with mu project. We are supposed to code an Ai player for the game Oware on python. There was a player given to us which we can adit to …

0
71

The End.