15,185 Topics
| |
| Hi, I am trying to find this string "QuickSearchResultsCOnfig" in a text file. The text file will contain this in several places. I need the following var QuickSearchResultsConfig = ['a','b','v','d','e 'f','f']; I need to replace the above with var QuickSearchResultsConfig = [['a',{hidden:true}],['b', {hidden:true}],'v','d','e 'f','g ']; My original approach: Store a,b,c,d,e,f,g … |
Hello! I'm fairly new to Python. Hopefully you can understand what I'm trying to accomplish here. I'm making a GUI that prints Parking Garage Tickets. I want to be able to post an expiration date on the ticket. I found out about timedelta, and it works if I put in, … | |
Hey- First time posting here so hopefully I explain everything correctly. [CODE] class sendbackcurricula(app.page): def GET(self): query = models.Curricula.query.all() map = dict() for x in query: x = x.to_dict() map[x['owner_id']] = x['title'] return json.dumps(map); [/CODE] The above code will return the last element held in the database at 'owner_id' and … | |
The basic idea for this program is to for me to enter a code to a corresponding website (which is already in a dictionary in the body of the program) and search that webpage for a specific phrase and return a value. This is so that I can check number … | |
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 … | |
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 … | |
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 … | |
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. | |
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. | |
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, … | |
[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 … | |
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 … | |
| |
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() … | |
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 … | |
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 … | |
is it possible to link modules together and freeze them into an executable using cx_freeze? and how can you do it | |
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: … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 | |
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() … | |
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 | |
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 … | |
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. | |
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 … |
The End.