15,179 Topics
| |
I am trying to make this pattern in python but stuck, any help please? Ashley http://images.colourbox.com/thumb_COLOURBOX3492089.jpg | |
` This is the code of Tic Tac Toe from Python the absolute beginner. How could I edit the global constants so the user could pick the pieces or should I just remove them all together? # global constants X = "X" O = "O" EMPTY = " " TIE … | |
I'm having a little problem. The challenge is this: "Modify the program so that different shapes are drawn at each angle rather than a small filled circle". So I'm trying to change the middle shape when the second hand hits 12, 3, 6, and 9. I've got some code, but … | |
Dear members, i have a question. I created my software (with windows made with wxpython) and with py2exe I embed the icon into the exe. Since I would like to add the same icon file (or any other image) also as decoration in the window but I don't want to … | |
I am trying to add collision detection to this simple game, but I am a little lost on where to begin. I know I need to use rects to do this but I am struggling to find out what I need to code to make this work. Any pseudocode or … | |
Today i was reading someone written code and trying to understand it, but I have encountered so many times that programmers override builtin methods or set new properties , the code below is from a tutorial i came accross , I hope some one can help me out how code … | |
Let's say you have a whole bunch of nicely named lists and want to save them all and their names in a pickle file. One solution can be to store these lists and their names in a Bag container class and pickle the bag instance object. Now you can use … | |
I have a video program that use gstreamer and wxwidgets. Before Ubuntu 9.10, the program works fine. But since I upgraded to 9.10 (or 10.04), it keeps getting crashes when trying to view video. The error is usually Fatal X11 IO error. I googled and found that GTK+ implementation is … | |
Hi guys...I'm new to python so I've no idea what I'm doing but I need to write a function that 1) asks the user how many strings they would like to input. 2)Stores the strings in a list 3) sorts the list 4) Displays the sorted list 5) Displays the … | |
I have made a package with the name MaPySan that has `__init__.py` file and other files namely, DockedGUI.py and poseManager.py and inside `__init__.py` i have, `import poseManager` which is my app that I want to run so how should I have it run from script editor that I do not … | |
a program that asks user to enter number of people their birth year date and month and sorts it i got the algorithm figured out its just the code thats not hitting me! | |
Which is the most popular editor on these forums, please? Especially so, an editor that takes Python to the maximum of what it is capable of achieving. I'm hoping that I won't need such-and-such an editor to do this, and such-and-such an editor to do that... An all-in-one if possible. … | |
Question Enter a code that will test if player 'A' for team A or 'B' for team B was entered Call the procedure display_player( , ) with the relevant variables Enter the code that request the user to enter the positon My failes answer is: def diplay_player(team, position): team = … | |
Hello. I have a python script to post news a website but i want to know how i can pass variables from php to the python script and run the script from php. Python script: (I didn't create this, was done by a friend) [CODE] import urllib2, urllib USER = … | |
Hi:) Would any of you know how to solve one of the following problems? I dont't care which one!! 1. Write a program that reads in student marks until –1 is entered then display the highest mark, the lowest mark, and the class median. 2. Setting up matches for a … | |
![image_(2)](/attachments/small/4/image_(2).jpeg "align-left") ![image_(2)](/attachments/large/4/image_(2).jpeg "image_(2)") Hi There, I'm having a problem looping text I have attached an image of what I want. Thanks in advance, Ashley def drawPatch(win, x, y, colour): for i in range(5): for j in range(5): topLeftX = x + i * 20 topLeftY = y + j … | |
Hi there, I am trying to repeat my triangle on 100px by 100px; Any help is much appreciated. Many thanks, Ashley def drawTrianglePatch(win, x, y, colour): for i in range(5): for j in range(5): if (i + j) % 2 == 0: triangle = i * 20 triangle = y … | |
When trying to load csv file data into Scribus it only takes the data of the last row. I'm using ScribusGenerator.py by Ekkehard Will and my best guess is that the cause of the problem is somewhere in this part of the code: def replaceVariablesWithCsvData(self, headerRow, row, lines): # lines … | |
what are site directories in python ? are these some special folders ? | |
Hi all I have been asked to calculate days in a week. I know there is not 24 hours but 23 hours 56 minutes in a siderial day. How do I express that fraction in interactive mode. For example: print 60*23/56/60*7 or something to that effect. Anyone? Glenn. | |
I was promted with this problem, and cant even seem to figure out where to start??? Any help appreciated. Thanks. Write an algorithm for each of the following python operations and test you algorithm by writing a it up in a suitable function. You are not allowed to use the … | |
Hey everyone. I really need help with a question in Python. I have been trying for several days to figure this out. Any help will be much appreciated! Here is the question: Body Mass Index (BMI) is a good indicator of boy fatness for most people. The formula for BMI … | |
Hi :) I'm writing a simple program where I need to create multiple lists when i start (from a file) and write them to the file when I quit. I've googled and found that the best way is to put all the lists into a tuple and then write that … | |
This python 2.7 snippet adds a thin layer of sugar on the itertools module's api, allowing many of its functions to be used as decorators and adding some new functions. Enjoy ! | |
If you have a smaller image, you can include it in your program as a base64 encoded string. This way you don't have to worry about an image file to go with your code. In your program you can then decode it back to the familiar bytes of an image … | |
Hi All, I am a newbie programmer in python and I am trying to read multiple csv files from a folder, perform some data sums based on timestamps for each row for all the csv files and then output the sums to one result csv file. So far I am … | |
Hi all, I am generating graphs using "cairo plot" in web2py project. Here I am using BytesIO() stream for generating graphs. Everything runs fine when I run on localhost but when I deploy it on apache server and then run from different machines OR from different browsers in same machine … | |
Need help with the following code, The error comes at line 20. import ogr import os, shutil,sys import osr regionShp = "ne_50m_geography_regions_polys.shp" regionFile = ogr.Open(regionShp) regionLayer = regionFile.GetLayer(0) spatRef = regionLayer.GetSpatialRef() countryShp = "ne_50m_admin_0_countries.shp" countryFile = ogr.Open(countryShp) countryLayer = countryFile.GetLayer(0) dstDir = "spatial_analysis_2" if os.path.exists(dstDef): shutil.rmtree(dstDir) os.mddir(dstDir) dstPath = os.path.join(dstDir, … | |
I am working on an assignment for my fundamentals class and we have to create a program that is going to write/read/ and append a file. I wanted to set it up to check and see if example.txt exists. If so then append, else write. My question would be how … | |
#Hello, I am working on a homework assignment that after many hours, I still cannot get to function correctly. #The point is to take a list input of ones and zeros and print a compressed version. #Example) #input: [1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,0,0,0,0] #output: *41*50*71001*40 #Since the compression takes up 3 symbols(asterisk, amount of … |
The End.