15,181 Topics

Member Avatar for
Member Avatar for superbhimanshu

Hello everyone, I have multiple lists of variables. Every list contains the variables corresponding to a single/unique entity. listVar_Entity1 = [x1, x2, x3, x4] listVar_Entity2 = [x5, x6, x7] listVar_Entity3 = [x8, x9, x10, x11, x12] # and so on Every member in a list has a mapping to each …

Member Avatar for TrustyTony
0
160
Member Avatar for jason.bennett.376258

hi There, i have made an AI player for the game Oware, i am looking to improve my programming in order to make my player stronger. can anyone help? here is my code import random #pots = [[1,2,8,4,2,6], [4,4,4,4,3,4]] def ai_player(pots, scoring_pits, turn, valid_moves): """ Input: pots: list of pot …

Member Avatar for gusano79
0
610
Member Avatar for reddsoxy

I am intereseted in writing a game or two for the android platform but am much more comfortable and knowledgable about python than I am about Java. I was curious if python is used for android games and if so some basic points of advice.

Member Avatar for TrustyTony
0
118
Member Avatar for fatalaccidents

Hello all, This is a two parter. One is an error that I'm receiving and one is a question in general about the capabilities of PyUSB. 1) So I've installed libusb from the tar file by just doing ./configure && make && sudo make install and I have checked that …

Member Avatar for fatalaccidents
0
1K
Member Avatar for Necrozze

Hey guys, I'm trying to learn how to use classes and work with seperate files, and I been reading about it and now I tryed making a little short "Hello World" thingy but I don't really understand the self. things, I thought I did but it's not working so I …

Member Avatar for Necrozze
0
301
Member Avatar for fatalaccidents

Hey guys, I wasn't exactly sure where to put this post, but this was my best guess: I'm on a HPC and wanted to use vim as a python IDE and was trying to install my own version of vim (7.3) with a python interpreter. I use configure to enable …

Member Avatar for biry2009
0
588
Member Avatar for Meena Yegappan

Hi I am trying to run a python script which has this code snippet: process = subprocess.Popen('./start_ws.pl') process.wait() os.system('make') The perl script started changes environmental variables and enters into new subshell. After entering into new subshell, the commands below script os.system('make') goes unnoticed.They get executed only if i exit from …

Member Avatar for slate
0
493
Member Avatar for ub007

Hi All, I'm running some tests to assess system behaviour when memory is being hogged. Found this on googling: perl -np -e '$x="0123456789"x1000000' < /dev/zero This works a charm. But my esxi platforms do not have perl installed. They have python supported though:) Any thoughts on how that one liner …

Member Avatar for TrustyTony
0
118
Member Avatar for Ismatus3

Hello , In this python script that do backup of folders , i just dont know why when i execute it printed : > Sauvegarde reussie vers E:\20130521 > Echec de la sauvegarde That means that this part : zip_command = "zip -qr {0} {1}".format(target, ' '.join(source)) # lancement de …

Member Avatar for woooee
0
311
Member Avatar for entropic3105

Where can I download the random module, because I've been looking for weeks and can't find a site where I can download it.

Member Avatar for entropic3105
0
751
Member Avatar for derejetaffese

i need small sample code using python which performs english verbs morphological analysis. Pls some body there, can you help your bro here?

Member Avatar for otengkwaku
0
323
Member Avatar for otengkwaku

hi guy, i have created an app why my beloved python. i have frozen it using cx_freeze for easy distribution but the problem is, on my development computer (win7) it runs perfectly but when i send it to a testing pc (windows XP sp3 32bit) it give me the error …

Member Avatar for vegaseat
0
590
Member Avatar for Sivaram R

models.py class Settings(models.Model): date_format = models.CharField('Date format', max_length=100) time_format = models.CharField('Time format', max_length=100) views.py for saving the date and time format in database as boolean. def date_format(request): settings = Settings.objects.get(user=request.user) settingsForm = SettingsForm(instance=settings) if request.method =='POST': settingsForm = SettingsForm(request.POST,instance=settings) if (settingsForm.is_valid()): settings=settingsForm.save() return redirect('/member/follow-up/') return render_to_response( 'incident/date_format.html', { 'about_menu': True, …

Member Avatar for ChrisPadgham
0
324
Member Avatar for 26bm

Hi, I am tring to make a custom cursor in pygame and I would like to use a XBM file to do so. I am wondering if somebody could please give me an example on how to create a XBM cursor, how to load it into pygame, and how to …

0
144
Member Avatar for Varunkrishna

def word_Rep(text,Dic_Word): rc = re.compile('|'.join(map(re.escape, Dic_Word))) def translate(match): return Dic_Word[match.group()] return rc.sub(translate, text) Dic_Word= { #A Words 'a':'ein', 'an':'eine', 'able':'KOmmen', 'about':'gegen', 'above':'Uber', 'absence':'Abwesenheit', 'absent':'abwesend', 'accent':'Betonung', 'accept':'akzeptieren', 'according':'nach', 'acquainted':'kennen', 'across':'uber' } Text_Trans= raw_input("[*]ENTER THE TEXT TO TRANSLATE:") Trans=word_Rep(Text_Trans,Dic_Word) print Trans please refer the above code. What happens here is that ,if …

Member Avatar for Varunkrishna
0
1K
Member Avatar for 26bm

Hi, I wrote some code using pygame that has two images. I am trying to figure out how transparency works, so I have tried to display a circle png on a square png. My code looks like this. import pygame from pygame.locals import * #make window pygame.init() screen = pygame.display.set_mode((1270, …

Member Avatar for 26bm
0
601
Member Avatar for vegaseat

Just a code sample that allows you to play your midi or mp3 music files with Python and module pygame.

4
2K
Member Avatar for massivefermion

I just downloaded [Python for S60 2.0.0](http://en.wikipedia.org/wiki/Python_for_S60).The instructions say that for using it,I should open PyS60 Application Packager but it complains:«No module named tkFileDialog». I'm using Python3.3.2 And I should say that I know Python for S60 is really old and outdated and that maybe the problem,so I will appreciate …

Member Avatar for TrustyTony
0
210
Member Avatar for vegaseat

You can draw a number of shapes directly on the PyGame window, and then save the drawing to an image file.

3
5K
Member Avatar for rude_god

Hi all I've been messing about with this bit of code. Basically what it's supposed to do is create these six buttons, which when clicked pass a parameter to a function and then call that function. The function basically removes one condition from a larger list depending on which button …

Member Avatar for Lardmeister
0
4K
Member Avatar for otengkwaku

Hi guys i have created a python 2.7 application using PyQt4 and Pyttsx. PyQt4 is a crossplatform GUI library and pyttsx is a text to speach library the code can be found [here](https://github.com/Oteng/timeTracker) Pleace if you have a comment of imporovement let me know thanks

0
99
Member Avatar for RockJake28

So I'm starting to learn python as it's an awesome language from what I've already done in it. I came across an exercise to learn lists and it was basically as follows Create a list of first names and a list of second names and use a for loop to …

Member Avatar for Lardmeister
0
325
Member Avatar for siss

I'm a complete beginner learning Python. I'm writing code to get response of cloudstack api call 'listTemplates'. But what ever i did, it shows a error message like 'Unable to execute API command listtemplates due to missing parameter templatefilter' i have tried to specify thar parameter but failed. can anyone …

Member Avatar for TrustyTony
0
500
Member Avatar for ram619

Hello......I have written a script in which I am telnetting from system1 to system2. There from system2 I am doing ssh to system3. This system3 is a Embedded Board running Linux. Here on system3 I am executing a code that gives me a CLI interface. In this CLI we have …

Member Avatar for ram619
0
174
Member Avatar for vadimak

Hello i need to make a cash register but i dont know how to do it. i was thinking about to make it in loop but i dont know how to make its. i need to input a barcode of product each barcode has price an stock level. In the …

Member Avatar for vadimak
0
544
Member Avatar for dp121307

I'm not sure if its my computer or what. For some reason when I run programs in class they go through fine but after running the same program at home it doesnt seem to work. Basically, what I'm trying to do is create an event handler that draws a circle …

Member Avatar for dp121307
0
378
Member Avatar for chriswelborn

I just wanted to show the basic usage of docopt, a module that makes parsing command-line arguments so much easier. I'm not affiliated with the creators of docopt, but I'm certainly thankful for their work and happy to post this little snippet. I will point you to [docopt.org](http://docopt.org) for more …

1
3K
Member Avatar for clouds_n_things

For those of you who have worked with NMMAP before, Im raising an error each time I run my script. I'm using <python3 nmap_scanner.py -H 10.50.60.125 -p 21, 1720> at the command line to execute the script, and im running into the error: Traceback (most recent call last): File "nmap_scanner.py", …

Member Avatar for chriswelborn
0
2K
Member Avatar for nouth

with terminal is there a way for me to get a list of names that are already taken? like for things like variables and filenames `import` so I can't accidentally name something that will make a bug

Member Avatar for chriswelborn
1
626
Member Avatar for shanki himanshu

the formula for naive bayes is P(A/B1,B2,B3...Bn) = [ P(A) * P(B1/A) * P(B2/A) * . . . P(Bn/A) ] / [ P(B1) * P(B2) *....P(Bn) ] i am working on a project to classify email as spam or not. i have a large data set. i am using nltk …

Member Avatar for shanki himanshu
0
159

The End.