- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
14 Posted Topics
Is there any way (non platform-depended) to close the tray using python 3. I couldn't find any function in the api of pygame.cdrom module. The best result so far is for Windows. [url]http://code.activestate.com/recipes/180919/[/url]
Have a look at: [url]http://docs.python.org/library/os.path.html[/url] You probably need some of the following: os.getcwd() os.path.join() os.path.listdir() os.path.isdir() os.path.isfile() Try to use these functions and not the literal path. This way, your program will be cross-platform and you will avoid such errors about / and \
Hi! I would like to build a minimalistic program which finds the tokens from a text. Its output should ideally be identical to the result of: [CODE]gposttl input_file | awk '{print $1}'[/CODE] which are just the tokens. An example: [CODE]That's a word and this is a number 123.456. I would …
[QUOTE=princessotes;1015567]Hi, I have a list of positive digits in a file. All I want to do is to add the negative sign (-) to each digit. Is there a code for this. eg list of digits 1 correspond -1 2 correspond-2 3 correspond -3 etc[/QUOTE] What about trying something similar …
The meaning of parallel is not that of parallel processing. I simply mean that if algorithms A and B are represented by the two sequence of operations (a_1, a_2, ...) and (b_1, b_2, ...), then the executed sequence of operations is (a_1, b_1, a_2, b_2, ...). It is not compulsory …
[QUOTE=SoulMazer;978554]Hi, I have written a simple chat server and a client that can connect to it. To make it more secure, I would like to add SSL to the connection process. How would I go about doing this? Thanks in advance.[/QUOTE] [url]http://www.heikkitoivonen.net/blog/2008/10/14/ssl-in-python-26/[/url] [url]http://docs.python.org/dev/library/ssl.html[/url]
[QUOTE=jcmeyer;966832]I want to copy a file to the clipboard. So if the user of my program goes into a directory or want to send the file attached in an email, they can just paste the file into the directory or email. I understand how to copy the file to another …
In python 3: [CODE=python]import os import shutil with open('../l.list') as f: for line in f: line = line.strip() print(line) os.mkdir(line) shutil.copy('../' + line, line + '/' + line + '.txt') [/CODE] It is pretty much the same as your shell script. @Gribouillis: Nice library.
I didn't find in the options Debian. I think it's one of the most stable distributions, having the greatest variety of packages.
Probably, the most efficient and easy way is to use std::sort. An example is here: [url]http://msdn.microsoft.com/en-us/library/ecdecxh1(VS.80).aspx[/url] My best guess is that, for the time being, useless information follows: There is a very short (but recursive version) of quicksort if you are interested in, or you are completely indifferent about the …
Is there a OS independent way of getting these statistics? AFAIK, LEDA can do it, but I need a non proprietary solution.
Maybe the cd is damaged. You could try another one or the alternative cd.
It helps if you have already upload your public ssh-rsa key to the remote machine. Then you don't have to enter the password each time the scp is executed.
I have just begun to learn python, so my question is probably silly. Just for practice I want to write a function which calculates the first n primes. prime computes some prime numbers and keeps them in a list. Then tries another number and if it's not even divisible by …
The End.
myle