Forum: Python May 9th, 2008 |
| Replies: 2 Views: 792 Is it possible to do a
import os
os.system('tskill firefox')
? |
Forum: Python May 9th, 2008 |
| Replies: 8 Views: 807 That is pretty ingenious!
Does it work without using lambda? e.g
'1':"w/e", etc |
Forum: Java Apr 8th, 2008 |
| Replies: 1 Views: 739 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: 1,007 |
Forum: Python Mar 26th, 2008 |
| Replies: 6 Views: 1,541 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... |
Forum: Python Mar 24th, 2008 |
| Replies: 7 Views: 2,191 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: Python Mar 24th, 2008 |
| Replies: 1 Views: 11,205 How can you access files in directories in a ZIP?, i.e:
ZIP --> Folder --> File --> Python?
I can do this on Linux, but not on Windows... |
Forum: IT Professionals' Lounge Mar 23rd, 2008 |
| Replies: 22 Views: 2,702 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: 862 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: ")... |
Forum: Python Mar 22nd, 2008 |
| Replies: 1 Views: 1,400 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... |
Forum: Python Mar 22nd, 2008 |
| Replies: 7 Views: 2,191 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,... |
Forum: Kernels and Modules Mar 21st, 2008 |
| Replies: 3 Views: 1,559 hmm.
suppose the script could make a log of the hardware info you'd need to actually compile?
maybe i'll write something... |
Forum: Python Mar 21st, 2008 |
| Replies: 4 Views: 567 rikxik has the easier way to do it.
But anyways;
1. eval is an in-built python function. works sort of like C pointers. sort of.
2. in Python, %s in a string followed by % variable outside of the... |
Forum: Python Mar 21st, 2008 |
| Replies: 8 Views: 832 np :D, I have a lot of time to spare. |
Forum: Python Mar 21st, 2008 |
| Replies: 3 Views: 7,442 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: 1,558 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: 1,559 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: IT Professionals' Lounge Mar 20th, 2008 |
| Replies: 22 Views: 2,702 If you put it that way, I'm sticking with Ubuntu because it works just fine. |
Forum: Python Mar 20th, 2008 |
| Replies: 8 Views: 832 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... |
Forum: Python Mar 20th, 2008 |
| Replies: 5 Views: 906 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... |
Forum: Python Mar 20th, 2008 |
| Replies: 1 Views: 2,268 Get easygui and look at the source for fileopenbox or diropenbox.
http://www.ferg.org/easygui/index.html |
Forum: IT Professionals' Lounge Mar 19th, 2008 |
| Replies: 13 Views: 1,726 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: IT Professionals' Lounge Mar 19th, 2008 |
| Replies: 22 Views: 2,702 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: 527 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: 2,191 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... |
Forum: Python Mar 19th, 2008 |
| Replies: 4 Views: 567 a = input("Number: ")
b = 2 + a
filename = eval(str(b))
outfile = open('%s' % filename,'w')
outfile.write(b) |
Forum: Python Mar 19th, 2008 |
| Replies: 8 Views: 754 found something awesome;
import webbrowser
file = 'any media or html/xml file you like.extension'
webbrowser.open('%s' % file) |
Forum: Python Mar 19th, 2008 |
| Replies: 4 Views: 13,559 It uses firefox to play mp3's. Odd.
But overall 10/10. |
Forum: IT Professionals' Lounge Mar 19th, 2008 |
| Replies: 22 Views: 2,702 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: 1,524 yeah, really, wth?
what is paragnet and how is source code difficult to get?
What's there to decrypt??? |
Forum: Python Mar 19th, 2008 |
| Replies: 8 Views: 754 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: 832 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: 832 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... |
Forum: Python Mar 18th, 2008 |
| Replies: 5 Views: 1,198 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: 6 Views: 1,463 Pretty good link;
http://effbot.org/zone/python-compile.htm
Sorry, not a great explainer.. |
Forum: Python Mar 18th, 2008 |
| Replies: 7 Views: 2,191 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: 2,191 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: 1,198 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... |
Forum: Python Mar 16th, 2008 |
| Replies: 6 Views: 1,463 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... |
Forum: Python Mar 16th, 2008 |
| Replies: 1 Views: 480 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... |