15,175 Topics
| |
the code on my localhost and on the server are completely the same (django), but it is not shown correctly; I include two screenshots What could be the cause of the difference? (the left one is the online server; the right one is the localhost) | |
How to convert dd-mmm-yyyy (01-Jan-2009) to dd/mm/yy (01/01/09) using python functions. | |
what can i get from object.attribute? what does it do? Thank you :) | |
hello Seniors, i am new to python development.i have started my internship in that language. can any one provide me the code that show me how to add subtract and multiply matrices in python.??? what will be the code if i want to take input from the user to enter … | |
I want to replace 'nf' with 1.0, so that the resulting string should be: '(1.0+nfpermult+1.0)' I tried various approaches using find(), re.sub but I am not able to make it work. eg. re.sub('nf', '1.0', str) replaces all occurrences of nf. also re.sub('\bnf\b', '1.0', str) does not work either as 'nf' … | |
[QUOTE=vegaseat;250820]This little code shows 6 random integer numbers from 1 to 50 ... [code]import random print "show 6 random integers from 1 to 50:" for k in range(6): r = random.randint(1, 50) print r, print [/code] Rewrite the code to make sure there are no duplicate numbers amongst the six … | |
Okay, I'm creating a Battleship game. It's going to be using the console for now, still don't know GUI. Anyways, this is my issue. I have created two boards as lists, the first for the user, the second for the computer. I have the computer generate random numbers and a … | |
hi everyone ı have a very big text file which is 35mb and that includes 85000 lines. those lines are the rules of ıptales and from the command shell ı do paste and copy and as you can see it that ıs very diffucult to paste every lıne ı trıed … | |
Hi everyone, having trouble coming up with the right code for 8 directional movement [ up, upright, right, downright, down, downleft, left, upleft] My keypress handling is: [CODE] if event.type == KEYDOWN: if event.key == K_LEFT: player.moveLeft = True player.moveRight = False if event.key == K_RIGHT: player.moveRight = True player.moveLeft … | |
Hi, I want write a program which extract 'Rated PG for some scary moments and mild language' from the following html file and return it as a list . html file: <div class="info"> <h5><a href="/mpaa">MPAA</a>:</h5> <div class="info-content"> Rated PG for some scary moments and mild language. (also 2009 extended version) … | |
I'm not sure this is the correct forum for this, but it's at least relative. I was wondering if anyone knew of some decent references and ebooks for a beginning Django user.Yes, I know djangoproject has tutorials, but there decently hard to understand. If someone could either help or steer … | |
I need to convert a number (in decimal form) that is between 1 to 4999 to Roman Numeral Form. However, though the code I have is kinda working, its only outputting the thousand digit, not anything less or any part thats less. [code] def int2roman(number): numerals={1:"I", 4:"IV", 5:"V", 9: "IX", … | |
Hi, I am trying to pack a unicode string of 40 bytes using the pack method. [code=python] data = pack('<8sB40s', asc_time, language_id, message) [/code] it throws the following error: struct.error: argument for 's' must be a string What is the argument for a unicode string? Thanks in advance. | |
hi currently on my ubuntu i have both wx-2.6-gtk2-unicode & wx-2.8-gtk2-unicode installed, but when i use this code in python 2.6 : [CODE]import wx[/CODE] always wxwidget 2.6 was imported. is there any solution to have both or it's better to uninstall version 2.6 ? thanks | |
Hi all, I have this dilemma, if I receive strings on the form of: <Ranking: AA (John)> <Ranking: CA (Peter)> <Ranking: TA-A (Samantha)> And I want to take the ranking only from the strings (i.e. AA, CA, TA-A) How can I do it using string methods like split or strip … | |
hello, i want to utilize the demo code given in the wxpython 2.8 documentation & demos. can any one guide me how can i do that??? when i try to copy that code to editor to change it according to my requirements ..it gives me an error message and close … | |
Hi, I wonder how to use wx.FileDialog with turbogears . I have this turbogears project, and i have a form which add new employees, and for each employee i need to let the person who is adding them to pick a photo from his filesystem. And all wxPython guides already … | |
Hello everybody, I am having trouble to create the following script: I would like a screenshot been taken each time a click is detected. Also (if possible) to be able to modify the x and y of the size of the screenshot. There is my code (doesn't work yet): [CODE] … | |
Duh! I'm now using Linux from my external HDD again. Please suggest a good IDE for me Thanks | |
I really need help because of my senior project. I don't know the Python syntax and how I write. So please help me...! I have a prototype presentation on monday and I have to show login, logout and sending a mail code parts... Can you help meee???? pleaseeeee=(((( | |
Hi , Im trying to extract the number 7.2 from the html string below using python: '''<a href="/ratings_explained">weighted average</a> vote of <a href="/List?ratings=7">7.2</a> / 10</p><p>''' I thought this would be code to do this .But how come this doesnt work ? averageget = re.compile('<a href="/List?ratings=7">(.*?)</a>') average = averageget.findall(htmlr) Could it … | |
Would it be of interest to learn C or C++ if one already know python? I'm a linux and programming enthusiast (i.e hobbyist ;-) ) and C is pretty common on linux and many other applications. But is it worthwhile learning C if I already know python? What are the … | |
Hi all, How to write one file to the end of other file using python. | |
First: Yes I'm comparing apples to oranges but in this case it is kind of possible to compare them Context: I'm a php-developer for 3-4 years I think and I really like php, I also use python for 2 years. I recently came in contact with django (python framework) and … | |
Hello, I'm trying to deal a bit with IRC and Python 3. The decoding from bytes to Unicode create quite a dilemma. 1. Somehow it works to convert the å character from utf-8 to bytes, but the received bytes seem to often be encoded in latin-1, or at least they … | |
Okay, so I have a tuple for a game, and this is it: [icode]['Hondros', {'Equiped': [['none', [], 0], ['Rags', [0, 1, 0, 0], 1, 1], ['Mocassins', [0, 0, 1, 0], 1, 1], ['Gauntlets', [0, 0, 0, 1], 6, 5]], 'Equipment': [0, 1, 1, 1], 'Stats': {'AC': 14, 'Strength': 15, 'Constitution': … | |
Im trying to write a code for a colour picker, so a user can pick 4 different colours and then it would return them so i can use them in a different par tof the program, but its not working properly and i can work out why. any ideas? [CODE]def … | |
In the program below, I have two questions. First, the first object, card1 passes the strings A & c to it's master class. What I want to know is, what do these two strings have to do with the A & c in RANKS & SUITS? If the class had … | |
I'm thinking about writing a small command line directory management program in Python. The most basic functionality I want is to be able to compare the the files in a directory and sub-directory, and if there are any duplicates then delete the lower most duplicate. I all ready have a … | |
lets say i want to make a function that accepts a single argument that is supposed to be a number. lets say the function displays the range between 0 and the argument. Normally I'd do something like this: [CODE] def range_display(integer): set = [] for num in range(0, integer): range_list … |
The End.