14,952 Topics

Member Avatar for
Member Avatar for JubalBarca

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 …

Member Avatar for sepp2k
0
219
Member Avatar for bobstein

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 …

Member Avatar for TrustyTony
0
15K
Member Avatar for 3e0jUn

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

Member Avatar for 3e0jUn
0
178
Member Avatar for HTMLperson5

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 …

Member Avatar for 3e0jUn
2
4K
Member Avatar for aekaette

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 …

Member Avatar for belenos46
0
607
Member Avatar for 3e0jUn

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 …

Member Avatar for 3e0jUn
0
123
Member Avatar for dilbert_here00

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

Member Avatar for dilbert_here00
0
3K
Member Avatar for yordan.todorov.35

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

Member Avatar for chris.stout
0
1K
Member Avatar for jtaylor408

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 …

0
172
Member Avatar for Ene Uran

Does anybody have experience with Python on the iPad? Is it easy to get and use Python?

Member Avatar for chriswelborn
1
143
Member Avatar for HTMLperson5

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

Member Avatar for Gribouillis
0
3K
Member Avatar for javanub123

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

Member Avatar for Gribouillis
0
142
Member Avatar for whypython

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 …

Member Avatar for Gribouillis
0
251
Member Avatar for manticmadman

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 …

Member Avatar for TrustyTony
0
193
Member Avatar for jgehlot09

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 …

Member Avatar for jgehlot09
0
731
Member Avatar for chophouse

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 …

Member Avatar for chophouse
0
2K
Member Avatar for shean1488

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

Member Avatar for ScottieF
0
266
Member Avatar for peterparker

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 …

Member Avatar for peterparker
0
262
Member Avatar for tony75

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 …

Member Avatar for tony75
0
663
Member Avatar for ThePythonNoob

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 …

Member Avatar for ThePythonNoob
0
242
Member Avatar for hughesadam_87

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

1
80
Member Avatar for avgprogramerjoe

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

Member Avatar for astronautlevel
0
3K
Member Avatar for astronautlevel

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!

0
104
Member Avatar for sam.tubb.10

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 …

Member Avatar for TrustyTony
0
223
Member Avatar for ChristianOncken

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

Member Avatar for ChristianOncken
0
1K
Member Avatar for david56connor

Hi there, I have a piece of code that I made to handle the joining of 'characters' in to a 'raid' on a game. The program refreshes a page to check if the 'raid' is available, if it is, it 'forms' the raid and 'joins' the characters. The joining process …

0
136
Member Avatar for smile1

I apologise in advance but I have resorted to posting all of my code as I'm really struggling on this! I have created a table which is initially empty then a user imports a text file and creates 'n' rows depending on the content. Each row has an option menu …

Member Avatar for TrustyTony
0
1K
Member Avatar for whypython

Suppose I have this textfile: **Generation #1:** trash_jsdbjsabnf trash_nsdjklfndsnf trash_jlsndfknsf ... trash_akjsdlkjasdasd **Game_List:** game = 111 game = 222 game = 333 **Generation #2:** trash_jsdbjsabnf trash_nsdjklfndsnf trash_jlsndfknsf ... trash_slajdlaskjdlas **Game_List:** game = 119 game = 262 game = 323 ... ... **Generation #500:** trash_jsdbjsabnf trash_nsdjklfndsnf trash_jlsndfknsf ... trash_jkansdklnalsda **Game_List:** game …

Member Avatar for TrustyTony
0
126
Member Avatar for etquart

Hi All, I'm currently working on finding a solution to strip/edit a texfile in order to pass it through to Oracle's SQLLOADER which in turn will import the data into a table. The textfile will need to be imported into a clob column inside the first table after which the …

Member Avatar for TrustyTony
0
140
Member Avatar for peterparker

A basic program which writes the user name who has logged in the windows machine: ###################### # User info # ###################### import os import datetime from time import strftime def foo(): usr_log = os.environ ['USERNAME'] sys_log = os.environ ['USERPROFILE'] current_time = strftime("%a, %d %b %Y %H:%M:%S") dt_str = str (datetime.date.today()) …

Member Avatar for peterparker
0
209

The End.