Will be Prosumer's Revolution and Technical Revolution in the Future!
Linux User/Developer is also Windows User/Developer... Cross Platform Engineer...
"이제는 공학인을 대통령, 국회의원으로 만들자!" "더욱 더 많은 동지분들이 공학제국 건설에 동참할 수 있도록 널리 알려주세요~" [ F = m * a ]
어느덧 리눅스는 공학인 뿐만 아니라 모든 사람들이 탐험해 보아야 할 필수 요소가 된것 같습니다!
한번쯤 색 다른 미지의 세계를 경험해보는 것도 나쁘진 않을 것입니다. 재미있잖아요.(PLAY~ LINUX!) ^^
어떤 형태로든 자신이 작업/테스트/삽질?해 보았던 경험들을 LUG에 문서로 남겨두면 후배, 동지분들에게 도움이 되겠지요.
Hi all, Before creating an issue @ bugs.python.org I wanted to run the following by everyone We are having a difficult time with what looks like a cPickle issue when given a data structure containing >15 nested dictionaries, but only when threading is involved Environment is FreeBSD 8, Python 2.5.5 The following diff contains an addition for
I know that I can index into a list of lists like this: a=[[1,2,3],[4,5,6],[7,8,9]] a[0][2]=3 a[2][0]=7 but when I try to use fancy indexing to select the first item in each list I get: a[0][:]=[1,2,3] a[:][0]=[1,2,3] Why is this and is there a way to select [1,4,7]?
Hi There, I want to trigger another script and having it running forked to my mother process. I googled around and came up with following: commandlist=['./GPSsim.pl',pro to,'files/gps.txt'] subprocess.Popen(commandlist) print "GPS simulator started" This however doesn't seem disconnect stdout but it still throws me
hello, I wrap my database in some class, and on creation of the instance, a connection to the database is created, and will stay connected until the program exists, something like this: self.conn = sqlite3.connect ( self.filename ) Now I wonder if there are pros or contras to keep the connection to the database continuously "open" ?
Hi, I'm trying to create a listening socket connection on port 1514. I tried to follow the documentation at: [link] and came up with following lines: import socket host = '' # Symbolic name meaning all available interfaces port = 1514 # Arbitrary non-privileged port
Delegation in old-style classes worked fine: ... def __init__(self, x): ... self.__dict__['x'] = x ... def __getattr__(self, name): ... return getattr(self.x, name) ... def __setattr__(self, name, value): ... setattr(self.x, name, value) ... {1: None} But when I try the equivalent recipe with a new-style class, it behaves
hi there, greetings. i am looking for a small, console-based (opensource) texteditor, written in python (or as shellscript!), but i'm not finding something usable. very find would be emacs-keybindings ... dank u well, tanja
Hi All, I have another question about formatted input. Suppose I am reading a text file, and that I want it to be something like this word11 = num11, word12 = num12, word13 = num13 etc... word21 = num21, word22 = num12, word23 = num23 etc... etc... where wordx1 belongs to a certain dictionary of words, say dic1, while
Hello. I'm trying to send email using python 2.6.1 under snow leopard, but I can't get it to work. I'm trying one of the many examples I found on the web EXAMPLE 1 import smtplib fromaddr = 'fromu...@gmail.com' toaddrs = 'tou...@gmail.com' msg = 'There was a terrible error that occured and I wanted you to
level: beginner word= 'even' dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2} i want to know if word is entirely composed of letters in dict2 my approach: step 1 : convert word to dictionary(dict1) step2: for k in dict1.keys(): if k in dict2: if dict1[k] != dict2[k]: return False
There's a bug in Python 2.6's "urllib.urlencode". If you pass in a Unicode character outside the ASCII range, instead of it being encoded properly, an exception is raised. File "C:\python26\lib\urllib.py", line 1267, in urlencode v = quote_plus(str(v)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in
Hello Learning python datetime somewhat similar to SQL type timestamp my attempt creating a 24 h 2 months ago is str(datetime.now () - timedelta (days = 60)) +' cron '+ str(datetime.now () - timedelta (days = 59)) Do you agree? Can I improve this declaration? Regards Niklas Rosencrantz
In an HTML page that I'm scraping using urllib2, a \xc2\xa0 bytestring appears. The page's charset = utf-8, and the Chrome browser I'm using displays the characters as a space. The page requires authentication: [link] When I try to concatenate strings containing the bytestring, Python
Does anyone know of a Python module for *moderate* "time-stretching"[1] an MP3 (or AIFF) file? FWIW, the audio I want to time-stretch is human speech. TIA! ~K [1] By "moderate time stretching" I mean, for example, taking an audio that would normally play in 5 seconds, and stretch it so that it plays in 7.5 seconds, keeping the pitch unchanged. A lot of
Hi everyone, My name is Prashant Kumar and I wish to contribute to the Python development process by helping convert certain existing python over to python3k. Is there anyway I could obtain a list of libraries which need to be ported over to python3k, sorted by importance(by importance i mean packages which serve as a dependency for larger number of packages
i've got toto.py : import titi def niwhom(): pass and titi.py : def nipang(): pass how can i know in titi.py that's it's toto.py that is calling titi.py and the path of toto ? And why : bidule.py : class bidetmusique: pass truc.py : X = __import__("bidule") why exec("X.bidetmusique()") return none
I have a list of tuples. l = [((30,50),(70)), ((50,20),(20))] for i in range(10): k = ((i+30,i+50),(i+70))#suppose creating new tuple in each iteration using some random value and in sert it into list. flag=True for i, v in enumerate(l): if v >= k: l.insert(i,k) flag = False break
Hi All, Pydev 1.6.2 has been released Details on Pydev: [link] Details on its development: [link] Release Highlights: ------------------------------ - * Pydev is now also distributed with Aptana Studio 3, so it can be gotten in a version that doesn't require installing it as a separate
Hi I am working on an exercise which requires me to write a funtion that will check if a given word can be found in a given dictionary (the hand). def is_valid_word(word, hand, word_list): """ Returns True if word is in the word_list and is entirely composed of letters in the hand. Otherwise, returns False.
Hi all you experts, This has me beat. Has anyone any ideas about what might be going wrong? This is code from within a windows service (hence no print statements - no sys.stdout to print on!). I am trying to trace through to find where the code is not working. No stdout so I have to log to a file.
Hi, I want to define the relationship for my users and their groups with declarative style (so that the relating model can inherit Timestamp mixin and Tablename mixin): class User(DeclarativeBase, Tablename, TimestampMixin): '''User avatar is named after its id. A user may be a student or teacher or both.
Kwan Lai Cheng, 07.09.2010 06:06: If you can tell us what these structs are being used for in the original C code, we might be able to point you to a suitable way to implement the same thing efficiently in Python. Stefan
Hello! I'm a newbie to Python (literally just started last Saturday), and I coded a program that selects a random wallpaper from a directory and swaps it with your current one (Windows only.) What I'm looking to do is have it start up with Windows and automatically swap the wallpapers. This part I have already coded, and
Pythonistas: The "Samurai Principle" says to return victorious, or not at all. This is why django.db wisely throws an exception, instead of simply returning None, if it encounters a "record not found". I illustrated the value of that concept, here: [link]
I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', '9.0601']. What I want to do is to find minimum and maximum number in this list. I used min function,
Here are instructor's solutions manuals to the scientific textbooks in PDF format. They cover solutions to all problems. If you need any, let me know its title, edition and author. If your title is not listed here don't worry because it is a list of some .. NOTE: This service is NOT free, and Don't reply here, instead send an
The Python Software Foundation’s Blog staff has been recently expanded by a new set of top-notch bloggers to bring you the latest in PSF news, ranging from the scintillating projects that the PSF has its fingers in to the mundane, but necessary board minutes. Don’t despair if you hate reading blogs! The blog also has a handy RSS
Dear Pythonistas, For a project I'm working on, I need to store fairly large dictionaries (several million keys) in some form (obviously not in memory). The obvious course of action was to use a database of some sort. The operation is pretty simple, a function is handed a generator that gives it keys and values, and it maps the keys to the values in a non-
I'm using filecmp.cmp() to compare some files (surprise!). The documentation says:- Unless shallow is given and is false, files with identical os.stat() signatures are taken to be equal. I'm not setting shallow explicitly so it's True, thus the function should be comparing the os.stat() results. However this doesn't seem
The following code runs OK under 3.1: @filename=cats_and_dogs.py def make_sound(animal): print(animal + ' says ' + sounds[animal]) sounds = { "cat": "meow", "dog": "woof" } for i in sounds.keys(): make_sound(i) When I move the def to it's own file to create a module, it barfs: @filename= cats_and_dogs.py
I have a list of tuples l = [(('s','a'),(5,9)), (('u','w'),(9,2)), (('y','x'),(3,0))] some functions using this list and fetch data using index l[0][1], l[1] [1] I need to change position of each values in the list and that dont affect fuctions which are using this list. I must have to use list of tuples.
Hi all, I am trying to redirect stdout and stderr on a python windows service, so that the service will not stall after 256 chars is written, and so I can use print for simple debugging. I have the following 4 lines (copy/pasted) in the source of my code. if __name__ == '__main__': sys.stdout = sys.stderr = open("d:\logfile.txt", "a")
Hello, I have used ctypes to wrap a C-library - it has been a really painless experience! The C-library instantiates a quite large "container-like" structure. There are then several functions to inspect the content of the container, get at items and free the whole thing: /* C - code */ c_container_type * c_container_alloc( const char * filename );
VGNU Linux, 06.09.2010 13:02: It can and has been. What kind of embedded system with what set of capabilities are you thinking about? TV sets? Mobile phones? Smart dust? Stefan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On behalf of the Python development team, I'm happy to announce the second alpha preview release of Python 3.2. Python 3.2 is a continuation of the efforts to improve and stabilize the Python 3.x line. Since the final release of Python 2.7, the 2.x line
i've got a python.txt that contain python and it must stay as it (python.txt) how can i include it in my program ? import python.txt doesn't work is there a way : a) to make an include("python.txt") b) tell him to treat .txt as .py file that i can make an import python ? i'am using python3 Regards Bussiere
level: beginner how can i access the contents of a text file in Python? i would like to compare a string (word) with the content of a text file (word_list). i want to see if word is in word_list. let's assume the TXT file is stored in the same directory as the PY file. def is_valid_word(word, word_list)
Hi! I'm writing a package with several files in it, and I've found that "isinstance" doesn't work the way I expect under certain circumstances. Short example: here are two files. import filetwo class AClass( object ): pass if __name__ == '__main__': a = AClass() filetwo.is_aclass( a ) import fileone
I'm using httplib, and want to get the Location header from the response. The getheaders() method gives you back a list of (name, value) tuples. It would be a lot more convenient if it gave you back a dict, but it is what it is. Anyway, I came up with: location = [t[1] for t in headers if t[0] == 'location'][0]
I'am getting this annoying message all the time when using IDLE. ... personal firewall software is blocking the connection When I am editing a source *.py file and I click on F5 (run) I get the above message. What can I do? I am using Norton Internet Security. I try to find if 127.0.0.1 is blocked, but I do not know where to look.
I'm writing a "literate programming" document, example.txt, which mixes text and code in ReST format: This is my excellent module for making spam. It has one public function, ``make_spam``, which takes a single argument for how much spam to make: >>> from module import make_spam >>> make_spam(3)
On Sunday 05 September 2010, it occurred to alex goretoy to exclaim: Umn. Yes, wrong list. Still, SSH is "secure shell". Shell ≠ WWW. TLS/SSL is secure. Once you have an encrypted connection to the correct party, the information you send over that connection is just as illegible to the outsider as it'd be over an SSH connection. If you're connected to someone
Trying to learn Python for a specific purpose to repair a quicktime file that's corrupted, is it even possible to create a proof-of- concept python script that generates a valid 'moov' atom from a corrupt .mov video ?, "file size 1.3gb" (Kodak camera failed to finalize file). Mac--> [link]
Yes, Python is a Turing complete programming language. Anything you can do in any programming language, you can do in Python. By the way, there's no need to send three messages in 10 minutes asking the same question, and adding FORM METHOD links to your post will probably just get it flagged as spam by many people.
I am trying to plot a runtime graph using pylab. But the very purpose of functionality is lost because of high CPU percentage hogged by plotting the graph. Here is the piece of code which I have written. def timerfunc(ulcm, dlcm): count=0 xaxis=[] yaxis=[] ion() while 1: xaxis.append(count)
위 내용은 RSS를 지원하는 사이트에서 방금 읽어온 내용으로만 구성되어 있습니다.
한국LUG는 대한민국의 리눅스 지식인[사용자/개발자]들의 커뮤니티입니다. [매년 1~2회의 공개세미나 개최]
한국LUG :
울산
- 광주
- 전북
- 인천
- 대전
- LUG 위키
한국LUG 사이트는 1024 x 768 해상도(운영자 노트북:14")에 최적화 되어 있습니다. : LINUX FANSITE
WWW.LUG.OR.KR Server is made by CentOS Linux, P4 1.8G, Memory 512MB, Main HDD 160GB, Backup HDD 40GB and LAMP, qmail MTA.
CentOS Linux & Mozilla Firefox UTF-8 Base Created.
1998-2010 www.lug.or.kr Directed By Great Dragon, Kim.
Top
LUG 포인트 정책 : [회원가입 : +100점] [로그인(하루한번) : +50점] [글쓰기 : +20점] [코멘트 : +10점] [다운로드 : -200점] [질문 포인트 : 최소 200점]
데스크탑 프로그래밍(gcc, g++, wxGTK[wxWidgets] 등)은 "Fedora"를 사용하고, 서버 운영(WEB, FTP 등)은 "CentOS"를 사용하시길 권장합니다.
도전하는자, 자신을 투자하는자만이 뜻하는바를 이룰 수 있다.
Information should be Exchanged with Interactive, not One Way Direction. 준회원,
정회원,
우수회원,
VIP회원,
기업회원,
관리자
System Uptime : 05:01:01 up 44 days, load average: 0.33, 0.29, 0.21
Be Maker!
인생에서, 100% 순이익을 보장하는건 없다. 1%의 지식을 나눔으로써, 가끔씩 손해볼 필요도 있다.
그대가 가진 1%의 지식만이라도 공공을 위해 포스팅하라. 손해본다는 생각이 앞선다면 그대의 인생은 힘들어질것이다.
자신이 가진 지식의 1%도 투자하지 않고, 오로지 자신의 이익만 탐하는자와는 동지가 되지마라.
만나서 대화하면 모두 좋은 사람들이지만, 유독 인터넷에서만 자신을 밝히지 않고, 좀비로 서식하는 사람들이 많다.
부지불식간[不知不識間], 좀비(하류) 인생이 될지도 모르니, 항상 자신을 경계하도록 하라. [writer TY Kim]
[工學, engineering]
대한민국이 Global Leader로 자리매김하기 위해서는 공학(소프트웨어, 하드웨어, 기계, 전자, 전기, 화공, 재료, 건축, 토목 등) 우선 정책이 필수이다.
특히, 모든 산업의 핵심 부분을 담당하며, 고부가가치 창조의 원천인 소프트웨어 기반 산업의 약진과 수출에 한반도의 존폐가 달려있다고해도 과언이 아니다.
[도서 안내]
1. CentOS Linux
2. gcc로 공부하는 C++
베스트셀러 입성^^