15,175 Topics
| |
[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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
I need to write a function that takes a string as an argument and outputs the letters backward, one per line.so far I have this: [code] def wordReverse(word): acum = "" for ch in word: acum = ch + acum return acum [/code] I tried adding \n to acum but … | |
Hi all its me needing help again :P My exercise says: Write a function wordPop that accepts a text and a length N and returns the list of all the words that are N letters long, sorted by their length. okay so what I have is 2 fuctions first: [CODE]def … | |
hi, im trying to do something like the following: text_area = wx.TextCtrl(self.panel, -1, style=wx.MULTILINE) a = (all the text in the text control window) I can't get my head around how to define the text with wxpython, how should I go about this? | |
Hello. I am just starting to learn Python, but I have some basic programming and web coding background. As my first real Python project, I want to come up with something that manages some basic content on HTML pages. Specifically, I want to come up with a way that I … | |
I use windows-xp python 2.6 Could I have your help. I need to hide and then show a Tkinter root window. And also "remove" the exit, minimize and maximize options. I can't do it like this! root.hide() #do some stuff root.show() Root.hide works but root.show doesn't. No Exception thrown. :( | |
I am trying to square each number in the list under [I]nums[/I]. But I don't know how to do it. I got this so far: [code] def squareEach(nums): for i in nums: y=i*i return y [/code] What is happening here is it's counting how many numbers are in the list … |
The End.