Troubles with Python imports

2021-02-09 Thread Philipp Daher via Python-list
Hello, I’ve just typed „pip install selenium“ into my command prompt on windows 10. Although my computer told me that the requirement was already satisfied, import selenium did not work. So I tried different methods to install it and typed „Python“ in my command prompt and imported selenium. It

Python cannot count apparently

2021-02-07 Thread Philipp Daher via Python-list
Hello, I recently coded this snippet of code: myString=„hello“ for i in range(len(myString): print(string[i]) And now for the weird part: SOMETIMES, the output is this: hello And SOMETIMES, the output changes to: ohell WHY??? Why do I get different outputs with the EXACT SAME CODE? Can

Selenium finds object that is interactible but says otherwise

2021-02-06 Thread Philipp Daher via Python-list
Hello, I recently programmed some code for a webdriver with selenium. I asked the program to find an input tag, which is interactible, with this:     searchbar=driver.find_element_by_class_name("ut-player-search-control--input-container") then i ask it to send keys, which has worked before too.

Pyautogui troubles

2021-01-31 Thread Philipp Daher via Python-list
Dear Python-Team, I have just repaired python after running my program which imports pyautogui, closing and reopening it and then getting this: ModuleNotFoundError: No module named „pyautogui“. Repairing didn’t work and I still get that message. All I did was closing the perfectly working progr

Re: string encoding regex problem

2014-08-23 Thread Philipp Kraus
Hi, On 2014-08-16 09:01:57 +, Peter Otten said: Philipp Kraus wrote: The code works till last week correctly, I don't change the pattern. Websites' contents and structure change sometimes. My question is, can it be a problem with string encoding? Your regex is all-as

Re: string encoding regex problem

2014-08-15 Thread Philipp Kraus
On 2014-08-16 00:48:46 +, Roy Smith said: In article , Philipp Kraus wrote: found = re.search( "http://sourceforge.net/projects/boost/files/boost/";) ) if found == None : raise MyError.StopError("Boost Download URL not found") But found is always None,

string encoding regex problem

2014-08-15 Thread Philipp Kraus
Hello, I have defined a function with: def URLReader(url) : try : f = urllib2.urlopen(url) data = f.read() f.close() except Exception, e : raise MyError.StopError(e) return data which get the HTML source code from an URL. I use this to get a part of a HTML

Re: Download all youtube favorites with youtube-dl script

2013-09-26 Thread Philipp Hagemeister
Best, Philipp On 09/26/2013 05:13 PM, Bill wrote: > I have been using the script youtube-dl > http://rg3.github.io/youtube-dl/ > > And I was wondering if there is a way to download all of a user's > favorites or uploads. > > The script has a functionality to download all

Re: Issues a longer xpath expression

2013-02-22 Thread Philipp Hagemeister
Hi anonymous, your code is working perfectly right. It's just that the only time that you find anything matching //div[@class="col f-cb"] is this one: 名称 视频下载 课程简介 And obviously, there's no in there, so the xpath won't match. Cheers, Philipp On 02

Re: ** Please Rank These Learning Sources **

2013-02-21 Thread Philipp Hagemeister
there - instead of relying on the intuitive grasp that both "a" and "ä" are single character strings, and that print is a function like any other, they have to work with a lot of magic and hand-waving) - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: pypi changelog api

2013-02-21 Thread Philipp Hagemeister
ut the problem is that that would mean lots of load on PyPi (if you query every minute or so) and outdated packages (if you query less often than that). Keeping a connection that PyPi would push to seems to be much cleaner. - Philipp signature.asc Description: OpenPGP digital signature -- http:

Re: pypi changelog api

2013-02-21 Thread Philipp Hagemeister
? Cheers, Philipp On 02/21/2013 02:52 PM, Michael Herman wrote: > I'd love to see https://crate.io/ set up an API or at the very least an RSS > feed for tracking changes. I've emailed the author about this. I think if > enough people do, an RSS feed would be easy to setup. > >

Re: pypi changelog api

2013-02-21 Thread Philipp Hagemeister
ed the entire changelog, just download it once (it's not that large, barely 40MB). Here it is, up until 1361452402 (now): http://phihag.de/2013/pypi-changelog-2013-02-20.json.bz2 What I'd like is a real-time push service of changelog entries, but I'm not certain that would be sca

Re: any chance for contracts and invariants in Python?

2013-02-14 Thread Philipp Hagemeister
ing. 4. Update all subclasses whenever something changes. 5. Traverse the entire class hierarchy for every method call. Which option should be picked? Additionally, the reference implementation is not actually a fork of cpython (or a metaclass), but a Python script that - as far as I understand - I

Re: what’s the difference between socket.send() and socket.sendall() ?

2013-01-08 Thread Philipp Hagemeister
everything has been sent or an error occurs. If you're using TCP with blocking sockets and don't want to be bothered by internals (this is the case for most simple network applications), use sendall. Otherwise, use send and make sure to read and process its return value. - Philipp On

Re: Blue Screen Python

2012-10-09 Thread Philipp Hagemeister
cause a bluescreen, Python 2.7 still works fine one thousands of Win7 machines. Cheers, Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Error help

2012-08-02 Thread Philipp Hagemeister
Better write another one that wraps the calculation and outputs stuff. > > def secondBlockDifferences(): Instead of writing two methods to do the same thing, write one with arguments. > (...) > text_file=open(file_name, 'w') You're leaking the handle. Use with(open(file_name, 'w')) as text_file: . > text_file.write('\nParticipant info: ', participant_info) > firstBlockDifferences() > secondBlockDifferences() - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: consistent input() for Python 2 and 3

2012-08-02 Thread Philipp Hagemeister
put to the invocation arguments is often a better choice. - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux shell to python

2012-07-30 Thread Philipp Hagemeister
On 07/30/2012 01:31 PM, Jürgen A. Erhard wrote: > On Mon, Jul 30, 2012 at 12:35:38PM +0200, Philipp Hagemeister wrote: >> import subprocess >> [ l.partition(' ')[0] # or l[:7], if you want to copy it verbatim >> for l in subprocess.check_output(['lspci&

Re: Linux shell to python

2012-07-30 Thread Philipp Hagemeister
r l in subprocess.check_output(['lspci']).splitlines() if 'Q' in l and isp_str1 in l and isp_str2 in l ] You can also just paste the whole pipeline with the shell=True parameter. That's not recommended though, and it's hard to correctly quote strings. - Phil

Re: catch UnicodeDecodeError

2012-07-26 Thread Philipp Hagemeister
impression that the exception was not properly caught by the except clause. Oops, over a dozen posts and I still haven't grasped the OP's problem. Sorry! and thanks for noting that. - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: catch UnicodeDecodeError

2012-07-26 Thread Philipp Hagemeister
on of non-newline characters. Therefore, the most you can do is calculate an upper bound for the line number. - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: catch UnicodeDecodeError

2012-07-25 Thread Philipp Hagemeister
you can do is count the number of bytes with the value 10 before ude.start, like this: lineGuess = buf[:ude.start].count(b'\n') + 1 - Philipp On 07/25/2012 01:05 PM, jaroslav.dob...@gmail.com wrote: > it doesn't work signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: from future import pass_function

2012-07-25 Thread Philipp Hagemeister
# to actually find out what pass happens to be in this context) - Philipp On 07/25/2012 10:40 AM, Ulrich Eckhardt wrote: > Hi! > > I just had an idea, it occurred to me that the pass statement is pretty > similar to the print statement, and similarly to the print() function,

Re: dict: keys() and values() order guaranteed to be same?

2012-07-23 Thread Philipp Hagemeister
ons to the dictionary, the lists will directly correspond. In most cases, you should simply use items() though. Can you elaborate on the use case for needing both keys() and values(), where items() is not applicable? - Philipp [1] http://docs.python.org/library/stdtypes.html#dict.items signatu

Re: unittest: Improve discoverability of discover (Was: Initial nose experience)

2012-07-16 Thread Philipp Hagemeister
On 07/16/2012 02:37 PM, Philipp Hagemeister wrote: > Can we improve the discoverability of the discover > option, for example by making it the default action, or including a > message "use discover to find test files automatically" if there are no > arguments? Oops, alr

unittest: Improve discoverability of discover (Was: Initial nose experience)

2012-07-16 Thread Philipp Hagemeister
automatically" if there are no arguments? - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Initial nose experience

2012-07-16 Thread Philipp Hagemeister
ree and run them all with a single command. Currently, $ python -m unittest does nothing useful (afaik). Would it break anything to look in . , ./test, ./tests for any files matching test_* , and execute those? - Philipp signature.asc Description: OpenPGP digital signature -- http://mai

Re: multiprocessing: excepthook not getting called

2012-06-13 Thread Philipp Hagemeister
u can just queue a special message. - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: multiprocessing: excepthook not getting called

2012-06-13 Thread Philipp Hagemeister
=target) p.start() p.join() # try it here in main target() Cheers, Philipp On 06/12/2012 11:02 PM, Dave Cook wrote: > Why doesn't my excepthook get called in the child process? > > import sys > import multiprocessing as mp > > def target(): > name =

Re: Any Advice Would Be Greatly Appreciated

2012-02-29 Thread Philipp Hagemeister
If you're looking for skilled developers, the best way to find them is probably to search their current work. http://careers.stackoverflow.com/ and the more experimental http://githire.com/ are two excellent developer-friendly solutions for that. - Philipp On 03/01/2012 12:08 AM, Greg Har

codecs in a chroot / without fs access

2012-01-09 Thread Philipp Hagemeister
lob('/usr/lib/python*/encodings/*.py')] for e in encs: try: codecs.lookup(e) except LookupError: pass # __init__.py or something enumerate /usr/lib/python.*/encodings/*.py and call codecs.lookup for every os.path.splitext(os.path.basename(filename))[0] Dou you see any p

Re: youtube-dl: way to deal with the size cap issue + new errors + issues ...

2011-11-21 Thread Philipp Hagemeister
ttps://github.com/rg3/youtube-dl/issues/152) will be your best shot. Note that you can already redirect youtube-dl's output to a file, just like any other shell program: $ youtube-dl uHlDtZ6Oc3s > log will write a file log that contains all of youtube-dl's output. If the return code i

Re: python-based downloader (youtube-dl) missing critical feature ...

2011-11-04 Thread Philipp Hagemeister
ure implemented is providing a patch (in form of a github pull-request, if possible). - -- Philipp (youtube-dl developer) l...@mail.python.org wrote: > python-based youtube-dl > ~ > http://rg3.github.com/youtube-dl/ > ~ > is sorely missing a flag in order to indicate the maxi

Re: Code Review

2011-09-17 Thread Philipp Hagemeister
t in searchedwordset (or just skip this method and write word not in searchedwordset). Cheers, Philipp Emeka wrote: > Hello All, > > While learning Python I put together another Text Twist. I would want > somebody to go through it and comment. > https://github.com/janus/Text-Twi

Re: From Python on Solaris to Python on LINUX

2011-09-15 Thread Philipp Hagemeister
el and therefore include a slightly older one). -- Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a PYD file

2010-08-23 Thread Philipp Pagel
.. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://webclu.bio.wzw.tum.de/~pagel/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3: hex() on arbitrary classes

2009-09-01 Thread Philipp Hagemeister
and deleted it by accident. Philipp > > Python 3.2a0 (py3k:74624, Sep 1 2009, 16:53:00) > [GCC 4.3.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> class X: > ... def __index__(sel

Python3: hex() on arbitrary classes

2009-09-01 Thread Philipp Hagemeister
e object to int before constructing the hex string? Regards, Philipp Hagemeister signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: identifying live hosts on a network

2009-05-20 Thread Philipp Hagemeister
other steps have you tried?) Philipp hunteroakes...@gmail.com wrote: > HI > I am new to python and am having trouble coming up with a script that > idenifies all the live hosts on my network. > thanks Hunter signature.asc Description: OpenPGP digital signature -- http://mail.python

Re: issue: Permissions in odfpy

2009-05-19 Thread Philipp Hagemeister
n:oasis:names:tc:opendocument:xmlns:table:1.0', 'protected', 'true') doc.save('out.ods') Regards, Philipp shruti surve wrote: > hey, > i am using odfpy and generating spreadsheet in open office..but nobody > should modify the file..so can anyb

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Philipp Hagemeister
David Lyon wrote: > On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister > wrote: >> Yes, but that processing will add /example/ to sys.path, right? > > It actually works the other way around. The directories listed in > sys.path are scanned for .pth files. No, they ar

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Philipp Hagemeister
ctly is wrong > here? > > What are you expecting? and maybe we can tell you why you aren't getting > it... > > David I'm expecting .pth files in the current directory to be be processed, according to docs/install/. Christian Heimes already pointed out this is not the

.pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Philipp Hagemeister
" 1&3&5 => 6) echo /example/ > test.pth; python -c 'import sys;print(repr(sys.path))' should contain '/example'. I think I misinterpreted the documentation, but what exactly is wrong here? Regards, Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Binary IP address representation

2009-04-22 Thread Philipp Hagemeister
alueError("Unknown protocol family " + family) Since socket.AF_INET6 will not be defined on old systems (are there any versions of Python 2.5+ that do not have that defined?), your solution is better for those (but needs netaddr, which is unlikely to enter stdlib soon). Thanks for sharing it.

Profiler throws NameError on any function

2009-03-26 Thread Philipp Lies
Hi, I'm trying to run the python profiler on some code but I always get NameErrors, even for the simplest case taken from the docs: import profile def foo(): a = 5 def prof(): profile.run('foo()') When I run prof() I get the following output: Traceback (most recent call last): File "",

Re: how to convert from network to host byte order

2009-03-05 Thread Philipp Hagemeister
; out = struct.pack('=H', struct.unpack('!H', inp)[0]) >>> out '\x00\x04' For more information, look for "Size and alignment" in http://docs.python.org/library/struct.html. Regards, Philipp Hagemeister -BEGIN PGP SIGNATURE- Version

Re: Convert IPv6 address to binary representation on 2.x/Windows

2009-03-04 Thread Philipp Hagemeister
rite it. But then, why should I need ipaddr? netaddr[3] has the function I'm looking for Addr('::1').packed(), but it's way over the top for this purpose; an assembler implementation would be more readable. Kind regards, Philipp Hagemeister [1] http://bugs.python.org/issue5379 [

Convert IPv6 address to binary representation on 2.x/Windows

2009-03-04 Thread Philipp Hagemeister
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 socket.inet_pton which does exactly what I want is not available on 2.x on Windows. Strangely, the documentation of socket.inet_aton (IPv4 only) reads: "inet_aton() does not support IPv6, and getnameinfo() should be used instead for IPv4/v6 dual sta

Re: Reading a file

2009-02-14 Thread Philipp Pagel
teria for picking the values are, of course. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: Install modules with no root privilegies

2008-11-24 Thread Philipp Pagel
s" documentation: http://docs.python.org/install/index.html Have a look at Section 3 "Alternate installation". cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: Renumbering

2008-09-03 Thread Philipp Pagel
sh that way. Biopython has such a parser: www.biopython.org cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: How to covert ASCII to integer in Python?

2008-05-31 Thread Philipp Pagel
Mensanator <[EMAIL PROTECTED]> wrote: > On May 30, 10:03???am, Philipp Pagel <[EMAIL PROTECTED]> > wrote: > > 'P' is obviously not an ASCII representation of a number. > It is in base 36. Sure, but if that was the OP's intent he would most likely ha

Re: How to covert ASCII to integer in Python?

2008-05-30 Thread Philipp Pagel
t(a) > and what you will get ? An error !!! 'P' is obviously not an ASCII representation of a number. What did you expect? The closest number by visual appearance? cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http

Re: Python Success stories

2008-04-23 Thread Philipp Pagel
azrael <[EMAIL PROTECTED]> wrote: > A friend of mine i a proud PERL developer which always keeps making > jokes on python's cost. There is only one sane way to deal with this situation: You need a common enemy. Java comes to mind ;-) cu Philipp -- Dr. Philipp

Re: Graphs in Python

2008-04-11 Thread Philipp Pagel
ense but I don't think that's a good solution to the OP's problem. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphs in Python

2008-04-11 Thread Philipp Pagel
s. - More specific stuff e.g. in A. Gibbons "Algorithmic Graph Theory". cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete hidden files on unix

2008-03-03 Thread Philipp Pagel
also do this: import os os.system('rm .lock*') cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread Philipp Pagel
e date_string and format can't be parsed by time.strptime() or if it returns a value which isn't a time tuple. New in version 2.5. -- cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bio

Re: How to pass shell variable to shell script from python

2008-02-27 Thread Philipp Pagel
Gerardo Herzig <[EMAIL PROTECTED]> wrote: > Rockins Chen wrote: > Well, if you have to use os.system, that could be > os.system("export target=localhost.localdomain.org; ./callee.sh") Or os.system("env target=localhost.localdomain.org ./callee.sh") cu

Re: >>>> 911 operation by evil JEWS and Mossad <<<

2007-11-08 Thread philipp neulist
On Nov 7, 4:08 pm, [EMAIL PROTECTED] wrote: > 911 carried out by evil jews and mossadhttp://www.guba.com/watch/2000991770 > > 911 truckload of Explosives on the George Washington > Bridgehttp://www.youtube.com/watch?v=J520P-MD9a0 > [...] I reported the first post in this thread (on Google groups)

Re: The Modernization of Emacs

2007-06-17 Thread Philipp Leitner
Ever came to your mind that there are people (programmers and others) who will not use emacs for their day-to-day work simply because they have tools that suit them better for the work they have to do (Eclipse for me, as an example)? Except from that: I personally don't feel that your rantings are

Re: a=b change b a==b true??

2007-02-26 Thread Philipp Pagel
you want: >>> import copy >>> a=[[2,4],[9,3]] >>> b = copy.deepcopy(a) >>> [map(list.sort,b)] [[None, None]] >>> a [[2, 4], [9, 3]] >>> b [[2, 4], [3, 9]] cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131

Re: CSV(???)

2007-02-23 Thread Philipp Pagel
t: either upgrade to something less outdated or see if you can get todays csv to work with the oldtimer. cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Dept. of Genome Oriented BioinformaticsFax. +49-8161-71 2186 Technical University of Munich http://mip

Re: Finding a tuple in a tuple

2007-02-22 Thread Philipp Pagel
quot;) > What I want to do is return true if any member of tuple t1 is found in > the remaining tuples. Another way to go instead of using sets, although probably less elegant: >>> True in [x in t1 for x in t2] True >>> True in [x in t1 for x in t3] True >>> Tru

Re: Glob returning an empty list when passed a variable

2007-02-09 Thread Philipp Pagel
ea_name) '"*Foo*"' Unless there are files with funny names containing '"' you will not get a match. cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Dept. of Genome Oriented BioinformaticsFax. +49-8161-71 2186 Technical University of Munich http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

Re: os.popen and broken pipes

2007-02-09 Thread Philipp Pagel
Chris <[EMAIL PROTECTED]> wrote: > It could easily be the 2gig file size limitation, how large are the > extracts? The files are much smaller than that, so that's not the issue. Anyway, Antoon pointed me in the right direction. Thanks for the help Philipp --

Re: os.popen and broken pipes

2007-02-09 Thread Philipp Pagel
Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2007-02-09, Philipp Pagel <[EMAIL PROTECTED]> wrote: > > for filename in file_list: > > file = os.popen('uncompress -c '+filename, 'r') > > do_something(file) > > file.cl

os.popen and broken pipes

2007-02-09 Thread Philipp Pagel
compress changes the wording of the error message but not the result. I tried to give popen a large bufsize argument but that didn't really help. Probably I'm overlooking something obvious here but right now I can't see it. Any hints? cu Philipp -- Dr. Philipp Pagel

Re: Programmatically finding "significant" data points

2006-11-14 Thread Philipp Pagel
differetn groupos of some kind? Or are you just looking for extreme values (outliers maybe?)? So it's more of statistical question than a python one. cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Dept. of Genome Oriented BioinformaticsFax. +49-

Re: Better way to replace/remove characters in a list of strings.

2006-09-04 Thread Philipp Pagel
Chris Brat <[EMAIL PROTECTED]> wrote: > Is there a better way to replace/remove characters (specifically ' and > " characters in my case, but it could be anything) in strings in a > list, than this example to replace 'a' with 'b': x = map(lambda foo:

Re: where or filter on list

2006-08-30 Thread Philipp Pagel
extend this function to any given value ? By subtracting the desired value from foo. cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Dept. of Genome Oriented BioinformaticsFax. +49-8161-71 2186 Technical University of Munich http://mips.gsf.de/staff/pagel -- http://mail.python.org/mailman/listinfo/python-list

wxPython Install

2006-08-16 Thread Dr. Philipp Walderdorff
got wxPython-2.6.3.2-1.fc5 installed, but, excuse me, I really don't know anymore what at least helped. Did you solve your problem? Because I am writing a documentation for wiki I could need your experience. Thanks Philipp -- http://mail.python.org/mailman/listinfo/python-list

str as param for timedelta

2006-01-27 Thread Philipp
Hello Pythonistas I'm new to Python, I hope you understand my question. I would like to pass a parameter "gap" to a function. gap should be used there to create a timedelta Object. from datetime import * def f(gap): print (datetime.now() + datetime.timedelta(gap)) f('hours = -8') I r

convert char to byte representation

2005-10-10 Thread Philipp H. Mohr
Hello, I am trying to xor the byte representation of every char in a string with its predecessor. But I don't know how to convert a char into its byte representation. This is to calculate the nmea checksum for gps data. e.g. everything between $ and * needs to be xor: $GPGSV,3,1,10,06,79,

Re: Which SQL module to use?

2005-10-04 Thread Philipp
mrstephengross schrieb: > I'd like to do some basic SQL stuff in Python. It seems like there are > a heck of a lot of SQL modules for Python. What's the simplest and > easiest one to use? > > Thanks, > --Steve ([EMAIL PROTECTED]) > Do you have any

Abstract methods in python - is this a good way ?)

2005-08-07 Thread Philipp H. Mohr
Hello, I would like to use abstract methods in python to force some of the classes to implement common methods. I found this web page and wonder if it is a good way of implementing them: http://www.lychnis.net/blosxom/programming/python-abstract-methods-3.lychnis Also could some one please tel

Re: passing arguments to a function - do I need type ?

2005-07-10 Thread Philipp H. Mohr
Hello, thank you very much for all your help. I have solved the problem - you guys where right, the problem was some where else. I have another class which got an accessor: def getCenter(self): global center return center and I called it by saying n.getCenter, but this returns:

passing arguments to a function - do I need type ?

2005-07-10 Thread Philipp H. Mohr
Hello, I got a newbie question, I have written the following distance function: def distance(self,element1, element2): dist = 0 for n in range(len(element1)): dist = dist + pow((element1[n] - element2[n]),2) print 'dist' + dist return sqrt(dist) and i

Re: Store multiple dictionaries in a file

2005-06-30 Thread Philipp H. Mohr
Hello, this is the solution I went for, as I am indeed not concernt about security and the implementation is straight forward. Thank you, Phil > If you're not worried about security, you could write the repr() of each > dict to the file and get the values back by using the eval() function. > r

Re: Store multiple dictionaries in a file

2005-06-30 Thread Philipp H. Mohr
Thank you for you answer. > > I would like to store multiple dictionaries in a file, if possible one per > > line. > > Why "one per line" ? I agree with you that it sounds like nasty code :-) but there is a good reason for doing it this way - I think. My code collects data (attributes) of its cu

Store multiple dictionaries in a file

2005-06-30 Thread Philipp H. Mohr
Hello, I would like to store multiple dictionaries in a file, if possible one per line. My code currently produces a new dictionary every iteration and passes it on to another peace of code. In order to be able to re-run some experiments at a later date I would like to store every dictionary in th