15,190 Topics

Member Avatar for
Member Avatar for pn1925

I am trying to write a python script to open file, read each line, and replace the 18th position of each line with a a user specified character (sysargv[3]) IF AND ONLY IF that 18th position is another user specified character (sysargv[2]). It should then save it as a file …

Member Avatar for pn1925
0
147
Member Avatar for Trak

Hi :) i'm kind of new to this site and everytime I read a thread someone else makes i don't understand what anyone is saying.... :sad: well anyways, please help me python pros. I have been on my very first exercise of "Learn Pyhton the Hard Way" since two weeks …

Member Avatar for brikbrat
0
603
Member Avatar for 3e0jUn

Guys check out http://cx6-dev.blogspot.com/ for an awesome game coded in Python. It's new but still fun. HIGHLY RECOMMENDED! PS: You'll need to have Python 3.2 or above to install/play it.

0
75
Member Avatar for helpneeded87

Hello, I was seeking help in why my small program/script is not performing the way I would like. Here is the question. Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each …

Member Avatar for helpneeded87
0
243
Member Avatar for lrh9

I had been wanting to write an IRC bot with asynchronous IO for a while. My bot responds to pings, but can be extended by defining functions and registering them to get called when the bot receives certain commands. My bot uses the RFC 1459 USER command and parameters, but …

Member Avatar for lrh9
0
261
Member Avatar for TrustyTony

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

Member Avatar for svfox2000
0
1K
Member Avatar for chriswelborn

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 …

Member Avatar for chriswelborn
0
312
Member Avatar for veledrom

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 …

Member Avatar for HiHe
0
2K
Member Avatar for 3e0jUn

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

Member Avatar for HiHe
0
151
Member Avatar for kuchi

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

Member Avatar for kuchi
1
758
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
234
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
180
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
702
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
145
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
143
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
253
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
194
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
733
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
681
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
254

The End.