15,181 Topics
| |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
i need small sample code using python which performs english verbs morphological analysis. Pls some body there, can you help your bro here? | |
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 … | |
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, … | |
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 … | |
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 … | |
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, … | |
Just a code sample that allows you to play your midi or mp3 music files with Python and module pygame. | |
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 … | |
You can draw a number of shapes directly on the PyGame window, and then save the drawing to an image file. | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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", … | |
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 | |
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 … |
The End.