Forum: Python May 9th, 2008 |
| Replies: 2 Views: 320 |
Forum: Python May 9th, 2008 |
| Replies: 8 Views: 323 |
Forum: Java Apr 8th, 2008 |
| Replies: 1 Views: 203 Python to Java: Questions I Have Hi,
I'm a high-school freshman that wont be taking a programming class until next year. I am proficient at Python, and they decided to put me in AB Programming, which is Java.
When I first started... |
Forum: Python Apr 1st, 2008 |
| Replies: 1 Views: 352 |
Forum: Python Mar 26th, 2008 |
| Replies: 6 Views: 522 Re: Function & writing to file problem You, my friend, need to try concatenation.
I believe that it works with both lists and strings, so this is what you'd do;
final = fileString1 + '\n'+ fileString2 + '\n' + "" + integerData
outfile =... |
Forum: Python Mar 24th, 2008 |
| Replies: 7 Views: 635 Re: XML parsing Ok, I fixed it :)!
It works great!
I decided to give up on converting it to DOC ;) but it converts to text files excellently.
I'll update the version I posted earlier after I get back on Linux to... |
Forum: Linux Users Lounge Mar 23rd, 2008 |
| Replies: 22 Views: 1,043 Re: Faster Linux for Good Hardware Too much choice :).
Thanks for all of your replies.
I made a list of all the kernel mods I need and I'll try it out again.
Probably wont go to Arch VooDoo unless the Final Hardy LTS disappoints (I... |
Forum: Python Mar 23rd, 2008 |
| Replies: 3 Views: 400 Re: user input choosing attribute Your best method would be to use lists (in C, arrays).
(BTW:
1. I don't think you can use self outside of a class.
2. raw_input always returns a string
)
data = []
type = raw_input("Type: ")
entry =... |
Forum: Python Mar 22nd, 2008 |
| Replies: 1 Views: 277 Re: NameError: name 'guess' is not defined guess == int(raw_input("enter an integer:"))
should be
guess = int(raw_input("enter an integer:"))
If you try to assign a value to a variable using '==', you will return a Boolean data validity... |
Forum: Python Mar 22nd, 2008 |
| Replies: 7 Views: 635 Re: XML parsing hmmm..
not quite windows yet..
I found the bug but cant kill it.
Does anybody know how to use zipfile.ZipFile to access a file within a directory in a ZIP?
edit: this works great on Linux, i'd post... |
Forum: Kernels and Modules Mar 21st, 2008 |
| Replies: 3 Views: 382 |
Forum: Python Mar 21st, 2008 |
| Replies: 4 Views: 203 |
Forum: Python Mar 21st, 2008 |
| Replies: 8 Views: 375 |
Forum: Python Mar 21st, 2008 |
| Replies: 3 Views: 1,862 Re: Python web browser automation Webbrowser is great too.
import webbrowser as WEB
WEB.open('anyfile.extension')
# are URL's accepted? probably
# or under Linux, you could;
# import os
# os.system('firefox URL')
# and then
#... |
Forum: Kernels and Modules Mar 20th, 2008 |
| Replies: 1 Views: 473 Re: new to linux :quick linux questions. If you have kernel source, look in promising folders. There isnt great documentation on where to find things, I dont think.
There are daemons (background tasks), active, dead, zombie (killed but... |
Forum: Kernels and Modules Mar 20th, 2008 |
| Replies: 3 Views: 382 Kernel Autocompile Script (?) Hi,
to me, specifying hardware for compiling the kernel is the biggest pain and things never seem to go perfectly.
Either the boot process is too slow, or sound doesn't work, or something...
Is... |
Forum: Linux Users Lounge Mar 20th, 2008 |
| Replies: 22 Views: 1,043 |
Forum: Python Mar 20th, 2008 |
| Replies: 8 Views: 375 Re: Judging my skill. You're looking for this; http://www.codesampler.com/python.htm
I just messed with size dimensions, speed and crap to learn a bit of pygame.
The original is well commented (I tested out a script to... |
Forum: Python Mar 20th, 2008 |
| Replies: 5 Views: 579 Re: Making a programs in addition to the main one If you want to send data to external programs, your easiest method is using sys.argv.
After executing your first program, you'd need to execute the other program with your data in the argument within... |
Forum: Python Mar 20th, 2008 |
| Replies: 1 Views: 275 |
Forum: Linux Users Lounge Mar 19th, 2008 |
| Replies: 13 Views: 930 Re: When Hardy Comes Out... Yeah, it may be better to backup your files and Gconf, then do a manual reinstall via CD.
The dist-upgrade method messed up all of my default programs (on Feisty).
To linux:
do you have an... |
Forum: Linux Users Lounge Mar 19th, 2008 |
| Replies: 22 Views: 1,043 Re: Faster Linux for Good Hardware I've done everything I've found to tweak Ubuntu.
IPv6 alias junk, screwing with ext3 writeback methods, stripping all the unused services via BUM (yea, hdparm is enabled) and tuning the boot... |
Forum: Python Mar 19th, 2008 |
| Replies: 2 Views: 187 Re: defining and Importing file If you dont read the link;
yourfile = open('yourfilename.txt','r')
# r stands for read
yourtext = yourfile.readlines()
print yourtext |
Forum: Python Mar 19th, 2008 |
| Replies: 7 Views: 635 Re: XML parsing Using Dive Into Python, I came up with this.
I decided to parse the file myself, its easier this way (to me).
import os, zipfile
print """DiXTiXa.py; GPLv3 Python DOCX to TXT Assembler
Converts MS... |
Forum: Python Mar 19th, 2008 |
| Replies: 4 Views: 203 |
Forum: Python Mar 19th, 2008 |
| Replies: 8 Views: 317 Re: python + web found something awesome;
import webbrowser
file = 'any media or html/xml file you like.extension'
webbrowser.open('%s' % file) |
Forum: Python Tutorials Mar 19th, 2008 |
| Replies: 3 Views: 6,689 |
Forum: Linux Users Lounge Mar 19th, 2008 |
| Replies: 22 Views: 1,043 Faster Linux for Good Hardware Hi,
I am in the search of my 'perfect' Linux fit.
So far, Ubuntu 7.10 seems to be getting the most points, but it is slow compared to Zenwalk and others.
My hardware is pretty good, it can manage... |
Forum: *nix Software Mar 19th, 2008 |
| Replies: 9 Views: 645 |
Forum: Python Mar 19th, 2008 |
| Replies: 8 Views: 317 Re: python + web A web browser is better suited for such, but please search the global module index, there will be something in there for you. |
Forum: Python Mar 19th, 2008 |
| Replies: 8 Views: 375 Re: Judging my skill. Here is an interesting example I slightly modified.
import random, os, pygame
from pygame.locals import *
SCREEN_WIDTH = 742
SCREEN_HEIGHT = 600
def loadIageFile(name, useColorKey = False):
... |
Forum: Python Mar 18th, 2008 |
| Replies: 8 Views: 375 Re: Judging my skill. Very simple :);
Do you know what to do?
Do you even know what you want to do?
There's a wide variety of games...
I'm sure you've heard of Pygame.. why don't you test it out.
I made a lil star-wars... |
Forum: Python Mar 18th, 2008 |
| Replies: 5 Views: 420 Re: pyGTK and the Mandate of Sudo Sudo has its uses, overall I think its important, though it can be a pain.
Let me stress that this has to be portable. I can't randomly create scripts like that on multiple-users computers. People... |
Forum: Python Mar 18th, 2008 |
| Replies: 5 Views: 373 |
Forum: Python Mar 18th, 2008 |
| Replies: 7 Views: 635 Re: XML parsing Thank you all for great replies!
Dive Into Python looks really good, I'll read it. Thanks, again. |
Forum: Python Mar 16th, 2008 |
| Replies: 7 Views: 635 XML parsing I need to convert .docx files to .doc (on Linux and Windows).
I'm planning to use the zip mod to access all of the internal XML documents.
Then I'll the /word/document.xml and I need to parse it so... |
Forum: Python Mar 16th, 2008 |
| Replies: 5 Views: 420 Re: pyGTK and the Mandate of Sudo I'm running GNOME :D.
Did you try to actually remove anything with KleanSweep? Because it still prompts for a password when I use it (if you do, make sure to back up).
One more thing, did you run KS... |
Forum: Python Mar 16th, 2008 |
| Replies: 5 Views: 373 Re: Compiling SPE IDE Using PY2EXE Sorry, just that in a different Python to Executable compiler, (by a Mr Gold.. something), you have to add a line specifying whether to compile tk, wx, or gtk support or not.
I'm not sure, but py2exe... |
Forum: Python Mar 16th, 2008 |
| Replies: 1 Views: 188 Re: Need help streamlining this code please I'm not gonna bother changing your approach, just perhaps you code.
I wouldn't define a function in a function. Try classes.
And its good syntax to define a function before you use it.
import... |
Forum: Python Mar 16th, 2008 |
| Replies: 5 Views: 420 pyGTK and the Mandate of Sudo So I have a pyGTK app going on nicely, but it requires sudo permission (under Linux) to perform a BASH operation.
If I prompt for a password using a GUI, is there any way I can do my BASH stuff... |