15,185 Topics
| |
As in C++ was some question about speed of simple hard disk based lookup, here is a version of unscramble program completely HD based lookup, which gives all possible candidate words for multiword anagram. Program is not sensitive for case of words but does not ignore special characters like ' … | |
This is a script that was supposed to be very basic, just running a command with my scripts arguments attached. I didn't realize that if user 'cj' opens firefox, when user 'root' does '**firefox -new-tab**' it doesn't work. Firefox will just open a new window, and thats exactly what I … | |
Hi, I've started learning Python and want to find out how easy is creating GUI for a software. I used to use VB6 with Visual Studio and it was all about Drag and Drop items on a form. Do we have such thing or we just have to hand code … | |
I have a code for a game. money_file = open ('money.$','r').read() money_file = str(money_file) money = int(money_file) But everytime I run it, it returns an error: Traceback (most recent call last): File "C:\Users\eeo.j\Desktop\CX6 SDK\CX6 Normal\CX6.py", line 86, in <module> money = int(money_file) ValueError: invalid literal for int() with base 10: … | |
I've an web page which reads the data from (server side) database and write into csv file, but as per requirement I need to write the file in client side and asked user to save the file in their local machine with popup window to save the location (client side), … | |
Okay, my problem goes as follows. I've been writing a small program in python (an adventure game) which has hitherto run via the console. I'm now working on giving it a full interface, which is requiring a lot of changes to my rather simplistic/archaic structure and generally making things something … | |
OK, so when I use open(<filename>, 'w') the program either writes to the specified file or creates a new one if it doesn't exist, right? Is there a way to create a folder path or something? Like to create D:\My Documents\Folder and create a file in that folder? How would … | |
I've been working on Tkinter, and setting a message box. It worked fine, but I didn't really like the fact that the text displayed was in a small position in the window. Take a look at this code and you'll know what I mean. def About(self): text = Message(self, text=''' … | |
| Hi, all. I am trying to clear the console window without using the "os" library. This seems like the only way to do it: from os import system import time print "I will clear the screen in 2 seconds" time.sleep(2) system("cls") print "*Cleared Screen*" SystemExit() But the problem is, this … |
Hello, I am trying to read values from an excel spreadsheet but just for specific cells at a time; say Cell A1 and B1. Then I want to save the respective values into a variable and use the variable through out the rest of the code. Then loop at the … | |
Is there any way to host several txt files on a computer without having to dive deep into socket programming? I have a few requirements, though: * People could connect when the app is running * No inteference of Windows * Instructions on how to create a client side software … | |
Hi, I was trying to access some functions from a dll using python ctypes, but not sure how to pass pointers to get it to work. Here is an example of what i am trying to call: GetAvailableDevices ( SdkHandle session, DeviceDetail * pDev_list, uint32_t * dev_list_size ) Parameters: [in] … | |
Hi there, i need to use this function but it is write in Python and if is possible i dont want to start learning Python just for one function so i wanted to ask if someoen can direct me to Pythong to C# convertor or help me convert this function. … | |
I want to be able to have a set of panels of vertical panels that remain the same size, but I want to have a vertical scroll bar that will allow me to scroll in the window. Right now I'm using a wx.ScrolledPanel and adding panels to that and putting … | |
Does anybody have experience with Python on the iPad? Is it easy to get and use Python? | |
| Hi, all. I am having a problem using the `getpass()` function, there are no problems with the `raw_input()`, though. I'm trying to check the user input is valid (meaning that the Username is nav and the password is 39429432) Really, I DON'T want to use `raw_input()` for the password field. … |
Hey Guys, i just started learning python and havent really done much programming so im pretty new im following a book and I have to read some data from a text file the code thats giving me trouble is os.chdir('Users\spreston\Desktop\HeadFirst\Chapter 3') the error says that the path does not exist, … | |
Suppose I have this textfile A: League 1: a = 123456, b = england a = 234564, b = brazil a = 939311, b = germany ... League 2: a= 213213, b = italy ... ... League 500: a = 74778, b = denmark ... ----------------------------------------------------- Now, I have another … | |
I am trying to check for a palindrome. I keep getting errors when reaching the first if statement. I feel it is because i returns as a letter and not the position number in the string. What am I missing? def palindrome(str): s=(str) sum=len(s) l=int(sum/2) for i in s[0:l]: if … | |
I am trying to grab the string/object from the treeview. So when a user click on any item in the treeview, I can show it on the terminal. ANy help is appreciated.Here is the code. QtCore.QObject.connect(self.treeWidget, QtCore.SIGNAL("clicked(QModelIndex)"), self.treefunction) def treefunction(self, index): print index Output on clicking the item in treeview … | |
I'm getting an error/crash when trying to use Python on my virtual server running Win 2008 Server. Python installed without incident, and IDLE opens and the interactive widnow works fine. But when I try to open a new window and run it it crshes when trying to save. Example: I … | |
Hi everybody. My question is. I made an html template that I will extend in every other html pages. And this template have some variables. So my question is how to assign a function to this base template. Let me be more clear and give you an example: base.html ... … | |
I am learning Python through LPTHW. There is an exercise where we need to create test scenarios. The following is the code for whom Test Case have to be made: ############################# # Sentence Parser # ############################# class ParserError(Exception): pass class Sentence(Object): def __init__(self, subject, verb, object): # remember, we take … | |
Hello Friends Creating library object. I have a library.txt that contain 20 books and every line in library,txt contain author ,title and loan , my questions is how to create class and object for library script with python. 1. search at title 2. search at author 3. Borrow a book … | |
Hey guys im need some help with this binary calculator, you enter the amount of bits or n in and then it calculates the number? In order for you to understand my problem more I will explain why I am making this, I asked my dad how big 128 bit … | |
Hi guys, I was working with the pandas package and was so impressed with how simple something was that I had to share. Have you ever worked with csv data (in excel for example) and wanted to import the data to python, take either a column average or row average, … | |
This is a simple game of pong with made using pygame. You will need to make a picture of the pong for it to run properly. Simply make a cirlce in paint, 25x25. Joe | |
Hi guys. I made a pong game with Python, and I was looking for some possible improvements. The code can be found [here](https://github.com/astronautlevel/Python-Repo/blob/master/Python/Pong%20game/Pong.py). Please look at it and reccomend some improvements. Thanks! | |
Hello, I am newish to wxPython and I am attmpting to make a text editor Everytime it attempts the open file code it gets this error: IOError: [Errno 22] invalid mode ('r') or filename: u'' WHY!!! here is the code... import wx import os wildcard = "Text file (*.txt)|*.txt;|"\ "All … | |
from socket import * from time import time, ctime import thread import Queue import os class ThreadSafeConsole(Text): def __init__(self, master, **options): Text.__init__(self, master, **options) self.queue = Queue.Queue() self.update_me() def write(self, line): self.queue.put(line) def clear(self): self.queue.put(None) def update_me(self): try: while 1: line = self.queue.get_nowait() if line is None: self.delete(1.0, END) else: … |
The End.