15,181 Topics

Member Avatar for
Member Avatar for kimberling

Hi, I had write a script in perl to randamize hex value and get the results as attached. Which is decimal value-----hexadecimal value. If i want to get randomized hexadecimal value 0x12c8xxxx but not 0x12c80000, what can i do? (where xxxx is not zero but with some hex value) I …

Member Avatar for calccrypto
0
88
Member Avatar for Gribouillis

How would you safely round a floating point number to the nearest integer ? Python has the built in function [icode]round[/icode], but it returns a floating point number [code=python] >>> round(4.9) 5.0 >>> help(round) Help on built-in function round in module __builtin__: round(...) round(number[, ndigits]) -> floating point number Round …

Member Avatar for Gribouillis
0
3K
Member Avatar for kumarantechie

hi, I want to run an application that is compiled in python 2.5 in fedora 13 but fedora 13 comes with python 2.6.4 so i manually install python 2.5 to run the application but it is saying that no module named gtk .. how to set path for gtk for …

Member Avatar for woooee
0
145
Member Avatar for TrustyTony

Here is my practise with [URL="http://www.boggled.org/"]boggle [/URL]letter square non-overlapping word finder after some drastic debugging and cleaning. I think it is reasonable speed also. Comments wellcome.

Member Avatar for TrustyTony
0
1K
Member Avatar for personx1212

hi there, i have some binary data (zip files, music, etc..)stored in a database, how can i start those files in memory without saving them to HDD..or even to temp files folder... thanks.

Member Avatar for personx1212
0
75
Member Avatar for acrocephalus

Hello! I am trying to run the code provided in the texttable module documentation ([URL="http://jefke.free.fr/coding/python/texttable/"]http://jefke.free.fr/coding/python/texttable/[/URL]) as shown in the code, but it returns a name error which tells that Texttable is not defined. [CODE]import texttable table = Texttable() table.set_cols_align(["l", "r", "c"]) table.set_cols_valign(["t", "m", "b"]) table.add_rows([ ["Name", "Age", "Nickname"], ["Mr\nXavier\nHuon", 32, …

Member Avatar for Gribouillis
0
2K
Member Avatar for fingerpainting

[B]Background: [/B] I'm extracting values from a file which is sometimes an xls and sometimes an xlsx file. An xls is easily read with xlrd, but xlrd nor any other Python library (as far as I could find) supports xlsx, so instead I'm using[URL="http://github.com/dilshod/xlsx2csv"] xlsx2csv[/URL] to convert to csv and …

Member Avatar for fingerpainting
0
9K
Member Avatar for spockGirl

Hi! I'm trying to figure out if it's possible to graph a piecewise mathematical function using Python where the limits of the function are dependent on another variable (i.e., if a > b, graph f(x); if b > a, graph g(x)). I've been trying to google stuff about graphing, but …

Member Avatar for Gribouillis
0
130
Member Avatar for wolfeater017
Member Avatar for tbone2sk
0
153
Member Avatar for buddyalexander

I have just started to learn python (Learning Python), and I am trying to move some files to another folder that are over a week old. I keep getting an error about the files not existing. import shutil, sys, time, os src = 'c:/users/wca36050/temp1' dst = 'c:/users/wca36050/temp2' now = time.time() …

Member Avatar for TrustyTony
0
240
Member Avatar for onthego

I can't seem to get a comma embedded string (i.e. an LDIF DN value) to save as a key in an associative list without the value being interpreted as a list itself. I can't find a method that will cause the value of the string variable to be interpreted intact …

Member Avatar for onthego
0
236
Member Avatar for abhijat

Hi guys, I'm new to the forum and to progamming. I've started following a set of online video lectures as an introduction to programming using python. One of the problem they asked to solve is to create a simple program that computes and prints the 1000th prime number. I got …

Member Avatar for TrustyTony
0
1K
Member Avatar for wolfeater017

is it possible to link modules together and freeze them into an executable using cx_freeze? and how can you do it

0
113
Member Avatar for nickles

I'm trying to decrypt some data from gpg files that I've downloaded. Downloading the files to a directory is no problem, but I'm having trouble actually decrypting them. Here's what I'm doing right now: [CODE]def extractGPGs(gpglist,path,gpgPath="\"C:\\Program Files\\GNU\\GnuPG\\gpg.exe\""): os.chdir(path) if not os.path.isdir("GPGFiles"): os.mkdir("GPGFiles") if not os.path.isdir("OtherFiles"): os.mkdir("OtherFiles") if gpglist == None: …

0
67
Member Avatar for jonnyflash

I'm writing an app that requires a list from Python to be read into an array in C++. The problem I'm having is that I can't get my code to work under any version of Python after 2.4, and I don't think I'm using any deprecated functions. It runs fine …

Member Avatar for Gribouillis
0
1K
Member Avatar for tiddster

I am using regular expressions to look for certain keyword sin a string. At the moment I have got: import re thisText = "<meta http-equiv='content-type' content='text/html; cHarSet=gBk' />" n = re.compile(r'\b\s*charset=gbk[a-z]*', re.IGNORECASE|re.VERBOSE) print n.findall(thisText) this allows me to get the string, ignoring the case of the text. I also want …

Member Avatar for snippsat
0
107
Member Avatar for aint

When I write a code, I put time related codes in the beginning and at the end to see how many seconds it takes. Is it possible to write it as a module, and refer to it when i write a code just with a single line of code? [CODE]import …

Member Avatar for snippsat
0
110
Member Avatar for sachinpkale

Hi, I am trying to export http_proxy using following python script Though, it prints 'Successful', it is not setting proxy correctly. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ import os command = r"export http_proxy=http://my_username:my_password@proxy_server_address:3128" if os.system(command) == 0 : print("Successful") else : print("Unsuccessful") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What will be the possible problem

0
20
Member Avatar for gishi

hi! does anyone know how to convert excel file (xls and xlsx)(or even just xls) into csv preferably using xlrd and csv modules. i need to convert a specific excel sheet to csv. i need to create a csv file instead of using comma but semicolon. i am still not …

Member Avatar for gishi
0
619
Member Avatar for faby

hello everyone! I wanted to create a priority queue in which there would be different dictionaries with their priority numbers. The major problem I'm experiencing is that the queue just prints the dictionaries without regard for their priority. Please what do I have to do so that the queue prints …

Member Avatar for TrustyTony
0
2K
Member Avatar for cleve23

Is there a module in python that i can use to parse javascript??? I finding a module that parse out the error message like what the cssutils do when checking on css script. Thanks

0
54
Member Avatar for lewashby

In the following program I don't understand why 'mixer' is given as an argument to the function 'create_gui'. Please explain. File 1 [CODE]# imports from Tkinter import * from sound_panel import * import pygame.mixer # create gui app = Tk() app.title("Head First Mix") # create mixder mixer = pygame.mixer mixer.init() …

Member Avatar for vegaseat
0
133
Member Avatar for wolfeater017

how do you get it in pygame so that when you click on a rect it will reset the window but only when you click on that certain rect

Member Avatar for wolfeater017
0
113
Member Avatar for hamstes

Hi. Im new to Python and I need help upgrading the python version 2.6.5 to version 3.1.2. I'm running x64 Ubuntu. After I download and install the 3 version it does not overwrite or default itself as the new thing. I can't uninstall the 2 version because of dependencies on …

Member Avatar for redyugi
0
127
Member Avatar for SgtMe

I want to make an array (using the built-in array module), to create an array made up of classes. All the objects in the array will be the same class, but I want to be able to append new classes on the end and read the values. Thanks in advance.

Member Avatar for SgtMe
0
172
Member Avatar for timrichardson

Hi. I'm getting the hang of tkinter now, thanks for help in my first thread on this. Now, I've happily using the simpledialog module, but it's not using the themed widgets (ttk). I think it's a good exercise for me as a python beginner to fix this myself, but I …

Member Avatar for vegaseat
0
306
Member Avatar for murjam

Hello This is my first post on this forum. I have found that this place seems to have lot of knowledgeable people when it comes to Python. Anyway I'm quite new to GUI programming and I'm not exactly having a huge problem but I'm more interested about how to make …

Member Avatar for TrustyTony
0
154
Member Avatar for KirkK

I can't seem to understand why I cannot run this. Please explain. Thank you in advance. [code] #07/22/2010 #Write a program that will calculate a 20% tip and a 6% #sales tax on a meal price. The user will enter the meal price #and the program will calculate tip, tax, …

Member Avatar for TrustyTony
0
160
Member Avatar for aniyishay

Hey guys, Im trying to learn python and i decided to try and make a text based tic tac toe game. I dont have the matching up yet (where the rows say there are 3 in a row they win). But I have this so far and as you can …

Member Avatar for aniyishay
0
2K
Member Avatar for kate2mba

Wirte a regular expression pattern to match all words ending in s. This is what I got but seems like im thinking to hard on it, plus of course its not working lol Please help! :) [CODE]import re str = "Subs are everwhere" print (str) matchObj = re.match(".*?s ",str,re.L|re.I) if …

Member Avatar for kate2mba
0
147

The End.