15,181 Topics
| |
I can't figure out what the problem is or how to rewrite my code to fix it. Basically I'm trying to create an Adventure game heavily influenced by the game Zork. The game presents you with some options and then you input your choice. I'm trying to account for a … | |
Hi, I am trying my hands on lambda function and here is my code. [CODE]>>> a = [1,2,3,4] >>> b = [17,12,11,10] >>> map(lambda x,y:x+y, a,b)[/CODE] And the output is : [CODE] < map object at 0xb7540eec >[/CODE] So my question is why this map object output? Why not actual … | |
How do i convert the list ['T','h','i','s',' ', 'i','s'] to ['This','is'] | |
I wrote code to rotate the image 90 - 180-45 But how can I rotate the Image at different angles : 20 or 80 or 155 ..... Etc. in jython | |
Tried to add two images on each other But the problem is because I have two images are merged in a gradual Which means that: to show the first picture on top and clear and the second picture is not visible Then gradually start Image Alathanih Baldhor to disappear Image … | |
Hi guys, i have a tricky problem with this wxgtk gui and thread nesting. As you can see i'm trying to collect data through a buffer ( self.data= dict() ) through the main gui. I need to get the data from the ComboBox and the three textfields then i need … | |
I've been running a python script successfully on Linux for about a month. Recently, I got a message that says "can not execute", "No such file or directory". I can type python and it runs on command line, but my script will no longer run on the daemon. It has … | |
Hi all. My new job involves writing scripts for people in other departments. I'm pretty much on my own with this and I'm still a beginner with Python(I think my brain is still in PHP mode and I'm still struggling with this object oriented approach). Here is what I have: … | |
Hello, I need help to get all together. Pls see 2 different codes below . 1 code: Represents format for final result paper called "vysvedcenie" (evaluation) for a particular student. code: [CODE]def do_once(f): f() def do_twice(f): f() f() def do_four(f): do_twice(f) do_twice(f) def hlavicka(): print 'x',' '*40+'VYSVEDCENIE'+' '*46+'x' def vertikal(): … | |
Does anyone here have any experience of the notebook widget in PythonCard? I can't figure it out and it is missing from the docs... Thanks. | |
Hi, I created a numpy matrix(1 row, 3 cols) with the following values [4 6 8]. What I want to do is to concatenate all these values into a single entry of binary values. So instead of [4 6 8] I would want to have a numpy matrix of just … | |
Firstly, this is homework for my computing science class, but we are allowed to get help on the internet or using any other way we want. I'm trying to write a program to read in a file with user responses to questions (I.E. an automated handset vote) and then to … | |
hi. i am writing a program in python and i need two things will be processed simultaneously but because i have a lot of global variables i can n't do it with parallel python library. i tried multiprocessing and Multithread too but nothing find yet. can someone suggest me a … | |
This snippet explores the change of a hexadecimal (base 16) string to a denary (base 10) integer and the reverse. Interestingly Python allows the representation of the hexadecimal string in two different forms. For instance 255 can be changed to 'FF' (also 'ff') or '0xff'. Any of these hexadecimal strings … | |
Hi everyone! I have a quick question. Is there any way i can update python package for cygwin manually? The setup.exe which handles cygwin installation and updates, prompts me to update the whole cygwin installation to 1.7.x but i would like to keep using the older version (1.5.25). I only … | |
1 23 456 7891 23456 plz give the code by using while loop................ | |
I have a question about h5py. I've read almost all of the tutorials online but I must be missing something. I'm wanting to read data from an h5 file that already exists. Here is the first part of the file as it looks from being h5dump'ed just so you can … | |
hey i want to put two values into one dict and am not sure how to achieve this. i want it to look like this. what am trying to do is a dictionary that holds the date as the key, and a dictionary as its value. That dictionary will contain … | |
I've been working on this code all night and i can't seen to find out how to do the math i think it needs a loop of some kind on line 17 and 18 also it wont print out the avg mpg please help def main(): 1 print("This program calculates … | |
the project is about a debate, and there are 4 candicates in the debate, and we need to group them into 4 different dict and count the word frequence they said. the debate is line by line, and we should group the sentences by name tage, like PAUL: and then … | |
Hello everyone, I have to code an array that in each row, it has 16 columns! So I called it myself a 17 dimensional array but I was wondering what data sturcture in Python can best represent this keeping in mind that, it should be easily addressable and modifible. For … | |
Hi There, I'm very new to Python. Is there a easy way of looping trhough a file and using the values in a grep command? [code] Value A Value B 2011-12-14 20:54:09, 797410378, 2011-12-14 20:55:52, 734451141, 2011-12-14 20:56:30, 796058907, 2011-12-14 20:59:51, 736280553, 2011-12-14 21:09:42, 729858848, 2011-12-14 21:12:02, 825895818, 2011-12-14 21:13:53, … | |
hey i am trying to find many attacks were logged per day per ip. i am reading from a syslog file. here a line couple lines am reading from [QUOTE]Jan 10 09:32:09 j4-be03 sshd[3876]: Failed password for root from 218.241.173.35 port 47084 ssh2 Jan 10 09:32:19 j4-be03 sshd[3879]: Failed password … | |
Hello I am new to Dani web but here it goes. I am trying to create a game that called Three button monte i am using graphics from zelle but and i will upload the proper code to go alone with mine. My problem is when it comes to checking … | |
hi everyone i have made a program which extracts information from an email account, it extracts the date, the sender, number of copies written in the body, and it extracts the pdf file from the email and puts it into a directory, it also counts the number of pages in … | |
Is there an easy way to modify the contents of a zip file inside the archive, without unpacking everything to a temp directory, making the change, then packing it all up again? I've got a whole bunch of zip files, each one with a bunch of plain text files (html, … | |
[CODE]info = '''<table> <tr align = "center"> <h1> Lachlan Osborn </h1> <p> Address: 5 Smith Street, Manly <br> Date of Birth: 26th April 1993 </p> <a href="semester.html"><b>My Semester Units</b></a> <p><b>Check out my <a href="hobbies.html">hobbies.</a></b></p> </tr> </center>''' def remove_html(text, info): import re text = re.sub(r'<.*?>', '', info) return text remove_html(text.strip())[/CODE] | |
I want this program to read a text file then target and replace anything start with < and end with > for example it finds <html>, replace that into **** but somehow i tested it and it didn't work than i expected. any suggestions? [CODE]def remove_html(text): txtLIST = list(text) i … | |
Alright so I was not sure exactly how to say this, but here is the idea. I have a graph or table I guess you could call that looks like this. [CODE] print ''' ----------------------------- | | | |x | | | |----------------------------- ''' [/CODE] Then I want to make … | |
Create a function that take a full name as a parameter and returns just the middle name regardless of how many words it consists of. |
The End.