15,175 Topics

Member Avatar for
Member Avatar for Kruptein

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)

Member Avatar for hondros
0
298
Member Avatar for rmsagar
Member Avatar for vegaseat
0
198
Member Avatar for eva yang
Member Avatar for vegaseat
0
127
Member Avatar for punter999

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 …

Member Avatar for vegaseat
0
141
Member Avatar for kbalamuk

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' …

Member Avatar for vegaseat
-1
6K
Member Avatar for badboy00z

[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 …

Member Avatar for badboy00z
0
845
Member Avatar for hondros

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 …

Member Avatar for hondros
0
101
Member Avatar for rehber344

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 …

Member Avatar for woooee
0
184
Member Avatar for BlackPhoenix

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 …

Member Avatar for JugglerDrummer
0
292
Member Avatar for masterinex

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) …

Member Avatar for vegaseat
0
233
Member Avatar for Democles

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 …

Member Avatar for Stefano Mtangoo
0
79
Member Avatar for curiouskitten

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", …

Member Avatar for vernondcole
0
4K
Member Avatar for vsagarmb

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.

Member Avatar for d5e5
0
164
Member Avatar for mehdi0016

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

Member Avatar for vegaseat
0
92
Member Avatar for El Duke

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 …

Member Avatar for vegaseat
0
135
Member Avatar for punter999

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 …

Member Avatar for vegaseat
0
96
Member Avatar for fferrandini

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 …

Member Avatar for Stefano Mtangoo
0
94
Member Avatar for Benou

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] …

0
36
Member Avatar for Stefano Mtangoo

Duh! I'm now using Linux from my external HDD again. Please suggest a good IDE for me Thanks

Member Avatar for Stefano Mtangoo
0
123
Member Avatar for gzm_e

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=((((

Member Avatar for Stefano Mtangoo
0
73
Member Avatar for masterinex

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 …

Member Avatar for ghostdog74
0
99
Member Avatar for mahela007

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 …

Member Avatar for Narue
0
133
Member Avatar for rajeshwari_ib
Member Avatar for eva yang
0
7K
Member Avatar for Kruptein

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 …

Member Avatar for ShawnCplus
0
58
Member Avatar for ribot

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 …

0
67
Member Avatar for hondros

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': …

Member Avatar for hondros
0
168
Member Avatar for pyguy420

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 …

Member Avatar for woooee
0
111
Member Avatar for lewashby

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 …

Member Avatar for woooee
0
96
Member Avatar for lrh9

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 …

Member Avatar for Gribouillis
0
92
Member Avatar for ffs82defxp

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 …

Member Avatar for snippsat
0
89

The End.